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; }
/** * * @change 2.5.8 */ function loop_thread_list($r) { global $row_class; ++$this->thread_count; $info['poll'] = $r->t_poll; $info['ann'] = $r->t_ann; $info['sticky'] = $r->t_pin; $info['locked'] = $r->t_status; $info['t_id'] = $r->t_id; $tID = $info['t_id']; $info['t_name'] = awcsforum_funcs::awc_html_entity_decode($r->t_name); $info['t_name'] = str_replace('%', '%', $info['t_name']); // die(">" . $this->show_guest_ip); if ($this->show_guest_ip == '0' and $r->t_lastuserid == '0' and UserPerm < 2) { $info['user'] = $this->words['guest']; } else { $info['user'] = $r->t_lastuser; } // $info['user'] = $r->t_lastuser ; $info['userid'] = $r->t_lastuserid; $info['link'] = awc_url; if ($this->thread_count % 2) { $info['row_class'] = 'thread_rows0'; } else { $info['row_class'] = 'thread_rows1'; } $to_tplt = self::Check_ShowForumRows($info); $to_tplt['mem_url'] = awcsforum_funcs::awcforum_url("mem_profile/{$r->t_starter}/{$r->t_starterid}"); // $to_tplt['thread_title'] = awcsforum_funcs::awc_html_entity_decode($info['t_name']); $to_tplt['mod'] = (UserPerm >= 2 and $r->t_ann != '1') ? '<INPUT type="checkbox" name="tID[]" value="' . $info['t_id'] . '">' : null; $to_tplt['col_5_isSearch_forum_name'] = ''; $to_tplt['t_starter'] = $r->t_starter; if ($this->show_guest_ip == '0' and $r->t_starterid == '0' and UserPerm < 2) { $to_tplt['t_starter'] = $this->words['guest']; } $to_tplt['t_topics'] = $r->t_topics; $to_tplt['t_hits'] = $r->t_hits; $to_tplt['last'] = '<a href="' . awc_url . 'last_post/id' . $r->t_id . '">' . awcsforum_funcs::convert_date($r->t_lastdate, "s") . '</a>'; $to_tplt['user'] = $info['user']; $to_tplt['NewPost'] = self::new_thread_check($r->t_id, $r->t_lastdate); $this->link = awc_url; $this->tID = $r->t_id; $this->total_posts = $r->t_topics; $to_tplt['jump'] = self::GetThreadPostLimit(); if ($this->extra_column) { if (!isset($tplt)) { global $tplt; } $to_tplt['forum_name'] = $r->f_name; $word['forum_name'] = $this->words['forums']; $to_tplt['col_5_isSearch_forum_name'] = $tplt->phase($word, $to_tplt, 'col_5_isSearch_forum_name'); // move } return $to_tplt; }
function display_code_for_edit() { global $ADskin, $wgOut; $dbr = wfGetDB(DB_SLAVE); $awc_f_theme_css = $dbr->tableName('awc_f_theme_css'); $sql = "SELECT css_id, css_att, css_custom, css_code, css_ver , css_section\r\r\n FROM {$awc_f_theme_css} \r\r\n WHERE (css_id={$this->css_id}) LIMIT 1 "; $res = $dbr->query($sql); $out = '<form action="' . awc_url . 'admin/css/css_edit_save" method="post">'; $out .= '<input name="id" type="hidden" value="' . $this->css_id . '">'; $out .= '<table>'; $r = $dbr->fetchObject($res); $css_info['css_att'] = $r->css_att; $css_info['custom'] = $r->css_custom; $css_info['code'] = $r->css_code; $css_info['ver'] = $r->css_ver; $css_id = $r->css_id; $out .= "<tr><td><hr />"; $out .= '<input name="ver" type="hidden" value="' . $r->css_ver . '">'; $out .= $ADskin->css_editing_boxs($css_info, $css_id); $out .= '</td></tr>'; $dbr->freeResult($res); $out .= '</table></form>'; Set_AWC_Forum_BreadCrumbs('<a target="blank" href="http://wiki.anotherwebcom.com/Category:' . str_replace('css_', 'CSS_', $r->css_section) . '">' . $r->css_section . '</a>'); Set_AWC_Forum_BreadCrumbs($r->css_att, true); $out .= "<br />"; $awc_f_theme_css_history = $dbr->tableName('awc_f_theme_css_history'); $sql = "SELECT cssh_code, cssh_ver, cssh_date\r\r\n FROM {$awc_f_theme_css_history} \r\r\n WHERE cssh_cssid={$css_id} ORDER BY cssh_date DESC"; $res = $dbr->query($sql); while ($r = $dbr->fetchObject($res)) { $out .= get_awcsforum_word('admin_edit_ver') . ' ' . $r->cssh_ver . ' (' . awcsforum_funcs::convert_date($r->cssh_date, 'l') . ') <br />'; $out .= "<textarea cols='75' rows='5' wrap='virtual' class='post_box'>{$r->cssh_code}</textarea> <br /><br />"; } $wgOut->addHTML($out); }
function show_func() { global $wgOut; $awc_f_theme_tplt = $this->rDB->tableName('awc_f_theme_tplt'); $sql = "SELECT *\n FROM {$awc_f_theme_tplt} \n WHERE tplt_id={$this->id}"; $res = $this->rDB->query($sql); $r = $this->rDB->fetchObject($res); $this->rDB->freeResult($res); $tplt_section = $r->tplt_section; $tplt_function = $r->tplt_function; $html = '<a target="blank" href="http://wiki.anotherwebcom.com/' . $r->tplt_function . ' (Forum Skin Template)">' . $r->tplt_function . '</a> '; $html .= ' ( ' . get_awcsforum_word('admin_edit_ver') . ' ' . $r->tplt_ver . ' )'; $html .= '<form enctype="multipart/form-data" action="' . awc_url . 'admin/tplt/save_func" method="post">'; $html .= '<input name="id" type="hidden" value="' . $this->id . '">'; #$html .= "<textarea name='tplt_code' cols='95' rows='20' style='width:98%' wrap='virtual' class='post_box'>".str_replace(array('<','>'),array('<','>'),$r->tplt_code)."</textarea> <br />"; $html .= "<textarea name='tplt_code' cols='95' rows='20' style='width:98%' wrap='virtual' class='post_box'>" . htmlentities($r->tplt_code, ENT_NOQUOTES) . "</textarea> <br />"; $html .= ' <input type="submit" value="' . get_awcsforum_word('submit') . '">'; $html .= '</form>'; $html .= "<br />"; $awc_f_theme_tplt_history = $this->rDB->tableName('awc_f_theme_tplt_history'); $sql = "SELECT tplth_code, tplth_ver, tplth_date\n FROM {$awc_f_theme_tplt_history} \n WHERE tplth_tplt_id={$this->id} ORDER BY tplth_date DESC"; $res = $this->rDB->query($sql); while ($r = $this->rDB->fetchObject($res)) { $html .= get_awcsforum_word('admin_edit_ver') . ' ' . $r->tplth_ver . ' (' . awcsforum_funcs::convert_date($r->tplth_date, 'l') . ') <br />'; $html .= "<textarea cols='75' rows='5' wrap='virtual' class='post_box'>{$r->tplth_code}</textarea> <br /><br />"; } Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'admin/tplt/show_section/' . $tplt_section . '">' . $tplt_section . '</a>'); Set_AWC_Forum_BreadCrumbs($tplt_function, true); $wgOut->addHTML($html); }
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 GetQuote($pID) { global $wgOut, $wgRequest, $awc_tables, $awcUser; // forum-wiki-perm move to top if (!$awcUser->canPost) { return $wgOut->loginToUse(); } $rDB = wfGetDB(DB_SLAVE); $res = $rDB->query("SELECT p.*, t.t_wiki_pageid, t.t_id, t.t_name, t.t_ann, t.t_pin, t.t_status, t.t_topics, f.f_name, f.f_wiki_write_perm\r\r\n FROM {$awc_tables['awc_f_posts']} p, {$awc_tables['awc_f_threads']} t, {$awc_tables['awc_f_forums']} f \r\r\n WHERE p.p_id={$pID} AND f.f_id=p.p_forumid AND p.p_threadid=t.t_id LIMIT 1"); $r = $rDB->fetchRow($res); $perm = new awcs_forum_perm_checks(); if (!$awcUser->canPost or !$perm->can_post($r['f_wiki_write_perm'])) { return awcs_forum_error('no_forum_read_perm'); } $title = $r['p_title']; if ($title == "") { $title = $r['t_name']; } $title = awcsforum_funcs::awc_html_entity_decode($title); $ptitle = awcsforum_funcs::awc_html_entity_decode($r['p_title']); $ttitle = awcsforum_funcs::awc_html_entity_decode($r['t_name']); $this->ThreadTitle = $ttitle; $this->f_name = $r['f_name']; $this->t_wiki_pageid = $r['t_wiki_pageid']; $this->tID = $r['t_id']; $this->fID = $r['p_forumid']; if ($r['t_ann']) { $t_ann = "checked"; } if ($r['t_pin']) { $t_pin = "checked"; } if ($r['t_status']) { $t_status = "checked"; } $this->post = "[QUOTE=" . $r['p_user'] . " [[Special:AWCforum/sp/id" . $pID . "|" . awcsforum_funcs::convert_date($r['p_date'], "1") . "]]]" . $r['p_post'] . "[/quote]" . chr(10); Set_AWC_Forum_SubTitle(get_awcsforum_word('word_quoting'), $ptitle); Set_AWC_Forum_BreadCrumbs(get_awcsforum_word('word_quoting')); Set_AWC_Forum_BreadCrumbs('<a href="' . awc_url . 'st/id' . $r['p_threadid'] . '">' . $ttitle . '</a>', true); return self::preview_show('quote'); }
function DisplayUserInfo1() { global $wgOut, $awcUser, $awc_tables; $this->pm_list('pminbox'); return; if ($this->todo_url == 'member_options') { Set_AWC_Forum_SubTitle(get_awcsforum_word('mem_memCP'), $this->membername); } $html = '<table width="100%" class="mem_pm_table" cellpadding="0" cellspacing="0">'; $html .= "<tr><td class='pm_header' width='5%' align='left' nowrap>" . get_awcsforum_word('mem_pm_new') . "</td>\r\r\n <td class='pm_header' width='85%' align='left' nowrap>" . get_awcsforum_word('mem_pm_title') . "</td>\r\r\n <td class='pm_header' width='5%' align='left' nowrap>" . get_awcsforum_word('mem_pm_sender') . "</td>\r\r\n <td class='pm_header' width='5%' align='left' nowrap>" . get_awcsforum_word('mem_pm_sentdate') . "</td>\r\r\n </tr>"; $dbr = wfGetDB(DB_SLAVE); $sql = "SELECT p.pm_id, p.pm_title, pi.pmi_sender, pi.pmi_read, pi.pmi_send_date \r\r\n FROM {$awc_tables['awc_f_pms']} p, {$awc_tables['awc_f_pms_info']} pi \r\r\n WHERE p.pm_id=pi.pmi_pmid AND pi.pmi_receipt_id = " . $awcUser->mId . " AND pi.pmi_folder_id=0 ORDER BY pi.pmi_send_date DESC"; $res = $dbr->query($sql); $c = null; while ($r = $dbr->fetchObject($res)) { $c++; $r->pmi_read == 0 ? $ind = '->' : ($ind = ''); $html .= "<tr><td class='pm_row' width='5%' align='left' nowrap>{$ind}</td>\r\r\n <td class='pm_row' width='85%' align='left' nowrap><a href='" . awc_url . "member_options/readpm/id" . $r->pm_id . "'>" . $r->pm_title . "</a></td>\r\r\n <td class='pm_row' width='5%' align='left' nowrap>" . $r->pmi_sender . "</td>\r\r\n <td class='pm_row' width='5%' align='left' nowrap>" . awcsforum_funcs::convert_date($r->pmi_send_date, "l") . "</td>\r\r\n </tr>"; } $dbr->freeResult($res); $html .= '</table>'; # m_pmcount $info = array(); self::display_memcp($html); }
function GetForumDisplayInfo($info) { global $awc, $wgOut, $awcs_forum_config, $str_len, $forum, $perm_sql; $thread_tools = new awcs_forum_thread_list_tools(); if ($info['both']) { $info['classThreadtitle'] = 'class="' . $info['classThreadtitle'] . '" id="' . $info['idThreadtitle'] . '"'; $info['classReplies'] = 'class="' . $info['classReplies'] . '" id="' . $info['idReplies'] . '"'; $info['classViews'] = 'class="' . $info['classViews'] . '" id="' . $info['diViews'] . '"'; $info['classLastAction'] = 'class="' . $info['classLastAction'] . '" id="' . $info['idLastAction'] . '"'; } elseif (!$info['id']) { $info['classThreadtitle'] = 'class="' . $info['classThreadtitle'] . '"'; $info['classReplies'] = 'class="' . $info['classReplies'] . '"'; $info['classViews'] = 'class="' . $info['classViews'] . '"'; $info['classLastAction'] = 'class="' . $info['classLastAction'] . '"'; } else { $info['classThreadtitle'] = 'id="' . $info['idThreadtitle'] . '"'; $info['classReplies'] = 'id="' . $info['idReplies'] . '"'; $info['classViews'] = 'id="' . $info['idViews'] . '"'; $info['classLastAction'] = 'id="' . $info['idLastAction'] . '"'; } # die(">". $UserPerm); $dbr = wfGetDB(DB_SLAVE); $permsql = substr($perm_sql, 0, -4); // if(strlen($info['forum']) > 0) $permsql = substr($permsql, 0, -4); $info['forum'] = substr($info['forum'], 4, strlen($info['forum'])); if (strlen($info['forum']) > 0 and strlen($permsql) > 0) { $permsql .= ' AND '; } $awc_f_threads = $dbr->tableName('awc_f_threads'); $awc_f_forums = $dbr->tableName('awc_f_forums'); $awc_f_cats = $dbr->tableName('awc_f_cats'); $awc_f_posts = $dbr->tableName('awc_f_posts'); $sql = "SELECT {$awc_f_threads}.*, {$awc_f_forums}.f_name, {$awc_f_forums}.f_desc, {$awc_f_forums}.f_id, {$awc_f_forums}.f_parentid, {$awc_f_cats}.cat_name, {$awc_f_cats}.cat_id, {$awc_f_cats}.c_wiki_perm\n FROM {$awc_f_threads}\n INNER JOIN {$awc_f_forums}\n ON {$awc_f_threads}.t_forumid={$awc_f_forums}.f_id\n INNER JOIN {$awc_f_cats}\n ON {$awc_f_cats}.cat_id={$awc_f_forums}.f_parentid\n WHERE {$permsql} \n " . $info['forum'] . " AND {$awc_f_forums}.f_passworded = 0\n ORDER BY {$awc_f_threads}.t_lastdate DESC\n LIMIT " . $info['howmanythreads']; # die(">".$permsql); /* * GROUP BY $awc_f_threads.t_id * $sql = "SELECT $awc_f_threads.*, $awc_f_forums.f_name, $awc_f_forums.f_desc, $awc_f_forums.f_id, $awc_f_forums.parent_id, $awc_f_cats.cat_name, $awc_f_cats.cat_id, $awc_f_cats.c_wiki_perm FROM $awc_f_threads INNER JOIN $awc_f_forums ON $awc_f_threads.t_forumid=$awc_f_forums.f_id INNER JOIN $awc_f_cats ON $awc_f_cats.cat_id=$awc_f_forums.parent_id WHERE $permsql ".$info['forum']." AND $awc_f_forums.f_passworded = 0 GROUP BY $awc_f_threads.t_id ORDER BY $awc_f_threads.t_lastdate DESC LIMIT " . $info['howmanythreads']; $sql = $dbr->selectSQLText( array( 'awc_f_threads', 'awc_f_posts', 'awc_f_forums', 'awc_f_cats' ), array( "$awc_f_posts.*, $awc_f_threads.*, f_name, f_desc, f_id, parent_id, cat_name, cat_id" ), "$permsql ".$info['forum']." AND f_passworded = 0", __METHOD__, array('OFFSET' => 0, 'LIMIT' => $info['howmanythreads'], 'GROUP BY' => 't_id', 'ORDER BY' => 't_lastdate DESC, p_id DESC',), array( 'awc_f_posts' => array('JOIN','t_id=thread_id'), 'awc_f_forums' => array('JOIN','t_forumid=f_id'), 'awc_f_cats' => array('JOIN','parent_id=cat_id')) ); */ if (strlen($info['forum']) == 0 and strlen($permsql) == 0) { $sql = str_replace('WHERE', '', $sql); } // awc_pdie($sql); $html = null; $singleline = null; if ($res = $dbr->query($sql)) { while ($r = $dbr->fetchObject($res)) { $f_name = $r->f_name; $f_id = $r->f_id; $tTitle = awcsforum_funcs::awc_html_entity_decode($r->t_name); $str_len($tTitle) > $awcs_forum_config->cf_forumTag_titlecutoff ? $t_name = awcsforum_funcs::awc_shorten($tTitle, $awcs_forum_config->cf_forumTag_titlecutoff) . "..." : ($t_name = $tTitle); $tmp = $info['imgBeforeThreadTitle'] . ' ' . $info['txtBeforeThreadTitle'] . ' <a href="' . $awc['link'] . 'st/id' . $r->t_id . '">' . $t_name . '</a>'; $limit = null; #$total['TotalPosts'] = null; $send['t_topics'] = $r->t_topics; $send['t_id'] = $r->t_id; $send['t_name'] = $r->t_name; $send['link'] = $this->awc_url; $t = null; if ($r->t_ann == "1") { $t = get_awcsforum_word('thread_makeAnnouncement') . " "; } if ($r->t_status == "1") { $t = get_awcsforum_word('1indicator_locked') . " "; } if ($r->t_pin == "1") { $t = get_awcsforum_word('1indicator_sticky') . " "; } if ($r->t_pin == "1" and $r->t_status == "1") { $t = get_awcsforum_word('1indicator_lockSticky') . " "; } if ($r->t_poll == "1") { $t = get_awcsforum_word('1indicator_poll') . " "; } # $TotalPosts = $tmp['TotalPosts']; # $limit = GetLimit($TotalPosts); $thread_tools->link = $this->awc_url; $thread_tools->tID = $r->t_id; $thread_tools->total_posts = $r->t_topics; $limit = $thread_tools->GetThreadPostLimit(); //$limit = GetThreadPostLimit($send); $tmp = $t . $tmp . ' ' . $limit; # die($awc['link']); $html .= '<tr>'; $html .= '<td width="100%" ' . $info['classThreadtitle'] . ' style="' . $info['styleThreadtitle'] . '" nowrap>' . $tmp . '</td>'; $singleline .= '<tr><td width="100%" ' . $info['classThreadtitle'] . ' style="' . $info['styleThreadtitle'] . '" >'; $singleline .= $tmp; # $singleline .= ; if ($info['replies'] == "yes") { $html .= '<td ' . $info['classReplies'] . ' style="' . $info['styleReplies'] . '" nowrap>' . $r->t_topics . '</td>'; $singleline .= ' <SPAN STYLE="' . $info['styleReplies'] . '"> (' . $r->t_topics . ' ' . $info['wReplies'] . ') </SPAN>'; } if ($info['postcount'] == "yes") { $html .= '<td ' . $info['classViews'] . ' style="' . $info['styleViews'] . '" nowrap>' . $r->t_hits . '</td>'; $singleline .= ' <SPAN STYLE="' . $info['styleViews'] . '"> (' . $r->t_hits . ' ' . $info['wViews'] . ') </SPAN> '; } if ($info['date'] == "yes" || $info['users'] == "yes") { $u = $r->t_lastuser == '' ? $r->p_user : $r->t_lastuser; $uID = $r->t_lastuser == '' ? $r->p_userid : $r->t_lastuserid; #$u = $wgOut->parse("[[User:$u|$u]]"); $u = "<a href='" . $awc['link'] . "mem_profile/{$u}/{$uID}'>{$u}</a>"; $rplac = array('<p>', '</p>', chr(10)); $u = str_replace($rplac, '', $u); $u = $info['users'] == "yes" ? ' - ' . $u : null; $d = $info['date'] == "yes" ? '<a href="' . $awc['link'] . 'last_post/id' . $r->t_id . '"> ' . awcsforum_funcs::convert_date($r->t_lastdate, "s") . ' </a>' . ' ' : null; $html .= '<td ' . $info['classLastAction'] . ' style="' . $info['styleLastAction'] . '" nowrap>' . $d . $u . '</td>'; $singleline .= ' <SPAN STYLE="' . $info['styleLastAction'] . '"> (' . $d . $u . ') </SPAN><td></tr>'; } $html .= '</tr>'; } $dbr->freeResult($res); } if ($f_name == '') { return; } if ($info['header_both']) { $info['classThreadtitle'] = 'class="' . $info['header_classThreadtitle'] . '" id="' . $info['header_idThreadtitle'] . '"'; $info['classReplies'] = 'class="' . $info['header_classReplies'] . '" id="' . $info['header_idReplies'] . '"'; $info['classViews'] = 'class="' . $info['header_classViews'] . '" id="' . $info['header_diViews'] . '"'; $info['classLastAction'] = 'class="' . $info['header_classLastAction'] . '" id="' . $info['header_idLastAction'] . '"'; } elseif (!$info['header_id']) { $info['classThreadtitle'] = 'class="' . $info['header_classThreadtitle'] . '"'; $info['classReplies'] = 'class="' . $info['header_classReplies'] . '"'; $info['classViews'] = 'class="' . $info['header_classViews'] . '"'; $info['classLastAction'] = 'class="' . $info['header_classLastAction'] . '"'; } else { $info['classThreadtitle'] = 'id="' . $info['header_idThreadtitle'] . '"'; $info['classReplies'] = 'id="' . $info['header_idReplies'] . '"'; $info['classViews'] = 'id="' . $info['header_idViews'] . '"'; $info['classLastAction'] = 'id="' . $info['header_idLastAction'] . '"'; } $out = null; if ($info['showall'] == false) { $out = '<table width="' . $info['width'] . '" cellpadding="0" cellspacing="0"><tr><td nowrap><a href="' . $awc['link'] . 'sf/id' . $f_id . '">' . $f_name . '</a><hr></td></tr></table>'; } $out .= '<table width="' . $info['width'] . '" cellpadding="2" cellspacing="0">'; $out .= '<tr>'; $singleline_out = '<table width="' . $info['width'] . '" cellpadding="2" cellspacing="0"><tr>'; $out .= '<td width="75%" align="left" class="' . $info['header_classThreadtitle'] . '" style="' . $info['header_styleThreadtitle'] . '" nowrap>' . $info['wThreadtitle'] . '</td>'; if ($info['replies'] == "yes") { $out .= '<td width="1%" align="left" class="' . $info['header_classReplies'] . '" style="' . $info['header_styleReplies'] . '" nowrap>' . $info['wReplies'] . '</td>'; } if ($info['postcount'] == "yes") { $out .= '<td width="1%" align="left" class="' . $info['header_classViews'] . '" style="' . $info['header_styleViews'] . '" nowrap>' . $info['wViews'] . '</td>'; } #if($info['users'] == true) $out .= '<td width="1%" align="left" nowrap>'.get_awcsforum_word('forum_started_by').'</td>'; if ($info['date'] == "yes" || $info['users'] == "yes") { $out .= '<td width="20%" align="left" class="' . $info['header_classLastAction'] . '" style="' . $info['header_styleLastAction'] . '" nowrap>' . $info['wLastAction'] . '</td>'; } $out .= '</tr>'; $out .= $html; $out .= '</table><br />'; $singleline_out = '<table width="' . $info['width'] . '" cellpadding="2" cellspacing="0">'; $singleline_out .= $singleline; $singleline_out .= '</table><br />'; $out = str_replace(chr(10), '', $out); $singleline_out = str_replace(chr(10), '', $singleline_out); if ($info['inline']) { return $singleline_out; } return $out; }
function process_all_cats($cats, $children, $cat_link = null) { global $tplt; $outHTML = null; $word_guest = get_awcsforum_word('word_guest'); $word_header = array('topics' => get_awcsforum_word('word_topics'), 'replies' => get_awcsforum_word('word_replies'), 'forum_last_post' => get_awcsforum_word('forum_last_post')); foreach ($cats as $cat_id => $cat_data) { $html = $tplt->phase('', '', 'cat_open_table'); $info['AdminEdit'] = UserPerm == 10 ? '<a href="' . awc_url . 'admin/cat/get_cat_id_edit/' . $cat_data['id'] . '">*</a> | ' : null; $info['title'] = '<a href="' . awc_url . 'sc/id' . $cat_data['id'] . '/' . rawurlencode(str_replace('/', ' ', $cat_data['name'])) . $this->html_ext . '">' . $cat_data['name'] . '</a>'; if ($cat_link != null) { $info['title'] = $cat_data['name']; } $html .= $tplt->phase($word_header, $info, 'cat_header'); foreach ($children as $forum_id => $c) { if ($c['f_parentid'] == $cat_id) { if ($this->show_guest_ip == '0' and $c['f_lastuserid'] == '0' and UserPerm < 2) { $c['f_lastuser'] = $word_guest; } $c['last_title'] = awcsforum_funcs::awc_html_entity_decode($c['f_lasttitle']); $last_title = $c['last_title']; if (isset($c['last_title'][$this->MaxTitleCol])) { $c['last_title'] = awcsforum_funcs::awc_shorten($c['last_title'], $this->MaxTitleCol) . "..."; } $c['last_date'] = $c['f_lastdate'] != '0000-00-00 00:00:00' ? awcsforum_funcs::convert_date($c['f_lastdate'], "s") : ' '; $c['mem_link'] = awcsforum_funcs::awcforum_url('mem_profile/' . $c['f_lastuser'] . '/' . $c['f_lastuserid']); $c['AdminEditLink'] = UserPerm == 10 ? '<a href="' . awc_url . 'admin/forum/get_forum_id_edit/' . $c['f_id'] . '">*</a> | ' : null; $c['forum_link'] = awc_url . 'sf/id' . $c['f_id'] . '/' . rawurlencode(str_replace('/', ' ', $c['f_name'])) . $this->html_ext; # die($last_title); $c['last_thread_link'] = awc_url . 'last_post/id' . $c['f_threadid'] . '/' . rawurlencode(str_replace('/', ' ', $last_title)) . $this->html_ext; $html .= $tplt->phase('', $c, 'cat_list_forums_rows'); } } $html .= $tplt->phase('', '', 'cat_close_table'); $outHTML .= $html; } $tplt->kill('cat_open_table'); $tplt->kill('cat_close_table'); $tplt->kill('cat_list_forums_rows'); unset($word_header, $c, $info); return $outHTML; }