Admin: Warning Functions | > Module written by Matt Mecham | > Date started: 23rd April 2003 | | > Module Version Number: 1.0.0 +-------------------------------------------------------------------------- */ if ( ! defined( 'IN_ACP' ) ) { print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; exit(); } class ad_warn { var $base_url; function auto_run() { global $ibforums, $DB, $std, $ibforums; //----------------------------------------- // Kill globals - globals bad, Homer good. //----------------------------------------- $tmp_in = array_merge( $_GET, $_POST, $_COOKIE ); foreach ( $tmp_in as $k => $v ) { unset($$k); } $ibforums->admin->nav[] = array( 'act=warn', 'Warning Set-up' ); $ibforums->admin->page_detail = "This section will allow you to modify your warning parameters"; $ibforums->admin->page_title = "Member Warning Set-up"; //----------------------------------------- switch($ibforums->input['code']) { //----------------------------------------- default: $this->overview(); break; } } //----------------------------------------- // // Overview: show um.. overview. // //----------------------------------------- function overview() { global $ibforums, $DB, $std, $ibforums; $unit_map = array( 'd' => 'Day(s)' , 'h' => 'Hour(s)', ); $ibforums->adskin->td_header[] = array( "Warn Level" , "20%" ); $ibforums->adskin->td_header[] = array( "Details" , "80%" ); $ibforums->html .= $ibforums->adskin->start_table( "Currently active Auto tasks" ); $warns = array(); $DB->query("SELECT * from ibf_warn_settings ORDER BY warn_level"); while ( $r = $DB->fetch_row() ) { $warns[ $r['warn_level'] ][] = $r; } if ( count($warns) > 0 ) { foreach( $warns as $id => $data ) { $tmp = ""; $ban = ""; $mod = ""; $nop = ""; if ( $data['warn_ban'] != "" ) { if ( $data['warn_ban'] == 'p' ) { $ban = "Permanent Ban"; } else { list ($val, $unit) = explode( ',', $data['warn_ban'] ); $ban = "Temporary suspension for ".$val." ".$unit_map[$unit]; } } if ( $data['warn_modq'] != "" ) { if ( $data['warn_modq'] == 'p' ) { $mod = "Permanent post moderation"; } else { list ($val, $unit) = explode( ',', $data['warn_modq'] ); $mod = "Require post moderation for ".$val." ".$unit_map[$unit]; } } if ( $data['warn_nopost'] != "" ) { if ( $data['warn_nopost'] == 'p' ) { $nop = "Permanent post banning"; } else { list ($val, $unit) = explode( ',', $data['warn_nopost'] ); $nop = "Post ban for ".$val." ".$unit_map[$unit]; } } $html = ""; if ( $ban != "" ) { $html .= ""; } if ( $mod != "" ) { $html .= ""; } if ( $nop != "" ) { $html .= ""; } $html .= "
Ban $ban Edit Remove
Post Moderation $mod Edit Remove
Post Ban $nop Edit Remove
"; $ibforums->html .= $ibforums->adskin->add_td_row( array( "{$warns['warn_level']}", $html ) ); } } $ibforums->html .= $ibforums->adskin->add_td_basic( 'Add new auto task', 'center', 'pformstrip' ); $ibforums->html .= $ibforums->adskin->end_table(); //----------------------------------------- //------------------------------- $ibforums->admin->output(); } } ?>