function q_thread($s, $dbr) { global $awc, $wikieits, $total_thread_count, $thread_title_for_search, $awc_tables, $tplt; $perm = new awcs_forum_perm_checks(); $perm_sql = $perm->forum_sql(); // if(strlen($s) > 0 AND strlen($perm_sql) > 0) $perm_sql .= ' AND ' ; $sql = "SELECT awc_f_posts.p_id, awc_f_posts.p_title, awc_f_posts.p_post, awc_f_posts.p_user, awc_f_posts.p_userid, awc_f_posts.p_editwhy, awc_f_posts.p_editwho, awc_f_posts.p_editdate, awc_f_posts.p_date,\r\r\n {$awc_tables['awc_f_threads']}.t_id, {$awc_tables['awc_f_threads']}.t_ann, {$awc_tables['awc_f_threads']}.t_pin, {$awc_tables['awc_f_threads']}.t_status, {$awc_tables['awc_f_threads']}.t_name, {$awc_tables['awc_f_threads']}.t_topics, {$awc_tables['awc_f_threads']}.t_hits, {$awc_tables['awc_f_threads']}.t_perm, {$awc_tables['awc_f_threads']}.t_poll, {$awc_tables['awc_f_threads']}.t_wiki_pageid, {$awc_tables['awc_f_threads']}.t_lastdate, \r\r\n {$awc_tables['awc_f_forums']}.f_posting_mesage_tmpt, {$awc_tables['awc_f_forums']}.f_name, {$awc_tables['awc_f_forums']}.f_id, {$awc_tables['awc_f_forums']}.f_wiki_write_perm, {$awc_tables['awc_f_forums']}.f_passworded, \r\r\n {$awc_tables['awc_f_cats']}.cat_name, {$awc_tables['awc_f_cats']}.cat_id\r\r\n FROM {$awc_tables['awc_f_threads']}\r\r\n JOIN {$awc_tables['awc_f_posts']} awc_f_posts\r\r\n ON {$awc_tables['awc_f_threads']}.t_id=awc_f_posts.p_threadid\r\r\n JOIN {$awc_tables['awc_f_forums']}\r\r\n ON {$awc_tables['awc_f_threads']}.t_forumid={$awc_tables['awc_f_forums']}.f_id\r\r\n JOIN {$awc_tables['awc_f_cats']} \r\r\n ON {$awc_tables['awc_f_forums']}.f_parentid={$awc_tables['awc_f_cats']}.cat_id\r\r\n WHERE {$perm_sql} {$s} AND {$awc_tables['awc_f_forums']}.f_passworded = 0\r\r\n ORDER BY awc_f_posts.p_thread_start DESC, awc_f_posts.p_date"; $sql = str_replace('AND AND', ' AND ', $sql); $sql = str_replace('WHERE AND', 'WHERE ', $sql); // awc_pdie($s); global $wgOut; require_once awc_dir . 'includes/post_phase.php'; require_once awc_dir . 'includes/thread_funk.php'; $post_cls = new awcs_forum_post_phase(); $res = $dbr->query($sql); $post_table = null; while ($r = $dbr->fetchObject($res)) { ++$total_thread_count; $thread_title_for_search = '<b>' . $r->t_name . '</b>'; $tplt_info['edit_buttons'] = null; $tplt_info['sig_display'] = null; $tplt_info['user_options'] = null; $tplt_info['post_avatar'] = null; $tplt_info['admin_lookup'] = null; $tplt_info['profile_link'] = null; $tplt_info['m_pm'] = null; $tplt_info['wikiedits_count_link'] = null; $tplt_info['topics_count_link'] = null; $tplt_info['post_count_link'] = null; $tplt_info['group'] = null; $tplt_info['post_edited_on'] = null; $tplt_info['wikiedits_count_link'] = null; $word = null; $tplt_info['user_name'] = $r->p_user; $tplt_info['post_title'] = $r->p_title; // $tplt_info['post_edited_on'] = $r->p_editdate; $tplt_info['date'] = $r->p_date; $tplt_info['post'] = $post_cls->phase_post($r->p_post, '', false); // $tplt_info['post'] = awc_wikipase($r->p_post, $wgOut); // $tplt_info['post'] = $r->p_post ; $tplt_info['avatarwidth'] = 0; $post_table .= $tplt->phase($word, $tplt_info, 'post_table'); } $wgOut->addHTML($post_table); $end = ', ' . get_awcsforum_word('word_inThread') . ' ' . $thread_title_for_search; $title = str_replace("|\$|", $total_thread_count, get_awcsforum_word('search_SearchResultsFound')) . ": {$this->searchword}" . $end; Set_AWC_Forum_SubTitle(get_awcsforum_word('search_SearchResults'), $title); // die($post_table); return; require awc_dir . 'thread.php'; require awc_dir . 'includes/thread_funk.php'; $threads = new awcforum_threads(); $threads->awc_url = $awc['link']; $threads->cookie_expir = $awc['config']['cfl_Post_cookie_postcountexpire']; $threads->quick_height = $awc['config']['cfl_Post_quickpost_box_height']; // isset($awc['config']['wikieits']) ? $threads->wikieits = $awc['config']['wikieits'] : $threads->wikieits=null; // $wikieits = $threads->wikieits; # die($this->searchword); global $wgRequest; $wgRequest->data['action'] .= 'sw:' . $this->searchword; # die(print_r($wgRequest)); $threads->GetPosts($this->tID, $sql); $end = ', ' . get_awcsforum_word('word_inThread') . ' ' . $thread_title_for_search; $title = str_replace("|\$|", $total_thread_count, get_awcsforum_word('search_SearchResultsFound')) . ": {$this->searchword}" . $end; Set_AWC_Forum_SubTitle(get_awcsforum_word('search_SearchResults'), $title); return; }
function mem_profile($action) { global $wgOut, $rev_timestamp, $awc, $wgOut, $wgParser, $WhoWhere, $tplt, $awcs_forum_config, $wgScriptPath, $awcUser; // require(awc_dir . 'skins/members_skin.php'); // $skin_mem = New mem_skin(); require_once awc_dir . 'includes/post_phase.php'; require_once awc_dir . 'includes/thread_funk.php'; $post_cls = new awcs_forum_post_phase(); $WhoWhere = $action; $WhoWhere['type'] = 'forum'; $WhoWhere['where'] = $action . '||awc-split||' . $action; # die($action); $spl = explode("/", $action); if (isset($spl[1])) { $mem_name = $spl[1]; $mem_id = $spl[2]; } else { return awcs_forum_error(''); } $user_get = array('*'); $mem_page = array(); $mem_page = GetMemInfo($mem_id, $user_get); if ($mem_id == 0 and UserPerm != 10) { $mem_name = get_awcsforum_word('word_guest'); } #$out = $wgOut->parse($info); $mem_page['body'] = awc_clean_wikipase($wgOut->parse('[[User:'******'|' . get_awcsforum_word('edit') . ']]')) . ' '; # $mem_page['body'] = str_replace('User:'******'User:'******'&action=edit', $mem_page['body']); $mem_page['body'] .= awc_clean_wikipase($wgOut->parse('[[User_talk:' . $mem_name . '|' . get_awcsforum_word('word_discussion') . ']]')) . '<hr>'; $mem_page['body'] = str_replace('action=edit', 'awc_redirect=' . $mem_id . '&action=edit', $mem_page['body']); $mem_page['body'] = str_replace('action=edit', 'awc_mem_redirect=' . $mem_name . '&action=edit', $mem_page['body']); # die($mem_page['body']); # $post = awc_wikipase($post, $wgOut) ; $GetWikiPage_body = GetWikiPage('<wiki>' . $mem_name . '</wiki>', '', '2', $mem_id); $post_cls->displaysmiles = '0'; $post_cls->convert_wTitle = '0'; $GetWikiPage_body = $post_cls->phase_post($GetWikiPage_body, '', false); // die(awcsforum_funcs::convert_date($rev_timestamp, 'l')); /* $GetWikiPage_body = convert_pre($GetWikiPage_body); $GetWikiPage_body = remove_forum_tag_from_post($GetWikiPage_body); $GetWikiPage_body = br_convert($GetWikiPage_body); $GetWikiPage_body = awc_wikipase($GetWikiPage_body, $wgOut) ; */ $mem_page['body'] .= $GetWikiPage_body; $post = str_replace('</a>', '</a>', $mem_page['body']); $post = str_replace('<a href', '<a href', $post); $post = str_replace('">', '">', $post); $mem_page['body'] = $post; // needs to be in the loop to check against each post for other extensions triggered foreach ($wgParser->mOutput->mHeadItems as $k_ID => $mHeadItems) { $wgOut->addHeadItem($k_ID, $mHeadItems); } $Pass['body_info'] = isset($mem_page['body']) ? $mem_page['body'] : ' '; $Pass['sig'] = isset($mem_page['m_sig']) ? $post_cls->phase_post($mem_page['m_sig'], '', false) : ' '; $Pass['group '] = isset($mem_page['group']) ? $mem_page['group'] : null; $Pass['m_topics'] = $awcs_forum_config->cf_showThreadCount == '1' ? isset($mem_page['m_topics']) ? get_awcsforum_word('word_threads') . ' <a href="' . awc_url . 'search/memtopics/' . urlencode($mem_page['name']) . '/' . $mem_id . '">' . $mem_page['m_topics'] . '</a>' : null : null; $Pass['m_posts'] = $awcs_forum_config->cf_showPostCount == '1' ? isset($mem_page['m_posts']) ? get_awcsforum_word('word_posts') . ' <a href="' . awc_url . 'search/memposts/' . urlencode($mem_page['name']) . '/' . $mem_id . '">' . $mem_page['m_posts'] . '</a>' : null : null; $Pass['m_pm'] = $awcUser->guest == '0' ? get_awcsforum_word('word_send') . ' <a href="' . awc_url . 'member_options/pmnew/' . $mem_page['name'] . '">' . get_awcsforum_word('word_pm') . '</a>' : null; $Pass['wikiedits'] = isset($mem_page['edit_count']) ? get_awcsforum_word('word_postsWikiedits') . ' <a href="' . awcsf_wiki_url . 'Special:Contributions/' . $mem_page['name'] . '">' . $mem_page['edit_count'] . '</a>' : get_awcsforum_word('word_postsWikiedits') . ' <a href="' . awcsf_wiki_url . 'Special:Contributions/' . $mem_page['name'] . '">0</a>'; $m_adv = isset($mem_page['m_adv']) ? 1 : 0; if ($m_adv == 0 || empty($mem_page['m_adv'])) { $m_adv = 1; $AvatraSize = explode('x', $awcs_forum_config->cf_AvatraSize); if ($mem_page['m_topics'] == '0' and $mem_page['m_posts'] == '0') { $mem_page['m_adv'] = "{$wgScriptPath}" . awcForumPath . "images/avatars/avatar_guest.gif"; $mem_page['m_advw'] = $AvatraSize[0]; $mem_page['m_advh'] = $AvatraSize[1]; $this->pm_enable = 0; } else { $mem_page['m_adv'] = "{$wgScriptPath}" . awcForumPath . "images/avatars/avatar_default.gif"; $mem_page['m_advw'] = $AvatraSize[0]; $mem_page['m_advh'] = $AvatraSize[1]; } } $Pass['m_adv'] = ($m_adv == 1 and $mem_page['m_adv'] != '') ? '<DIV align="center"><img class="adv" src="' . $mem_page['m_adv'] . '" border="0" height="' . $mem_page['m_advh'] . '" width="' . $mem_page['m_advw'] . '" align="middle"/></div>' : null; $Pass['avatarwidth'] = $mem_page['m_advw']; $out = $tplt->phase('', $Pass, 'mem_profile_table', true); Set_AWC_Forum_SubTitle(get_awcsforum_word('mem_profile') . $mem_name, get_awcsforum_word('mem_lastmod') . " " . awcsforum_funcs::convert_date($rev_timestamp, 'l')); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('mem_profile') . ' ' . $mem_name, true); $wgOut->addHTML($out); # $dbr = wfGetDB( DB_SLAVE ); }
function enter_members($action) { global $wgOut, $awcUser, $awcs_forum_config, $wgRequest, $IP, $WhoWhere; include_once awc_dir . 'includes/post_phase.php'; include_once awc_dir . 'includes/post_box.php'; include_once awc_dir . 'includes/thread_funk.php'; global $wgJsMimeType; // 2.5.8 $wgOut->addScript("<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", pm_ajax_onload);</script>\n"); Set_AWC_Forum_SubTitle(get_awcsforum_word('mem_memCP'), $awcUser->mName); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('mem_memCP')); if ($awcUser->mId == '0') { return $wgOut->loginToUse(); } $this->here = true; $this->membername = $awcUser->mName; $this->m_id = $awcUser->mId; $this->sig_length = $awcs_forum_config->cf_SigLength; $this->wikieits = $awcs_forum_config->wikieits; $this->modPMlimit = $awcs_forum_config->cf_mod_maxpmhave; $this->modPMsendlimit = $awcs_forum_config->cf_mod_maxpmsendusers; $this->userPMlimit = $awcs_forum_config->cf_mem_maxpmhave; $this->userPMsendlimit = $awcs_forum_config->cf_mem_maxpmsendusers; $dbw = wfGetDB(DB_MASTER); $dbw->update('awc_f_mems', array('m_pmpop' => '0'), array('m_id' => $this->m_id), ''); $this->GetThisMemInfo(); $this->DefaultMemForumOptions(); $this->upload = $awcs_forum_config->cf_advatar_no_upload; $this->uploadsize = $awcs_forum_config->cf_advatar_upload_size; $this->uploadext = $awcs_forum_config->cf_advatar_upload_exe; $this->send_pm_body_in_email = $awcs_forum_config->cf_send_pm_body_in_email; $this->send_thread_body_in_email = $awcs_forum_config->cf_send_thread_body_in_email; $this->send_post_body_in_email = $awcs_forum_config->cf_send_post_body_in_email; $this->cf_css_mem_select = $awcs_forum_config->cf_css_mem_select; $this->cf_FCKeditor = $awcs_forum_config->cf_FCKeditor; $this->cf_extrawikitoolbox = $awcs_forum_config->cf_extrawikitoolbox; $this->imagepath = awc_path . 'images/avatars/'; $this->imagefolder = awc_dir . 'images/avatars/'; $spl = explode("/", $action); $todo = isset($spl[1]) ? $spl[1] : null; $this->id = isset($spl[2]) ? $spl[2] : null; #die($todo); define('what_page', $todo); $WhoWhere['where'] = 'forum'; $WhoWhere['where'] = 'memcp||awc-split||memcp'; $this->todo_url = 'member_options/'; switch ($todo) { case 'save_sig': $this->sig_save(); break; case 'clearIndicators': $this->clearIndicators(); break; case 'CheckAvatraSize': $wgOut->addHTML($this->avatra_check_size()); break; case 'miscusersettings': $this->saveForumOptions(); break; case 'viewaadv': $this->viewaadv(); break; case 'editsig': $this->sig_get_edit(); break; case 'editava': $this->avatar_get(); break; case 'editgen': $this->editgen(); break; case 'pminbox': case 'pmsent': case 'pmsaved': $this->pm_list($todo); break; case 'pmnew': $this->pm_create(); break; case 'sendpm': $this->pm_send($action); break; case 'readpm': $this->pm_read(); break; case 'quotepm': $this->mem_info['m_pmoptions']['m_pmautoquote'] = '1'; $this->pm_read(); break; case 'pms_change': $this->pm_change(); break; case 'getPMoptions': $this->getPMoptions(); break; case 'savePMoptions': $this->savePMoptions(); break; case 'threadsubscribe': $this->threadsubscribe(); break; case 'threadsubscribe_email': $this->threadsubscribe('email'); break; case 'threadsubscribe_list': $this->threadsubscribe('list'); break; case 'delete_tsub': $this->delete_tsub(); break; case 'menu_options': $this->menu_options(); break; case 'menu_options_save': $this->menu_options_save(); break; case 'pm_clear_unread': $this->pm_clear_unread(); break; case 'pm_re_count': $this->pm_re_count(); break; default: Set_AWC_Forum_BreadCrumbs('', true); $user_wiki_page = GetWikiPage('<wiki>' . $this->membername . '</wiki>', '', '2', $this->m_id); $user_wiki_page = awcs_forum_post_phase::phase_post($user_wiki_page, '', false); self::display_memcp($user_wiki_page); break; } }
function edithistory() { global $wgOut; $rDB = wfGetDB(DB_SLAVE); $r = $rDB->selectRow('awc_f_posts', array('p_id', 'p_user', 'p_userid', 'p_date', 'p_post', 'p_title', 'p_editdate', 'p_editwho'), array('p_id' => $this->id)); if ($r->p_userid == $this->mId || UserPerm >= 2) { include_once awc_dir . 'includes/post_phase.php'; $post_cls = new awcs_forum_post_phase(); $post_cls->preview = true; $post_cls->p_userid = $r->p_userid; $post_cls->p_user = $r->p_user; $post_cls->p_post = $r->p_post; $post_cls->p_title = $r->p_title; $post_cls->p_date = $r->p_date; $post_cls->p_editdate = $r->p_editdate; $post_cls->p_editwho = $r->p_editwho; $post_cls->p_id = $r->p_id; unset($r); $html = $post_cls->display_post(); unset($post_cls->wiki_titles); $html .= '<br />'; $word['date_of_post'] = get_awcsforum_word('date_of_post'); $word['by'] = get_awcsforum_word('by'); $word['title'] = get_awcsforum_word('word_title'); $awc_f_post_edits = $rDB->tableName('awc_f_post_edits'); $sql = "SELECT * FROM {$awc_f_post_edits} WHERE pe_pid={$this->id} ORDER BY pe_id DESC"; $res = $rDB->query($sql); while ($r = $rDB->fetchObject($res)) { $info['date'] = awcsforum_funcs::convert_date($r->pe_when, "l"); $info['who'] = $r->pe_who; $info['pe_post'] = $post_cls->phase_post($r->pe_post, '0', false); $info['pe_title'] = $r->pe_title; $html .= '<table border="1" width="100%"> <tr> <td> <b>' . $word['date_of_post'] . '</b> ' . $info['date'] . ' <b>' . $word['by'] . '</b> ' . $info['who'] . '<hr /> <b>' . $word['title'] . '</b> :' . $info['pe_title'] . '<hr /> ' . $info['pe_post'] . ' </td> </tr> </table> <br /> '; } unset($rDB, $r, $res, $post_cls, $info, $word); $wgOut->addHTML($html); } else { unset($rDB, $r, $res, $post_cls, $info, $word); return $wgOut->loginToUse(); } }
function check_msg_len($msg, $len) { if (function_exists('mb_strlen')) { $str_len = 'awc_mbstrlen'; } else { $str_len = 'awcsforum_funcs::awc_strlen'; } if ($str_len($msg) > $len and $len != '0') { if (function_exists('mb_substr')) { $msg = awcsforum_funcs::awc_shorten($msg, $len); } else { $msg = substr($msg, 0, $len); } } require_once awc_dir . 'includes/post_phase.php'; $post_phase = new awcs_forum_post_phase(); $post_phase->convert_wTitle = 0; $post_phase->displaysmiles = 1; $msg = $post_phase->phase_post($msg, 0, false); return $msg; }