warn.php
来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 694 行 · 第 1/2 页
PHP
694 行
else { if ( $warn_level <= $this->ipsclass->vars['warn_min'] ) { $err = 1; } } if ( $err == 1 ) { $this->ipsclass->Error( array( LEVEL => '1', MSG => 'no_warn_max' ) ); } } //----------------------------------------- // Check security fang //----------------------------------------- if ( $this->ipsclass->input['key'] != $this->ipsclass->return_md5_check() ) { $this->ipsclass->Error( array( LEVEL => '1', MSG => 'del_post') ); } //----------------------------------------- // As Celine Dion once squawked, "Show me the reason" //----------------------------------------- if ( trim($this->ipsclass->input['reason']) == "" ) { $this->show_form('we_no_reason'); return; } //----------------------------------------- // Plussy - minussy? //----------------------------------------- $save['wlog_type'] = ( $this->ipsclass->input['level'] == 'add' ) ? 'neg' : 'pos'; $save['wlog_date'] = time(); //----------------------------------------- // Contacting the member? //----------------------------------------- if ( $this->ipsclass->input['contact'] != "" ) { $save['wlog_contact'] = $this->ipsclass->input['contactmethod']; $save['wlog_contact_content'] = "<subject>{$this->ipsclass->input['subject']}</subject><content>{$this->ipsclass->input['contact']}</content>"; if ( trim($this->ipsclass->input['subject']) == "" ) { $this->show_form('we_no_subject'); return; } if ( $this->ipsclass->input['contactmethod'] == 'email' ) { //----------------------------------------- // Send the email //----------------------------------------- $this->email->get_template("email_member"); $this->email->build_message( array( 'MESSAGE' => str_replace( "<br>", "\n", str_replace( "\r", "", $this->ipsclass->input['contact'] ) ), 'MEMBER_NAME' => $this->warn_member['members_display_name'], 'FROM_NAME' => $this->ipsclass->member['members_display_name'] ) ); $this->email->subject = $this->ipsclass->input['subject']; $this->email->to = $this->warn_member['email']; $this->email->from = $this->ipsclass->member['email']; $this->email->send_mail(); } else { //----------------------------------------- // PM :o //----------------------------------------- require_once( ROOT_PATH.'sources/lib/func_msg.php' ); $this->lib = new func_msg(); $this->lib->ipsclass =& $this->ipsclass; $this->lib->init(); $this->lib->to_by_id = $this->warn_member['id']; $this->lib->from_member = $this->ipsclass->member; $this->lib->msg_title = $this->ipsclass->input['subject']; $this->lib->msg_post = $this->ipsclass->remove_tags($this->ipsclass->input['contact']); $this->lib->force_pm = 1; $this->lib->send_pm(); if ( $this->lib->error ) { print $this->error; exit(); } } } //----------------------------------------- // Right - is we banned or wha? //----------------------------------------- $restrict_post = ''; $mod_queue = ''; $susp = ''; $save['wlog_notes'] = "<content>{$this->ipsclass->input['reason']}</content>"; $save['wlog_notes'] .= "<mod>{$this->ipsclass->input['mod_value']},{$this->ipsclass->input['mod_unit']},{$this->ipsclass->input['mod_indef']}</mod>"; $save['wlog_notes'] .= "<post>{$this->ipsclass->input['post_value']},{$this->ipsclass->input['post_unit']},{$this->ipsclass->input['post_indef']} </post>"; $save['wlog_notes'] .= "<susp>{$this->ipsclass->input['susp_value']},{$this->ipsclass->input['susp_unit']}</susp>"; if ( $this->ipsclass->input['mod_indef'] == 1 ) { $mod_queue = 1; } elseif ( $this->ipsclass->input['mod_value'] > 0 ) { $mod_queue = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['mod_value']), 'unit' => $this->ipsclass->input['mod_unit'] ) ); } if ( $this->ipsclass->input['post_indef'] == 1 ) { $restrict_post = 1; } elseif ( $this->ipsclass->input['post_value'] > 0 ) { $restrict_post = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['post_value']), 'unit' => $this->ipsclass->input['post_unit'] ) ); } if ( $this->ipsclass->input['susp_value'] > 0 ) { $susp = $this->ipsclass->hdl_ban_line( array( 'timespan' => intval($this->ipsclass->input['susp_value']), 'unit' => $this->ipsclass->input['susp_unit'] ) ); } $save['wlog_mid'] = $this->warn_member['id']; $save['wlog_addedby'] = $this->ipsclass->member['id']; //----------------------------------------- // Enter into warn loggy poos (eeew - poo) //----------------------------------------- $this->ipsclass->DB->do_insert( 'warn_logs', $save ); //----------------------------------------- // Update member //----------------------------------------- $warn_level = intval($this->warn_member['warn_level']); if ( $this->ipsclass->input['level'] == 'add' ) { $warn_level++; } else { $warn_level--; } if ( $warn_level > $this->ipsclass->vars['warn_max'] ) { $warn_level = $this->ipsclass->vars['warn_max']; } if ( $warn_level < intval($this->ipsclass->vars['warn_min']) ) { $warn_level = 0; } $this->ipsclass->DB->do_update( 'members', array ( 'mod_posts' => $mod_queue, 'restrict_post' => $restrict_post, 'temp_ban' => $susp, 'warn_level' => $warn_level, 'warn_lastwarn' => time(), ) , "id={$this->warn_member['id']}" ); //----------------------------------------- // Now what? Show success screen, that's what!! //----------------------------------------- $this->ipsclass->lang['w_done_te'] = sprintf( $this->ipsclass->lang['w_done_te'], $this->warn_member['members_display_name'] ); $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_success(); // Did we have a topic? eh! eh!! EH! $tid = intval($this->ipsclass->input['t']); if ( $tid > 0 ) { $this->ipsclass->DB->cache_add_query( 'warn_get_forum', array( 'tid' => $tid ) ); $this->ipsclass->DB->cache_exec_query(); $topic = $this->ipsclass->DB->fetch_row(); $this->output = str_replace( "<!--IBF.FORUM_TOPIC-->", $this->ipsclass->compiled_templates['skin_mod']->warn_success_forum( $topic['id'], $topic['name'], $topic['tid'], $topic['title'], intval($this->ipsclass->input['st']) ), $this->output ); } } /*-------------------------------------------------------------------------*/ // Show form /*-------------------------------------------------------------------------*/ function show_form($errors="") { if ( $this->type == 'member' ) { $this->ipsclass->Error( array( LEVEL => 1, MSG => 'no_permission') ); } $key = $this->ipsclass->return_md5_check(); if ( $errors != "" ) { $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_errors($this->ipsclass->lang[$errors]); } $type = array( 'minus' => "", 'add' => "" ); if ( $this->ipsclass->input['type'] == 'minus' ) { $type['minus'] = 'checked="checked"'; } else { $type['add'] = 'checked="checked"'; } $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_header( $this->warn_member['id'], $this->warn_member['members_display_name'], intval($this->warn_member['warn_level']), $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max'], $key, intval($this->ipsclass->input['t']), intval($this->ipsclass->input['st']), $type ); if ( $this->can_mod_q ) { $mod_tick = 0; $mod_arr = array(); if ( $this->warn_member['mod_posts'] == 1 ) { $mod_tick = 'checked'; } elseif ($this->warn_member['mod_posts'] > 0) { $mod_arr = $this->ipsclass->hdl_ban_line($this->warn_member['mod_posts'] ); $hours = ceil( ( $mod_arr['date_end'] - time() ) / 3600 ); if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) ) { $mod_arr['days'] = 'selected="selected"'; $mod_arr['timespan'] = $hours / 24; } else { $mod_arr['hours'] = 'selected="selected"'; $mod_arr['timespan'] = $hours; } $mod_extra = $this->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place(); } $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_mod_posts($mod_tick, $mod_arr, $mod_extra); } if ( $this->can_rem_post ) { $post_tick = 0; $post_arr = array(); if ( $this->warn_member['restrict_post'] == 1 ) { $post_tick = 'checked'; } else if ( $this->warn_member['restrict_post'] > 0 ) { $post_arr = $this->ipsclass->hdl_ban_line( $this->warn_member['restrict_post'] ); $hours = ceil( ( $post_arr['date_end'] - time() ) / 3600 ); if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) ) { $post_arr['days'] = 'selected="selected"'; $post_arr['timespan'] = $hours / 24; } else { $post_arr['hours'] = 'selected="selected"'; $post_arr['timespan'] = $hours; } $post_extra = $this->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place(); } $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_rem_posts($post_tick, $post_arr, $post_extra); } if ( $this->can_ban ) { $ban_arr = array(); if ( $this->warn_member['temp_ban'] ) { $ban_arr = $this->ipsclass->hdl_ban_line( $this->warn_member['temp_ban'] ); $hours = ceil( ( $ban_arr['date_end'] - time() ) / 3600 ); if ( $hours > 24 and ( ($hours / 24) == ceil($hours / 24) ) ) { $ban_arr['days'] = 'selected="selected"'; $ban_arr['timespan'] = $hours / 24; } else { $ban_arr['hours'] = 'selected="selected"'; $ban_arr['timespan'] = $hours; } $post_extra = $this->ipsclass->compiled_templates['skin_mod']->warn_restricition_in_place(); } $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_suspend($ban_arr, $ban_extra); } $this->output .= $this->ipsclass->compiled_templates['skin_mod']->warn_footer( $this->warn_member['members_disable_pm'] ); } }?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?