Example #1
0
                echo getBareImageTitle();
                ?>
"><img src="<?php 
                echo $_zp_themeroot;
                ?>
/images/search.png" alt="Zoom Image" /></a><?php 
            }
            ?>
						<?php 
            if (function_exists('printCommentForm') && $_zp_current_image->getCommentsAllowed() && $_zp_current_image->getCommentCount() > 0) {
                ?>
						<a class="album-tool" href="<?php 
                echo htmlspecialchars(getImageURL());
                ?>
" title="<?php 
                echo getCommentCount();
                ?>
 Comments"><img src="<?php 
                echo $_zp_themeroot;
                ?>
/images/shout.png" alt="Comments" /></a>
						<?php 
            }
            ?>
				</div>
				<a class="thumb" href="<?php 
            echo htmlspecialchars(getImageURL());
            ?>
" title="<?php 
            echo getBareImageTitle();
            ?>
Example #2
0
/**
 * Prints a form for posting comments
 *
 * @param bool $showcomments defaults to true for showing list of comments
 * @param string $addcommenttext alternate text for "Add a comment:"
 * @param bool $addheader set true to display comment count header
 * @param string $comment_commententry_mod use to add styles, classes to the comment form div
 * @param bool $desc_order default false, set to true to change the comment order to descending ( = newest to oldest)
 */
function printCommentForm($showcomments = true, $addcommenttext = NULL, $addheader = true, $comment_commententry_mod = '', $desc_order = false)
{
    global $_zp_gallery_page, $_zp_current_admin_obj, $_zp_current_comment, $_zp_captcha, $_zp_authority, $_zp_HTML_cache, $_zp_current_image, $_zp_current_album, $_zp_current_page, $_zp_current_article;
    if (getOption('email_new_comments')) {
        $email_list = $_zp_authority->getAdminEmail();
        if (empty($email_list)) {
            setOption('email_new_comments', 0);
        }
    }
    if (is_null($addcommenttext)) {
        $addcommenttext = '<h3>' . gettext('Add a comment:') . '</h3>';
    }
    switch ($_zp_gallery_page) {
        case 'album.php':
            if (!getOption('comment_form_albums')) {
                return;
            }
            $obj = $_zp_current_album;
            break;
        case 'image.php':
            if (!getOption('comment_form_images')) {
                return;
            }
            $obj = $_zp_current_image;
            break;
        case 'pages.php':
            if (!getOption('comment_form_pages')) {
                return;
            }
            $obj = $_zp_current_page;
            break;
        case 'news.php':
            if (!getOption('comment_form_articles') || !is_NewsArticle()) {
                return;
            }
            $obj = $_zp_current_article;
            break;
        default:
            return;
            break;
    }
    $comments_open = $obj->getCommentsAllowed();
    ?>
	<!-- printCommentForm -->
	<div id="commentcontent">
		<?php 
    $num = getCommentCount();
    if ($showcomments) {
        if ($num == 0) {
            if ($addheader) {
                echo '<h3 class="empty">' . gettext('No Comments') . '</h3>';
            }
            $display = '';
        } else {
            if ($addheader) {
                echo '<h3>' . sprintf(ngettext('%u Comment', '%u Comments', $num), $num) . '</h3>';
            }
            if (getOption('comment_form_toggle')) {
                ?>
					<div id="comment_toggle"><!-- place holder for toggle button --></div>
					<script type="text/javascript">
						// <!-- <![CDATA[
						function toggleComments(hide) {
							if (hide) {
								$('div.comment').hide();
								$('.Pagination').hide();
								$('#comment_toggle').html('<button class="button buttons" onclick="toggleComments(false);"><?php 
                echo gettext('show comments');
                ?>
</button>');
							} else {
								$('div.comment').show();
								$('.Pagination').show();
								$('#comment_toggle').html('<button class="button buttons" onclick="toggleComments(true);"><?php 
                echo gettext('hide comments');
                ?>
</button>');
							}
						}
						$(document).ready(function () {
							toggleComments(window.location.hash.search(/#zp_comment_id_/));
						});
						// ]]> -->
					</script>
					<?php 
                $display = ' style="display:none"';
            } else {
                $display = '';
            }
        }
        $hideoriginalcomments = '';
        if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
            $hideoriginalcomments = ' style="display:none"';
            // hide original comment display to be replaced by jQuery pagination
        }
        if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
            ?>
				<div class="Pagination"></div><!-- this is the jquery pagination nav placeholder -->
				<div id="Commentresult"></div>
				<?php 
        }
        ?>
			<div id="comments"<?php 
        echo $hideoriginalcomments;
        ?>
>
				<?php 
        while (next_comment($desc_order)) {
            if (!getOption('comment_form_showURL')) {
                $_zp_current_comment['website'] = '';
            }
            ?>
					<div class="comment" <?php 
            echo $display;
            ?>
>
						<div class="commentinfo">
							<h4 id="zp_comment_id_<?php 
            echo $_zp_current_comment['id'];
            ?>
"><?php 
            printCommentAuthorLink();
            ?>
: <?php 
            echo gettext('on');
            ?>
 <?php 
            echo getCommentDateTime();
            printEditCommentLink(gettext('Edit'), ', ', '');
            ?>
</h4>
						</div><!-- class "commentinfo" -->
						<div class="commenttext"><?php 
            echo html_encodeTagged(getCommentBody(), false);
            ?>
</div><!-- class "commenttext" -->
					</div><!-- class "comment" -->
					<?php 
        }
        ?>
			</div><!-- id "comments" -->
			<?php 
    }
    if (getOption('comment_form_pagination') && COMMENTS_PER_PAGE < $num) {
        ?>
			<div class="Pagination"></div><!-- this is the jquery pagination nav placeholder -->
			<?php 
    }
    ?>
		<!-- Comment Box -->
		<?php 
    if ($comments_open) {
        if (MEMBERS_ONLY_COMMENTS && !zp_loggedin(POST_COMMENT_RIGHTS)) {
            echo gettext('Only registered users may post comments.');
        } else {
            $disabled = array('name' => '', 'website' => '', 'anon' => '', 'private' => '', 'comment' => '', 'street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => '');
            $stored = array_merge(array('email' => '', 'custom' => ''), $disabled, getCommentStored());
            $custom = getSerializedArray($stored['custom']);
            foreach ($custom as $key => $value) {
                if (!empty($value)) {
                    $stored[$key] = $value;
                }
            }
            foreach ($stored as $key => $value) {
                $disabled[$key] = false;
            }
            if (zp_loggedin()) {
                if (extensionEnabled('userAddressFields')) {
                    $address = userAddressFields::getCustomData($_zp_current_admin_obj);
                    foreach ($address as $key => $value) {
                        if (!empty($value)) {
                            $disabled[$key] = true;
                            $stored[$key] = $value;
                        }
                    }
                }
                $name = $_zp_current_admin_obj->getName();
                if (!empty($name)) {
                    $stored['name'] = $name;
                    $disabled['name'] = ' disabled="disabled"';
                } else {
                    $user = $_zp_current_admin_obj->getUser();
                    if (!empty($user)) {
                        $stored['name'] = $user;
                        $disabled['name'] = ' disabled="disabled"';
                    }
                }
                $email = $_zp_current_admin_obj->getEmail();
                if (!empty($email)) {
                    $stored['email'] = $email;
                    $disabled['email'] = ' disabled="disabled"';
                }
                if (!empty($address['website'])) {
                    $stored['website'] = $address['website'];
                    $disabled['website'] = ' disabled="disabled"';
                }
            }
            $data = zp_apply_filter('comment_form_data', array('data' => $stored, 'disabled' => $disabled));
            $disabled = $data['disabled'];
            $stored = $data['data'];
            foreach ($data as $check) {
                foreach ($check as $v) {
                    if ($v) {
                        $_zp_HTML_cache->disable();
                        //	shouldn't cache partially filled in pages
                        break 2;
                    }
                }
            }
            if (!empty($addcommenttext)) {
                echo $addcommenttext;
            }
            ?>
				<div id="commententry" <?php 
            echo $comment_commententry_mod;
            ?>
>
					<?php 
            $theme = getCurrentTheme();
            $form = getPlugin('comment_form/comment_form.php', $theme);
            require $form;
            ?>
				</div><!-- id="commententry" -->
				<?php 
        }
    } else {
        ?>
			<div id="commententry">
				<h3><?php 
        echo gettext('Closed for comments.');
        ?>
</h3>
			</div><!-- id="commententry" -->
			<?php 
    }
    ?>
	</div><!-- id="commentcontent" -->
	<?php 
    if (getOption('comment_form_rss') && getOption('RSS_comments')) {
        ?>
		<br clear="all" />
		<?php 
        if (class_exists('RSS')) {
            switch ($_zp_gallery_page) {
                case "image.php":
                    printRSSLink("Comments-image", "", gettext("Subscribe to comments"), "");
                    break;
                case "album.php":
                    printRSSLink("Comments-album", "", gettext("Subscribe to comments"), "");
                    break;
                case "news.php":
                    printRSSLink("Comments-news", "", gettext("Subscribe to comments"), "");
                    break;
                case "pages.php":
                    printRSSLink("Comments-page", "", gettext("Subscribe to comments"), "");
                    break;
            }
        }
    }
    ?>
	<!-- end printCommentForm -->
	<?php 
}
Example #3
0
 /**
  * Get the number of comments/replies for current entry
  *
  * @return integer
  */
 public function getCommentCount()
 {
     if (array_key_exists('commentcount', $this->_data)) {
         return $this->_data['commentcount'];
     }
     $commentcount = $this->getExtension('Thread') > getCommentCount();
     if (!$commentcount) {
         $commentcount = $this->getExtension('Atom')->getCommentCount();
     }
     $this->_data['commentcount'] = $commentcount;
     return $this->_data['commentcount'];
 }
Example #4
0
function commonComment()
{
    if (function_exists('printCommentForm')) {
        ?>
		<div id="commentbox">
			<?php 
        if (getCommentErrors() || getCommentCount() == 0) {
            $style = NULL;
            $head = '';
        } else {
            //TODO: if the following line is used as intended the comment textarea is hidden to start with and when shown is not full width.
            //				$style = ' class="comment" style="display:none;"';
            $style = ' class="commentx" style="display:block;"';
            $head = "<div{$style}><h3>" . gettext('Add a comment') . '</h3></div>';
        }
        printCommentForm(true, $head, true, $style);
        ?>
		</div><!-- id="commentbox" -->
		<?php 
    }
}
Example #5
0
<?php

// force UTF-8 Ø
?>
<!-- stopdesign comment form -->
<?php 
$showhide = "<a href=\"#comments\" id=\"showcomments\"><img src=\"" . $_zp_themeroot . "/images/btn_show.gif\" width=\"35\" height=\"11\" alt=\"" . gettext("SHOW") . "\" /></a> <a href=\"#content\" id=\"hidecomments\"><img src=\"" . $_zp_themeroot . "/images/btn_hide.gif\" width=\"35\" height=\"11\" alt=\"" . gettext("HIDE") . "\" /></a>";
$num = getCommentCount();
?>
<h2>
	<?php 
if ($num == 0) {
    echo gettext("No comments yet");
} else {
    printf(ngettext('%u comment so far', '%u comments so far', $num), $num) . ' ' . $showhide;
}
?>
</h2>
<?php 
printCommentErrors();
?>

<!-- BEGIN #comments -->
<div id="comments">
	<?php 
$autonumber = 0;
while (next_comment()) {
    if (!$autonumber) {
        ?>
				<dl class="commentlist">
				<?php 
Example #6
0
        ?>
<div><?php 
        echo shortenContent(getAlbumDesc(), 115, '...');
        ?>
</div><?php 
    }
    ?>
						<small>
	<?php 
    printAlbumDate();
    ?>
	<?php 
    if (getCommentCount() > 0) {
        ?>
&bull;&nbsp;<?php 
        echo getCommentCount() . ' ' . gettext('Comment(s)');
    }
    ?>
						</small>
					</li>
	<?php 
    $x++;
}
?>
			</ul>
		</div>
		<div class="paging">
<?php 
if (getPrevPageURL() || getNextPageURL()) {
    ?>
	<?php 
Example #7
0
    }
    ?>
		<?php 
    if (getPrevNewsURL() or getPrevNewsURL()) {
        ?>
<br clear:both /><?php 
    }
    ?>
		<h3><?php 
    printNewsTitle();
    ?>
</h3>

		<div class="newsarticlecredit">
			<span class="newsarticlecredit-left"> <?php 
    $count = getCommentCount();
    $cat = getNewsCategories();
    printNewsDate();
    if ($count > 0) {
        echo ' | ';
        printf(gettext("Comments: %d"), $count);
    }
    if (!empty($cat)) {
        echo ' | ';
    }
    ?>
			</span>
			<?php 
    if (!empty($cat)) {
        printNewsCategories(", ", gettext("Categories: "), "newscategories");
    }
Example #8
0
                 $pool->setQualifier('draft', 'equals', 0);
                 $pool->setQualifier('visibility', 'equals', 3);
                 $pool->setQualifier('acceptcomment', 'equals', 1);
                 $row = $pool->getAll('*');
                 if (!empty($row)) {
                     sendCommentPing($entryId, $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $entryId), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
                 }
             }
             importlib('model.blog.skin');
             $skin = new Skin($context->getProperty('skin.skin'));
             if ($entryId > 0) {
                 $commentBlock = getCommentView($entry, $skin);
                 dress('article_rep_id', $entryId, $commentBlock);
                 $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                 $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem)));
                 $commentCount = getCommentCount($blogid, $entryId);
                 $commentCount = $commentCount > 0 ? $commentCount : 0;
                 list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
             } else {
                 $commentView = '';
                 $commentBlock = getCommentView($entry, $skin);
                 dress('article_rep_id', $entryId, $commentBlock);
                 $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                 $commentCount = 0;
                 $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem)));
             }
             Respond::PrintResult(array('error' => 0, 'commentView' => $commentView, 'commentCount' => $commentCount, 'commentBlock' => $commentBlock, 'recentCommentBlock' => $recentCommentBlock));
             exit;
         }
     }
 }
Example #9
0
Comment");
			obj.innerHTML = "<?php 
                echo str_innerHTML($tempComments);
                ?>
";
		} catch(e) { }
		try {
			obj = loader.document.getElementById("recentComments");
			obj.innerHTML = "<?php 
                echo str_innerHTML($tempRecentComments);
                ?>
";
		} catch(e) { }
		try {
<?php 
                $commentCount = getCommentCount($blogid, $comment['entry']);
                list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
                $commentCount = $commentCount > 0 ? "({$commentCount})" : '';
                ?>
			obj = loader.document.getElementById("commentCount<?php 
                echo $comment['entry'];
                ?>
");
			if (obj != null) obj.innerHTML = "<?php 
                echo str_innerHTML($commentView);
                ?>
";
		} catch(e) { }
		try {
			obj = loader.document.getElementById("commentCountOnRecentEntries<?php 
                echo $comment['entry'];
Example #10
0
                }
                $nextID = $photoRes[$nChkN]['picID'];
                $photoPic .= <<<TO
     
   <!-- Right arrow shall be included in the ajax -->
   <div id="allPhotoRightArrow">
   <a href="../libs/aAjaxClass/photoAjax.php?user={$curU}&PN={$nChkN}&imgID={$nextID}&PVB=true&album={$album}"></a>
    </div>
TO;
                break;
            }
        }
        $comInfo = sideComments($pID);
        $approve = getApprove($pID);
        $appPeople = getPeopleApprove($pID);
        $comCount = getCommentCount($pID);
        $pPostID = "post_" . getPostID($pID);
        $title = date('l, M d, Y @ h:ia', $PVBRes[0]['picTime']);
        $time = relativeTime($PVBRes[0]['picTime']);
        /**/
        $allData = ["op" => "YES", "pic" => $photoPic, "picTime" => $time, "com" => $comInfo, "approve" => $approve, "peopleAprove" => $appPeople, "comCount" => $comCount, "postID" => $pPostID, "albumN" => $album, "title" => $title];
        echo json_encode($allData);
        //print_r($allData);
    }
}
//ADD NEW ALBUM TO THE PHOTO ADD
if ($_GET['newAlbum'] == true) {
    $ab = [];
    $fabulm = false;
    $albumName = urldecode($_GET['albumName']);
    //check if its the first album
Example #11
0
function commonNewsLoop($paged)
{
    $newstypes = array('album' => gettext('album'), 'image' => gettext('image'), 'video' => gettext('video'), 'news' => gettext('news'));
    while (next_news()) {
        $newstype = getNewsType();
        $newstypedisplay = $newstypes[$newstype];
        if (stickyNews()) {
            $newstypedisplay .= ' <small><em>' . gettext('sticky') . '</em></small>';
        }
        ?>
		<div class="newsarticle<?php 
        if (stickyNews()) {
            echo ' sticky';
        }
        ?>
">
			<h3><?php 
        printNewsTitleLink();
        echo " <span class='newstype'>[" . $newstypedisplay . "]</span>";
        ?>
</h3>
			<div class="newsarticlecredit">
				<span class="newsarticlecredit-left">
					<?php 
        $count = getCommentCount();
        $cat = getNewsCategories();
        printNewsDate();
        if ($count > 0) {
            echo ' | ';
            printf(gettext("Comments: %d"), $count);
        }
        ?>
				</span>
				<?php 
        if (is_GalleryNewsType()) {
            echo ' | ' . gettext("Album:") . " <a href='" . getNewsAlbumURL() . "' title='" . getBareNewsAlbumTitle() . "'>" . getNewsAlbumTitle() . "</a>";
        } else {
            if (!empty($cat) && !in_context(ZP_ZENPAGE_NEWS_CATEGORY)) {
                echo ' | ';
                printNewsCategories(", ", gettext("Categories: "), "newscategories");
            }
        }
        ?>
			</div> <!-- newsarticlecredit -->
			<br clear="all" />
			<?php 
        printCodeblock(1);
        ?>
			<?php 
        printNewsContent();
        ?>
			<?php 
        printCodeblock(2);
        ?>
			<br clear="all" />
			</div>
	<?php 
    }
    if ($paged) {
        printNewsPageListWithNav(gettext('next &raquo;'), gettext('&laquo; prev'), true, 'pagelist', true);
    }
}
Example #12
0
function getDefaultCenterPanel($mapping)
{
    $ctx = Model_Context::getInstance();
    $blogid = $ctx->getProperty('blog.id');
    ?>
									<div id="<?php 
    echo $mapping['plugin'];
    ?>
" class="section">
									<h3 class="caption<?php 
    echo isset($_REQUEST['edit']) ? ' visible' : ' invisible';
    ?>
">
											<span><?php 
    echo _t('알림판');
    if (isset($_REQUEST['edit'])) {
        ?>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetup" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=-1&edit"><?php 
        echo _t('위로');
        ?>
</a>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetdown" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=1&edit"><?php 
        echo _t('아래로');
        ?>
</a>
<?php 
    }
    ?>
											</span>
										</h3>
<?php 
    if (isset($_REQUEST['edit'])) {
        ?>
									</div>
<?php 
        return true;
    } else {
        // Get default data
        $stats = Statistics::getStatistics($blogid);
        $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
        $comments = getRecentComments($blogid, 10);
        $guestbooks = getRecentGuestbook($blogid, 10);
        list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10);
        $trackbacks = getRecentTrackbacks($blogid, 10);
        $recents = array();
        // title, date, link, category
        foreach ($comments as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment'));
        }
        foreach ($commentNotifies as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify'));
        }
        foreach ($guestbooks as $guestbook) {
            array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook'));
        }
        foreach ($trackbacks as $trackback) {
            array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback'));
        }
        $sort_array = array();
        foreach ($recents as $uniqid => $row) {
            // Sorting.
            foreach ($row as $key => $value) {
                if (!array_key_exists($key, $sort_array)) {
                    $sort_array[$key] = array();
                }
                $sort_array[$key][$uniqid] = $value;
            }
        }
        if (!empty($sort_array)) {
            array_multisort($sort_array['date'], SORT_DESC, $recents);
        }
        $recents = array_slice($recents, 0, 14);
        ?>
										<div id="shortcut-collection">
											<h4 class="caption"><span><?php 
        echo _t('바로가기');
        ?>
</span></h4>

											<ul>
												<li class="newPost"><a class="newPost" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/entry/post"><span><?php 
        echo _t('새 글 쓰기');
        ?>
</span></a></li>
<?php 
        if ($latestEntryId !== 0) {
            $latestEntry = getEntry($blogid, $latestEntryId);
            if (!is_null($latestEntry)) {
                ?>
												<li class="modifyPost"><a href="<?php 
                echo $ctx->getProperty('uri.blog');
                ?>
/owner/entry/edit/<?php 
                echo $latestEntry['id'];
                ?>
"><?php 
                echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10)));
                ?>
</a></li>
<?php 
            }
        }
        if ($ctx->getProperty('service.reader') == true) {
            ?>
												<li class="rssReader"><a href="<?php 
            echo $ctx->getProperty('uri.blog');
            ?>
/owner/network/reader"><?php 
            echo _t('RSS로 등록한 이웃 글 보기');
            ?>
</a></li>
<?php 
        }
        if (Acl::check("group.administrators")) {
            ?>
												<li class="deleteCache"><a href="<?php 
            echo $ctx->getProperty('uri.blog');
            ?>
/owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php 
            echo _t('캐시 지우기');
            ?>
</a></li>
<?php 
            if (Acl::check("group.creators")) {
                ?>
												<li class="optimizeStorage"><a href="<?php 
                echo $ctx->getProperty('uri.blog');
                ?>
/owner/data" onclick="optimizeData();return false;"><?php 
                echo _t('저장소 최적화');
                ?>
</a></li>
<?php 
            }
        }
        ?>
												<li class="clear"></li>
											</ul>
										</div>

										<div id="total-information">
											<h4 class="caption"><span><?php 
        echo _t('요약');
        ?>
</span></h4>

											<table class="posts-line">
												<caption><?php 
        echo _t('글');
        ?>
</caption>
												<thead>
													<th>type</th>
													<th>sum</th>
												</thead>
												<tbody>
													<tr>
														<td class="type"><?php 
        echo _t('글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getEntriesTotalCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('댓글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getCommentCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('방명록');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getGuestbookCount($blogid));
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('걸린 글');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format(getTrackbackCount($blogid));
        ?>
</td>
													</tr>
												</tbody>
											</table>
											<table class="visitors-line">
												<caption><?php 
        echo _t('방문자');
        ?>
</caption>
												<thead>
													<th>type</th>
													<th>sum</th>
												</thead>
												<tbody>
													<tr>
														<td class="type"><?php 
        echo _t('오늘');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['today']);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('어제');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['yesterday']);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('7일 평균');
        ?>
</td>
														<td class="sum"><?php 
        $weekly = Statistics::getWeeklyStatistics();
        $weeklycount = 0;
        foreach ($weekly as $day) {
            $weeklycount += $day['visits'];
        }
        echo number_format($weeklycount / 7);
        unset($weekly);
        unset($weeklycount);
        ?>
</td>
													</tr>
													<tr>
														<td class="type"><?php 
        echo _t('총방문자');
        ?>
</td>
														<td class="sum"><?php 
        echo number_format($stats['total']);
        ?>
</td>
													</tr>
												</tbody>
											</table>
										</div>

										<div id="myBlogInfo">
											<h4 class="caption"><span><a href="<?php 
        echo $ctx->getProperty('uri.blog') . '/owner/communication/comment';
        ?>
"><?php 
        echo _t('알림판');
        ?>
</a></span></h4>
											<table class="recent">
												<caption>asdasd</caption>
												<thead>
													<tr>
														<th scope="col" class="date"><?php 
        echo _t('날짜');
        ?>
</th>
														<th scope="col" class="category"><?php 
        echo _t('종류');
        ?>
</th>
														<th scope="col"><?php 
        echo _t('내용');
        ?>
</th>
													</tr>
												</thead>
												<tbody>
<?php 
        foreach ($recents as $item) {
            ?>
													<tr class="<?php 
            echo $item['category'];
            ?>
">
														<td class="date"><?php 
            echo Timestamp::format('%m/%d', $item['date']);
            ?>
</td>
														<td class="category">
															<?php 
            switch ($item['category']) {
                case 'trackback':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>';
                    break;
                case 'comment':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>';
                    break;
                case 'commentNotify':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>';
                    break;
                case 'guestbook':
                    echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>';
                    break;
            }
            ?>
														</td>
														<td class="title"><a href="<?php 
            echo $item['link'];
            ?>
"><?php 
            echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20));
            ?>
</a></td>
													</tr>
<?php 
        }
        ?>
												</tbody>
											</table>
										</div>

<?php 
        $noticeURL = TEXTCUBE_NOTICE_URL;
        $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss";
        $noticeEntries = array();
        if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) {
            $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')));
        } else {
            list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS);
            if ($result == 0) {
                $xmls = new XMLStruct();
                $xmls->setXPathBaseIndex(1);
                $noticeEntries = array();
                if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) {
                    if ($xmls->getAttribute('/rss', 'version')) {
                        for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) {
                            $item = array('permalink' => rawurldecode($link));
                            $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title");
                            if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) {
                                $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate"));
                            } else {
                                if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) {
                                    $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date"));
                                } else {
                                    $item['written'] = 0;
                                }
                            }
                            array_push($noticeEntries, $item);
                        }
                    }
                }
                Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries));
            }
        }
        ?>
										<div id="textcube-notice">
											<h4 class="caption"><span><a href="<?php 
        echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko");
        ?>
"><?php 
        echo _t('공지사항');
        ?>
</a></span></h4>
<?php 
        if (count($noticeEntries) > 0) {
            array_splice($noticeEntries, 3, count($noticeEntries) - 3);
            ?>
											<table>
												<tbody>
<?php 
            foreach ($noticeEntries as $item) {
                ?>
													<tr>
														<td class="date"><?php 
                echo Timestamp::format2($item['written']);
                ?>
</td>
														<td class="title"><a href="<?php 
                echo $item['permalink'];
                ?>
" onclick="return openLinkInNewWindow(this);" ><?php 
                echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 35));
                ?>
</a></td>
													</tr>
<?php 
            }
            ?>
												</tbody>
											</table>

<?php 
        } else {
            ?>
											<div id="fail-notice">
												<?php 
            echo _t('공지사항을 가져올 수 없습니다. 잠시 후 다시 시도해 주십시오.');
            ?>
											</div>
<?php 
        }
        ?>
										</div>
<?php 
    }
    ?>
									</div>
<?php 
}
Example #13
0
</h5>
						<div class="news-info">
							<?php 
            if (getNewsDate() && getOption('libratus_date_news')) {
                ?>
<span><i class="fa fa-calendar-o"></i>&nbsp;<?php 
                printNewsDate();
                ?>
&nbsp;&nbsp;&nbsp;&nbsp;</span><?php 
            }
            ?>
							<?php 
            if (function_exists('getCommentCount')) {
                ?>
							<span><i class="fa fa-comments-o"></i>&nbsp;<?php 
                echo gettext('Comments:') . ' ' . getCommentCount();
                ?>
&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<?php 
            }
            ?>
							<?php 
            if (getNewsCategories()) {
                ?>
<span><i class="fa fa-folder-o"></i>&nbsp;<?php 
                printNewsCategories(', ', '', 'taglist');
                ?>
&nbsp;&nbsp;&nbsp;&nbsp;</span><?php 
            }
            ?>
						</div>
Example #14
0
function getRiverActivity($activities, $user, $login_user)
{
    $handle = array();
    $site_url = get_config('wwwroot');
    foreach ($activities as $activity) {
        $userEntity = get_entity($activity->subject_guid);
        $avatar_url = getProfileIcon($userEntity);
        $object_guid = $activity->object_guid;
        $entity = get_entity($object_guid);
        $activity_like = checkLike($activity->object_guid, $login_user->guid);
        $activity_comment_count = getCommentCount($activity);
        $activity_like_count = likes_count_number_of_likes($activity->object_guid);
        $entityString = "";
        $entityTxt = "";
        $icon_url = "";
        $img_url = "";
        $message_board = "";
        $container_entity = "";
        $batch_images = array();
        $isObject = false;
        if ($activity->subtype == "tidypics_batch") {
            $isObject = true;
            $batch_images = getBatchImages($activity->object_guid, $user->guid);
            if (sizeof($batch_images) > 1) {
                $entityTxt = "added the photos to the album";
                $album_guid = $batch_images[0]['container_guid'];
                $activity_like = checkLike($album_guid, $login_user->guid);
                $activity_comment_count = api_get_image_comment_count($album_guid);
                $activity_like_count = likes_count_number_of_likes($album_guid);
            } else {
                if (sizeof($batch_images) == 1) {
                    $activity_like_count = $batch_images[0]['like_count'];
                    $activity_comment_count = $batch_images[0]['comment_count'];
                    $activity_like = $batch_images[0]['like'];
                    $img = get_entity($batch_images[0]['guid']);
                    $original_file_name = $img->originalfilename;
                    $container_entity = get_entity($entity->container_guid);
                    if ($img->title != null) {
                        $entityTxt = "added the photo " . $img->title . " to the album " . $container_entity->title;
                    } else {
                        $entityTxt = "added the photo " . $original_file_name . " to the album " . $container_entity->title;
                    }
                    if ($img->description != null) {
                        if (strlen($img->description) > 300) {
                            $entityString = substr(strip_tags($img->description), 0, 300);
                            $entityString = preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $entityString) . '...';
                        } else {
                            $entityString = strip_tags($img->description);
                        }
                    } else {
                        $entityString = '';
                    }
                }
            }
        } else {
            if ($activity->action_type == "create" && $activity->subtype == "album") {
                $isObject = true;
                $album = get_entity($activity->object_guid);
                $entityTxt = "created a new photo album " . $album->title;
                $container_entity = get_entity($entity->container_guid);
                if ($container_entity->type == 'group') {
                    $entityTxt = $entityTxt . ' in the group ' . $container_entity->name;
                }
                $album_cover = $album->getCoverImage();
                $file_name = $album_cover->getFilenameOnFilestore();
                $image_join_date = $album_cover->time_created;
                $position = strrpos($file_name, '/');
                $position = $position + 1;
                $icon_file_name = substr_replace($file_name, 'largethumb', $position, 0);
                $image_icon_url = $site_url . 'services/api/rest/json/?method=image.get_post';
                $image_icon_url = $image_icon_url . '&joindate=' . $image_join_date . '&guid=' . $album_cover->guid . '&name=' . $icon_file_name;
                $image_icon_url = elgg_format_url($image_icon_url);
                $image_url = $site_url . 'services/api/rest/json/?method=image.get_post';
                $image_url = $image_url . '&joindate=' . $image_join_date . '&guid=' . $album_cover->guid . '&name=' . $file_name;
                $image_url = elgg_format_url($image_url);
                $batch_images[] = createAlbumCoverImage($album_cover, $image_join_date, $image_icon_url, $image_url, $user);
            } else {
                if ($activity->action_type == "friend" && $activity->subtype == "") {
                    $isObject = true;
                    $msg = "is now a friend with";
                    $friendEntity = get_entity($activity->object_guid);
                    $entityTxt = $msg . " " . $friendEntity->name;
                    $icon_url = getProfileIcon($friendEntity);
                    $icon_url = elgg_format_url($icon_url);
                    $img_url = getProfileIcon($friendEntity, 'master');
                    //$friendEntity->getIconURL('master');
                    if (strpos($img_url, 'user/defaultmaster.gif') !== false) {
                        $img_url = getProfileIcon($friendEntity, 'large');
                        //$friendEntity->getIconURL('large');
                    }
                    $img_url = elgg_format_url($img_url);
                } else {
                    if ($activity->action_type == "update" && $activity->view == 'river/user/default/profileiconupdate') {
                        $isObject = true;
                        $entityTxt = "has a new avatar";
                        $entityString = "";
                        $timeCreated = time_ago($activity->posted);
                        $batch_images[] = createProfileImageBatch($activity->object_guid, $timeCreated, $userEntity);
                    } else {
                        if ($activity->subtype == "comment" && $activity->action_type == "comment" && $activity->view == 'river/object/comment/album') {
                            $isObject = true;
                            $album_comment = get_entity($activity->object_guid);
                            $album_entity = '';
                            if ($album_comment) {
                                $album_entity = get_entity($album_comment->container_guid);
                            }
                            $entityTxt = 'comment on album ' . $album_entity->title;
                            $entityString = $album_comment->description;
                            $entityString = strip_tags($entityString);
                        } else {
                            if ($activity->subtype == "file" && $activity->action_type == "create" && $activity->view == 'river/object/file/create') {
                                $isObject = true;
                                $container_entity = get_entity($entity->container_guid);
                                if ($container_entity->type == 'group') {
                                    $entityTxt = 'uploaded the file ' . $entity->title . ' in the group ' . $container_entity->name;
                                } else {
                                    $entityTxt = 'uploaded the file ' . $entity->title;
                                }
                                if ($entity->description != null) {
                                    $entityString = $entity->description;
                                    $entityString = strip_tags($entityString);
                                } else {
                                    $entityString = $entity->title;
                                }
                                $simpletype = $entity->simpletype;
                                if ($simpletype == "image") {
                                    $activity->type = 'image';
                                    $icon_url = $site_url . 'services/api/rest/json/?method=file.get_post' . '&guid=' . $entity->guid . '&size=largethumb';
                                    $icon_url = elgg_format_url($icon_url);
                                    $img_url = $site_url . 'services/api/rest/json/?method=file.get_post' . '&guid=' . $entity->guid . '&size=original';
                                    $img_url = elgg_format_url($img_url);
                                } else {
                                    $activity->type = 'download';
                                    $icon_url = getProfileIcon($entity, 'large');
                                    //elgg_format_url($entity->getIconURL('large'));
                                    $img_url = $site_url . 'services/api/rest/json/?method=file.get_post' . '&guid=' . $entity->guid . '&size=' . $entity->originalfilename;
                                    $img_url = elgg_format_url($img_url);
                                }
                            } else {
                                if ($activity->subtype == "comment" && $activity->action_type == "comment" && $activity->view == 'river/object/comment/create') {
                                    $isObject = true;
                                    $file_entity = get_entity($activity->target_guid);
                                    if ($file_entity->title) {
                                        $entityTxt = 'comment on ' . $file_entity->title;
                                    } else {
                                        $entityTxt = 'comment on post';
                                    }
                                    $entityString = $entity->description;
                                    $entityString = strip_tags($entityString);
                                } else {
                                    if ($activity->action_type == "comment" && $activity->subtype == "comment" && $activity->view == 'river/object/comment/image') {
                                        $isObject = true;
                                        $image_entity = get_entity($activity->target_guid);
                                        $image_file_name = $image_entity->originalfilename;
                                        if ($image_file_name) {
                                            $entityTxt = 'comment on photo ' . $image_file_name;
                                        } else {
                                            $entityTxt = 'comment on post';
                                        }
                                        $entityString = $entity->description;
                                        $entityString = strip_tags($entityString);
                                    } else {
                                        if ($activity->action_type == "create" && $activity->subtype == "thewire" && $activity->view == 'river/object/thewire/create') {
                                            $isObject = true;
                                            $entityTxt = 'posted to the wire';
                                            $entityString = $entity->description;
                                            $entityString = strip_tags($entityString);
                                        } else {
                                            if ($activity->action_type == "create" && $activity->view == 'river/group/create') {
                                                $isObject = true;
                                                $entityTxt = 'created the group ' . $entity->name;
                                                $entityString = strip_tags($entity->description);
                                            } else {
                                                if ($activity->action_type == "join" && $activity->view == 'river/relationship/member/create') {
                                                    $isObject = true;
                                                    $entityTxt = 'joined the group ' . $entity->name;
                                                    $entityString = strip_tags($entity->description);
                                                } else {
                                                    if ($activity->action_type == "messageboard" && $activity->view == 'river/object/messageboard/create') {
                                                        $isObject = true;
                                                        $post_on_entity = get_entity($activity->object_guid);
                                                        $message_board = elgg_get_annotation_from_id($activity->annotation_id);
                                                        $entityTxt = 'posted on ' . $post_on_entity->name . '\'s message board';
                                                        $entityString = strip_tags($message_board->value);
                                                    } else {
                                                        if ($activity->action_type == "create" && $activity->view == 'river/object/blog/create' && $activity->subtype == 'blog') {
                                                            $isObject = true;
                                                            $container_entity = get_entity($entity->container_guid);
                                                            if ($container_entity->type == 'group') {
                                                                $entityTxt = 'published a blog post ' . $entity->title . ' in the group ' . $container_entity->name;
                                                            } else {
                                                                $entityTxt = 'published a blog post ' . $entity->title;
                                                            }
                                                            if ($entity->description != null) {
                                                                if (strlen($entity->description) > 300) {
                                                                    $entityString = substr(strip_tags($entity->description), 0, 300);
                                                                    $entityString = preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $entityString) . '...';
                                                                } else {
                                                                    $entityString = strip_tags($entity->description);
                                                                }
                                                            } else {
                                                                $entityString = '';
                                                            }
                                                        } else {
                                                            if ($activity->subtype == "bookmarks" && $activity->action_type == "create" && $activity->view == 'river/object/bookmarks/create') {
                                                                $isObject = true;
                                                                $entity = get_entity($activity->object_guid);
                                                                $container_entity = get_entity($entity->container_guid);
                                                                if ($container_entity->type == 'group') {
                                                                    $entityTxt = 'bookmarked ' . $entity->title . ' in the group ' . $container_entity->name;
                                                                } else {
                                                                    $entityTxt = 'bookmarked ' . $entity->title;
                                                                }
                                                                if ($entity->description != null) {
                                                                    $icon_url = getImageLink($entity->description);
                                                                    if (strlen($entity->description) > 300) {
                                                                        $entityString = substr(strip_tags($entity->description), 0, 300);
                                                                        $entityString = preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $entityString) . '...';
                                                                    } else {
                                                                        $entityString = $entity->description;
                                                                    }
                                                                } else {
                                                                    $entityString = '';
                                                                }
                                                                $entityString = strip_tags($entityString);
                                                                $img_url = $entity->address;
                                                            } else {
                                                                if ($activity->subtype == "discussion_reply" && $activity->action_type == "reply" && $activity->view == 'river/object/discussion_reply/create') {
                                                                    $isObject = true;
                                                                    $target_entity = get_entity($activity->target_guid);
                                                                    $entityTxt = 'replied on the discussion topic ' . $target_entity->title;
                                                                    $entityString = $entity->description;
                                                                    $entityString = strip_tags($entityString);
                                                                } else {
                                                                    if ($activity->subtype == "groupforumtopic" && $activity->action_type == "create" && $activity->view == 'river/object/groupforumtopic/create') {
                                                                        $isObject = true;
                                                                        $container_entity = get_entity($entity->container_guid);
                                                                        $entityTxt = 'added a new discussion topic ' . $entity->title . ' in the group ' . $container_entity->name;
                                                                        if ($entity->description != null) {
                                                                            if (strlen($entity->description) > 300) {
                                                                                $entityString = substr(strip_tags($entity->description), 0, 300);
                                                                                $entityString = preg_replace('/\\W\\w+\\s*(\\W*)$/', '$1', $entityString) . '...';
                                                                            } else {
                                                                                $entityString = $entity->description;
                                                                            }
                                                                            $entityString = strip_tags($entityString);
                                                                        } else {
                                                                            $entityString = '';
                                                                        }
                                                                    } else {
                                                                        //$isObject = true;
                                                                        //$entityTxt = get_object_entity_as_row($activity->object_guid)->description;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if ($isObject) {
            $handle[] = array('id' => $activity->id, 'time' => time_ago($activity->posted), 'type' => $activity->type, 'sub_type' => $activity->subtype, 'action_type' => $activity->action_type, 'object_guid' => $activity->object_guid, 'subject_guid' => $activity->subject_guid, 'view' => $activity->view, 'string' => $entityString, 'txt' => $entityTxt, 'name' => $userEntity->name, 'username' => $userEntity->username, 'avatar_url' => $avatar_url, 'icon_url' => $icon_url, 'img_url' => $img_url, 'like_count' => $activity_like_count, 'like' => $activity_like, 'comment_count' => $activity_comment_count, 'batch_images' => $batch_images);
        }
    }
    return $handle;
}
Example #15
0
function commonComment()
{
    if (function_exists('printCommentForm')) {
        ?>
		<div id="commentbox">
			<?php 
        if (getCommentErrors() || getCommentCount() == 0) {
            $style = NULL;
            $head = '';
        } else {
            $style = ' class="commentx" style="display:block;"';
            $head = "<div{$style}><h3>" . gettext('Add a comment') . '</h3></div>';
        }
        printCommentForm(true, $head, true, $style);
        ?>
		</div><!-- id="commentbox" -->
		<?php 
    }
}
Example #16
0
/**
 * Prints a form for posting comments
 *
 * @param bool $showcomments defaults to true for showing list of comments
 * @param string $addcommenttext alternate text for "Add a comment:"
 * @param bool $addheader set true to display comment count header
 * @param string $comment_commententry_mod use to add styles, classes to the comment form div
 */
function printCommentForm($showcomments = true, $addcommenttext = NULL, $addheader = true, $comment_commententry_mod = '')
{
    global $_zp_gallery_page, $_zp_themeroot, $_zp_current_admin_obj, $_zp_current_comment;
    if (is_null($addcommenttext)) {
        $addcommenttext = '<h3>' . gettext('Add a comment:') . '</h3>';
    }
    switch ($_zp_gallery_page) {
        case 'album.php':
            if (!getOption('comment_form_albums')) {
                return;
            }
            $comments_open = OpenedForComments(ALBUM);
            $formname = '/comment_form.php';
            break;
        case 'image.php':
            if (!getOption('comment_form_images')) {
                return;
            }
            $comments_open = OpenedForComments(IMAGE);
            $formname = '/comment_form.php';
            break;
        case 'pages.php':
            if (!getOption('comment_form_pages')) {
                return;
            }
            $comments_open = zenpageOpenedForComments();
            $formname = '/comment_form.php';
            break;
        case 'news.php':
            if (!getOption('comment_form_articles')) {
                return;
            }
            $comments_open = zenpageOpenedForComments();
            $formname = '/comment_form.php';
            break;
        default:
            return;
            break;
    }
    $arraytest = '/^a:[0-9]+:{/';
    // this screws up Eclipse's brace count!!!
    ?>
<!-- printCommentForm -->
	<div id="commentcontent">
		<?php 
    $num = getCommentCount();
    if ($showcomments) {
        if ($num == 0) {
            if ($addheader) {
                echo '<h3 class="empty">' . gettext('No Comments') . '</h3>';
            }
            $display = '';
        } else {
            if ($addheader) {
                echo '<h3>' . sprintf(ngettext('%u Comment', '%u Comments', $num), $num) . '</h3>';
            }
            if (getOption('comment_form_toggle')) {
                ?>
					<script type="text/javascript">
						// <!-- <![CDATA[
						function toggleComments(hide) {
							if (hide) {
								$('div.comment').hide();
								$('#comment_toggle').html('<button type="button" onclick="javascript:toggleComments(false);"><?php 
                echo gettext('show comments');
                ?>
</button>');
							} else {
								$('div.comment').show();
								$('#comment_toggle').html('<button type="button" onclick="javascript:toggleComments(true);"><?php 
                echo gettext('hide comments');
                ?>
</button>');
							}
						}
						$(document).ready(function() {
							toggleComments(true);
						});
						// ]]> -->
					</script>
					<?php 
                $display = ' style="display:none"';
            } else {
                $display = '';
            }
        }
        ?>
		<div id="comments">
			<div id="comment_toggle"><!-- place holder for toggle button --></div>
			<?php 
        while (next_comment()) {
            if (!getOption('comment_form_showURL')) {
                $_zp_current_comment['website'] = '';
            }
            ?>
				<div class="comment" <?php 
            echo $display;
            ?>
>
					<a name="c_<?php 
            echo $_zp_current_comment['id'];
            ?>
"></a>
					<div class="commentinfo">
						<h4><?php 
            printCommentAuthorLink();
            ?>
: on <?php 
            echo getCommentDateTime();
            printEditCommentLink('Edit', ', ', '');
            ?>
</h4>
					</div><!-- class "commentinfo" -->
					<div class="commenttext"><?php 
            echo getCommentBody();
            ?>
</div><!-- class "commenttext" -->
				</div><!-- class "comment" -->
				<?php 
        }
        ?>
		</div><!-- id "comments" -->
		<?php 
    }
    ?>
		<!-- Comment Box -->
		<?php 
    if ($comments_open) {
        $stored = array_merge(getCommentStored(), array('street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => ''));
        $raw = $stored['custom'];
        if (preg_match($arraytest, $raw)) {
            $custom = unserialize($raw);
            foreach ($custom as $key => $value) {
                if (!empty($value)) {
                    $stored[$key] = $value;
                }
            }
        }
        $disabled = array('name' => '', 'website' => '', 'anon' => '', 'private' => '', 'comment' => '', 'street' => '', 'city' => '', 'state' => '', 'country' => '', 'postal' => '');
        foreach ($stored as $key => $value) {
            $disabled[$key] = false;
        }
        if (zp_loggedin()) {
            $raw = $_zp_current_admin_obj->getCustomData();
            if (preg_match($arraytest, $raw)) {
                $address = unserialize($raw);
                foreach ($address as $key => $value) {
                    if (!empty($value)) {
                        $disabled[$key] = true;
                        $stored[$key] = $value;
                    }
                }
            }
            $name = $_zp_current_admin_obj->getName();
            if (!empty($name)) {
                $stored['name'] = $name;
                $disabled['name'] = ' disabled="disabled"';
            } else {
                $user = $_zp_current_admin_obj->getUser();
                if (!empty($user)) {
                    $stored['name'] = $user;
                    $disabled['name'] = ' disabled="disabled"';
                }
            }
            $email = $_zp_current_admin_obj->getEmail();
            if (!empty($email)) {
                $stored['email'] = $email;
                $disabled['email'] = ' disabled="disabled"';
            }
            if (!empty($address['website'])) {
                $stored['website'] = $address['website'];
                $disabled['website'] = ' disabled="disabled"';
            }
        }
        $data = zp_apply_filter('comment_form_data', array('data' => $stored, 'disabled' => $disabled));
        $disabled = $data['disabled'];
        $stored = $data['data'];
        if (MEMBERS_ONLY_COMMENTS && !zp_loggedin(POST_COMMENT_RIGHTS)) {
            echo gettext('Only registered users may post comments.');
        } else {
            if (!empty($addcommenttext)) {
                echo $addcommenttext;
            }
            ?>
				<div id="commententry" <?php 
            echo $comment_commententry_mod;
            ?>
>
				<?php 
            $theme = getCurrentTheme();
            $form = getPlugin('comment_form' . $formname, $theme);
            require $form;
            ?>
				</div><!-- id="commententry" -->
				<?php 
        }
    } else {
        ?>
			<div id="commententry">
				<h3><?php 
        echo gettext('Closed for comments.');
        ?>
</h3>
			</div><!-- id="commententry" -->
			<?php 
    }
    ?>
		</div><!-- id="commentcontent" -->
	<?php 
    if (getOption('comment_form_rss')) {
        ?>
	<br clear="all" />
	<?php 
        switch ($_zp_gallery_page) {
            case "image.php":
                printRSSLink("Comments-image", "", gettext("Subscribe to comments"), "");
                break;
            case "album.php":
                printRSSLink("Comments-album", "", gettext("Subscribe to comments"), "");
                break;
            case "news.php":
                printZenpageRSSLink("Comments-news", "", "", gettext("Subscribe to comments"), "");
                break;
            case "pages.php":
                printZenpageRSSLink("Comments-page", "", "", gettext("Subscribe to comments"), "");
                break;
        }
    }
    ?>
<!-- end printCommentForm -->
<?php 
}