View Single Post
mimos04
Junior Member
Join Date: Apr 2011
Old 07-03-2018 , 15:04   Re: Advanced Bans (SQL) | for WEBSITE / PHP
Reply With Quote #1436

Quote:
Originally Posted by ZEDD_Intensity View Post
Greetings,

2018, but if someone still needs it, here's a BugFixed/Edited version for Advanced_Bans.php for advanced_bans_sql users. Originally made/postedby cRaNnK on GitHub. Whenever I've seen someone asking about a php code for advanced_bans, they've always been given the link to AMXBans, even though the guy(like me) never wanted to use AMXBans. cRaNnk's code had a Bunch of errors as well and I decided to editit for my servers to match my preferences.
  • EDIT THE LIST TITLE ON LINE 15 : $sname. I know there are a bunch of other $snames, but edit only the one at LINE 15.
  • The file is set to sort bans according to the ban times from Longest to Shortest and then Permanent Bans. So all Permas will always be at the end. I wanted to sort the bans from newest to oldest, but I couldn't find any field that sent a detail for when the ban was issued, like a BanID or something.
  • Admin SteamIDs are masked with the format : STEAM_0.1.***.***. Hyperlink to visit admin's steam profile from maskedIDs removed. All bans by your server/rcon won't have anything in the Admin SteamID Field.
  • Added Search Feature based on letters. This is why I didn't add sorting with name. Type "A" in the search field and it'll show only the banned names starting with A.
  • All warnings/errors fixed. You won't see an error unless you decide to turn the code upside down or heavily/aggressively/wildly edit it. There always used to be an "Undefined : "page" and "s" Notice, which won't go away until another page for bans was created - Fixed and Hidden.
  • Default table-name that the script will query is "advanced_bans". If you've edited the source and changed the name, edit Line 16.

If you're running your SQLDatabase on the same server as your website, leave the Line 2 : $sql_host = ""; BLANK. Putting your actual host-address there will cause "Access Denied" Warning. Also remember to Whitelist your GameServer IP in your Remote SQL if haven't done already and using for the first time. Failing to do that will deny your access to database connection and "error" the plugin.

The COLORS of the table is what I use, because I've embedded the whole page in my website and it has it's own background image, so that cherry red with white color looks kinda cute altogether. To edit colors yourself, Just Ctrl+F "color" and look around to make sure you're editing the right color. Visit this website to know the #C0D3S of your favourite colors.

I'm NOT willing to edit the php any further 'for anyone', so I hope you find someone to do it if you need anything majorly changed.

Hope this helps.

Regards,
ZEDD

Attachment Updated :
  • Previous code had Code Injection Vulnerabilities. Fixed!
Updated again :
  • When you ban an IP Address, it's gonna approach an array that isn't set and echoes an error. Fixed!
are this working?
mimos04 is offline