nick, try something like that to. let me know if it worked.
PHP Code:
<?php
error_reporting(7);
$templatesused = "home_newthreads,home_latestthreads";
require("./global.php");
$maxthreads=30;
$doforumperms=$DB_site->query("SELECT forumid FROM forum");
$forumslist="";
while ($forumperms=$DB_site->fetch_array($doforumperms)) {
$forumid=$forumperms[forumid];
$getperms=getpermissions($forumid);
if ($getperms[canview]) {
$forumslist.=",$forumid";
}
}
$newsql=$DB_site->query("SELECT * FROM thread WHERE forumid IN (0$forumslist) AND visible=1 ORDER BY lastpost ASC LIMIT 0,$maxthreads");
while ($new=$DB_site->fetch_array($newsql)) {
$getforumid=$new[forumid];
$getnewsql=$DB_site->query_first("SELECT * FROM post WHERE forumid=$getforumid");
$forumname=$DB_site->fetch_array($getnewsql);
$geticonid=$new[iconid];
if ($new[iconid]==0) {
$newicon="<img src=\"{imagesfolder}/icons/icon1.gif\" border=\"0\">";
} else {
$newicon="<img src=\"{imagesfolder}/icons/icon$newconid.gif\" border=\"0\">";
}
$getthreadid=$new[threadid];
$gettitle=$new[title];
$getforumname=$forumname[title];
$getreplycount=$new[replycount];
$getusername=$new[postusername];
$getuserid=$new[postuserid];
$gettime=vbdate($timeformat,$new[dateline]);
$getdate=vbdate($dateformat,$new[dateline]);
eval("\$newthreads .= \"".gettemplate('home_newthreads')."\";");
}
eval("dooutput(\"".gettemplate('home_latestthreads')."\");");
?>