Last 10 forum posts

i presume u guys r using PHP Nuke on your site and i jus wanted to know how do you get that block last forum posts on the site..i have php nuke also and would liek that feature on my site
 

N.B.

1
Staff member
PHP:
<?php
$sql_id_forum=sql_connect("HOSTNAME","USERNAME","PASSWORD","DATABASENAME");
$query = "SELECT threadid, title FROM thread WHERE forumid != 3 AND forumid != 21 AND forumid != 22 AND forumid !=44 ORDER BY threadid DESC limit 0,10";
$result = sql_query($query,$sql_id_forum);
$numrows = sql_num_rows($result);


$content = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">";
while(list($threadid, $posttitle) = sql_fetch_row($result, $dbi)) {
         $posttitle = str_replace ("_", " ", $posttitle);
         $posttitle = str_replace (".", " ", $posttitle);
         $content .= "<strong><b>·</b></strong> <a href=\"http://forum.cdrsoft.cc/showthread.php?threadid=$threadid\" target=\"_blank\">$posttitle</a><br>";
}

$query = "SELECT userid, lastactivity FROM session";
$result = mysql_query($query,$sql_id_forum);
$users = 0;

while(list($userid, $lastactivity) = sql_fetch_row($result, $dbi)) {
         $date = time()+160;
         if($lastactivity >= ($date - 15*60))
          $users++;
}
$content .= "<br><br>$users users online";
$content .= "</table>";
sql_logout($sql_id_forum);
?>
 
Top