// Latest trailers
$xxx_trailers=10;$pids='';$tids='';$comma='';$query=$db->query("
SELECT p.pid, p.message, p.tid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE t.fid IN (".$xxx_trailers.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
ORDER BY t.dateline DESC
LIMIT 0, 12");while($getid=$db->fetch_array($query)){$pids.=",'{$getid['pid']}'";$tids.=",'{$getid['tid']}'";$posts[$getid['tid']]=$getid;}$pids="pid IN(0{$pids})";$altbg= alt_trow();$threadlist='';$query=$db->query("
SELECT t.*, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
LEFT JOIN ".TABLE_PREFIX."threadfields_data td ON (td.tid=t.tid)
WHERE t.fid IN (".$xxx_trailers.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.dateline DESC
LIMIT 0, 12");while($thread=$db->fetch_array($query)){$thread['message']=$posts[$thread['tid']]['message'];$thread['pid']=$posts[$thread['tid']]['pid'];$thread['threadlink']= get_thread_link($thread['tid']);$thread['forumlink']= get_forum_link($thread['fid']);if(my_strlen($thread['subject'])>25){$thread['subject']= my_substr($thread['subject'],0,25)."...";}$thread['subject']= htmlspecialchars_uni($parser->parse_badwords($thread['subject']));$forumcache=$cache->read("forums");$thread['forumlink']="<a href=\"".get_forum_link($thread['fid'])."\">".$forumcache[$thread['fid']]['name']."</a>";$message=$parser->parse_message($thread['message'],$parser_options);eval("\$xxx_trailers_threadlist .= \"".$templates->get("xxx_index_trailers_latestthreads_thread")."\";");$altbg= alt_trow();}if($xxx_trailers_threadlist){// Show the table only if there are threads
eval("\$xxx_trailers_latestthreads = \"".$templates->get("xxx_index_trailers_latestthreads")."\";");eval("\$indexbox = \"".$templates->get("xxx_index_box")."\";");}
(This post was last modified: 04-14-2011 03:09 AM by duhol.)