А някой искаше и скрипт за бан на акаунт сас причина и време ето го и него
Code:<script language="JavaScript" type="text/JavaScript"> function validate(form) { if (bancform.account.value =="") { bancform.account.focus(); alert("Напишете акаунта, който искате да баннете."); return false; } if (bancform.reason.value =="") { bancform.reason.focus(); alert("Напишете причина за бана."); return false; } if (bancform.who.value =="") { bancform.who.focus(); alert("Напишете от кого е бана."); return false; } if (bancform.bday.value =="") { bancform.bday.focus(); alert("Напишете броя на дните."); return false; } } function numberText(event, sender) { var e = window.event ? window.event : event; var key = document.all ? e.keyCode : e.charCode; if (!key) return true; key = String.fromCharCode(key); if (!key.match(/[0-9]/)) return false; } function remove_ban_confirmation(thetext){ ht = document.getElementsByTagName('html'); if (thetext=='undefined') { thetext='Are you sure?'; } ht[0].style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)'; if (confirm(thetext)){ return true; } else { ht[0].style.filter = ''; return false; } } function amisure() { return remove_ban_confirmation('Сигурни ли сте, че искате да премахнете този бан?'); } </script> <table width=200 cellpadding=2 cellspacing=0 class=text><Br> <form action='' name=bancform method=post> <tr> <td width=100><font alignt="center" size="3" color=white face="Verdana" style="font-size: 10pt"><b>Акаунт:</b></font></td> <td width=100><input type=text class=input name=account></td> </tr> <tr> <td width=100><font alignt="center" size="3" color=white face="Verdana" style="font-size: 10pt"><b>Причина:</b></font></td> <td width=100><input type=text maxlenght=50 class=input name=reason></td> </tr> <tr> <td width=100><font alignt="center" size="3" color=white face="Verdana" style="font-size: 10pt"><b>Баннат от:</b></font></td> <td width=100><input type=text maxlenght=50 class=input name=who></td> </tr> <tr> <td width=100><font alignt="center" size="3" color=white face="Verdana" style="font-size: 10pt"><b>Време на бана(дни):</b></font></td> <td width=100><input type=text class=input name=bday onkeypress="return numberText(event, this)"> <input type=hidden name=bancharacter> </td> </tr> <tr> <td width=100> </td> <td width=100> </td> </tr> <tr> <td width=100><input type=submit value='Ban Account' class=button onClick="return validate(document.form);"></td> <td width=100> </td> </tr> </form> </table> <div align="center"> <table width=530 border="0" cellspacing="0" cellpadding="0"> <tr> <td> <font size="2" face="Verdana" style="font-size: 10pt"> <center><br><? if(isset($_POST[bancharacter])){ require"config.php"; $username=clean_var(stripslashes($_SESSION['user_admin'])); $password=clean_var(stripslashes($_SESSION['user_adminpass'])); $account=clean_var(stripslashes($_POST['account'])); $reason=stripslashes($_POST['reason']); $bday=clean_var(stripslashes($_POST['bday'])); $who=clean_var(stripslashes($_POST['who'])); if(empty($account)){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Напишете акаунта, който искате да баннете.</b></font>"; } elseif(empty($reason)){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Напишете причина за бана.</b></font>"; } elseif(empty($who)){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Напишете от кого е бана.</b></font>"; } elseif(empty($bday)){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Напишете броя на дните.</b></font>"; } If($error != 1){ $che=mssql_num_rows(mssql_query("select memb___id from memb_info where memb___id='$account'")); if($che!=1){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Акаунтът $account не съществува.</b></font>";} $char_check=mssql_num_rows(mssql_query("select memb___id from memb_info where memb___id='$account' and bloc_code='1'")); if($char_check>0){ $error='1'; echo"<font color=red style='font-size: 10pt; font-weight: 700'><b>Акаунтът $account е вече баннат.</b></font>";} If($error != 1){ $time1=time(); $time2=$time1+(24*60*60*$bday); $date1=date("m/d/Y G:i:s",$time1); $date2=date("m/d/Y G:i:s",$time2); $run1=mssql_query("insert into banacc (account,bantime,unbantime,vbantime,vunbantime,reason,bdays,who) VALUES ('$account','$time1','$time2','$date1','$date2','$reason','$bday','$who')"); $run=mssql_query("update memb_info set bloc_code='1' where memb___id='$account'"); echo"<font color=green style='font-size: 10pt; font-weight: 700'><b>Акаунтът $account е баннат за $bday ден(дни). Проверете бан листа за всеки случай.</b></font>"; }} } ?> <?php if (isset($_POST["account_unban"])){ $account= stripslashes($_POST['account_unban']); $run1=mssql_query("delete from banacc where account='$account'"); $run2=mssql_query("update memb_info set bloc_code='0' where memb___id='$account'"); echo "<center><br><br><table width=400 border=0 cellspacing=0 cellpadding=0> <font alignt=center color=green size=3 face=Verdana style=font-size: 10pt><b>Банът на акаунта $account е премахнат успешно.</font> </table></center>"; } ?> <? require("config.php"); $time=time(); $run=mssql_query("update banacc set bantime='$time'"); $query=mssql_query("select account,bantime,unbantime from banacc"); while($row = mssql_fetch_row($query)) { if($row[1]>=$row[2]){ $run1=mssql_query("delete from banacc where account='$row[0]'"); $run2=mssql_query("update memb_info set bloc_code='0' where memb___id='$row[0]'"); } } ?> <? echo '<TABLE border=0 cellPadding=2 cellSpacing=2> <br><span class="normal_text"><b>Баннати акаунти</b></span> <br></br> <table id="mutable" class="alt5" height=30 border="1" bordercolor="333333" cellpadding="0" cellspacing="1" > <tr> <td align=left><font color=#666666><center>ID</center></font></td> <td align=left><font color=#666666><center>Акаунт</center></font></td> <td align=left><font color=#666666><center>Баннат на</center></font></td> <td align=left><font color=#666666><center>Време</center></font></td> <td align=left><font color=#666666><center>Оставащо време</center></font></td> <td align=left ><font color=#666666><center>Причина</center></font></td> <td align=left><font color=#666666><center>Баннат от</center></font></td> <td align=left><font color=#666666><center>Махни бана</center></font></td> </tr>'; require"config.php"; $ban=mssql_query("select memb___id from memb_info where bloc_code='1'"); for($i=0;$i<mssql_num_rows($ban);++$i){ $row=mssql_fetch_row($ban); $row1=mssql_fetch_row(mssql_query("select account,vbantime,vunbantime,reason,bdays,bantime,unbantime,who from banacc where account='$row[0]'")); $nr=$i+1; $rem=$row1[6]-$row1[5]; $ren=($rem/60/60); $re=explode('.',$ren,'2'); $character_table_edit = "<table width='40' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='85'><form action='' method='post' name='character_edit' id='character_edit'> <input name='Edit' type='submit' id='Edit' value='Unban' class='button' onClick='return amisure();'> <input name='account_unban' type='hidden' id='account_unban' value=$row[0]> </form></td> </tr> </table> "; echo "<tr> <td align=left><font size=1 color=#666666><b><center>$nr</center></b></font></td> <td align=left><font size=1 color=#FFFFFF><b><center>$row[0]</center></b></a></div></td> <td align=left><font size=1 color=#FFFFFF><b><center>$row1[1]</center></b></td> <td align=left><font size=1 color=#ed1c24><b><center>$row1[4] Дни</center></b></td> <td align=left><font size=1 color=#005825><b><center>$re[0] Часа</center></b></td> <td align=left width='100'><font size=1 color=#0076a3><center>$row1[3]</center></td> <td align=left width='70'><font size=1 color=#0076a3><center>$row1[7]</center></td> <td align=left>$character_table_edit</td> </tr> "; } ?></center> </td> </tr> </table></table>
Неса писани от мен !
Принципно аз го исках, но не отброява часове,причина, и прочие, пак си стои баннат със празни полета. Иначе благодаря, че си се потрудил