This is a simple script I wrote with help from 8088, using voogrus ID convertor
I am no php pro, this is the first thing like this I have released as I wanted something like this to ease my workload when adding new admins. Anyone experienced enough should know what to do with this and anyone who isn't shouldnt have trouble.
This will display all admins on sourcebans that are in the group(s) you select. It will also cache the page as large databases will cause slow loading (30mins, can be increased)
Requirements:
Website/server
Webshortcuts
Sourcebans
Installing:
Download the file
Unzip and open up connect.php
Find:
mysql_connect("ENTER YOUR DB LOCATION, NORMALLY LOCALHOST", "DB USERNAME", "DB PASSWORD")
Enter your DB location, typically localhost. You can also enter an IP.
Put in your db username and db password
Then find:
mysql_select_db("SELECT SB DB")
Enter the name of your SB database
Save and close.
Open up admins.php
Find:
$sql = "SELECT user,authid,srv_group,gid FROM ADMINS_TABLE WHERE srv_group = 'SERVER GROUP 1' OR srv_group = 'SERVER GROUP 2' OR srv_group = 'SERVER GROUP 3' ORDER BY gid ASC";
Edit ADMINS_TABLE to represent the name of your admins table (default is sb_admins)
If you want to only include certain server groups then edit:
srv_group = 'SERVER GROUP 1'
so that SERVER GROUP 1 is replaced by the exact name of the group you want to display (ex. Server Admins)
If you have multiple groups then continue in this fashion editing where it says group 2 etc. You can have as many as you want. If you want to show all then just delete:
WHERE srv_group = 'SERVER GROUP 1' OR srv_group = 'SERVER GROUP 2' OR srv_group = 'SERVER GROUP 3'
That entire section
I have set it to order by group id ascending (ORDER BY gid ASC) this displays my higher levelled admins first, again you can remove this or change to DESC to display in reverse order.
This next part is all for aesthetics.
Find:
<a href="LINK TO YOUR SITE"> and enter the link to your site
Find:
<img src="YOUR BANNER SRC" alt="" title="">
Enter the url to your banner, give it an alternative (for text only) and a title (for mouse over)
Find:
<p>ENTER YOUR INTRO TEXT HERE</p>
You can enter some text here if you want.
Find:
<p><small>ENTER FOOTER<br><br>© YOUR COPYRIGHT</p>
You can add some footer text here and a copyright, if you want. I am not going to hold copyright over this and allow anyone to edit as they please.
The above can all be deleted if you don't want to show it.
If you want to edit the cache time then open cache.php and find:
var $cache_time = 1800
Change the 1800 to how many seconds you want to cache for.
I kinda cheated for the css. I just robbed the one from my forum and then included it. I have kept it in the file, edit as you wish or include your own.
As I cheated on this I won't go into editing as it is such a big file, I would grab your own from your site (or create your own) and replace the one in the folder (renaming it to index.css for simplicitys sake)
Finally:
Upload the whole file to where you want it stored. Make sure the cache folder is CHMOD to 777
Go to the address where you uploaded it to and it *SHOULD* work
I hope I have helped some of you. I'll be here to try and help if anyone needs it.
Like I say, this is the first thing like this I have released, so be nice please!