Some major script overhaul for URsTats will be implemented in the next release.
I was lucky to speak with |WC|spaz last night. He helped to really shine a light on scripting fallacies I have in my script including database issues.
Many of which I was aware of, but never got around to doing and of course some others did not come to me logically which he pointed out such as database information retrieval.
All suggestions he made were logical and made PERFECT sense. So, I'll take the time to fix the code and make it faster and less obtrusive to the game server itself before I add any additional features.
I have also started working on reducing redundancy in the code by adding more functions to reduce the overall amount of code I have to use in the entire script.
For instance:
To sanitize the code a bit and make it HTML friendly, it has to pass through stripslashes() then htmlentities() php functions.
So instead of using htmlentities(stripslashes($var)); for each var from the database, I made 1 simple function to do that.
function html($var){
$var = htmlentities(stripslashes($var));
return $var;
}
So now I just use html($var); A lot less code overall.
URsTats has been a learning project for myself. When I started, I originally was using it just for my own personal use out of scripts from Maj and Mission. I decided to make it more than just simple statistics and make have some functionality such as server control and auto bans etc. I started learning PHP + MySQL and haven't slowed down since.
That being said, a lot of the original code including SQL code is still original and slow and VERY redundant. Now that I sufficient knowledge in both, it is wise for me (as spaz pointed out so.. delicately ;D ) to go through and make this WAY more efficient than what it is.
Some dbase types were originally made with large character sets and different types than what are actually needed. Mainly, because I did not know what to expect. This has been a great learning experience for me and has been a thrill to help others to use my software. To date, there are at LEAST 513 unique installs of URsTats. There is likely more, but this is based off of the upgrade link in the admin section of URsTats as a referrer.
Anywho, long story short.. The code is in major need of overhaul and my intentions are to do just that.
I would like to give a shout out to everyone that has helped my make URsTats better in whatever way they have, be it testing, suggestions of features, coding ideas etc... (In no particular order)
Reaper{DKMs} - Suggestons & Testing
|WC|FatherGoose - Suggestons & Testing
|ALPHA|Mission - Coding & Testing (Original GetPlayers.php)
|WC|Runamuck - Suggestions & Testing & Implementation
|WC|Spaz - Suggestions & Testing & Coding
|FS|Raider - (For answering every question I had no matter how silly)
Maj - Coding (rcon class)
|WC|Saiyan - Suggestons & Testing
Cleric{DKMs} - Testing
Guach - Suggestons & Testing
Serge (-CnD- clan) - Suggestons & Testing
|ALPHA|MadProfessor - (For answering every question I had no matter how silly)
And the list goes on.. Sorry I cannot recall at the moment the rest of the people that have assisted me.
Anywho, so this is my next goal to live up to what others have taught me and fix my code. Make it more efficient and operable while using as little resources as possible and of course.. Still look good :D
Any and all suggestions are welcome and invited! If you have any suggestions or tips, do let me know... alphahusky@gmail.com
Thanks!
This post has been edited by Pussnboots: 27 September 2011 - 03:22 PM