function phase_post($post, $id, $wiki_page = true) { global $wgOut, $wgOut, $wgParser; if ($post == '') { return $post; } // for sigs... $post = convert_pre($post); $post = remove_forum_tag_from_post($post); $post = awcf_hide_code2($post); if ($this->convert_wTitle == '1') { $post = wiki_links($post, $this->wiki_titles); } if ($this->displaysmiles == '1' and $this->viewing_mem_info['displaysmiles'] == '1') { $post = awcf_emotions($post, $this->emotions); } $post = br_convert($post); if ($wiki_page) { if (GetWikiPageOK($post)) { $post = GetWikiPage($post, $id); } } $post = awcf_unhide_code($post); $post = awc_wikipase($post, $wgOut); # awc_pdie($post); $post = Convert($post); // $post = Convert($post); # $f = array('</a>', '<a href', '">', "<a href=",); # $r = array('</a>', '<a href', '">', "<a target='blank' href=", '',); # $post = str_replace($f, $r, $post ) ; #$post = str_replace("<a href=", "<a target='blank' href=", $post ) ; # $post = str_replace('rel="nofollow"', "", $post ) ; if (isset($sw[1])) { foreach ($sw as $test) { $post = HighLightSearchWord($post, $test); } } else { #$post = HighLightSearchWord($post,$extras['word']); } // needs to be in the loop to check against each post for other extensions triggered if (isset($wgParser->mOutput->mHeadItems)) { foreach ($wgParser->mOutput->mHeadItems as $k_ID => $mHeadItems) { $wgOut->addHeadItem($k_ID, $mHeadItems); } } return $post; }
function load_awcs_forum() { # $START = processing_time(); // Used for testing speed... $RESULT at bottom... global $wgRequest, $wgOut, $wgScriptPath; global $awc, $awcUser, $awc_tables, $awc_ver, $ForumStat, $awcs_forum_config, $WhoWhere, $action_url, $tplt; global $awc_url, $wiki_url, $style_path, $button_path, $awc__url; require_once awc_dir . "includes/funcs.php"; require_once awc_dir . "includes/gen_funk.php"; require_once awc_dir . "includes/gen_class.php"; // awcs_forum_config, awcs_forum_user, awcs_forum_stats, $WhoWhere = null; define('awc_path', $wgScriptPath . awcForumPath); define('emo_path', awc_path . 'images/emotions/default/'); define('button_path', awc_path . 'images/buttons/default/'); $style_path = awc_path . 'skins/'; // used in awcs_forum_skin_templetes::phase() for "find and replace" $button_path = button_path; // used in awcs_forum_skin_templetes::phase() for "find and replace" $wiki_url = awcsf_wiki_url; // used in awcs_forum_skin_templetes::phase() for "find and replace" $awc_url = awc_url; // used in awcs_forum_skin_templetes::phase() function for "find and replace" $awc__url = $awc_url; if (!isset($awcUser)) { $awcUser = new awcs_forum_user(); } $wgRequest->action = null; $clean_todo = null; $clean_todo_arr = $wgRequest->getVal('title'); $clean_todo_arr = rawurldecode($clean_todo_arr); $clean_todo_arr = explode('/', $clean_todo_arr); if (isset($clean_todo_arr[1]) and (!isset($_GET['action']) or !isset($_POST['action']))) { $count_to = count($clean_todo_arr) - 1; for ($i = 1; $i <= $count_to; ++$i) { $clean_todo .= $clean_todo_arr[$i] . "/"; } $wgRequest->action = $clean_todo; } $action = $wgRequest->getVal('action'); if ($action == null) { $action = $clean_todo; } else { $action = str_replace('%2F', '/', $action); $wgRequest->action = $action; } $action_spl = explode("/", $action); #$todo = $action_spl[0]; $action_url = array(); $action_url['all'] = $action; $action_url['what_file'] = $action_spl[0]; if (isset($action_spl[1])) { if (strstr($action_spl[1], "id")) { $action_url['id'] = str_replace(array('_', 'id', 'id_'), '', $action_spl[1]); } else { $action_url['section'] = $action_spl[1]; $action_url['id'] = $wgRequest->getVal('id'); } } else { $action_url['id'] = $wgRequest->getVal('id'); } if (isset($action_spl[2])) { $action_url['todo'] = $action_spl[2]; } foreach ($action_spl as $act) { if (strstr($act, "id_")) { $action_url['id'] = str_replace(array('_', 'id', 'id_'), '', $act); } else { $action_url[] = $act; } } if ($wgRequest->action == "install_forum" and in_array('sysop', $awcUser->mGroups)) { require awc_dir . "updates/install/install_forum.php"; return; } if (!isset($awcs_forum_config)) { $awcs_forum_config = new awcs_forum_config(); // gen_class.php } if ($awcs_forum_config->get_config() === false) { $out = $awcs_forum_config->get_install(); $wgOut->addHTML($out); return; } # die("k,h"); // Note: // This needs to be after the awcs_forum_config() // for some reason the unserialize() gets messed with the default CSS and cant read it correctly if (awcs_forum_convert_latin) { $dbw = wfGetDB(DB_MASTER); $dbw->query("SET NAMES latin1"); unset($dbw); } /* // Check to see if forum is installed by checking of the Dbase config table is there... if(!$awcs_forum_config->installed){ $out = $awcs_forum_config->get_install() ; $wgOut->addHTML($out); return ; } */ // ckeck forum version... if (version_compare(awcs_forum_ver_current, awcs_forum_ver, '<')) { global $wgRequest; if (!strstr($wgRequest->action, "admin/forum_update") and !strstr($wgRequest->action, "admin/get_updates")) { if (!in_array('sysop', $awcUser->mGroups)) { awcs_forum_wfLoadExtensionMessages('AWCforum_genral_forum'); $wgOut->addHTML("<center>" . wfMsg('awcsf_updating') . "<br /> <b>" . wfMsg('awcsf_sysops_login') . "</b></center>"); return; } die(header('Location: ' . awc_url . 'admin/forum_update')); } } if (isset($awcs_forum_config->cf_header_import) and !empty($awcs_forum_config->cf_header_import)) { $header = awc_wikipase($awcs_forum_config->cf_header_import, $wgOut); $wgOut->addHTML($header); } // load this after config_config require awc_dir . "includes/load/load_skin_tplts.php"; if (!isset($tplt)) { require awc_dir . 'admin.php'; awcsforum_funcs::get_table_names(array('awc_f_cats'), true); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_admin')); // get lang difinitions... $admin = new awcforum_forumAdmin(); $admin->enterAdmin($action); return; } // load lang difinistions and get sql table names switch ($action_url['what_file']) { case 'search': require awc_dir . 'search.php'; awcsforum_funcs::get_table_names(array('awc_f_threads', 'awc_f_posts', 'awc_f_forums', 'awc_f_cats')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search')); // get lang difinitions... break; case 'post': require awc_dir . 'post.php'; awcsforum_funcs::get_table_names(array('awc_f_polls', 'awc_f_posts', 'awc_f_forums', 'awc_f_threads', 'awc_f_watchthreads', 'awc_f_watchforums')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_thread', 'lang_txt_redirects')); // get lang difinitions... break; case 'st': case 'sp': case 'last_post': case 'delete_post': case 'delete_thread': require awc_dir . 'thread.php'; awcsforum_funcs::get_table_names(array('awc_f_posts', 'awc_f_threads', 'awc_f_polls', 'awc_f_forums', 'awc_f_member_titles', 'awc_f_cats')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_thread')); // get lang difinitions... break; case 'member_options': require awc_dir . 'members.php'; awcsforum_funcs::get_table_names(array('awc_f_watchthreads', 'awc_f_watchforums', 'awc_f_threads', 'awc_f_pms_info', 'awc_f_pms', 'awc_f_mems', 'awc_f_threads')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_mem', 'lang_txt_redirects')); // get lang difinitions... break; case 'admin': require awc_dir . 'admin.php'; awcsforum_funcs::get_table_names(array('awc_f_cats'), true); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_admin', 'lang_txt_redirects')); // get lang difinitions... break; case 'pm': require awc_dir . 'pm.php'; awcsforum_funcs::get_table_names(array('awc_f_mems')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_mem')); // get lang difinitions... break; case 'mem_profile': case 'credits': case 'whoshere': require awc_dir . 'misc.php'; awcsforum_funcs::get_table_names(array('awc_f_langs', 'awc_f_sessions')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_mem')); // get lang difinitions... break; case 'mod': awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search', 'lang_txt_thread', 'lang_txt_redirects')); // get lang difinitions... break; case 'sc': case 'sf': case 'subf': default: require awc_dir . 'forum.php'; awcsforum_funcs::get_table_names(array('awc_f_cats', 'awc_f_forums', 'awc_f_anns', 'awc_f_threads')); // Get all the forums d-base table names, check for table pre-fix awcsforum_funcs::get_page_lang(array('lang_txt_forum', 'lang_txt_search')); // get lang difinitions... break; } $awcs_forum_config->ver = isset($awcs_forum_config->cf_forumversion) ? $awcs_forum_config->cf_forumversion : '2.x.x'; $awcs_forum_config->ver = str_replace('.', '', $awcs_forum_config->ver); // need a check, some servers will drop the last zero from the version, version needs to be three digets #strlen($awc_ver) == 2 ? $awc_ver = $awc_ver . '0' : $awc_ver = $awc_ver ; $awcs_forum_config->ver = !isset($awcs_forum_config->ver[2]) ? $awcs_forum_config->ver . '0' : $awcs_forum_config->ver; $awc_ver = $awcs_forum_config->ver; $info['url'] = awc_url; // Need a check here for Admin Setting.... if (isset($awcs_forum_config->cf_use_forum_stats) and $awcs_forum_config->cf_use_forum_stats == '1') { $ForumStat = new awcs_forum_stats(); $ForumStat->get_stats(); } // need to do something here.... // PM check, display pop-up or not, set MemCP text for top menu if ($awcUser->mId != '0') { $awcUser->get_mem_forum_options(); // set if (isset($awcUser->m_pmunread)) { $info['user_title'] = $awcUser->m_pmunread == 0 || $awcUser->m_pmunread == '' ? get_awcsforum_word('word_MemOpts') . '' : get_awcsforum_word('word_MemOpts') . ' <b>' . $awcUser->m_pmunread . '</b> ' . get_awcsforum_word('word_unreadpms'); $pms = $awcUser->m_pmunread . ' ' . get_awcsforum_word('word_unreadpms'); } else { $info['user_title'] = get_awcsforum_word('word_MemOpts'); $pms = ''; } $info['user_name'] = urlencode($awcUser->mName) . '/' . $awcUser->mId; $word['word_recent_posts'] = get_awcsforum_word('word_recent_posts'); $word['word_gotomempc'] = get_awcsforum_word('word_gotomempc'); $word['word_gotopms'] = get_awcsforum_word('word_gotopms'); $word['word_gotosig'] = get_awcsforum_word('word_gotosig'); $word['word_gotoavatar'] = get_awcsforum_word('word_gotoavatar'); $word['word_subscribe_email'] = get_awcsforum_word('word_subscribe_email'); $word['word_subscribe_memcp'] = get_awcsforum_word('word_subscribe_memcp'); $word['word_threads'] = get_awcsforum_word('word_threads'); $word['word_posts'] = get_awcsforum_word('word_posts'); $word['word_MemClearIndicators'] = get_awcsforum_word('word_MemClearIndicators'); $info['mem_links'] = $tplt->phase($word, $info, 'top_menu_user_links'); } else { $pms = ''; $mem_title = null; $info['mem_links'] = null; } $tplt->kill('top_menu_user_links'); $awcs_forum_config->get_css(); //$wgOut->addScript('<script type="text/javascript" src="'. awc_path . 'awc.js"></script>'); $wgOut->mScripts .= '<script type="text/javascript" src="' . awc_path . 'awc.js"></script>'; if (UserPerm == 10) { $word['word_AdminCP'] = get_awcsforum_word('word_AdminCP'); $word['word_AdminCP'] = strlen($word['word_AdminCP']) < 2 ? "Admin Control Panel" : $word['word_AdminCP']; $info['admin_link'] = $tplt->phase($word, '', 'top_menu_admin_link'); } else { $info['admin_link'] = null; } $tplt->kill('top_menu_admin_link'); if (CanSearch()) { $word['search'] = get_awcsforum_word('search_search'); $info['search_link'] = $tplt->phase($word, '', 'top_menu_search_link'); } else { $info['search_link'] = null; } $tplt->kill('top_menu_search_link'); $word['word_todays_posts'] = get_awcsforum_word('word_todays_posts'); $info['todays_posts'] = $tplt->phase($word, '', 'top_menu_todays_posts_link', true); $word['word_credits'] = get_awcsforum_word('word_credits'); $top_menu_links = $tplt->phase($word, $info, 'top_menu_top', true); $wgOut->addHTML($top_menu_links); if ($awcUser->mId != '0') { if (isset($awcUser->m_pmpop) and isset($awcUser->m_pmoptions['m_pmpop'])) { if ($awcUser->m_pmpop == '1' and $awcUser->m_pmoptions['m_pmpop'] == '1' and $action_url['what_file'] != 'member_options') { $wgOut->addHTML('<script type= "text/javascript"> alert("' . get_awcsforum_word('word_newpm') . '"); </script>'); } } } # $wgOut->addHTML('<hr>'); global $wgSitename; $awcs_forum_config->forum_name = !empty($awcs_forum_config->cf__forumname) ? str_replace('|$|', ' ' . $wgSitename . ' ', $awcs_forum_config->cf__forumname) : $wgSitename . ' ' . get_awcsforum_word('word_forum'); $awcs_forum_config->forum_subtitle = isset($awcs_forum_config->cf__forumsubtitle) ? $awcs_forum_config->cf__forumsubtitle : ''; if (!$awcUser->canRead and $action_url['what_file'] != 'credits') { global $wgSitename; $Tforum_name = str_replace('|$|', ' ' . $wgSitename . ' ', $awcs_forum_config->cf__forumname); Set_AWC_Forum_SubTitle($awcs_forum_config->forum_name, $awcs_forum_config->forum_name); $wgOut->loginToUse(); get_awcsforum_word('word_standalongforumextension') == '' ? $awc_info = 'Stand Alone Forum Extension' : ($awc_info = get_awcsforum_word('word_standalongforumextension')); $wgOut->addHTML("\r" . '<br /><hr><center> <a href="http://wiki.anotherwebcom.com" target="_blank" title="PHP, Visual Basic scripts and programs">AWC\'s</a>: <b>' . $awcs_forum_config->cf_forumversion . '</b> MediaWiki - ' . $awc_info . '</center>' . "\r"); return; } # switch ($action_url['what_file']) { case 'mod': require awc_dir . 'includes/mod_post.php'; awcs_forum_mod_options(); break; case 'whoshere': //$WhoWhere = 'whoshere' ; $WhoWhere['type'] = 'forum'; $WhoWhere['where'] = 'whoshere||awc-split||whoshere'; $whoshere = new awcforum_misc(); $whoshere->whoshere(); break; case 'search': awcs_forum_search(); #$search = new awcforum_search(); #$search->enter_search($action); break; case 'post': awcs_forum_post(); #$post=new awcsforum_post_cls(); #$post->enter_post($action); break; case 'st': case 'sp': case 'last_post': case 'delete_post': case 'delete_thread': awcs_forum_threads($action); break; case 'member_options': awcs_forum_members($action); break; case 'admin': $admin = new awcforum_forumAdmin(); $admin->enterAdmin($action); break; case 'pm': $pm = new awcforum_pm(); $pm->enter_pm($action); break; case 'mem_profile': case 'credits': $pm = new awcforum_misc(); $pm->enter_misc($action); break; case 'feed': //awc_pdie($action_url); $title = str_replace('feed/', '', $action_url['all']); $rss = new FeedItem($title, 'Description', awc_url . $title); awc_pdie($rss); break; case 'sc': case 'sf': case 'subf': case 'fpw': default: awcs_forum_listing(); break; } $awc_info = get_awcsforum_word('word_standalongforumextension') == '' ? 'Stand Alone Forum Extension' : get_awcsforum_word('word_standalongforumextension'); // admin check needed if (isset($awcs_forum_config->cf_show_whoes_here) and $awcs_forum_config->cf_show_whoes_here == '1') { $whos_here = new awcs_forum_whos_here(); $whos_here->load_ses($action); $word = array('word_forum_stats_whos_here' => get_awcsforum_word('word_forum_stats_whos_here'), 'members' => get_awcsforum_word('word_members'), 'guests' => get_awcsforum_word('word_guests'), 'word_forum_stats_bots' => get_awcsforum_word('word_forum_stats_bots')); $info['names'] = substr($whos_here->whos_here['names'], 0, -2); $info['num_mems'] = $whos_here->whos_here['mems']; $info['num_guests'] = $whos_here->whos_here['guests']; $info['num_bots'] = $whos_here->whos_here['bots']; $footer_whoshere = $tplt->phase($word, $info, 'footer_whoshere', true); $wgOut->addHTML($footer_whoshere); unset($word, $info); } #require(awc_dir . 'dBase.php'); #$dBase = new awcforum_cls_dBase(); # die("done"); /* * top poster, replier, most posts in thread, most viewed thrread. */ global $css_ver_info; if ($css_ver_info != null) { $css_ver_info = get_awcsforum_word('word_css_style_by') . " {$css_ver_info}"; } // Read the top please... http://google.com/search?q=Special:AWCforum will bring up your site sooner or later... $wgOut->addHTML('<br /><hr> <center> <a href="http://wiki.anotherwebcom.com" target="_blank" title="PHP, Visual Basic scripts and programs">AWC\'s</a>: <b>' . $awcs_forum_config->cf_forumversion . '</b> MediaWiki - ' . $awc_info . '<br />' . $css_ver_info . '</center>'); $wgOut->setRobotpolicy($awcs_forum_config->cf_setRobotpolicy); if (isset($ForumStat)) { $ForumStat->doUpdate(); } if ($awcUser->mId != '0') { $now = awcsforum_funcs::wikidate(wfTimestampNow()); if (isset($awcs_forum_config->cf_save_recent_in_dabase) and $awcs_forum_config->cf_save_recent_in_dabase == '1') { $dbw = wfGetDB(DB_MASTER); $dbw->update('awc_f_mems', array('m_lasttouch' => wfTimestampNow(), 'm_lasthere' => $now), array('m_id' => $awcUser->mId), ''); } else { global $wgCookieExpiration, $wgCookiePath, $wgCookieDomain; $exp = time() + $wgCookieExpiration; setcookie('awc_startTime', $now, $exp, $wgCookiePath, $wgCookieDomain); } } # $wgOut->setSubtitle( 'Time Test: ' . processing_time($START) . ' Memory Peek= ' . memory_get_peak_usage(true) . ' memory_get_usage= ' . memory_get_usage() ) ; # testing }
function do_raw_lang() { global $wgOut; $dbw = wfGetDB(DB_MASTER); $dbr = wfGetDB(DB_SLAVE); $awc_f_langs = $dbr->tableName('awc_f_langs'); $sql = "SELECT lang_id, \n lang_txt_forum,\n lang_txt_thread, \n lang_txt_admin, \n lang_txt_mem, \n lang_txt_tag, \n lang_txt_search, \n lang_txt_errormsg,\n lang_txt_redirects\n FROM {$awc_f_langs} "; // die($sql); $res = $dbr->query($sql); while ($r = $dbr->fetchObject($res)) { $lang_txt_forum_raw = unserialize($r->lang_txt_forum); $lang_txt_thread_raw = unserialize($r->lang_txt_thread); $lang_txt_admin_raw = unserialize($r->lang_txt_admin); $lang_txt_mem_raw = unserialize($r->lang_txt_mem); $lang_txt_tag_raw = unserialize($r->lang_txt_tag); $lang_txt_search_raw = unserialize($r->lang_txt_search); $lang_txt_errormsg_raw = unserialize($r->lang_txt_errormsg); $lang_txt_redirects_raw = unserialize($r->lang_txt_redirects); if (isset($lang_txt_redirects_raw) and !empty($lang_txt_redirects_raw)) { foreach ($lang_txt_redirects_raw as $k => $v) { $new_lang_txt_redirects[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_redirects_raw['tmp'] = 'tmp'; $new_lang_txt_redirects['tmp'] = 'tmp'; } if (isset($lang_txt_forum_raw) and !empty($lang_txt_forum_raw)) { foreach ($lang_txt_forum_raw as $k => $v) { $new_lang_txt_forum[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_forum_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_thread_raw) and !empty($lang_txt_thread_raw)) { foreach ($lang_txt_thread_raw as $k => $v) { $new_lang_txt_thread[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_thread_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_admin_raw) and !empty($lang_txt_admin_raw)) { foreach ($lang_txt_admin_raw as $k => $v) { $new_lang_txt_admin[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_admin_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_mem_raw) and !empty($lang_txt_mem_raw)) { foreach ($lang_txt_mem_raw as $k => $v) { $ew_lang_txt_mem[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_mem_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_search_raw) and !empty($lang_txt_search_raw)) { foreach ($lang_txt_search_raw as $k => $v) { $new_lang_txt_search[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_search_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_tag_raw) and !empty($lang_txt_tag_raw)) { foreach ($lang_txt_tag_raw as $k => $v) { $new_lang_txt_tag[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_tag_raw['tmp'] = 'tmp'; $new_lang_txt_tag['tmp'] = 'tmp'; } if (isset($lang_txt_errormsg_raw) and !empty($lang_txt_errormsg_raw)) { foreach ($lang_txt_errormsg_raw as $k => $v) { $new_lang_txt_errormsg[$k] = awc_wikipase($v, $wgOut); } } else { $lang_txt_errormsg_raw['tmp'] = 'tmp'; $new_lang_txt_errormsg['tmp'] = 'tmp'; } $dbw->update('awc_f_langs', array('lang_txt_forum' => serialize($new_lang_txt_forum), 'lang_txt_thread' => serialize($new_lang_txt_thread), 'lang_txt_admin' => serialize($new_lang_txt_admin), 'lang_txt_mem' => serialize($ew_lang_txt_mem), 'lang_txt_tag' => serialize($new_lang_txt_tag), 'lang_txt_search' => serialize($new_lang_txt_search), 'lang_txt_redirects' => serialize($new_lang_txt_redirects), 'lang_txt_errormsg' => serialize($new_lang_txt_errormsg), 'lang_txt_forum_raw' => serialize($lang_txt_forum_raw), 'lang_txt_thread_raw' => serialize($lang_txt_thread_raw), 'lang_txt_admin_raw' => serialize($lang_txt_admin_raw), 'lang_txt_mem_raw' => serialize($lang_txt_mem_raw), 'lang_txt_tag_raw' => serialize($lang_txt_tag_raw), 'lang_txt_search_raw' => serialize($lang_txt_search_raw), 'lang_txt_redirects_raw' => serialize($lang_txt_redirects_raw), 'lang_txt_errormsg_raw' => serialize($lang_txt_errormsg_raw)), array('lang_id' => $r->lang_id), ''); unset($new_lang_txt_forum, $new_lang_txt_thread, $new_lang_txt_admin, $new_lang_txt_mem, $new_lang_txt_tag, $new_lang_txt_search, $new_lang_txt_redirects, $new_lang_txt_errormsg, $lang_txt_forum_raw, $lang_txt_thread_raw, $lang_txt_admin_raw, $lang_txt_mem_raw, $lang_txt_tag_raw, $lang_txt_search_raw, $lang_txt_redirects_raw, $lang_txt_errormsg_raw); } }
function box() { global $tplt; global $oFCKeditorExtension, $pageEditor; if ($this->is_pm) { $to_skin['posting_message'] = null; $word['title'] = get_awcsforum_word('word_posttile'); $to_skin['user_options'] = $this->user_options; $to_skin['pm_send_to_box'] = $this->mem_pm_sendto; } else { #$info['subscribed_word'] = $extra['subscribed_word']; $word['subscribed_word'] = get_awcsforum_word('word_subscribe'); $word['subscribed_email'] = get_awcsforum_word('word_subscribe_email'); $info['subscribed_email'] = $this->subscribed_email; $word['subscribed_list'] = get_awcsforum_word('word_subscribe_memcp'); $info['subscribed_list'] = $this->subscribed_list; $word['subscribed_no'] = get_awcsforum_word('word_unsubscrib'); $info['subscribed_no'] = $this->subscribed_no; if (isset($this->subscribe) and $this->subscribe == 'dont_show' or $this->mId == 0) { $to_skin['user_options'] = null; } else { $to_skin['user_options'] = $tplt->phase($word, $info, 'subscrib_chk', true); } $word['title'] = get_awcsforum_word('word_posttile'); $to_skin['pm_send_to_box'] = null; } $to_skin['url'] = $this->url; $to_skin['javaCheck'] = $this->javaCheck; $to_skin['posting_message'] = $this->f_posting_mesage_tmpt; $to_skin['post'] = $this->post; $to_skin['rows'] = $this->quick_box ? $this->quick_box_height : $this->box_height; $to_skin['max_chr'] = $this->max_title_lenth; $to_skin['cols'] = $this->quick_box ? $this->quick_box_width : $this->box_width; $to_skin['title'] = $this->title; $to_skin['hidden_input'] = null; $to_skin['mod_options'] = null; $to_skin['hidden_input'] .= isset($this->num_topics) ? '<input name="num_topics" type="hidden" value="' . $this->num_topics . '">' : null; $to_skin['hidden_input'] .= isset($this->pID) ? '<input name="pID" type="hidden" value="' . $this->pID . '">' : null; $to_skin['hidden_input'] .= isset($this->Thread_Title) ? '<input name="threadtitle" type="hidden" value="' . $this->Thread_Title . '">' : null; $to_skin['hidden_input'] .= isset($this->isThread) ? '<input name="isThread" type="hidden" value="' . $this->isThread . '">' : null; $to_skin['hidden_input'] .= isset($this->fID) ? '<input name="fID" type="hidden" value="' . $this->fID . '">' : null; $to_skin['hidden_input'] .= isset($this->tID) ? '<input name="tID" type="hidden" value="' . $this->tID . '">' : null; $to_skin['hidden_input'] .= isset($this->f_name) ? '<input name="f_name" type="hidden" value="' . $this->f_name . '">' : null; $to_skin['hidden_input'] .= isset($this->t_wiki_pageid) ? '<input name="t_wiki_pageid" type="hidden" value="' . $this->t_wiki_pageid . '">' : null; $to_skin['hidden_input'] .= $tplt->phase('', '', 'spam_fields', true); if ($this->Show_ann_sticky_lock) { if (UserPerm >= 2) { $info['ann_chk'] = (isset($this->ann) and $this->ann == '1') ? 'checked' : null; $info['pin_chk'] = (isset($this->sticky) and $this->sticky == '1') ? 'checked' : null; $info['lock_chk'] = (isset($this->lock) and $this->lock == '1') ? 'checked' : null; if (UserPerm == 10) { $word['thread_makeAnnouncement'] = get_awcsforum_word('thread_makeAnnouncement'); $info['ann'] = $tplt->phase($word, $info, 'mod_chks_ann', true); } else { $info['ann'] = ''; } $word['pinned_word'] = get_awcsforum_word('pinned_word'); $word['lockThread_word'] = get_awcsforum_word('lockThread_word'); $to_skin['mod_options'] = $tplt->phase($word, $info, 'mod_chks', true); } } else { $ann = (isset($this->ann) and $this->ann == '1') ? "on" : null; $sticky = (isset($this->sticky) and $this->sticky == '1') ? "on" : null; $lock = (isset($this->lock) and $this->lock == '1') ? "on" : null; $to_skin['hidden_input'] .= '<INPUT TYPE=hidden NAME="ann" value="' . $ann . '">'; $to_skin['hidden_input'] .= '<INPUT TYPE=hidden NAME="sticky" value="' . $sticky . '">'; $to_skin['hidden_input'] .= '<INPUT TYPE=hidden NAME="lock" value="' . $lock . '">'; } $to_skin['ExtraWikiToolBar'] = null; if (method_exists($oFCKeditorExtension, 'onEditPageShowEditFormInitial') and ($this->FCKeditor and $this->mem_FCKeditor and $this->riched_disable == 0)) { $form->textbox1 = str_replace("\r", '<br />', $to_skin['post']); $rawPost = $form->textbox1; $oFCKeditorExtension->onEditPageShowEditFormInitial($form); $to_skin['javaCheck'] = ''; } else { if ($this->extra_wikitools and $this->mem_extra_wikitools and !$this->quick_box) { global $wgOut; // only needed here... $Edittools = GetWikiPage('<wiki>Edittools</wiki>', '', '8', ''); $Edittools = awc_wikipase($Edittools, $wgOut); $to_skin['ExtraWikiToolBar'] = $Edittools; } } $to_skin['SimlieButtons'] = null; if ($this->displaysmiles == '1') { global $emotions; // only needed here... if (!isset($emotions)) { $emotions = GetEmotions(); } $to_skin['SimlieButtons'] = EmotionsToToolbar($emotions, ''); } $to_skin['WikiToolBar'] = GetWiki_ToolBar(); // 2.4.3 $forum_tags = array(); $forum_tags['center'] = array('open' => '[center]', 'close' => '[/center]', 'image' => 'center.gif'); $forum_tags['underline'] = array('open' => '[u]', 'close' => '[/u]', 'image' => 'underline.gif'); $forum_tags['strike'] = array('open' => '[s]', 'close' => '[/s]', 'image' => 'strike.gif'); $forum_tags['quote'] = array('open' => '[quote=username]', 'close' => '[/quote]', 'image' => 'quote.gif'); $forum_tags['color'] = array('open' => '[color=red]', 'close' => '[/color]', 'image' => 'color.gif'); $forum_tags['code'] = array('open' => '[code]', 'close' => '[/code]', 'image' => 'code.gif'); $forum_tags['search'] = array('open' => '[search]', 'close' => '[/search]', 'image' => 'search.jpg'); $forum_tags['google'] = array('open' => '[google]', 'close' => '[/google]', 'image' => 'google.gif'); $forum_tags['yahoo'] = array('open' => '[yahoo]', 'close' => '[/yahoo]', 'image' => 'yahoo.jpg'); if ($this->SyntaxHighlight_GeSHi) { require_once awc_dir . 'config/SyntaxHighlight_GeSHi_tags.php'; } $f_tags = array(); $f_tags['tags'] = null; foreach ($forum_tags as $what => $code) { $info['java_script'] = "javascript:insertTags('{$code['open']}', '{$code['close']}', '{$what}')"; $info['img'] = $code['image']; $f_tags['tags'] .= $tplt->phase('', $info, 'forum_tool_bar_tags'); } $tplt->kill('forum_tool_bar_tags'); $to_skin['ForumBar'] = $tplt->phase('', $f_tags, 'forum_tool_bar', true); unset($f_tags, $forum_tags); $word['posting_Preview_word'] = get_awcsforum_word('posting_Preview_word'); $word['submit'] = get_awcsforum_word('submit'); $submit_buttons = $tplt->phase($word, '', 'button:submit', true); if ($this->preview_button) { $submit_buttons .= $tplt->phase($word, '', 'button:preview', true); } $to_skin['submit_buttons'] = $submit_buttons; $word['posting_as'] = get_awcsforum_word('word_postingas') . ' <b>' . $this->user_name . '</b>'; if (!isset($tplt->tplts['post_box']) or empty($tplt->tplts['post_box'])) { $tplt->add_tplts(array("'post_box'"), true); // need to find out why some severs need this and some dont. } return $tplt->phase($word, $to_skin, 'post_box', true); }
function preview_show($post_or_thread_or_misc) { global $wgOut, $wgRequest, $awc_tables; include_once awc_dir . 'includes/post_phase.php'; $post_cls = new awcs_forum_post_phase(); require awc_dir . 'includes/post_box.php'; $posting_box = new awcs_forum_posting_box(); $posting_box->Thread_Title = $this->ThreadTitle; $posting_box->f_name = $this->f_name; $f_posting_mesage_tmpt = null; $f_name = null; if ($post_or_thread_or_misc == 'thread') { $rDB = wfGetDB(DB_SLAVE); $r = $rDB->selectRow('awc_f_forums', array('f_name', 'f_posting_mesage_tmpt'), array('f_id' => $this->fID)); $f_name = $r->f_name; $f_posting_mesage_tmpt = $r->f_posting_mesage_tmpt; unset($r); Set_AWC_Forum_SubTitle(get_awcsforum_word('posting_Preview_word') . ': ' . str_replace('_', ' ', $this->title), '', ''); Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'sf/id' . $this->fID . '">' . strtr($f_name, "_", " ") . '</a>'); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('posting_Preview_word'), true); $posting_box->Show_ann_sticky_lock = true; $posting_box->url = awc_url . 'post/todo_add_thread'; $posting_box->javaCheck = 'onsubmit="return check_NewThread()"'; } if ($post_or_thread_or_misc == 'post') { Set_AWC_Forum_SubTitle(get_awcsforum_word('word_postingreply'), get_awcsforum_word('word_postingreplyfor') . " " . $this->ThreadTitle); Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'sf/id' . $this->fID . '">' . $this->f_name . '</a>'); Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'st/id' . $this->tID . '">' . $this->ThreadTitle . '</a>'); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('posting_Preview_word'), true); $posting_box->Show_ann_sticky_lock = false; $posting_box->javaCheck = 'onsubmit="return check_quickPost()"'; $posting_box->url = awc_url . 'post/todo_add_post'; } if ($post_or_thread_or_misc == 'quote') { $posting_box->Show_ann_sticky_lock = false; $posting_box->javaCheck = 'onsubmit="return check_quickPost()"'; $posting_box->url = awc_url . 'post/todo_add_post'; $this->subscribe = isset($this->m_thread_subsrib[$this->tID]) ? $this->m_thread_subsrib[$this->tID] : ''; } if ($post_or_thread_or_misc == 'edit') { $posting_box->Show_ann_sticky_lock = false; $posting_box->javaCheck = $this->javaCheck; $posting_box->url = awc_url . 'post/todo_edit_post'; $posting_box->preview_button = true; $posting_box->isThread = $this->isThread; } $post_cls->preview = true; $post_cls->p_userid = $this->cur_memID; $post_cls->p_user = $this->cur_memName; $post_cls->p_post = $this->post; $post_cls->p_title = $this->title; $post_cls->p_date = awcsforum_funcs::date_seperated(wfTimestampNow()); $post_cls->ann = $this->ann; $post_cls->sticky = $this->sticky; $post_cls->lock = $this->lock; $post_cls->member_title = ''; $post_cls->member_title = ''; $html = $post_cls->display_post(); $wgOut->addHTML($html); switch ($this->subscribe) { case 'no': $posting_box->subscribed_no = 'selected'; break; case 'email': $posting_box->subscribed_email = 'selected'; break; case 'list': $posting_box->subscribed_list = 'selected'; break; } $posting_box->subscribe = $this->subscribe; if (strlen($f_posting_mesage_tmpt) > 2) { $posting_box->f_posting_mesage_tmpt = awc_wikipase($f_posting_mesage_tmpt, $wgOut); } $posting_box->f_name = urlencode($f_name); #$posting_box->Thread_Title = awcsforum_funcs::awc_html_entity_decode($this->title); $posting_box->title = $this->title; $posting_box->post = $this->post; if ($this->f_name) { $posting_box->f_name = urlencode($this->f_name); } $posting_box->fID = $this->fID; $posting_box->tID = $this->tID; $posting_box->pID = $this->pID; $posting_box->t_wiki_pageid = $this->t_wiki_pageid; //$e['do_poll'] = $is_poll; $posting_box->ann = $this->ann; $posting_box->sticky = $this->sticky; $posting_box->lock = $this->lock; $posting_box->quick_box = false; $html = $posting_box->box(); $wgOut->addHTML($html); return; }
function sig_get_edit() { global $wgOut; Set_AWC_Forum_SubTitle(get_awcsforum_word('mem_memCP'), $this->membername); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('mem_general_options')); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('mem_edit_sig_option'), true); $sig_is = isset($this->mem_info['m_sig']) ? $this->mem_info['m_sig'] : ''; $html = '<form action="' . awc_url . $this->todo_url . 'save_sig" method="post">'; $html .= '<table width="100%" cellpadding="0" cellspacing="0">'; $html .= '<tr><td class="mem_name">'; $raw_sig = $sig_is; $sig_is = remove_forum_tag_from_post($sig_is); $sig_is = br_convert($sig_is); $sig_is = awc_wikipase($sig_is, $wgOut); $sig_is = Convert($sig_is); $html .= $sig_is; $html .= '</tr></td></table>'; $html .= '<table class="dl_maintable" cellpadding="0" cellspacing="0"><tr>'; $html .= '<td width="100%" align="left">'; $html .= $this->WikiToolBar; $html .= '<input name="mem_name" type="hidden" value="' . $this->membername . '">'; $html .= '<input name="m_id" type="hidden" value="' . $this->m_id . '">'; $html .= '<textarea name="wpTextbox1" id="wpTextbox1" cols="70%" rows="10" wrap="virtual" class="post_box" onKeyDown="limitText(this.form.wpTextbox1,this.form.countdown,' . $this->sig_length . ');" onKeyUp="limitText(this.form.wpTextbox1,this.form.countdown,' . $this->sig_length . ');"">' . $raw_sig . '</textarea>'; $html .= '<br />'; $html .= ' <input type="submit" value="' . get_awcsforum_word('submit') . '"> ' . get_awcsforum_word('cf_SigLength') . ' ' . $this->sig_length . ' / <input readonly type="text" name="countdown" size="3" value="100"></form>'; $html .= '</td>'; $html .= '</tr></table></form>'; self::display_memcp($html); }
function add_tmpl_to_skin($tmp) { global $wgOut, $wgCanonicalNamespaceNames; $tmplt = $tmp; $tmplt = awc_wikipase($tmplt, $wgOut); $edit = str_replace('{{:', '', $tmp); // $edit = str_replace('{{:', 'Template:', $edit); $edit = str_replace('{{', $wgCanonicalNamespaceNames[10] . ':', $edit); $edit = str_replace('}}', '', $edit); return '<a href="' . awcsf_wiki_url . $edit . '">*</a> ' . $tmplt; }
function arr_CheckIn($chk, $current, $AddTo = false, $wPhase = false) { global $wgOut; if (!isset($chk) || empty($chk)) { return $current; } //if(!isset($current)) return ; //if(empty($current)) $current = array('tmp' => 'tmp') ; if (empty($current) or !isset($current)) { $current = array('tmp' => 'tmp'); } $re_arry = array(); $re_arry = array_diff_key($chk, $current); if (!empty($re_arry)) { if ($AddTo) { $r = array(); $r['updated'] = arr_AddTo($re_arry, $current); $r['dif'] = $re_arry; if ($wPhase) { foreach ($r['dif'] as $k => $v) { $r['dif'][$k] = awc_wikipase($v, $wgOut); } $r['phased'] = $r['dif']; } return $r; } else { return $re_arry; } } unset($re_arry); return $current; }