示例#1
0
if ($count > 0) {
    //calculate the pages
    $pages = $pagies->calculate_pages($count, $perPage, $p);
    //get the activity records
    $res = $DB->prepare("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t`article_comments`.`id`, \r\n\t\t\t\t\t\t\t\t\t\t\t\t`article_comments`.`added`, \r\n\t\t\t\t\t\t\t\t\t\t\t\t`article_comments`.`author`, \r\n\t\t\t\t\t\t\t\t\t\t\t\t`article_comments`.`article`, \r\n\t\t\t\t\t\t\t\t\t\t\t\t`article_comments`.`text`, \r\n\t\t\t\t\t\t\t\t\t\t\t\t`account_data`.`displayName` AS `author_str` \r\n\t\t\t\t\t\t\t\t\t\t\tFROM `article_comments` \r\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN `account_data` ON `account_data`.`id` = `article_comments`.`author` \r\n\t\t\t\t\t\t\t\t\t\t\tWHERE `article_comments`.`article` = :id \r\n\t\t\t\t\t\t\t\t\t\t\tORDER BY `article_comments`.`id` DESC \r\n\t\t\t\t\t\t\t\t\t\t\tLIMIT " . $pages['limit'] . ";");
    $res->bindParam(':id', $ArticleID, PDO::PARAM_INT);
    $res->execute();
    //loop the records
    while ($arr = $res->fetch()) {
        echo '
							<div class="comment_row" data-id="', $arr['id'], '">
								<div class="headline">
									<p><a href="', $config['BaseURL'], '/index.php?page=profile&uid=', $arr['author'], '">', $arr['author_str'], '</a> said:</p>
									<span id="time" data-original="', $arr['added'], '">NaN</span>
								</div>
								<p class="comment">', Articles::parseTitle($arr['text']), '</p>
							</div>';
    }
}
unset($arr, $res);
?>
                
           	</div>
            
            <?php 
//Pagination
if ($count > 0 and $count > $perPage) {
    echo '
					<!-- Pagination -->
					<br>
					<div class="d-cont pagination-holder">
示例#2
0
文件: articles.php 项目: superwow/cms
        	<h1><?php 
echo $Count;
?>
 Articles</h1>
            <!--<p>/</p>
            <h2><b>59</b> Comments</h2>-->
        </div>
    	
        <?php 
if ($Count > 0) {
    while ($arr = $res->fetch()) {
        echo '
				<div class="article_short">
					<a class="title" href="', $config['BaseURL'], '/index.php?page=article&id=', $arr['id'], '">', Articles::parseTitle($arr['title']), '</a><br/><br/>
					<h4>', date('d M, Y', strtotime($arr['added'])), ' | ', $arr['views'], ' Views</h4>
					<p>', Articles::parseTitle($arr['short_text']), '</p>
					<a class="read_more" href="', $config['BaseURL'], '/index.php?page=article&id=', $arr['id'], '">Read More</a>
				</div>';
    }
} else {
    echo 'There are no articles.';
}
?>
    	
    </div>
	    
    <div class="clear"></div>
    
</div>
<!-- Main side.End-->