Exemplo n.º 1
0
			<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>';