예제 #1
0
 function display_post($pm = false, $pm_links = null)
 {
     global $tplt;
     # awc_pdie($this);
     static $mem_Info = array();
     static $word = array();
     static $avatarwidth;
     $height_stuff = array('advar' => 0, 'memtitle' => 0, 'wikicount' => 0, 'postcount' => 0, 'threadcount' => 0);
     # awc_pdie($this);
     static $time_func_called = 0;
     ++$time_func_called;
     if ($time_func_called == 1) {
         $word = self::get_words();
         if (isset($this->cf_AvatraSize)) {
             $spl = explode('x', $this->cf_AvatraSize);
             $avatarwidth = $spl[1] + '20';
         } else {
             $avatarwidth = '135';
         }
     }
     if ($pm == false) {
         // wfRunHooks( 'awcsforum_rawpost', array( &$this ) );
         if ($time_func_called == 1) {
             $tplt_info['LimitJump'] = isset($extras['LimitJump_top']) ? $extras['LimitJump_top'] : null;
             $tplt_info['options_menu'] = isset($extras['options_menu']) ? $extras['options_menu'] : null;
         }
     } else {
         $edit_buttons['edit_buttons'] = $this->pm_links;
         $tplt_info['edit_buttons'] = $edit_buttons['edit_buttons'];
         $tplt_info['post_edited_on'] = null;
     }
     $tplt_info['avatarwidth'] = $avatarwidth;
     # Cache... Create array of Members info then check, cut down on queires on Sig and Group
     $HaveMemInfo = false;
     if (!empty($mem_Info)) {
         foreach ($mem_Info as $id => $value) {
             if ($mem_Info[$id]['m_id'] == $this->p_userid) {
                 $HaveMemInfo = true;
             }
         }
         if (!$HaveMemInfo) {
             $mem_Info[$this->p_userid] = GetMemInfo($this->p_userid, $this->user_info_cols);
         }
     } else {
         $mem_Info[$this->p_userid] = GetMemInfo($this->p_userid, $this->user_info_cols);
     }
     #  awc_pdie($mem_Info);
     $hook_user_info = array();
     $hook_user_info['name'] = $this->p_user;
     $hook_user_info['id'] = $this->p_userid;
     foreach ($mem_Info as $id => $value) {
         // if($id != 2) awc_pdie(">". $id);
         //die("kk");
         // if($id == 0){
         if ($this->p_userid == 0) {
             //  die();
             $AvatraSize = explode('x', $this->cf_AvatraSize);
             $mem_Info[0]['m_adv'] = "{$this->wgScriptPath}" . awcForumPath . "/images/avatars/avatar_guest.gif";
             $mem_Info[0]['m_advw'] = $AvatraSize[0];
             $mem_Info[0]['m_advh'] = $AvatraSize[1];
             $mem_Info[0]['edit_count'] = 0;
             $mem_Info[0]['m_posts'] = 0;
             $mem_Info[0]['m_topics'] = 0;
             $mem_Info[0]['edit_count'] = 0;
             $mem_Info[0]['member_title'] = '';
             $to_skin['member_title'] = '';
             $to_skin['edit_count'] = 0;
             $to_skin['m_posts'] = 0;
             $to_skin['m_topics'] = 0;
             $to_skin['m_advh'] = $mem_Info[0]['m_advh'];
             $to_skin['m_advw'] = $mem_Info[0]['m_advw'];
             $to_skin['m_adv'] = $mem_Info[0]['m_adv'];
             $tplt_info['group'] = '';
             $to_skin['m_sig'] = '';
             $mem_Info[0]['group'] = isset($mem_Info[$this->p_userid]['group']) ? $mem_Info[$this->p_userid]['group'] : '';
             $mem_Info[0]['m_sig'] = '';
             // if($this->p_post != 'guest') die($this->p_userid);
         } else {
             if (!isset($mem_Info[$id]['cached'])) {
                 $mem_Info[$id]['cached'] = true;
                 if ($mem_Info[$id]['m_id'] == $this->p_userid) {
                     //$mem_Info[0]['member_title'] = ''; mem_post_title
                     //  die($this->p_userid);
                     if ($this->viewing_mem_info['displaysigs'] == 1 or $awcUser->guest == '0' and $this->cf_SigGuestView) {
                         $m_sig = $mem_Info[$id]['m_sig'];
                         $m_sig = self::phase_post($m_sig, '', false);
                         $to_skin['m_sig'] = $m_sig;
                         if (isset($mem_Info[$id]['m_sig'])) {
                             $to_skin['m_sig'] = str_replace('<a href=', '<a target="blank" href=', $m_sig);
                         }
                         if ($this->viewing_mem_info['displaysigonce'] == 1 and !isset($mem_Info[$id]['show_sig'])) {
                             $mem_Info[$id]['show_sig'] = true;
                         } elseif ($this->viewing_mem_info['displaysigonce'] == 1) {
                             $to_skin['m_sig'] = null;
                         }
                     } else {
                         $to_skin['m_sig'] = null;
                     }
                     $to_skin['m_adv'] = null;
                     if ($this->viewing_mem_info['viewaadv'] == 1 || ($awcUser->guest == '0' and $this->cf_AdvatarGuestView)) {
                         if (isset($mem_Info[$id]['m_adv']) and !empty($mem_Info[$id]['m_adv'])) {
                             $to_skin['m_adv'] = $mem_Info[$id]['m_adv'];
                             $to_skin['m_advw'] = $mem_Info[$id]['m_advw'];
                             $to_skin['m_advh'] = $mem_Info[$id]['m_advh'];
                         } elseif ($mem_Info[$id]['m_topics'] == '0' and $mem_Info[$id]['m_posts'] == '0') {
                             $AvatraSize = explode('x', $this->cf_AvatraSize);
                             $to_skin['m_adv'] = "{$this->wgScriptPath}" . awcForumPath . "images/avatars/avatar_guest.gif";
                             $to_skin['m_advw'] = $AvatraSize[0];
                             $to_skin['m_advh'] = $AvatraSize[1];
                         } else {
                             $AvatraSize = explode('x', $this->cf_AvatraSize);
                             $to_skin['m_adv'] = "{$this->wgScriptPath}" . awcForumPath . "images/avatars/avatar_default.gif";
                             $to_skin['m_advw'] = $AvatraSize[0];
                             $to_skin['m_advh'] = $AvatraSize[1];
                         }
                     }
                     $mem_Info[$id]['m_adv'] = $to_skin['m_adv'];
                     // flip for caching
                     $mem_Info[$id]['m_advw'] = $to_skin['m_advw'];
                     // flip for caching
                     $mem_Info[$id]['m_advh'] = $to_skin['m_advh'];
                     // flip for caching
                     $mem_Info[$id]['m_sig'] = $to_skin['m_sig'];
                     // flip for caching
                     if (!isset($mem_Info[$id]['m_topics']) or empty($mem_Info[$id]['m_topics'])) {
                         $mem_Info[$id]['m_topics'] = '0';
                     }
                     $to_skin['m_topics'] = $mem_Info[$id]['m_topics'];
                     if (!isset($mem_Info[$id]['m_posts']) or empty($mem_Info[$id]['m_posts'])) {
                         $mem_Info[$id]['m_posts'] = '0';
                     }
                     $to_skin['m_posts'] = $mem_Info[$id]['m_posts'];
                     if (!isset($mem_Info[$id]['edit_count']) or empty($mem_Info[$id]['edit_count'])) {
                         $mem_Info[$id]['edit_count'] = '0';
                     }
                     $to_skin['edit_count'] = $mem_Info[$id]['edit_count'];
                     $tplt_info['group'] = $mem_Info[$id]['group'];
                     // @added 2.5.8
                     if (!isset($this->mem_post_title[0])) {
                         foreach ($this->mem_post_title as $memPostTitleID) {
                             if ($mem_Info[$id]['m_posts'] >= $memPostTitleID['count']) {
                                 $tplt_info['member_title'] = $memPostTitleID['title'];
                                 $tplt_info['member_title_css'] = $memPostTitleID['css'];
                             }
                         }
                     } else {
                         $tplt_info['member_title'] = '';
                         $tplt_info['member_title_css'] = '';
                     }
                     $mem_Info[$id]['member_title'] = $tplt_info['member_title'];
                     $mem_Info[$id]['member_title_css'] = $tplt_info['member_title_css'];
                     $to_skin['member_title'] = $tplt_info['member_title'];
                     $to_skin['member_title_css'] = $tplt_info['member_title_css'];
                     //- @added / 2.5.8
                 }
             } else {
                 $to_skin['edit_count'] = isset($mem_Info[$this->p_userid]['edit_count']) ? $mem_Info[$this->p_userid]['edit_count'] : 0;
                 $to_skin['m_posts'] = $mem_Info[$this->p_userid]['m_posts'];
                 $to_skin['m_topics'] = $mem_Info[$this->p_userid]['m_topics'];
                 $to_skin['m_advh'] = $mem_Info[$this->p_userid]['m_advh'];
                 $to_skin['m_advw'] = $mem_Info[$this->p_userid]['m_advw'];
                 $to_skin['m_adv'] = $mem_Info[$this->p_userid]['m_adv'];
                 $tplt_info['group'] = $mem_Info[$this->p_userid]['group'];
                 $tplt_info['member_title'] = isset($mem_Info[$this->p_userid]['member_title']) ? $mem_Info[$this->p_userid]['member_title'] : '';
                 $tplt_info['member_title_css'] = isset($mem_Info[$this->p_userid]['member_title_css']) ? $mem_Info[$this->p_userid]['member_title_css'] : '';
                 # die();
                 $to_skin['member_title'] = $tplt_info['member_title'];
                 $to_skin['member_title_css'] = $tplt_info['member_title_css'];
                 if ($this->viewing_mem_info['displaysigonce'] == 1) {
                     $to_skin['m_sig'] = '';
                 } else {
                     $to_skin['m_sig'] = $mem_Info[$this->p_userid]['m_sig'];
                 }
             }
         }
     }
     $height_stuff['advar'] = $mem_Info[$this->p_userid]['m_advh'] + 15;
     $height_stuff['memtitle'] = $to_skin['member_title'] == '' ? 0 : 20;
     $height_stuff['wikicount'] = 20;
     $height_stuff['postcount'] = 20;
     $height_stuff['threadcount'] = 20;
     if (!isset($mem_Info[$this->p_userid]['m_topics']) or empty($mem_Info[$this->p_userid]['m_topics'])) {
         $height_stuff['threadcount'] = 0;
     }
     if (!isset($mem_Info[$this->p_userid]['m_posts']) or empty($mem_Info[$this->p_userid]['m_posts'])) {
         $height_stuff['postcount'] = 0;
     }
     if (!isset($mem_Info[$this->p_userid]['edit_count']) or empty($mem_Info[$this->p_userid]['edit_count'])) {
         $height_stuff['wikicount'] = 0;
     }
     $tplt_info['sig_display'] = $tplt->phase($word, $to_skin, 'sig_display');
     $tplt_info['post_avatar'] = $tplt->phase($word, $to_skin, 'post_avatar');
     $to_skin['url'] = awcsf_wiki_url . "Special:Contributions/{$this->p_user}";
     $tplt_info['wikiedits_count_link'] = $this->showWEcount == '1' ? $tplt->phase($word, $to_skin, 'link_wikiedits') : null;
     $to_skin['url'] = awc_url . "search/memtopics/" . urlencode($this->p_user) . '/' . $this->p_userid;
     //  $to_skin['url'] = awc_url ."search/memtopics/".$this->p_userid ;
     $tplt_info['topics_count_link'] = $this->showTcount == '1' ? $tplt->phase($word, $to_skin, 'link_threads') : null;
     $to_skin['url'] = awc_url . "search/memposts/" . urlencode($this->p_user) . '/' . $this->p_userid;
     // $to_skin['url'] = awc_url ."search/memposts/".$this->p_userid ;
     $tplt_info['post_count_link'] = $this->showPcount == '1' ? $tplt->phase($word, $to_skin, 'link_posts') : null;
     $tplt_info['mem_drop_num'] = $time_func_called;
     $tplt_info['user_name'] = "<a href=\"" . awc_url . "mem_profile/{$this->p_user}/{$this->p_userid}\" onmouseover=\"mopen('mem{$tplt_info['mem_drop_num']}')\" onmouseout=\"mclosetime()\">{$this->p_user}</a>";
     $tplt_info['admin_lookup'] = (UserPerm == 10 and !$this->preview) ? '<a target="blank" href="' . awc_url . 'admin/mem_lookup/' . $this->p_user . '/' . $this->p_userid . '">*</a>' : '';
     $to_skin['url'] = awc_url . "mem_profile/{$this->p_user}/{$this->p_userid}";
     $tplt_info['profile_link'] = $tplt->phase($word, $to_skin, 'link_profile');
     $tplt_info['user_options'] = isset($to_skin['user_options']) ? $to_skin['user_options'] . '<br />' : null;
     if ($this->p_userid == 0) {
         //if($this->show_guest_ip == 0)
         if (UserPerm == 10 and !$this->preview) {
             $tplt_info['user_name'] = "<a href='" . awcsf_wiki_url . "Special:Contributions/{$this->p_user}'>{$this->p_user}</a>";
         } elseif ($this->show_guest_ip == 0) {
             $tplt_info['user_name'] = get_awcsforum_word('word_guest');
         }
         $tplt_info['post_count_link'] = null;
         $tplt_info['profile_link'] = null;
         $tplt_info['user_options'] = null;
         $tplt_info['topics_count_link'] = null;
         $tplt_info['group'] = null;
         $tplt_info['member_title'] = '';
         $tplt_info['member_title_css'] = '';
         if (UserPerm == 10 and !$this->preview) {
         } elseif ($this->show_guest_ip == 0) {
             $tplt_info['wikiedits_count_link'] = null;
         }
     }
     if (!isset($tplt_info['member_title'])) {
         $tplt_info['member_title'] = '';
         $tplt_info['member_title_css'] = '';
     }
     $m_pm = ($this->pm_enable == '1' and $this->guest == false) ? $word['word_send'] . ' <a href="' . awc_url . 'member_options/pmnew/' . $this->p_user . '/' . $this->p_id . '">' . $word['word_pm'] . '</a>' : null;
     $to_skin['url'] = awc_url . 'member_options/pmnew/' . $this->p_user . '/' . $this->p_id;
     $tplt_info['m_pm'] = $tplt->phase($word, $to_skin, 'link_send_pm_to');
     $tplt_info['date'] = null;
     $info['date'] = awcsforum_funcs::convert_date($this->p_date, "l") . " ";
     if (!$this->preview) {
         $tplt_info['date'] = $tplt->phase($word, $info, 'post_date_link');
     }
     if ($this->single_post or $pm or $this->preview) {
         $tplt_info['date'] = $info['date'];
     }
     $info['post_title'] = awcsforum_funcs::awc_html_entity_decode($this->p_title);
     #$info['post_title'] = $this->p_title ;
     $tplt_info['post_title'] = (!empty($this->p_title) and $this->p_title != $this->t_name) ? $tplt->phase($word, $info, 'post_title_row') : '';
     if ($time_func_called % 2) {
         $tplt_info['row_class'] = 'post0';
     } else {
         $tplt_info['row_class'] = 'post1';
     }
     /* 
     if ($this->bcmod) {
         //$tplt_info['row_class'] = 'post' . bcmod($time_func_called, '2')  ;
     } else {
         //$tplt_info['row_class'] = 'post' ;
     }
     */
     if ($pm == false) {
         if (!empty($this->p_editwho)) {
             $info['p_editdate'] = awcsforum_funcs::convert_date($this->p_editdate, "l");
             $info['p_editwho'] = $this->p_editwho;
             $tplt_info['post_edited_on'] = $tplt->phase($word, $info, 'post_edited_on');
         } else {
             $tplt_info['post_edited_on'] = null;
         }
         $edit_buttons['edit_buttons'] = null;
         if (UserPerm >= 2 and !$this->preview || CanDelete($this->p_user)) {
             if ($this->t_ann != "1" || UserPerm == 10) {
                 $url = awc_url . 'mod/mod_post/delete/' . $this->p_id;
                 #$url = awc_url .'post/delete_post/id' . $this->p_id ;
                 $t = $word['thread_deletepost'] . ' ? ';
                 $t = str_replace(array(chr(10), chr(13), "'"), '', $t);
                 $info['url'] = $url;
                 $info['msg'] = $t;
                 $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:delete_post');
             }
         }
         #if ( (UserPerm >= 2 || (CanDelete($this->p_user)) AND
         # $this->only_one_post == false) ) {
         # die(">". $this->only_one_post);
         if (UserPerm >= 2 and !$this->preview and !$this->single_post || CanDelete($this->p_user) and $time_func_called == 1 and !$this->has_limit) {
             if ($this->t_ann != "1" || UserPerm == 10) {
                 $url = awc_url . 'mod/mod_thread/delete/' . $this->t_id;
                 $t = $word['thread_deletethread'] . ' ? \\n' . $word['deleteThread'];
                 $t = str_replace(array(chr(10), chr(13), "'"), '', $t);
                 $info['url'] = $url;
                 $info['msg'] = $t;
                 $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:delete_thread');
             }
         }
         // die(">". $this->t_pollopen);
         if (!$this->preview and $time_func_called == 1 and !$this->single_post) {
             if ($this->polls_enabled == '1' and $this->p_userid != '0' and (!$this->t_poll or $this->multi_polls == '1') and UserPerm >= 10 || $this->uID == $this->p_userid) {
                 $word['poll'] = get_awcsforum_word('word_add_poll');
                 $info['url'] = awc_url . "post/add_poll/{$this->t_id}/{$this->f_id}";
                 $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:poll');
             }
         }
         if (UserPerm >= 2 and !$this->preview and $time_func_called != 1) {
             $info['url'] = awc_url . 'mod/mod_thread/splitmerge_get/' . $this->p_id;
             $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:spltmerge_button');
         }
         if (!$this->preview and $time_func_called == 1 and CanEdit($this->p_user) || UserPerm >= 2) {
             $info['url'] = awc_url . 'post/GetEditThread/id' . $this->p_id;
             $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:edit_button');
         }
         if (!$this->preview and $time_func_called != 1 and CanEdit($this->p_user) || UserPerm >= 2) {
             $info['url'] = awc_url . 'post/GetEdit/id' . $this->p_id;
             $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:edit_button');
         }
         // forum-wiki-perm
         if (($this->canPost and !$this->preview and $this->t_status == "0" and $this->forum_perm_can_post) || UserPerm >= 2) {
             $info['url'] = awc_url . "post/quote/id" . $this->p_id;
             $edit_buttons['edit_buttons'] .= $tplt->phase($word, $info, 'post:quote_button');
         }
         # $tplt_info['edit_buttons'] = $tplt->phase($word, $edit_buttons, 'edit_buttons_row');
     }
     $tplt_info['edit_buttons'] = $tplt->phase($word, $edit_buttons, 'edit_buttons_row');
     /*            
     if($this->preview){
         $tplt_info['edit_buttons'] = null;
     } else {
          $tplt_info['edit_buttons'] = $tplt->phase($word, $edit_buttons, 'edit_buttons_row');
     }
     */
     # crap! need to find a way to fill the height of the post-text, work-around
     $add = 0;
     // 2.5.8
     foreach ($height_stuff as $item => $number) {
         $add = $add + $number;
     }
     $tplt_info['table_height'] = $add;
     //($to_skin['m_adv'] == null) ? '65' : ($to_skin['m_advh'] + 65); // 2.5.8
     $tplt_info['post_height'] = $tplt_info['table_height'] - 10;
     $tplt_info['colspan'] = strlen($edit_buttons['edit_buttons']) > 0 ? ' ' : ' width="100%" colspan="2" ';
     $post = $this->p_post;
     $tplt_info['post'] = self::phase_post($post, $this->p_id);
     $tplt_info['p_id'] = $this->p_id;
     $tplt_info['pID'] = $this->p_id;
     wfRunHooks('awcsforum_post_render_display', array(&$tplt_info, $hook_user_info));
     // 2.5.6
     $post_table = $tplt->phase($word, $tplt_info, 'post_table');
     // if($time_func_called == 5) $post_table = '<a name="last"></a>' . $post_table;
     return $post_table;
 }
예제 #2
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 );
 }
예제 #3
0
 function GetThisMemInfo()
 {
     global $member_info;
     $user_get = array();
     $user_get[] = '*';
     $this->mem_info = GetMemInfo($this->m_id, $user_get);
     unset($user_get);
     $member_info = $this->mem_info;
     # awc_pdie($this->mem_info);
 }
예제 #4
0
 function do_split()
 {
     global $awcUser, $awc_tables, $wgRequest, $awcs_forum_config;
     if (UserPerm < 2) {
         return $wgOut->loginToUse();
     }
     require awc_dir . 'post.php';
     $post_cls = new awcsforum_post_cls();
     $pID = $this->tID[0];
     $dbr = wfGetDB(DB_SLAVE);
     $r = $dbr->selectRow('awc_f_posts', array('*'), "p_id={$pID}", __METHOD__, array('OFFSET' => 0, 'LIMIT' => 1));
     $this->tID = array(0 => $pID);
     $post_cls->post = $r->p_post;
     $post_cls->cur_memID = $r->p_userid;
     $post_cls->cur_memName = $r->p_user;
     unset($dbr, $r);
     $user_get = array();
     $user_get[] = 'm_id';
     $user_get[] = 'm_posts';
     $user_get[] = 'm_topics';
     $mem_Info = GetMemInfo($post_cls->cur_memID, $user_get);
     unset($user_get);
     $post_cls->cur_m_posts = $mem_Info['m_posts'];
     $post_cls->cur_m_topics = $mem_Info['m_topics'];
     $post_cls->mName = $post_cls->cur_memName;
     unset($mem_Info);
     $title = trim($wgRequest->getVal('t_title'));
     $post_cls->title = $post_cls->CleanThreadTitle($title);
     $post_cls->fID = $wgRequest->getVal('fID');
     $post_cls->is_poll = false;
     $post_cls->subscrib_what = 'no';
     $post_cls->forum_Antispam = '';
     $post_cls->ann = '0';
     $post_cls->sticky = '0';
     $post_cls->lock = '0';
     $post_cls->cf_threadsubscrip = $awcs_forum_config->cf_threadsubscrip;
     $post_cls->cf_forumsubscrip = $awcs_forum_config->cf_forumsubscrip;
     $post_cls->add_thread();
     self::delete_post(true);
 }
예제 #5
0
 /** Gets Members forum options
  * 
  * @uses GetMemInfo
  * @uses get_mem_forum_options
  * @uses clear_session
  * @uses set_session
  * @since Version 2.5.8 
  */
 function get_mem_forum_options($where = '')
 {
     global $awc_ver;
     $this->has_mem_info = true;
     if ($this->mId != '0') {
         $this->guest = false;
         $user = array();
         $user_get = array();
         $user_get[] = 'm_idname';
         $user_get[] = 'm_displaysigonce';
         $user_get[] = 'm_displaysig';
         $user_get[] = 'm_viewaadv';
         $user_get[] = 'm_posts';
         $user_get[] = 'm_topics';
         if (version_compare(awcs_forum_ver, '2.5.3', '>=')) {
             // need a check for this
             $user_get[] = 'm_pmunread';
             // .2.5.2
             $user_get[] = 'm_pmoptions';
             $user_get[] = 'm_pmpop';
             $user_get[] = 'm_thread_subsrib';
             $user_get[] = 'm_forum_subsrib';
             $user_get[] = 'm_lasthere';
             $user_get[] = 'm_lasttouch';
             $user_get[] = 'm_where';
             $user_get[] = 'm_forumoptions';
             $user_get[] = 'm_menu_options';
         }
         $user = GetMemInfo($this->mId, $user_get, false);
         if ($user == 'error') {
             return;
         }
         if ($user['name'] == '') {
             #  die($this->mName);
             /** @changeVer 2.5.8 - Added default PM options for new members*/
             $dbw = wfGetDB(DB_MASTER);
             $dbw->insert('awc_f_mems', array('m_idname' => $this->mName, 'm_id' => $this->mId, 'm_forumoptions' => serialize($this->m_forumoptions), 'm_pmoptions' => serialize($this->m_pmoptions)));
             $m_id = awcsforum_funcs::lastID($dbw, 'awc_f_mems', 'm_id');
             wfRunHooks('awcsforum_memAddedToDbase', array($m_id, $this));
             // added 2.5.8
             $sql = $dbw->selectSQLText(array('awc_f_stats'), array('*'), '', __METHOD__, array('OFFSET' => '0', 'LIMIT' => '1'));
             # $awc_f_stats = $dbw->tableName('awc_f_stats');
             # $sql = "SELECT * FROM $awc_f_stats LIMIT 1";
             $dbw->ignoreErrors(true);
             if ($res = $dbw->query($sql)) {
                 $r = $dbw->fetchRow($res);
                 $stats_id = $r['stats_id'];
                 $stat_mems = $r['stat_mems'] + 1;
                 $dbw->freeResult($res);
                 unset($r);
                 $dbw->update('awc_f_stats', array('stat_mems' => $stat_mems), array('stats_id' => $stats_id), '');
             }
             $dbw->ignoreErrors(false);
             unset($m_forumoptions, $dbw, $res);
             self::get_mem_forum_options();
         }
         foreach ($user as $u => $v) {
             $this->{$u} = $v;
         }
         unset($user, $user_get);
         if (!isset($awcs_forum_config->cf_save_recent_in_dabase) or $awcs_forum_config->cf_save_recent_in_dabase == '0') {
             // $this->m_lasthere - has already been set from dbase info, this will set for cookie info...
             $this->m_lasthere = isset($_COOKIE["awc_startTime"]) ? $_COOKIE["awc_startTime"] : awcsforum_funcs::wikidate(wfTimestampNow());
         }
         //  awc_pdie($this);
         // $awcstart = isset($_SESSION['awc_startTime']) ?  $_SESSION['awc_startTime'] :  null;
         if (!isset($_SESSION['awc_startTime']) or empty($_SESSION['awc_startTime'])) {
             awcsforum_funcs::clear_session();
             awcsforum_funcs::set_session($this->m_lasthere);
         }
     }
 }
예제 #6
0
 function sendpm($to_name, $title, $msg, $save_sent = false, $sendto_names = null)
 {
     global $wgUser, $wgOut, $wgPasswordSender, $IP, $awc_tables, $awcs_forum_config;
     // awcsforum_funcs::get_page_lang(array('lang_txt_mem'));
     /* 
     
     if ( !file_exists($IP . '/includes/AutoLoader.php')){
         require($IP . "/includes/UserMailer.php");
     }
     */
     $sender_name = $wgUser->mName;
     $sender_id = $wgUser->mId;
     $send_msg_text = false;
     if (isset($awcs_forum_config->cf_send_pm_body_in_email) and $awcs_forum_config->cf_send_pm_body_in_email == '1') {
         $send_msg_text = true;
     }
     $user_get = array();
     $user_get[] = 'm_id';
     $dbw = wfGetDB(DB_MASTER);
     $date_seperated = $dbw->timestamp();
     $pm_count = null;
     $to_address = array();
     /* set up email stuff here so its not included in the loop */
     $send_title = get_awcsforum_word('mem_pm_email_newpmawaiting') . ' ' . $title;
     $send_body = get_awcsforum_word('mem_pm_email_newpmawaitingbody');
     $send_body .= " \n" . $sender_name;
     $send_body .= " \n\n <a href='" . awcsforum_funcs::awcforum_url('member_options/pminbox') . "'>" . awcsforum_funcs::awcforum_url('member_options/pminbox') . "</a> \n\r\n\r";
     require_once awc_dir . 'send_mail.php';
     $html = true;
     if ($awcs_forum_config->cf_send_email_html == '0') {
         $html = false;
     }
     foreach ($to_name as $id => $send_to_info) {
         $pm_count++;
         if ($pm_count == 1) {
             #$bs = $dbw->nextSequenceValue( 'awc_f_pms_pm_id_seq' );
             $dbw->insert('awc_f_pms', array('pm_title' => $title, 'pm_text' => $msg));
             $pm_id = awcsforum_funcs::lastID($dbw, 'awc_f_pms', 'pm_id');
         }
         $dbw->insert('awc_f_pms_info', array('pmi_pmid' => $pm_id, 'pmi_sender' => $sender_name, 'pmi_sender_id' => $sender_id, 'pmi_receipt_id' => $send_to_info['id'], 'pmi_receipt' => $sendto_names, 'pmi_send_date' => $date_seperated));
         # $mem = GetMemInfo($id, $user_get);
         # if(isset($mem['name'])){
         # awc_pdie($wgUser->mId);
         if ($send_to_info['forum_username'] != 'no_name' or $send_to_info['id'] == $wgUser->mId) {
             $dbw->query("UPDATE {$awc_tables['awc_f_mems']} \n                                    SET m_pmtotal = m_pmtotal + 1,\n                                    m_pmunread = m_pmunread + 1, \n                                    m_pminbox = m_pminbox + 1,\n                                    m_pmpop = '1'\n                                    WHERE m_id =" . $send_to_info['id']);
         } else {
             $dbw->insert('awc_f_mems', array('m_id' => $send_to_info['id'], 'm_idname' => $send_to_info['name'], 'm_pmtotal' => '1', 'm_pmunread' => '1', 'm_pminbox' => '1', 'm_pmpop' => '1'));
         }
         /* @changeVer 2.5.8 */
         if (isset($send_to_info['email']) && !empty($send_to_info['email']) && $send_to_info['email'] != 'no_email') {
             $to_address[] = new MailAddress($send_to_info['email']);
             if ($send_to_info['pass_pm_text'] == '1' and $send_msg_text) {
                 $send_body .= "\n\r\n\r" . awcsforum_mailer::check_msg_len($msg, 0);
             }
             awcsforum_mailer::send_mail($to_address, $send_title, $send_body, $html);
         }
     }
     if ($save_sent) {
         $dbw->insert('awc_f_pms_info', array('pmi_pmid' => $pm_id, 'pmi_sender' => $sender_name, 'pmi_sender_id' => $sender_id, 'pmi_receipt_id' => $sender_id, 'pmi_receipt' => $sendto_names, 'pmi_send_date' => $date_seperated, 'pmi_folder_id' => '1', 'pmi_read_date' => $date_seperated, 'pmi_read' => '1'));
         $mem = GetMemInfo($id, $user_get);
         if (isset($mem['name'])) {
             $dbw->query("UPDATE {$awc_tables['awc_f_mems']} \n                                    SET m_pmtotal = m_pmtotal + 1,\n                                    m_pmsent = m_pmsent + 1\n                                    WHERE m_id =" . $sender_id);
         } else {
             $dbw->insert('awc_f_mems', array('m_id' => $sender_id, 'm_idname' => $wgUser->mName, 'm_pmtotal' => '1', 'm_pmsent' => '1'));
         }
     }
     $wgOut->redirect(awc_url . 'member_options/pminbox');
 }