topics.php
来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 1,929 行 · 第 1/5 页
PHP
1,929 行
$member['warn_img'] = '<{WARN_0}>'; $member['warn_percent'] = 0; } else if ( $member['warn_level'] >= $this->ipsclass->vars['warn_max'] ) { $member['warn_img'] = '<{WARN_5}>'; $member['warn_percent'] = 100; } else { $member['warn_percent'] = $member['warn_level'] ? sprintf( "%.0f", ( ($member['warn_level'] / $this->ipsclass->vars['warn_max']) * 100) ) : 0; if ( $member['warn_percent'] > 100 ) { $member['warn_percent'] = 100; } if ( $member['warn_percent'] >= 81 ) { $member['warn_img'] = '<{WARN_5}>'; } else if ( $member['warn_percent'] >= 61 ) { $member['warn_img'] = '<{WARN_4}>'; } else if ( $member['warn_percent'] >= 41 ) { $member['warn_img'] = '<{WARN_3}>'; } else if ( $member['warn_percent'] >= 21 ) { $member['warn_img'] = '<{WARN_2}>'; } else if ( $member['warn_percent'] >= 1 ) { $member['warn_img'] = '<{WARN_1}>'; } else { $member['warn_img'] = '<{WARN_0}>'; } } if ( $member['warn_percent'] < 1 ) { $member['warn_percent'] = 0; } $member['warn_text'] = $this->ipsclass->compiled_templates['skin_topic']->warn_level_warn($member['id'], $member['warn_percent'] ); } else { // Ratings mode.. $member['warn_text'] = $this->ipsclass->lang['tt_rating']; $member['warn_img'] = $this->ipsclass->compiled_templates['skin_topic']->warn_level_rating($member['id'], $member['warn_level'], $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max']); } if ( $this->ipsclass->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn'] or $this->ipsclass->member['g_is_supmod'] == 1 ) { $member['warn_add'] = "<a href='{$this->ipsclass->base_url}act=warn&type=add&mid={$member['id']}&t={$this->topic['tid']}&st=".intval($this->ipsclass->input['st'])."' title='{$this->ipsclass->lang['tt_warn_add']}'><{WARN_ADD}></a>"; $member['warn_minus'] = "<a href='{$this->ipsclass->base_url}act=warn&type=minus&mid={$member['id']}&t={$this->topic['tid']}&st=".intval($this->ipsclass->input['st'])."' title='{$this->ipsclass->lang['tt_warn_minus']}'><{WARN_MINUS}></a>"; } } } //----------------------------------------- // Profile fields stuff //----------------------------------------- if ( $this->ipsclass->vars['custom_profile_topic'] == 1 ) { if ( $this->custom_fields ) { $this->custom_fields->member_data = $member; $this->custom_fields->init_data(); $this->custom_fields->parse_to_view( 1 ); if ( count( $this->custom_fields->out_fields ) ) { foreach( $this->custom_fields->out_fields as $i => $data ) { if ( $data ) { $member['custom_fields'] .= "\n".$this->custom_fields->method_format_field_for_topic_view( $i ); } } } } } return $member; } /*-------------------------------------------------------------------------*/ // Render the delete button /*-------------------------------------------------------------------------*/ function delete_button($post_id, $poster) { if ($this->ipsclass->member['id'] == "" or $this->ipsclass->member['id'] == 0) { return ""; } $button = $this->ipsclass->compiled_templates['skin_topic']->button_delete($this->forum['id'],$this->topic['tid'],$post_id,$this->md5_check ); if ($this->ipsclass->member['g_is_supmod']) return $button; if ($this->moderator['delete_post']) return $button; if ($poster['id'] == $this->ipsclass->member['id'] and ($this->ipsclass->member['g_delete_own_posts'])) return $button; return ""; } /*-------------------------------------------------------------------------*/ // Render the edit button /*-------------------------------------------------------------------------*/ function edit_button($post_id, $poster, $post_date) { if ($this->ipsclass->member['id'] == "" or $this->ipsclass->member['id'] == 0) { return ""; } $button = $this->ipsclass->compiled_templates['skin_topic']->button_edit( $this->forum['id'],$this->topic['tid'],$post_id ); if ($this->ipsclass->member['g_is_supmod']) return $button; if ($this->moderator['edit_post']) return $button; if ($poster['id'] == $this->ipsclass->member['id'] and ($this->ipsclass->member['g_edit_posts'])) { // Have we set a time limit? if ($this->ipsclass->member['g_edit_cutoff'] > 0) { if ( $post_date > ( time() - ( intval($this->ipsclass->member['g_edit_cutoff']) * 60 ) ) ) { return $button; } else { return ""; } } else { return $button; } } return ""; } /*-------------------------------------------------------------------------*/ // Render the reply button /*-------------------------------------------------------------------------*/ function reply_button() { if ($this->topic['state'] == 'closed') { // Do we have the ability to post in // closed topics? if ($this->ipsclass->member['g_post_closed'] == 1) { return $this->ipsclass->compiled_templates['skin_topic']->button_posting( "{$this->ipsclass->base_url}act=post&do=reply_post&f=".$this->forum['id']."&t=".$this->topic['tid'], "<{A_LOCKED_B}>" ); } else { return "<{A_LOCKED_B}>"; } } if ( $this->topic['state'] == 'moved' ) { return "<{A_MOVED_B}>"; } return $this->ipsclass->compiled_templates['skin_topic']->button_posting( "{$this->ipsclass->base_url}act=post&do=reply_post&f=".$this->forum['id']."&t=".$this->topic['tid'], "<{A_REPLY}>" ); } /*-------------------------------------------------------------------------*/ // Render the IP address /*-------------------------------------------------------------------------*/ function view_ip($row, $poster) { if ($this->ipsclass->member['g_is_supmod'] != 1 && $this->moderator['view_ip'] != 1) { return ""; } else { $row['ip_address'] = $poster['mgroup'] == $this->ipsclass->vars['admin_group'] ? $this->ipsclass->compiled_templates['skin_topic']->ip_admin_hide() : $this->ipsclass->compiled_templates['skin_topic']->ip_admin_show( $row['ip_address'] ); return $this->ipsclass->compiled_templates['skin_topic']->ip_show($row['ip_address']); } } /*-------------------------------------------------------------------------*/ // Render the topic multi-moderation /*-------------------------------------------------------------------------*/ function multi_moderation() { $mm_html = ""; $mm_array = $this->ipsclass->get_multimod( $this->forum['id'] ); //----------------------------------------- // Print and show //----------------------------------------- if ( is_array( $mm_array ) and count( $mm_array ) ) { foreach( $mm_array as $m ) { $mm_html .= $this->ipsclass->compiled_templates['skin_topic']->mm_entry( $m[0], $m[1] ); } } if ( $mm_html ) { $mm_html = $this->ipsclass->compiled_templates['skin_topic']->mm_start($this->topic['tid']) . $mm_html . $this->ipsclass->compiled_templates['skin_topic']->mm_end(); } return $mm_html; } /*-------------------------------------------------------------------------*/ // Render the moderator links /*-------------------------------------------------------------------------*/ function moderation_panel() { $mod_links = ""; if (!isset($this->ipsclass->member['id'])) return ""; $skcusgej = 0; if ($this->ipsclass->member['id'] == $this->topic['starter_id']) { $skcusgej = 1; } if ($this->ipsclass->member['g_is_supmod'] == 1) { $skcusgej = 1; } if ($this->moderator['mid'] != "") { $skcusgej = 1; } if ($skcusgej == 0) { return ""; } //----------------------------------------- // Add on approve/unapprove topic fing //----------------------------------------- if ( $this->ipsclass->can_queue_posts( $this->forum['id'] ) ) { if ( $this->topic['approved'] != 1 ) { $mod_links .= $this->ipsclass->compiled_templates['skin_topic']->mod_wrapper('topic_approve', $this->ipsclass->lang[ 'cpt_approvet' ]); } else { $mod_links .= $this->ipsclass->compiled_templates['skin_topic']->mod_wrapper('topic_unapprove', $this->ipsclass->lang[ 'cpt_unapprovet' ]); } } $actions = array( 'MOVE_TOPIC', 'CLOSE_TOPIC', 'OPEN_TOPIC', 'DELETE_TOPIC', 'EDIT_TOPIC', 'PIN_TOPIC', 'UNPIN_TOPIC', 'MERGE_TOPIC', 'UNSUBBIT' ); foreach( $actions as $key ) { if ($this->ipsclass->member['g_is_supmod']) { $mod_links .= $this->append_link($key); } elseif ($this->moderator['mid']) { if ($key == 'MERGE_TOPIC' or $key == 'SPLIT_TOPIC') { if ($this->moderator['split_merge'] == 1) { $mod_links .= $this->append_link($key); } } else { if ($this->moderator[ strtolower($key) ]) { $mod_links .= $this->append_link($key); } } } elseif ($key == 'OPEN_TOPIC' or $key == 'CLOSE_TOPIC') { if ($this->ipsclass->member['g_open_close_posts']) { $mod_links .= $this->append_link($key); } } elseif ($key == 'DELETE_TOPIC') { if ($this->ipsclass->member['g_delete_own_topics']) { $mod_links .= $this->append_link($key); } } } if ($this->ipsclass->member['g_access_cp'] == 1) { $mod_links .= $this->append_link('TOPIC_HISTORY'); } if ($mod_links != "") { return $this->ipsclass->compiled_templates['skin_topic']->Mod_Panel($mod_links, $this->forum['id'], $this->topic['tid'], $this->md5_check); } } /*-------------------------------------------------------------------------*/ // Append mod links /*-------------------------------------------------------------------------*/ function append_link( $key="" ) { if ($key == "") return ""; if ($this->topic['state'] == 'open' and $key == 'OPEN_TOPIC') return ""; if ($this->topic['state'] == 'closed' and $key == 'CLOSE_TOPIC') return ""; if ($this->topic['state'] == 'moved' and ($key == 'CLOSE_TOPIC' or $key == 'MOVE_TOPIC')) return ""; if ($this->topic['pinned'] == 1 and $key == 'PIN_TOPIC') return ""; if ($this->topic['pinned'] == 0 and $key == 'UNPIN_TOPIC') return ""; ++$this->colspan; return $this->ipsclass->compiled_templates['skin_topic']->mod_wrapper($this->mod_action[$key], $this->ipsclass->lang[ $key ]); } /*-------------------------------------------------------------------------*/ // Process and parse the poll /*-------------------------------------------------------------------------*/ function parse_poll() { $html = ""; $check = 0; $poll_footer = ""; $this->ipsclass->load_template('skin_poll'); //----------------------------------------- // Get the poll information... //----------------------------------------- $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'polls', 'where' => "tid=".$this->topic['tid'] ) ); $this->ipsclass->DB->simple_exec(); $poll_data = $this->ipsclass->DB->fetch_row(); //----------------------------------------- // check we have a poll //----------------------------------------- if ( ! $poll_data['pid'] ) { return;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?