示例#1
0
$res->execute();
if ($res->rowCount() > 0) {
    echo '
			<div class="sub_header">
				<h1></h1>
			</div>
    
			<div class="blueberry">
				<ul class="slides">';
    $First = true;
    while ($arr = $res->fetch()) {
        echo '
					<li', $First ? ' style="position: relative"' : ' style="display: none"', '>
						', $arr['image'] != '' ? '<img src="./uploads/articles/' . $arr['image'] . '" />' : '', '
						<h1><a href="', $config['BaseURL'], '/index.php?page=article&id=', $arr['id'], '">', $arr['title'], '</a></h1>
						<h4>', date('d M, Y', strtotime($arr['added'])), ' | ', $arr['views'], ' Views | ', Articles::getCommentsCount($arr['id']), ' Comments</h4>
						<p>', htmlspecialchars(stripslashes($arr['short_text'])), '</p>
					</li>';
        if ($First) {
            $First = false;
        }
    }
    unset($arr, $First);
    echo '
				</ul>
				
				<!-- Optional, see options below -->
				<ul class="pager">';
    //Set the buttons for the slides
    for ($i = 0; $i < $res->rowCount(); $i++) {
        echo '<li><a href="#"><span></span></a></li>';
示例#2
0
?>
    </div>

	<div class="article">
    	<h1 id="title"><?php 
echo $row['title'];
?>
</h1>
        <h5 id="subinfo"><b><?php 
echo date('d M, Y', strtotime($row['added']));
?>
</b><?php 
echo $row['views'];
?>
 Views &nbsp;&nbsp;&nbsp; <?php 
echo Articles::getCommentsCount($row['id']);
?>
 Comments</h5>
        <p id="post">
         	<?php 
if (($text = $CACHE->get('articles/article_' . $row['id'])) === false) {
    // create the BBCode parser
    $parser = new SBBCodeParser_Document(true, false);
    //Strip slashes
    $text = stripslashes($row['text']);
    //Parse
    $text = $parser->parse($text)->detect_links()->detect_emails()->detect_emoticons()->get_html(true);
    //fix multiple break lines
    $text = preg_replace("/<br\\s*\\/?>\\s<br\\s*\\/?>\\s+/", "<br/>", $text);
    unset($parser);
    //Store the parsed post in the cache for a month