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'); }
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>