The code is :
$forums=$DB_site->query('SELECT forum.*, thread.title AS threadtitle FROM forum LEFT JOIN thread ON (thread.forumid=forum.forumid AND thread.lastpost=forum.lastpost) WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
and:
// dates
if ($forum['lastpost']>0) {
// title lenght (change it to suit your forum)
$titlelenght='32';
$forum['titleextra']='';
if (strlen($forum['threadtitle'])>$titlelenght) {
$forum['titleextra']='[...]';
}
$forum['threadtitle']=substr($forum['threadtitle'],0,$titlelenght);
|