safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip_add'] ) ) ) ); else $ip_add = ""; if( isset( $_REQUEST['ip'] ) ) $ip = htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ); else $ip = ""; if( isset( $_REQUEST['id'] ) ) $id = intval( $_REQUEST['id'] ); else $id = 0; if( $action == "add" ) { if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} include_once SYSTEM_DIR . '/classes/parse.class.php'; $parse = new ParseFilter( ); $parse->safe_mode = true; $banned_descr = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['descr'] ), false ) ); if( (trim( $_POST['date'] ) == "") or (($_POST['date'] = strtotime( $_POST['date'] )) === - 1) ) { $this_time = 0; $days = 0; } else { $this_time = $_POST['date']; $days = 1; } if( ! $ip_add ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );} $row = $db->super_query( "SELECT id FROM " . PREFIX . "_banned WHERE ip ='$ip_add'" ); if ( $row['id'] ) {msg( "error", $lang['ip_error_1'], $lang['ip_error_1'], "$PHP_SELF?mod=blockip" );} $db->query( "INSERT INTO " . USERPREFIX . "_banned (descr, date, days, ip) values ('$banned_descr', '$this_time', '$days', '$ip_add')" ); $cache->delete('banned.php'); } elseif( $action == "delete" ) { if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {die( "Hacking attempt! User not found" );} if( ! $id ) {msg( "error", $lang['ip_error'], $lang['ip_error'], "$PHP_SELF?mod=blockip" );} $db->query( "DELETE FROM " . USERPREFIX . "_banned WHERE id = '$id'" ); $cache->delete('banned.php' ); } echoheader( "", "" ); echo <<
{$lang['ip_example']}
{$lang['ip_type']}
{$lang['ban_date']}
{$lang['ban_descr']} {$lang['ip_add_descr']}
 
HTML; echo <<
HTML; $db->query( "SELECT * FROM " . USERPREFIX . "_banned WHERE users_id = '0' ORDER BY id DESC" ); $i = 0; while ( $row = $db->get_row() ) { $i ++; if( $row['date'] ) $endban = langdate( "j M Y H:i", $row['date'] ); else $endban = $lang['banned_info']; echo " "; } if( $i == 0 ) { echo ""; } echo <<
  {$lang['ban_date']} {$lang['ban_descr']}  
{$row['ip']} {$endban} " . stripslashes( $row['descr'] ) . " [{$lang['ip_unblock']}]


$lang[ip_empty]

HTML; echofooter(); ?>