Пример #1
0
 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('&lt;/a&gt;', '&lt;a href', '"&gt;', "<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;
 }
Пример #2
0
 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);
 }
Пример #3
0
 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:'******'&amp;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 . '&amp;action=edit', $mem_page['body']);
     $mem_page['body'] = str_replace('action=edit', 'awc_mem_redirect=' . $mem_name . '&amp;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('&lt;/a&gt;', '</a>', $mem_page['body']);
     $post = str_replace('&lt;a href', '<a href', $post);
     $post = str_replace('"&gt;', '">', $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 );
 }
Пример #4
0
 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;
     }
 }