Location: PHPKode > scripts > WH Social > wh_social/modules/topics.inc.php
<?php

    $sql = "SELECT * FROM topics ORDER BY date DESC LIMIT 2";
    $result = mysql_query($sql) OR die(mysql_error());

    if(!$result) {

    echo '<p>' . $lang['empty_topics'] . '</p>' . mysql_error();

        }else{

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

        echo '<p>' . $lang['empty_topics'] . '</p>' . mysql_error();

    }else{

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

        echo '<p><a href="read_discussion.php?id=' . (int)$row['id'] . '">' . htmlentities($row['subject'], ENT_QUOTES) . '</a><br>';
        echo '<small>' . date('d.m.Y - H:i', strtotime($row['date'])) . ' ' . $lang['o_clock'] . '</small></p>';
        }
    }
    }

    mysql_free_result($result);

?>
Return current item: WH Social