Location: PHPKode > scripts > WH Board > wh_board/blog.php
<?php require('style/layout/header.php'); ?>

    <div class="content_left">
        <ul id="breadcrumbs">
            <li><a href="index.php"><?php echo $lang['main_page']; ?></a></li>
            <li><a href="blog.php" class="actual">Blog</a></li>
        </ul>
    </div>
    <div class="content_right"><form method="post" id="search" action="search.php?search">
        <input type="text" name="search" placeholder="<?php echo $lang['enter_search_term']; ?>..." class="searchfield">
        <input type="hidden" name="submit" value="<?php echo $lang['search']; ?>" alt="<?php echo $lang['search']; ?>">
        </form>
    </div>

    <div class="clear"></div>

    <div id="headline">&nbsp;</div>

    <?php

		$articles = mysql_query("SELECT blog_id FROM articles") OR die(mysql_error());
		$count_articles = intval(mysql_num_rows($articles));

        echo '<span class="right">' . (int)$count_articles . ' ' . $lang['blank_article'] . ' &#8226; ';

		$comments = mysql_query("SELECT com_id FROM comments") OR die(mysql_error());
		$count_comments = intval(mysql_num_rows($comments));

        echo (int)$count_comments . ' ' . $lang['comments'] . '</span>
        <div class="clear"></div>';

        $count = mysql_query("SELECT blog_id FROM articles");
        include('framework/navigation.php');

    	$query = "SELECT * FROM articles ORDER BY blog_id DESC LIMIT $start,$entries";
    	$result = mysql_query($query) OR die(mysql_error());

    	if(!$result) {

    	echo '<p class="false">' . $lang['no_articles_available'] . '</p>' . mysql_error();

    		}else{

    		if(intval(mysql_num_rows($result)) == 0) {

    		echo '<p class="false">' . $lang['no_articles_available'] . '</p>';

    	}else{

    	while($row = mysql_fetch_assoc($result)) {

    		$idc = (int)$row['blog_id'];
    		$allcomms = mysql_query("SELECT com_id FROM comments WHERE com_id2 = '" . $idc . "'"); 
    		$speech = intval(mysql_num_rows($allcomms)); 

        	include_once('functions/bbcode.php');
        	include_once('functions/makeurl.php');

        	echo '<h3 class="title">' . htmlentities($row['blog_title'], ENT_QUOTES) . '</h3>
        	<span class="left"><a href="mailto:' . $webmaster . '" class="author">' . htmlentities($row['blog_author'], ENT_QUOTES) . '</a></span>
        	<span class="right"><small>' . date('d.m.Y - H:i', strtotime($row['blog_date'])) . '</small></span>

            <div class="clear"></div>

            <div id="line">&nbsp;</div>

            <div class="articles_post">' . bbcode(makeurl(stripslashes(nl2br($row['blog_post'])))) . '</div>

            <div class="clear"></div>

            <span class="left"><img src="style/images/icons/latest.png" alt="Comments">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="comments.php?id=' . (int)$row['blog_id'] . '">' . $lang['comments'] . '</a></span>
            <span class="right"><a href="blog.php#top"><img src="style/images/grafics/top.png" alt="Top" hspace="3" border="0"></a> 
            <a href="feeds/blog_rss.php" target="_blank"><img src="style/images/grafics/rss.png" alt="Blog Feeds" border="0"></a></span>

            <div class="clear_articles"></div>';
            }

        echo '<div id="navigation">
        <span class="pages">' . $lang['page'] . ' ' . $page . ' ' . $lang['of'] . ' ' . $allsites . '</span>';
        echo $link_string;
        echo '</div>
        <div class="clear_navi"></div>';
        }
        }

    ?>

<?php require('style/layout/footer.php'); ?>
Return current item: WH Board