Location: PHPKode > scripts > WH Board > wh_board/modules/latest_articles.php
<?php

    $sql = "SELECT * FROM articles ORDER BY blog_id DESC LIMIT 3";
    $result = mysql_query($sql) 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)) {

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

        include_once('functions/bbcode.php');

        echo '<h4>' . htmlentities($row['blog_title'], ENT_QUOTES) . '</h4>';

        echo 'Author: ' . htmlentities($row['blog_author'], ENT_QUOTES) . '<br>';
        echo '<small><em>' . date('d.m.Y - H:i', strtotime($row['blog_date'])) . '</em></small>';

        echo '<p>' . ((strlen($row['blog_post'])<6) ? $row['blog_post'] : strip_tags(substr($row['blog_post'],0,200)).'...') . '</p>
        <a href="blog_result.php?id=' . (int)$row['blog_id'] . '">' . $lang['read_more'] . '</a><br><br>';
        }
    }
    }

?>
Return current item: WH Board