本文整理汇总了PHP中Tweet::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Tweet::count方法的具体用法?PHP Tweet::count怎么用?PHP Tweet::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tweet
的用法示例。
在下文中一共展示了Tweet::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: overview
public function overview()
{
$unsent = Tweet::count("tweets.message_id = '' AND tweets.publish_at <= NOW()");
$pending = Tweet::count("tweets.message_id = '' AND tweets.publish_at > NOW()");
$total = Tweet::count();
$this->assign('unsent', $unsent);
$this->assign('pending', $pending);
$this->assign('total', $total);
$this->title = 'Twitter';
$this->render('tweet/overview.tpl');
}
示例2: foreach
foreach ($tweets as $tweet) {
$tweet->tagify();
$cleantext = $tweet->message;
//$tweet->clean();
echo "<li id=\"tweet-" . $tweet->id . "\" class=\"tweet" . ($i % 2 == 0 ? " altrow" : "") . "\">\n";
echo "<div class=\"userpic\"><a href=\"http://twitter.com/" . $tweet->screen_name . "\"><img src=\"" . $tweet->userpic . "\" alt=\"\" /></a></div>\n";
echo "<div class=\"tweet-meta\"><a href=\"http://twitter.com/" . $tweet->screen_name . "\">" . $tweet->name . "</a> " . relativeTime(strtotime($tweet->published)) . "</div>";
echo "<div class=\"tweet-body\">" . linkify($cleantext) . ' <a href="' . $tweet->permalink() . '" class="permalink">∞</a></div>';
echo "</li>\n";
$i++;
}
?>
</ul>
<?php
if ($tweets) {
echo Paginator::paginate($offset, Tweet::count($tag), PAGE_LIMIT, "index.php?" . ($tag ? 'tag=' . urlencode($tag) . '&' : '') . "offset=");
} else {
echo "<div class=\"tweetless\">\n";
echo "No tweets.\n";
echo "</div>\n";
}
?>
</div>
</div>
<div id="footer">
<p>Powered by <a href="http://plasticmind.com/twitster/?referral=1">Twitster</a></p>
</div>
</div>
</body>
</html>