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; }
/** * Save forum config * * @since Version 2.5.8 */ function do_config_forum() { global $wgRequest, $wgOut, $awc, $table_1, $awcs_forum_config; if (UserPerm != 10) { die("Nope - Admin"); } $dbr = wfGetDB(DB_SLAVE); $dbw = wfGetDB(DB_MASTER); #$yes_wikiedit = true; # use this to see is WIki's User Table has the user_editcount feild $table_1 = $dbr->tableName('user'); $dBaseCLS = new awcforum_cls_dBase(); $yes_wikiedit = $dBaseCLS->colCheck($table_1, 'user_editcount'); foreach ($awcs_forum_config as $q => $a) { $a = $wgRequest->getVal($q); if ($q != 'cf_forumversion' && $q != 'cf_forumlang') { if ($wgRequest->getVal($q) != '') { if ($q == 'cf_css_default') { $css = explode('|', $a); $a = serialize(array('Default' => $css[0])); } if ($q == 'cf__forumsubtitle' || $q == 'cf__forumname') { $a = awcsforum_funcs::awc_htmlentities($a); } $dbw->update('awc_f_config', array('a' => $a), array('q' => $q), ''); } } } // check what wiki ver this aplies to... might be older, if so elete. # no user_editcount feild, so reste Forum Config for the "Show Wiki Edits" if ($yes_wikiedit == false) { $dbw->update('awc_f_config', array('a' => 'no'), array('q' => 'wikieits'), ''); } $wgOut->redirect(awc_url . "admin"); }
*/ global $wgDBprefix, $wgUser, $delete_langs, $wgOut, $IP, $forumver, $wgOut; $awc_dir = awc_dir; # $awc_install_dir = awc_dir . "updates/install/"; # $awc_lang_dir = awc_dir . "languages/"; # $dbw =& wfGetDB(DB_MASTER); $dbr =& wfGetDB(DB_SLAVE); #$date_seperated = awcsforum_funcs::date_seperated(wfTimestampNow()); $date_seperated = $dbw->timestamp(); /** @changeVer 2.5.8 changed to new table install, use .sql file */ /** @todo work other dBases here too */ require_once awc_dir . 'dBase.php'; $installCLS = new awcforum_cls_dBase(); $installCLS->testCreate(); $installCLS->sourceFile($awc_install_dir, 'install_tables'); require_once $awc_install_dir . 'config.php'; foreach ($Config_Settings as $q => $v) { $s = isset($v[0]) ? $v[0] : null; $t = isset($v[1]) ? $v[1] : null; $a = isset($v[2]) ? $v[2] : null; #print "typeis->{$t} | q=$q<br />"; #die("typeis->" . $q); $sql1 = "SELECT * FROM " . $wgDBprefix . "awc_f_config WHERE q = '" . $q . "'"; $res1 = $dbr->query($sql1); if (!$dbw->fetchObject($res1)) { $wgOut->addHTML($wgDBprefix . "awc_f_config <b>Inserted: </b> " . $q . "<br>"); $dbw->insert('awc_f_config', array('q' => $q, 'a' => $a, 'typeis' => $t, 'section' => $s)); }