Jump to content
MakeWebGames

Neon

Members
  • Posts

    88
  • Joined

  • Last visited

Everything posted by Neon

  1. /** * A function for making time periods readable * * @author Aidan Lister <[email protected]> * @version 2.0.1 * @link http://aidanlister.com/2004/04/making-time-periods-readable/ * @param int number of seconds elapsed * @param string which time periods to display * @param bool whether to show zero time periods */ function time_duration($seconds, $use = null, $zeros = false) { // Define time periods $periods = array ( 'years' => 31556926, 'Months' => 2629743, 'weeks' => 604800, 'days' => 86400, 'hours' => 3600, 'minutes' => 60, 'seconds' => 1 ); // Break into periods $seconds = (float) $seconds; $segments = array(); foreach ($periods as $period => $value) { if ($use && strpos($use, $period[0]) === false) { continue; } $count = floor($seconds / $value); if ($count == 0 && !$zeros) { continue; } $segments[strtolower($period)] = $count; $seconds = $seconds % $value; } // Build the string $string = array(); foreach ($segments as $key => $value) { $segment_name = substr($key, 0, -1); $segment = $value . ' ' . $segment_name; if ($value != 1) { $segment .= 's'; } $string[] = $segment; } return implode(', ', $string); }   So if its currently stored as a timestamp in the future then do. time() - $storedTimeStamp. If its stored as seconds, then just use that. Send that to this like time_duration(time,'m'); M means minutes only.
  2. CentOS, apache, php w/ apc & mod_fcgid, mysql (dB), dovecot (mail), proftp (ftp), bind (dns)
  3. Those can't be the true access logs. They were just from October 3rd, and most were the cron jobs running. The only non cron-job was a login.php hit. So, not much help. Unless your security on the login.php page is poor. However, seems you got it. Hope it doesn't happen again. Best of luck.
  4. Re-uploading the files will not a help an SQL injection at all. Someone exploited one of your queries because you did not properly cleanse a variable. Never trust the user input. You must strip tags, replace entities and add slashes. If you get me those access logs, I'll find where he "performed" this SQL attack and tell you what you need to patch or secure more.
  5. It could be a million different things. One quick way is to download your raw access logs and begin looking. If you don't know what your looking for, then send em to me and I'll take a look. Or your FTP pass could of been jacked from the millions of viruses programmed to do just that. Then some malicious files were uploaded. 1) Change your passwords. 2) Check the "last modified" date on all your files on your server 3) Download and view the FTP & Access logs Depending if we find the cause, your scripts may need securing.
  6. You have 2 choices 1) Adjust the path to the files in register.php, so it points correctly. 2) Move the files to match the path in register.php, and hope nothing else breaks. That being said. I'm at my computer for another 30ish minutes. PM me your digits, and I'll take a look.
  7. The linking files could mean including/requiring them. What the means is you get access to the functions, variables and classes within those files. So you simply do require_once or include_once in your script with the parameter being the absolute path to the file. As for those 2 errors, the files (config.php & connect.php) couldn't be loaded. Check that they exist first off, and if they do check that there CHMODed at least above 600. If none of that works then the lines in register.php (line 43 & 44) must be pointing the wrong location. Hope that helps.
  8. Holy cow. At least use CODE tags to help the formatting. This is just a wall of difficult to read code now. I don't know mccodes at all, but at this line.   $wq=$db->query("SELECT * FROM gangwars where warID={$_POST['war']}");   Has nothing in that post field. Or its not formatted correctly. You could try encasing the value in double quotes. So try this.   $wq=$db->query('SELECT * FROM gangwars where warID=" ' . $_POST['war'] . ' "' );
  9. Hello, Chiming in with a quick update. We recently released 0.1.9 and our remaining features to finish is... Balance Fighting Formula Add remaining crimes Re-structure balance of items/shield/weapons Add flasks (energy, will refills)   0.2.0 Marks our public beta release. However, an invite code of "ra1n" will allow up to 5 users into the current state of the game right now. Those users will be rewarded with soulgems on the public release. I've attached a video for those who just wanna see it. http://screencast.com/t/SDfljMYn5
  10. Its just better for web development to not mix PHP and HTML. Most of all these game engines mix it to no end, but true new web development follows the Model-View-Controller. However, the MVC model is kinda for the PHP side of things, so it doesn't truly apply to templates. Trust me that if you start working with a team or another developer needs to work on your code. Its 1000x easier to modify templates & their associated PHP files then messing around with a massive PHP file that mixes 10 different languages.
  11. Use an already used template engine. Smarty seems to be my favorite, but I've never tried out any others. You then can create library templates for like the header, footer and navigation menu. You can then make sort of an information box that you can dynamically change the contents of with either GET parameters or some other method for page moving.
  12. There used to be a game here around '07 called SoulRaider or BattleCartel. I don't know the full story, but one day the site just was gone. Years and years passed without any knowledge. I myself was a player on the old game, but since have become proficient in PHP and the web based languages. We are at around 55,000 lines of custom code to re-make an old favorite game. We built our own framework, mysql wrapper, language abstraction and the only 3rd party software we use is Smarty for templates. We have been building the game with optimization and security in mind. Our code is constantly bench-marked and always audited. We take pride in our work and almost ready to release the game. I've attached some screenshots of the game in progress. We are working with a small beta team of about 8 users and looking to add a few more in soon. Would be happy to hear if anyone here remembers the old game. Or is interested in becoming part of the new game. The feature list as much as I can remember. News feed Airport Bank Crimes Attacking Hacking Gym Classes Lottery Gangs Messageboard Private Messaging Inventory Store FAQ   [ATTACH=CONFIG]163[/ATTACH][ATTACH=CONFIG]164[/ATTACH][ATTACH=CONFIG]165[/ATTACH][ATTACH=CONFIG]166[/ATTACH][ATTACH=CONFIG]167[/ATTACH] EDIT: We have released the game. View the full news story here: http://soulraider.net/forums/topic/41-024-released-public-release/unread/
×
×
  • Create New...