PHP Banlist Page
Personally I use a combination of this page and another called phpMyEdit (bear in mind that you have to configure the main page considering it will allow you to edit your listings.) It can be found here: phpMyEdit
Just Copy the Code in notepad, edit the mysql login info (No it will not display your login info from the web, unless you don't have php enabled), and save as banlist.php or whatever you like and upload to you apache/mysql/php server.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Ultra Banlist</title> </head> <body> <h1>Ultra Banlist</h1> <?php // change these things $server = "localhost"; $dbuser = "root"; $dbpass = "root"; $dbname = "database"; mysql_connect($server, $dbuser, $dbpass); mysql_select_db($dbname); $result = mysql_query("SELECT * FROM banlist ORDER BY id DESC"); //This will display the most recent by id edit this query how you see fit. Limit, Order, ect. echo "<table width=100% border=1 cellpadding=3 cellspacing=0>"; echo "<tr style=\"font-weight:bold\"> <td>Type</td> <td>Name</td> <td>Reason</td> <td>Admin/Mod</td> <td>Time</td> <td>TimeTempBan</td> <td>id</td> </tr>"; while($row = mysql_fetch_assoc($result)){ if($col == "#eeeeee"){ $col = "#ffffff"; }else{ $col = "#eeeeee"; } echo "<tr bgcolor=$col>"; if($row['type'] == "5"){ echo "<td>Unban</td>"; }else{ if($row['type'] == "3"){ echo "<td>Kick</td>"; }else{ if($row['type'] == "2"){ echo "<td>Warn</td>"; }else{ if($row['type'] == "0"){ echo "<td>Banned</td>"; }else{ if($row['type'] == "1"){ echo "<td>IPBanned</td>"; }else{ if($row['type'] == "4"){ echo "<td>Fine</td>"; }else{ if($row['type'] == "6"){ echo "<td>Jailed</td>"; }else{ if($row['type'] == "9"){ echo "<td>Perma</td>"; }else{ echo "<td>Unknown</td>"; //Holy Epic If Statement Batman! } } } } } } } } echo "<td>".$row['name']."</td>"; echo "<td>".$row['reason']."</td>"; echo "<td>".$row['admin']."</td>"; //Convert Epoch Time to Standard format $datetime = date("F j, Y, g:i a", $row['time']); echo "<td>$datetime</td>"; $dateconvert = date("F j, Y, g:i a", $row['temptime']); if($row['temptime'] == "0"){ echo "<td>None</td>"; }else{ echo "<td>$dateconvert</td>"; } echo "<td>".$row['id']."</td>"; echo "</tr>"; } echo"</table>"; ?> </div> Ban database provided by UltraBans. </body></html>
-
View User Profile
-
Send Message
Posted Dec 3, 2011Working good, thanks. :)
-
View User Profile
-
Send Message
Posted Dec 5, 2011You should change those awful if statements to
I am happy to do any PHP coding work for this project. I have some free time here and there so if you need anything hit me up.
-
View User Profile
-
Send Message
Posted Apr 9, 2012How would I go about getting my current database in my MySQL database?
Thanks!
Tom
-
View User Profile
-
Send Message
Posted Apr 26, 2012If you want to stop people abusing sql with refresh then here ya go...
-
View User Profile
-
Send Message
Posted Jul 19, 2012why this Error? Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given on line 35
-
View User Profile
-
Send Message
Posted Jul 26, 2012You could use elseif { } instead of else { if { }}
-
View User Profile
-
Send Message
Posted Aug 4, 2012@VitaminBoy
Same... Dont get it..
-
View User Profile
-
Send Message
Posted Aug 6, 2012@VitaminBoy
The web and server must be on the same DB and on the same VPS. Then it will work....
-
View User Profile
-
Send Message
Posted Aug 19, 2012Hello.
I have a question.
Can i put a banlist page in my Blogger website? How??
Thanks, I dont know much about this.
-
View User Profile
-
Send Message
Posted Aug 23, 2012date and time is displaying incorrectly for me. I have a feeling its set to the wrong timezone. I cant seem to figure out how to fix it
-
View User Profile
-
Send Message
Posted Sep 3, 2012-
View User Profile
-
Send Message
Posted Sep 15, 2012Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a1805279/public_html/bans/banlist.php on line 35 Anyway To Fix That Problem?
-
View User Profile
-
Send Message
Posted Nov 25, 2012How can I Disable warns in SQL, I want that BanList show onls Bans, TempBans and IPBans, not some kicks and warns..
How can I do that?
-
View User Profile
-
Send Message
Posted Dec 17, 2012Heres the same script, with MySQli, and a check for if the database connection works.
-
View User Profile
-
Send Message
Posted Dec 23, 2012You could just use a switch statement to make things a little cleaner than if's.
-
View User Profile
-
Send Message
Posted Jan 29, 2013How do you make the banlist with the zxq.net host, and mybb forums? Thanks
-
View User Profile
-
Send Message
Posted Feb 14, 2013@emfjop
I would like to put one on my wordpress site, if anyone could help with that.
-
View User Profile
-
Send Message
Posted Feb 14, 2013@saimon13
I got that error too. Just today actually, I mean it has worked for me before.
-
View User Profile
-
Send Message
Posted Feb 20, 2013Help adding it to dreamweaver in a html page?
-
View User Profile
-
Send Message
Posted Mar 17, 2013It's PHP.. not HTML