session->vars['sessionurl'] = $vbulletin->session->vars['sessionurl_q'] = $vbulletin->session->vars['sessionurl_js'] = $vbulletin->session->vars['sessionhash'] = ''; $vbulletin->input->clean_array_gpc('r', array( 'offset' => TYPE_UINT, )); if($vbulletin->GPC['offset']) $offset=$vbulletin->GPC['offset']; else $offset = 0; // check to see if there is a forum preference foreach (array_keys($vbulletin->forumcache) AS $forumid) { $forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"]; if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'] AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND (($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) AND verify_forum_password($forumid, $vbulletin->forumcache["$forumid"]['password'], false) ) { $forumchoice[] = $forumid; } } if (!empty($forumchoice)) { $forumsql = "AND thread.forumid IN(" . implode(',', $forumchoice) . ")"; } else { $forumsql = ""; } if (empty($forumchoice)) { // no access to view selected forums exit; } $threadcount = $db->query_first_slave(" SELECT count(*) AS totalthreads FROM " . TABLE_PREFIX . "thread AS thread WHERE 1=1 $forumsql AND thread.visible = 1 AND open <> 10 "); $totalthreads = $threadcount['totalthreads']; $threadcache = array(); // query last threads from visible / chosen forums $threads = $db->query_read_slave(" SELECT thread.threadid, thread.title, thread.lastpost FROM " . TABLE_PREFIX . "thread AS thread WHERE 1=1 $forumsql AND thread.visible = 1 AND open <> 10 ORDER BY " . ($lastpost ? "thread.lastpost" : "thread.dateline") . ($asc?" ASC ":" DESC ") ." LIMIT ".$offset.",$count "); while ($thread = $db->fetch_array($threads)) { // fetch the threads // remove sessionhash from urls: $threadcache[] = $thread; } $output .= $stylevar[htmldoctype]; $output .= "
"; $output .= ""; $output .= "