SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 17/07/2011, 06:12 AM   #1
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,075
Reputation: 406
Thumbs up [PHP / MYSQL][BETA] TKAdmin [LITE][FULL WEBSITE ACP/UCP]

TkAdmin

Introduction
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.
Code:
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
About the MySQL
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
Code:
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.
Screenshots


Instructions
Code:
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 :).
DEMO
Link = HERE
Username = demo1
Password = demo1


Download
HERE (1.5)
OLD VERSION (1.4)
OLD VERSION (1.3)
OLD VERSION[ (1.2)
OLD VERSION (1.1)
OLD VERSION (1.0)


Credits
  • Me - Doing most of the PHP
  • XFlawless - Doing most of the design
  • YLess - His two plugins and foreach
  • G-sTyLeZzZ - MySQL plugin
  • Mauzen for the hosting


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.

Thanks,
[HiC]TheKiller
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.

Last edited by [HiC]TheKiller; 09/01/2012 at 11:23 PM.
[HiC]TheKiller is offline   Reply With Quote
Old 17/07/2011, 06:17 AM   #2
Ari3l
Huge Clucker
 
Join Date: Aug 2010
Location: Puerto Madryn
Posts: 244
Reputation: 3
Default Respuesta: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Amazing Good Job
Ari3l is offline   Reply With Quote
Old 17/07/2011, 06:17 AM   #3
Tyler_Cordwell
Little Clucker
 
Join Date: Mar 2011
Posts: 33
Reputation: 7
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Nice work will use if i have to in time, Looks good now!
__________________
Tyler_Cordwell is offline   Reply With Quote
Old 17/07/2011, 06:21 AM   #4
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,116
Reputation: 901
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Good job [HiC]TheKiller, wet my pants <3
__________________

192.169.82.202:7777 - An awesome CnR server consisting of doozy features! Come, we have players!


Lorenc_ is offline   Reply With Quote
Old 17/07/2011, 06:42 AM   #5
serman
Big Clucker
 
serman's Avatar
 
Join Date: Dec 2010
Location: India
Posts: 152
Reputation: 15
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Good Job !!
__________________
My Work
__________________________________________________ _____
[GameMode]World Stunting
| [FilterScript]Simple AFK/BRB Sys. | [FilterScript]Rank System V1.0
[GameMode]Advanced MissionsNew

Scripting for $$ PM me if u r interested..

serman is offline   Reply With Quote
Old 17/07/2011, 06:43 AM   #6
ScRaT
Huge Clucker
 
ScRaT's Avatar
 
Join Date: Oct 2010
Location: -
Posts: 202
Reputation: 41
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

nice 10/10
"we are going to murder you"
ScRaT is offline   Reply With Quote
Old 17/07/2011, 07:30 AM   #7
FireCat
Banned
 
Join Date: Jul 2010
Posts: 2,471
Reputation: 596
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

I knew it would be awesome
FireCat is offline   Reply With Quote
Old 17/07/2011, 09:12 AM   #8
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,075
Reputation: 406
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Thanks guys, feel free to suggest anything .
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Old 17/07/2011, 09:40 AM   #9
andruz99
Big Clucker
 
andruz99's Avatar
 
Join Date: Oct 2009
Posts: 152
Reputation: 5
Default Re: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Best of the best!, Nice job.
__________________

__________________________________________________

My Filterscripts
Time/Clock system server based: http://forum.sa-mp.com/showthread.php?t=268961
andruz99 is offline   Reply With Quote
Old 17/07/2011, 10:39 AM   #10
Tigerkiller
Gangsta
 
Tigerkiller's Avatar
 
Join Date: May 2010
Posts: 757
Reputation: 25
Default AW: [PHP / MYSQL][BETA] TKAdmin [FULL WEBSITE]

Nice Job
Tigerkiller is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tool/Web/Other] Dynamic MySql Website! Rokzlive Tools and Files 34 22/06/2013 12: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 09:18 PM
TKAdmin [HiC]TheKiller Help Archive 7 15/03/2010 04:28 AM
Sending email from server via mysql via my website? Gamer_Z Help Archive 0 13/03/2010 05:55 PM


All times are GMT. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.