本文整理匯總了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');
}
}
?>
示例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)) {