Shakes & Fidget Ban System

06/02/2014 17:02 EptunLP#1
Hi there guys , i was bored so i created a simple ban system :p

How it works? When user uses bugs or break rules you can simple ban him by pressing one little button that says Ban! [ If you have administration by Jessi :p ]

And if time goes then you just click on Unban!

So what to do? Go to your request.php and search case $ACT_LOGIN
Then find this:
PHP Code:
// compare passwords, if wrong, throw wrong password exception & break 
         
        
$db_pass $db_data ['password']; 
         
        if (
$pass != $db_pass) { 
            
$ret = array ( 
                    
$ERR_LOGIN_FAILED  // $ERR_WRONG_PASSWORD 
                        
); 
             
            break; 
        } 
Then below it type this
PHP Code:
if ($db_data ['banned'] == 1) { 
            
$ret = array (
                    
$ERR_LOGIN_FAILED // Shows him at login screen that he have ban
                        
);
                        
            break;
        } 
Then go to your phpmyadmin select your database and click on sql

Delete everything thats inside and type in this
Code:
ALTER TABLE user_data ADD banned VARCHAR (60)
And if you dont have administration by jessi then if you want to ban a player go to your database then go to user_data search the nickname of player search for banned and type in 1 to unban type 0

if you have administration by jessi go into ban.php and delete everything inside and type in this
PHP Code:
<?php

    
// Simple AdminUI
    // Author: Jessi 4 psfgame.de
    // You are allowed to modify and/or redistribute any part of this

require_once("backend/main.php");
loggedinorreturn();
stdhead("ban");

dbconn();

if(isset(
$_POST["doit"]) && isset($_POST["sec"]) && isset($_POST["id"]))
{
    if(
$_POST["sec"] == "yes")
    {
        
$pid $_POST["id"];
        
$sql "UPDATE user_data SET banned = 1,ssid = 0 WHERE user_id = $pid";
        
$qry mysql_query($sql);
        echo 
"account banned..";
?>
        <meta http-equiv="refresh" content="5; URL=index.php">
<?php
    
}
    else
    {
        echo 
"wrong answer...";
?>
        <meta http-equiv="refresh" content="6; URL=user.php?id=<?=$_POST["id"]?>">
<?php
    
}
}
else
{
?>

<form action="<?=$_SERVER["PHP_SELF"?>" method="post" enctype="multipart/form-data" target="_self">
<table cellpadding="4" cellspacing="1" border="0" style="width:100%" class="tableinborder">
 <tr class="tabletitle" width="100%">
  <td colspan="10" width="100%"><span class="normalfont"><center><b>Authentication</b></center></span></td> 
 </tr><tr><td width="100%" class="tablea"><center>
<table border="0" cellspacing="1" cellpadding="4" class="tableinborder">
<tr><td class=tableb align=left>Type in "yes":</td><td class=tablea align=left><input type="text" size="40" name="sec" /></td></tr>
<tr><td class=tablea colspan="2" align="center"><input type="submit" value="Ban!" class=btn></td></tr>
</table>
<input type="hidden" name="doit" value="yes" />
<input type="hidden" name="id" value="<?=$_GET["id"]?>" />
</form>
</center>
</td></tr></table>
<?php
}
stdfoot();
?>
Then create a file named unban.php and type in
PHP Code:
<?php

    
// Simple AdminUI
    // Author: Jessi 4 psfgame.de
    // You are allowed to modify and/or redistribute any part of this

require_once("backend/main.php");
loggedinorreturn();
stdhead("UnBan");

dbconn();

if(isset(
$_POST["doit"]) && isset($_POST["sec"]) && isset($_POST["id"]))
{
    if(
$_POST["sec"] == "yes")
    {
        
$pid $_POST["id"];
        
$sql "UPDATE user_data SET banned = 0 WHERE user_id = $pid";
        
$qry mysql_query($sql);
        echo 
"account unbanned...";
?>
        <meta http-equiv="refresh" content="5; URL=index.php">
<?php
    
}
    else
    {
        echo 
"wrong answer...";
?>
        <meta http-equiv="refresh" content="6; URL=user.php?id=<?=$_POST["id"]?>">
<?php
    
}
}
else
{
?>

<form action="<?=$_SERVER["PHP_SELF"?>" method="post" enctype="multipart/form-data" target="_self">
<table cellpadding="4" cellspacing="1" border="0" style="width:100%" class="tableinborder">
 <tr class="tabletitle" width="100%">
  <td colspan="10" width="100%"><span class="normalfont"><center><b>Authentication</b></center></span></td> 
 </tr><tr><td width="100%" class="tablea"><center>
<table border="0" cellspacing="1" cellpadding="4" class="tableinborder">
<tr><td class=tableb align=left>Type in "yes":</td><td class=tablea align=left><input type="text" size="40" name="sec" /></td></tr>
<tr><td class=tablea colspan="2" align="center"><input type="submit" value="UnBan!" class=btn></td></tr>
</table>
<input type="hidden" name="doit" value="yes" />
<input type="hidden" name="id" value="<?=$_GET["id"]?>" />
</form>
</center>
</td></tr></table>
<?php
}
stdfoot();
?>
And in user.php search this ( it is translated to my language)
PHP Code:
<a href="pmspy.php?id=<?=$u["user_id"]?>">Zprávy od ostatních</a><br>
                                                    <a href="pmsend.php?to=<?=$u["user_id"]?>">Poslat zprávu - Momentalne nefunkcne</a><br>
And replace it with this
PHP Code:
<a href="pmspy.php?id=<?=$u["user_id"]?>">Zprávy od ostatních</a><br>
                                                    <a href="pmsend.php?to=<?=$u["user_id"]?>">Poslat zprávu - Momentalne nefunkcne</a><br>
                                                    <a href="ban.php?id=<?=$u["user_id"]?>">Ban </a><br>
                                                    <a href="unban.php?id=<?=$u["user_id"]?>">Unban </a><br></td>
Hope you enjoy this!
06/02/2014 17:06 Crasim#2
is very similar to the system that I have created two days ago xD the only difference is the database that I created a page dedicated only to users banned xD
PS: uses a system using enum as I had recommended to me jessi

[Only registered and activated users can see links. Click Here To Register...]
06/02/2014 20:08 UND3RW0RLD#3
Quote:
Originally Posted by EptunLP View Post
And replace it with this
PHP Code:
<a href="pmspy.php?id=<?=$u["user_id"]?>">Zprávy od ostatních</a><br>
                                                    <a href="pmsend.php?to=<?=$u["user_id"]?>">Poslat zprávu - Momentalne nefunkcne</a><br>
                                                    <a href="ban.php?id=<?=$u["user_id"]?>">Ban </a><br>
                                                    <a href="unban.php?id=<?=$u["user_id"]?>">Unban </a><br></td>
Hope you enjoy this!
Tiny improvement
PHP Code:
<a href="pmspy.php?id=<?=$u["user_id"]?>">Zprávy od ostatních</a><br>
                                                    <a href="pmsend.php?to=<?=$u["user_id"]?>">Poslat zprávu - Momentalne nefunkcne</a><br>
<?php
if($u["banned"] == 0)
{
?>
                                                    <a href="ban.php?id=<?=$u["user_id"]?>">Ban </a><br>
<?php
}
else
{
?>
                                                    <a href="unban.php?id=<?=$u["user_id"]?>">Unban </a>
<?php
}
?>
                                                    <br></td>
06/02/2014 21:40 nazulor#4
nice work :)
06/02/2014 22:17 eskocze#5
Gj a třeba další verze bude? Duvod banu atd časový ban
06/30/2014 20:09 Zatlos#6
Eptun máš i jiné navody a jinak jak dám ban ??
06/30/2014 20:19 EptunLP#7
Návodov by som ti mohol písať na 10 strán a ban dáš tak že pojdeš do db najdeš hráča a nastavíš banned na 1 ;)
06/30/2014 20:22 Zatlos#8
Ahoj Eptune Kde najdu další tvoje návody ??
06/30/2014 20:25 EptunLP#9
Viac už tu nemám, ak chceš pomoc napiš mi do pm tvoj skype ;)
07/01/2014 08:21 Zatlos#10
Ahoj EptunLP napsal sem do pm skype Kdyby to tam nebylo tak muj skype je marian.zatlos potřebuji pomoct s pomocníkami ve věži mám v request.php nakodovany ale nezobrazjí se mi nevýš proč ??
07/01/2014 09:51 EptunLP#11
Pozrel som sa , nič tam nemáš nakódované