當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gallery::getNumComments方法代碼示例

本文整理匯總了PHP中Gallery::getNumComments方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::getNumComments方法的具體用法?PHP Gallery::getNumComments怎麽用?PHP Gallery::getNumComments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gallery的用法示例。


在下文中一共展示了Gallery::getNumComments方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: printf

} else {
    printf(gettext('<strong>%u</strong> images'), $imagecount);
}
?>
</li><li>
<?php 
if ($albumscount_unpub > 0) {
    printf(gettext('<strong>%1$u</strong> albums (%2$u un-published)'), $albumcount, $albumscount_unpub);
} else {
    printf(gettext('<strong>%u</strong> albums'), $albumcount);
}
?>
</li>
<li>
<?php 
$commentcount = $gallery->getNumComments(true);
$commentcount_mod = $commentcount - $gallery->getNumComments(false);
if ($commentcount_mod > 0) {
    if ($commentcount != 1) {
        printf(gettext('<strong>%1$u</strong> comments (%2$u in moderation)'), $commentcount, $commentcount_mod);
    } else {
        printf(gettext('<strong>1</strong> comment (%u in moderation)'), $commentcount_mod);
    }
} else {
    if ($commentcount != 1) {
        printf(gettext('<strong>%u</strong> comments'), $commentcount);
    } else {
        echo gettext('<strong>1</strong> comment');
    }
}
?>
開發者ID:hatone,項目名稱:zenphoto-1.4.1.4,代碼行數:31,代碼來源:gallery_statistics.php

示例2: printf

        ?>
				</li>
				<li>
				<?php 
        $t = $gallery->getNumAlbums(true);
        $c = $t - $gallery->getNumAlbums(true, true);
        if ($c > 0) {
            printf(ngettext('<strong>%1$u</strong> Album (%2$u un-published)', '<strong>%1$u</strong> Albums (%2$u un-published)', $t), $t, $c);
        } else {
            printf(ngettext('<strong>%u</strong> Album', '<strong>%u</strong> Albums', $t), $t);
        }
        ?>
				</li>
				<li>
				<?php 
        $t = $gallery->getNumComments(true);
        $c = $t - $gallery->getNumComments(false);
        if ($c > 0) {
            printf(ngettext('<strong>%1$u</strong> Comment (%2$u in moderation)', '<strong>%1$u</strong> Comments (%2$u in moderation)', $t), $t, $c);
        } else {
            printf(ngettext('<strong>%u</strong> Comment', '<strong>%u</strong> Comments', $t), $t);
        }
        ?>
				</li>
				<?php 
        if (getOption('zp_plugin_zenpage')) {
            ?>
					<li>
						<?php 
            list($total, $type, $unpub) = getNewsPagesStatistic("pages");
            if (empty($unpub)) {
開發者ID:hatone,項目名稱:zenphoto-1.4.1.4,代碼行數:31,代碼來源:admin.php


注:本文中的Gallery::getNumComments方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。