本文整理汇总了PHP中Articles::getCommentsCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::getCommentsCount方法的具体用法?PHP Articles::getCommentsCount怎么用?PHP Articles::getCommentsCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::getCommentsCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
$res->execute();
if ($res->rowCount() > 0) {
echo '
<div class="sub_header">
<h1></h1>
</div>
<div class="blueberry">
<ul class="slides">';
$First = true;
while ($arr = $res->fetch()) {
echo '
<li', $First ? ' style="position: relative"' : ' style="display: none"', '>
', $arr['image'] != '' ? '<img src="./uploads/articles/' . $arr['image'] . '" />' : '', '
<h1><a href="', $config['BaseURL'], '/index.php?page=article&id=', $arr['id'], '">', $arr['title'], '</a></h1>
<h4>', date('d M, Y', strtotime($arr['added'])), ' | ', $arr['views'], ' Views | ', Articles::getCommentsCount($arr['id']), ' Comments</h4>
<p>', htmlspecialchars(stripslashes($arr['short_text'])), '</p>
</li>';
if ($First) {
$First = false;
}
}
unset($arr, $First);
echo '
</ul>
<!-- Optional, see options below -->
<ul class="pager">';
//Set the buttons for the slides
for ($i = 0; $i < $res->rowCount(); $i++) {
echo '<li><a href="#"><span></span></a></li>';
示例2: date
?>
</div>
<div class="article">
<h1 id="title"><?php
echo $row['title'];
?>
</h1>
<h5 id="subinfo"><b><?php
echo date('d M, Y', strtotime($row['added']));
?>
</b><?php
echo $row['views'];
?>
Views <?php
echo Articles::getCommentsCount($row['id']);
?>
Comments</h5>
<p id="post">
<?php
if (($text = $CACHE->get('articles/article_' . $row['id'])) === false) {
// create the BBCode parser
$parser = new SBBCodeParser_Document(true, false);
//Strip slashes
$text = stripslashes($row['text']);
//Parse
$text = $parser->parse($text)->detect_links()->detect_emails()->detect_emoticons()->get_html(true);
//fix multiple break lines
$text = preg_replace("/<br\\s*\\/?>\\s<br\\s*\\/?>\\s+/", "<br/>", $text);
unset($parser);
//Store the parsed post in the cache for a month