View file bannick.php

File size: 1.27Kb
<?php
// MyForum - Сервис форумов 
// Copyright © A'lex и KO. All Rights Reserved
// По всем вопросам обращайтесь на email [email protected] или в асю 376920428

include 'config.php';
include 'functions.php';

if(!$moder) {exit;}

$r = mysql_query("SELECT * FROM {$table}{$f}_bannick");
for($i=0; $i<mysql_numrows($r); $i++) {
	$a=mysql_fetch_array($r);
	if (!lastdate($a['Date'], $date)) {mysql_query("DELETE FROM {$table}{$f}_bannick WHERE Nick='{$a['Nick']}'");}
}
$r = mysql_query("SELECT * FROM {$table}{$f}_banip");
for($i=0; $i<mysql_numrows($r); $i++) {
	$a=mysql_fetch_array($r);
	if (!lastdate($a['Date'], $date)) {mysql_query("DELETE FROM {$table}{$f}_banip WHERE IP='{$a['IP']}' AND UserAgent='{$a['UserAgent']}'");}
}

if($mode=='del') {
	if (mysql_query("DELETE FROM {$table}{$f}_bannick WHERE Nick='$nick'")) {$body='Удалено!<br/>';}
}

$r = mysql_query("SELECT * FROM {$table}{$f}_bannick");
for($i=0; $i<mysql_numrows($r); $i++) {
	$a=mysql_fetch_array($r);
	$bnick=$a['Nick'];
	$body.="$bnick<a href=\"bannick.php?mode=del&nick=$bnick&f=$f$isid\">x</a><br/>\n";
}
displaytext('Бан по имени', $Banner, $body, "<a href=\"index.php?f=$f$isid\">Назад</a>", $w);

mysql_close($lnk);
?>