function q_results($sql, $dbr) { global $wgOut, $LimitJump_top, $LimitJump_bot, $first_return, $todo, $tplt, $awcUser; $thread_tools = new awcs_forum_thread_list_tools(); $thread_tools->extra_column = true; $word_headers = array('replies' => get_awcsforum_word('word_replies'), 'views' => get_awcsforum_word('views'), 'last_action' => get_awcsforum_word('last_action'), 'started_by' => get_awcsforum_word('thread_title_started_by')); $word = array('started_by' => get_awcsforum_word('forum_started_by')); $sql = str_replace('AND AND', ' AND ', $sql); $sql = str_replace('WHERE AND', 'WHERE ', $sql); #die($sql); $res = $dbr->query($sql); $r = $dbr->fetchRow($res); $total = $dbr->numRows($res); $dbr->freeResult($res); $this->total = $total; $send['TotalPosts'] = $total; $limit = GetLimit($send, 'search'); $i = 0; $tmp = ''; $dbr = wfGetDB(DB_SLAVE); #awcsforum_funcs::limitSplit($limit); #die($limit); #$res = $dbr->query($sql . ' ' . $limit); require_once awc_dir . 'dBase.php'; $dbase = new awcforum_cls_dBase(); $limit = $dbase->limit($limit); $res = $dbr->query("{$sql} {$limit}"); while ($r = $dbr->fetchObject($res)) { // ++$i; $to_skin = $thread_tools->loop_thread_list($r); $e['NewPost'] = $thread_tools->new_thread_check($r->t_id, $r->t_lastdate); if ($todo == 'recent') { if (isset($e['NewPost']) and strlen($e['NewPost']) > 0) { ++$i; $thread_tools->link = awc_url; $thread_tools->tID = $r->t_id; $thread_tools->total_posts = $r->t_topics; $to_skin['search_words'] = ''; $tmp .= $tplt->phase($word, $to_skin, 'thread_list_rows'); } } else { ++$i; $thread_tools->link = awc_url; $thread_tools->tID = $r->t_id; $thread_tools->total_posts = $r->t_topics; $to_skin['search_words'] = ''; $tmp .= $tplt->phase($word, $to_skin, 'thread_list_rows'); } unset($e); } $dbr->freeResult($res); if ($LimitJump_top) { #kw $tID = isset($this->tID) ? '/tID' . $this->tID : null; $fID = isset($this->fID) ? '/fID' . $this->fID : null; $cID = isset($this->cID) ? '/cID' . $this->cID : null; $what = isset($this->what) ? '/what' . $this->what : null; $this->searchword = str_replace(' ', '_', $this->searchword); # die($LimitJump); # $this->fID = $wgRequest->getVal('fID'); # $this->cID = $wgRequest->getVal('cID'); # $LimitJump = $LimitJump . "/kw:$this->searchword$tID$fID$cID"; # die(">". print_r($LimitJump) ); if ($first_return) { $LimitJump_bot = str_replace('limit:', "kw:{$this->searchword}{$tID}{$fID}{$cID}{$what}" . '/limit:', $LimitJump_bot); $LimitJump_top = str_replace('limit:', "kw:{$this->searchword}{$tID}{$fID}{$cID}{$what}" . '/limit:', $LimitJump_top); } $LimitJump = '<tr><td width="100%" colspan="6" align="right" class="page_jumps_holderBot">' . $LimitJump_bot . '</td></tr>'; } else { $LimitJump_top = null; $LimitJump = null; } $to_tplt['col_5_isSearch_forum_name'] = '<td class="thread_col_head" width="20%" align="center" nowrap="nowrap">' . get_awcsforum_word('word_forum') . '</td>'; $to_tplt['tr_id'] = ''; $to_tplt['first_col_name'] = get_awcsforum_word('thread_title'); $html = $tplt->phase($word_headers, $to_tplt, 'thread_list_header'); $html .= $tmp . $LimitJump; $html .= '</table>'; if (!$this->searchword) { $this->searchword = $this->MemSearch; } $end = ''; if ($this->what == 'c') { $end = ', ' . get_awcsforum_word('word_inCat') . ' ' . $cat_name . ''; } if ($this->what == 'f') { $end = ', ' . get_awcsforum_word('word_inForum') . ' ' . $cat_name . '/' . $forum_name . ''; } if ($this->what == 't') { $end = ', ' . get_awcsforum_word('word_inThread') . ' ' . $thread_name; } $title = str_replace("|\$|", $i, get_awcsforum_word('search_SearchResultsFound')) . ": {$this->searchword}" . $end; /* broken... $read_threads = (isset($_SESSION['awc_rActive'])) ? count($_SESSION['awc_rActive']) : 0; if($this->todo == 'search/recent/') $this->total = ($this->total - $read_threads) ; */ if ($this->todo == 'search/recent/') { $this->total = ''; } Set_AWC_Forum_SubTitle('(' . $this->total . ') ' . get_awcsforum_word('search_SearchResults'), $title); Set_AWC_Forum_BreadCrumbs($this->searchword, true); # $str = $wgOut->parse($html); $wgOut->addHTML($html); return; }