barnsi |
12-10-2015 05:43 PM |
Hello World!
...how can i INCLUDE only one forum? :confused:
i found one solution in including forum "355":
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON ( forum.forumid = thread.forumid ) WHERE NOT ISNULL(threadid) AND forum.forumid = '355' AND visible = '1' AND open!='10'
...but how can i include all the childforums under forum 355?
PHP Code:
WHERE NOT ISNULL(threadid) AND forum.forumid IN (355,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,396,397,392,398,399,393,400,401,394,395,402,403,404,366,405,415,416,406,417,418,407,419,420,408,421,422,423,424,425,426,427,428,429,430,409,410,431,432,411,412,413,414,433,434) AND visible = '1' AND open!='10'
...the more comfortable way to include one forum including complete childlist:
(in this example forum 355)
PHP Code:
ob_start(); global $vbulletin, $db, $vbphrase; //Begin Thread Counts $childlist = 0; if($fcc355 = $vbulletin->forumcache[355]['childlist']) { $childlist = trim(str_replace('-1', '', $fcc355), ','); } $toutput=''; $recent_threads = $vbulletin->db->query_read(" SELECT thread.threadid, thread.prefixid, thread.title, thread.dateline, thread.lastpost, thread.lastposter, thread.lastposterid, thread.visible, thread.open, thread.postusername, thread.postuserid, thread.replycount,
thread.views, forum.forumid, forum.title as forumtitle FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON ( forum.forumid = thread.forumid ) WHERE NOT ISNULL(threadid) AND forum.forumid IN ($childlist) AND visible = '1' AND open!='10'
ORDER BY lastpost DESC LIMIT 0, 20
|