|17/07/2011, 07:12 AM||#1|
Join Date: Mar 2008
Location: New Zealand
[PHP / MYSQL][BETA] TKAdmin [LITE][FULL WEBSITE ACP/UCP]
Tkadmin has been my little project for a while because there have been quite a few people wanting a basic admin script with a website. I've spent quite a while with XFlawless setting this up to be as "Noob-friendly" as possible. I'm not a professional at PHP or HTML / CSS so the website doesn't look perfect but it will do. I hope that people can learn something from this project and edit it and understand how it works, you can use it as is though.
About the PAWN
The PAWN isn't fully efficient because I wasn't too keen on using ZCMD because it's just more includes. I've used DCMD and some macro's to help people understand the script better. There are overall 17 admin commands and 3 player commands. You can easily insert the player commands into your current command list because I didn't want to add a whole new command just to show two commands.
Players: /report, /admins, /setemail Level 1: /reports, /muted, /acmds, admin chat Level 2: /ip, /akill, /slap, /mute, /unmute Level 3: /explode, /goto, /freeze, /unfreeze, /vkill, /kick Level 4: /get, /ban, /unban Level 5: /setlevel Rcon: /makeadmin
The MySQL tables are basically done so that you can understand it easier. I've put the bans in normal dates and the news in unix timestamps so that you are able to understand it better. The tables are not fully optimized so, you are able to do that if you want. Over all there is only 4 tables, one for Player information, one for bans and two for the website (News).
About the Website
I have spent quite a bit of time securing most of the PHP script. You are unable to XSS attack it or MySQL inject it. You are also unable to steal others session cookies because they are hashed to your IP address. Make sure that you have a unique hash in your server so that nobody is able to crack your server session cookies. Most of the script pulls from the MySQL database because of the admin and player news scripts. The functions for the website are as follows
Player Stats (Everyone) - Toplist - Compare players stats - View players stats Admin Page (Everyone) - Lists all of the servers admins. Player Panel (Registered Players) - View your own stats - Change password - Change Email - Link your current IP (For auto logging) Admin Panel (Admins) - Server statistics (Totals of everything) - Level 1+ - Player Information (View a players information) - Level 2+ - Unban / Ban players online - Level 4+ - View the ban log / users current ban - Level 4+ - Change the website / admin news - Level 5 - Update a players information - Level 5 - Delete a player - Level 5 Forum Link (Everyone) -You can optionally enter a forums link when you set the site up.
Setting up the PAWN (The SA-MP directory in the downloads folder) 1. Firstly you must put the tkadmin.pwn file in your filterscripts folder located in your sa-mp directory. You must then open it and edit your database information (MySQL_HOST, Mysql_DB, MySQL_User, MySQL_Pass). 2. Secondly you must put all of the includes into PAWNO -> Includes (SScanf, foreach, mysql). You can now compile tkadmin.pwn into a .amx. 3. Thirdly you have to add the plugins. I have included the windows plugins but not the Linux ones because there are multiple. The links to all of the plugins are as follows sscanf - http://forum.sa-mp.com/showthread.php?t=120356 whirlpool - http://forum.sa-mp.com/showthread.php?t=65290 mysql - http://forum.sa-mp.com/showthread.php?t=56564 4. You must add the MySQL library to the same directory as your server.cfg and the server starting file. This file is libmysql.dll if you are using windows or libmysqlclient.so.15 if you are using Linux. If you are running linux and you are missing the file then download it from the MySQL thread on sa-mp forums http://forum.sa-mp.com/showthread.php?t=56564 5. Lastly, you must edit your server.cfg. You must add tkadmin to the end of your filterscripts line. You must also add the plugins to config. If you are using windows, all you have to add is "plugins mysql whirlpool sscanf" (Take off the quotes). If you are using linux, you have to add them with the .so extension on the end. Setting up the MySQL (The SQL TABLES directory in the downloads folder) 1. You must find out your PhpMyAdmin directory from your host. Generally they would give it to you or it would be in your cpanel. If you do not have a host, search free host with MySQL in google, I'm sure you could find a few. 2. You must create a database for the admin script. This is either done inside PhpMyAdmin or inside your cpanel. 3. When you have made your database, all you need to do is find the import button and import the .sql file that is located in the SQL Tables folder in the download. Setting up the Website (The WEB directory in the downloads folder) 1. Firstly you need to upload the files to your server that you want the website to be hosted on, a free host would work but it's better to have the server, website and MySQL on the same server so it doesn't lag. 2. After you have uploaded. Run the setup.php, you must make sure that it has write permissions to write to the other files. All you need to do is enter the information on that page for it to setup your website. 2a. If you are unable to get the setup.php working, you can set it up manually. There is two .php files that it writes to, one being database.php and one being servervariables.php. Open database.php and edit the SQL server information from localhost to your info, from root to your user, from pass to your password and from sa-mp to your database. Make sure that you keep the quotes around these values, or your site will give errors. Now open severvariables.php. Edit the 'Test Server' to your server name, "Hello, welcome...." to your website message, "we are going to....." to your slogan and type around 10 random letters into the password hash box, make sure that you don't leave it as the default one. 3.Make sure that the setup.php has been deleted :).
Link = HERE
Username = demo1
Password = demo1
OLD VERSION (1.4)
OLD VERSION (1.3)
OLD VERSION[ (1.2)
OLD VERSION (1.1)
OLD VERSION (1.0)
Hope you guys enjoy it, please report any bugs (here or add me on msn) and feel free to suggest anything in this topic. Also, if you are having issues understanding anything, feel free to PM me / add me on MSN or even post here.
Last edited by [HiC]TheKiller; 09/01/2012 at 11:23 PM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|[Tool/Web/Other] Dynamic MySql Website!||Rokzlive||Tools and Files||34||22/06/2013 01:19 PM|
|Full MySQL Lookup working for my server||jameskmonger||Everything and Nothing||7||19/02/2011 04:48 PM|
|[Tool/Web/Other] [PHP] [MYSQL]Voting for your website! V1.0||DiddyBop||Tools and Files||10||02/10/2010 10:18 PM|
|TKAdmin||[HiC]TheKiller||Help Archive||7||15/03/2010 05:28 AM|
|Sending email from server via mysql via my website?||Gamer_Z||Help Archive||0||13/03/2010 05:55 PM|