while ($latest_array = mysql_fetch_array($resultlatest)) {
// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);
<?
require("./admin/config.php");
require("global.php");
$num_active = 20;
$num_chars = 90;
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='8' or forumid='9' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active";
$resultlatest = mysql_query($querylatest,$db);
print("<table width=\"98%%\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\" bgcolor=\"#232323\"><tr><td><table width=\"100%%\" cellspacing=\"1\" cellpadding=\"4\">");
while ($latest_array = mysql_fetch_array($resultlatest)) {
// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);
printf("<tr><td colspan=\"2\" bgcolor=\"#333333\"><b><font color=\"#CCCCCC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]);
// split the date up a bit
//corrected (-;
$datestr1 = date("d-m-Y",$latest_array["lastpost"]);
$datetime = date("H:i",$latest_array["lastpost"]);
printf ("<tr valign=\"top\"><td nowrap bgcolor=\"#333333\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>%s</b><br>$datestr1 ? %s<br>???????: %s</font></td>", $latest_array["postusername"], $datetime, $latest_array["replycount"]);
$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";
$result_thread_text= mysql_query($querythread,$db);
$result_thread_array = mysql_fetch_array($result_thread_text);
// remove bbcode
$messtext = bbcodeparse($result_thread_array["pagetext"]);
// remove [~img]xxx[~/img]
$messtext=eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]","",$messtext);
printf ("<td width=\"100%%\" bgcolor=\"#3E3E3E\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"images/icons/icon%s.gif\"> ????????? ????????? ??: %s<hr size=\"1\" noshade color=\"#232323\">%s...<br><a href=\"showthread.php?threadid=%s\">????????? ></font></td></tr>",$result_thread_array["iconid"],$latest_array["lastposter"],substr(strip_tags($messtext),0,$num_chars),$latest_array["threadid"]);
printf ("</td></tr>");
}
printf ("</table></td></tr></table>");
?>