Location: PHPKode > scripts > WH Social > wh_social/admin/handler/listall.php
<?php

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

    if(!$result) {

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

        }else{

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

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

    }else{

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

        echo '<p><a href="../read_discussion.php?id=' . (int)$row['id'] . '" target="_blank">' . 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