本文整理匯總了PHP中WCF::getTopicLastPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP WCF::getTopicLastPost方法的具體用法?PHP WCF::getTopicLastPost怎麽用?PHP WCF::getTopicLastPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WCF
的用法示例。
在下文中一共展示了WCF::getTopicLastPost方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: while
<li class="topic">Topic</li>
<li class="lastpost">Last post</li>
</ul>-->';
if ($countOnPage > 0) {
//loop the records
while ($arr = $topics_res->fetch()) {
if ($author = WCF::getAuthorById($arr['author'])) {
$arr['author_str'] = $author;
} else {
$arr['author_str'] = 'Unknown';
}
unset($author);
//format the time
$arr['added'] = date('D M j, Y, h:i a', strtotime($arr['added']));
//Get the last post
$lastPost = WCF::getTopicLastPost($arr['id']);
echo '
<ul class="topic_row">
<li class="icon">
<img src="template/forums/style/icons/topic_unread_mine.png" width="55px" height="39px"/>
</li>
<li class="topic_title_by_date">
<h1><a href="', $config['BaseURL'], '/forums.php?page=topic&id=', $arr['id'], '">', WCF::parseTitle($arr['name']), '</a></h1>
<p>Created by <a href="#">', $arr['author_str'], '</a>, ', $arr['added'], '</p>
</li>
<li class="lastpost">';
if ($lastPost) {
echo '
<h4>by <a href="', $config['BaseURL'], '/index.php?page=profile&uid=', $lastPost['author'], '">', $lastPost['author_str'], '</a></h4>
<h5>', $lastPost['added'], '</h5>
<a href="', $config['BaseURL'], '/forums.php?page=topic&id=', $arr['id'], '&p=', $lastPost['page_number'], '#post-', $lastPost['id'], '" class="go_to_lastpost" title="Go to last post"><p>Go to last post</p></a>';