-
Posts
2,124 -
Joined
-
Last visited
-
Days Won
144
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Donator Packs - Items & More
Magictallguy replied to Reecey12345's topic in Requests & In Production
Seconded. I've never used it personally, but I have seen it on games I've worked on. Definitely worth the money -
Have you tried RedBean? One of the best ORMs I've ever used!
-
Alright Alan, you've piqued my interest. Put my name in the hat for Game Administrator please :)
-
Secure my game to the maximum [Payment]
Magictallguy replied to Reecey12345's topic in Requests & In Production
£5 for a £500 job? You've got no chance there -
Fine, your loss.. I give good massages!
-
Hey! I didn't say no.. I said "Get a train to Bolton! :P"
-
Again, I was/am groggy. That was bad phrasing, sorry about that. I meant $db = mysqli_connect('yada yada') instead of $db = new mysqli('yada yada');
-
I have always preferred OOP with procedural-style functions. Always have, always will. I have multiple arguments to support my preference, but I've recently had a tooth pulled - so I'm a little groggy :P
-
[In Prod.] Enhanced Registration
Magictallguy replied to KyleMassacre's topic in Requests & In Production
+1 for that sir! Well said -
You must spread some Reputation around before giving it to sniko again. Sorry sniks :P
-
[In Prod.] Enhanced Registration
Magictallguy replied to KyleMassacre's topic in Requests & In Production
Ugh, MD5.. Other than the obvious flaw with using MD5, your system is decent. I like it :) To battle the MD5 flaw, I'd do something like this: ALTER TABLE `users` ADD `newpass` ENUM('yes','no') NOT NULL DEFAULT 'no', CHANGE `userpass` `userpass` TEXT NOT NULL; Then run a select upon the authenticate (which it does, you'll just need to add in `newpass`) function mtgCrypt($pass) { return crypt($pass, '$6$rounds=5000$someSaltHard_CodedIn$'); } if((md5($_POST['password']) == $r['userpass'] AND $r['newpass'] == 'no') OR (mtgCrypt($_POST['password']) == $r['userpass'] AND $r['newpass'] == 'yes')) { // Correct details entered. Update the user's password to the new system. if($r['newpass'] == 'no') $db->query("UPDATE `users` SET `userpass` = '".mtgCrypt($_POST['password'])."', `newpass` = 'yes' WHERE `userid` = ".$r['userid']); // Handle the rest of the login $_SESSION['userid'] = $r['userid']; $_SESSION['loggedin'] = true; header("Location: loggedin.php"); exit; } else { // Login failed. Send them back to login.php with details as to why or handle it here } Using something like this system is how I've managed to convert multiple games using MD5 into something (currently) irreversible. Try it, and see what happens ;) -
If it's max table size then .. get a better host! If that's not an option, then write a backup query that handles overspill from the original table and creates/inserts into the new table automatically. If it's database size, then create another database designed specifically for handling the player transaction logs! If it's both, then combine the methods
-
Quite right! Though, a collab for idea sharing might not be a bad idea ;) Skype's on my profile :) You'll be storing a lot of information. Why not use the database for what it was intended? Information storage! My transaction log uses 1 table, is currently full of around 64,000 rows and working through it to get the information I need is 1 quick query. Using a txt file isn't, in my opinion, a route *anyone* should take if they have database capabilities
-
I've moved it around a little. That may be more to your liking
-
The only I've left in hrefs to the viewuser.php and gang.php is because you may have set up something that allows guests to view limited information about player profiles and gang descriptions respectively... <?php session_start(); include(__DIR__ . '/config.php'); global $_CONFIG; define("MONO_ON", 1); include(__DIR__ . '/class/class_db_'.$_CONFIG['driver'].'.php'); $db = new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); while($r = $db->fetch_row($settq)) $set[$r['conf_name']] = stripslashes(htmlspecialchars($r['conf_value'])); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $set['game_name'];?></title> <script language="JavaScript"> <!-- function getCookieVal(offset) { var endstr = document.cookie.indexOf(";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal(j); i = document.cookie.indexOf(" ", i) + 1; if (i === 0) break; } return null; } function SetCookie(name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie(name, path, domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') !== null) { usr.value = GetCookie('username'); pw.value = GetCookie('password'); if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length !== 0 && pw.value.length !== 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime() + (365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <style type="text/css"> <!-- body { background-image: url('bg25.jpg'); background-color: #000000; margin-top: 0px; margin-bottom: 0px; font-family: calibri, helvetica, arial, geneva, sans-serif; font-size: 12px; color: white; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited, a:active, a:hover, a:link { color: red; text-decoration: none; } table, tr, td { font-family: helvetica, arial, geneva, sans-serif; font-size: 12px; } img { border: none } textarea { font-family: helvetica, arial, geneva, sans-serif; font-size: 12px; color: red; } .table2 { } .lgrad { background-repeat: repeat-y; width: 19px; } .linegrad { background-image: url(linegrad.PNG); background-repeat: repeat-y; background-align: center; width: 2px; } .rgrad { background-repeat: repeat-y; width: 19px; } .dgrad { background-repeat: repeat-x; height: 38px; } .dgradl { background-repeat: no-repeat; height: 38px; width: 38px; } .dgradr { background-repeat: no-repeat; height: 38px; width: 38px; } .center { width: 932px; background-image: url('bg26.jpg'); background-color: #000000; vertical-align: top; text-align: center; } .table { background-color: #FFFFFF } .table3 { background-color: #000000 } .table td { background-color: #DEDEDE; height: 22px; } .table3 td { background-color: #CCCCCC } td .alt { background-color: #EEEEEE; height: 22px; } td .h { background-image: url(tablehgrad.png); background-repeat: repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image: url(tablehgrad.png); background-repeat: repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style></head> <body onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"><img src="title.jpg" alt="Mccodes Version 2" /> <!-- Begin Main Content --><?php if(file_exists('ipbans/' . $_SERVER['REMOTE_ADDR'])) exit("<b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b>"); ?> <h3>> <?php echo $set['game_name'];?> Log-In</h3> <table width='80%'> <tr> <td width='50%'><fieldset> <legend>About <?php echo $set['game_name'];?></legend> <?php echo $set['game_description'];?> </fieldset></td> <td><fieldset> <legend>Login</legend> <form action='authenticate.php' method='post' name='login' onsubmit='return saveme();'> Username: <input type='text' name='username' /> Password: <input type='password' name='password' /> Remember me? <input type='radio' value='ON' name='save' />Yes <input type='radio' name='save' value='OFF' checked='checked' />No <input type='submit' value='Submit' /> </form> </fieldset></td> </tr> </table> <h3><a href='register.php'>REGISTER</a> | <a href='tos.php'>TOS</a> | <a href='rules.php'>GAME RULES</a> | <a href='#'>PREVIEW</a> | <a href='forum/Upload'>FORUMS</a> | <a href='leaders.php'>TOP LIST</a></h3> <em><center>Powered by codes made by Dabomstew (© <?php echo date('Y');?>). Game Copyright ©<?php echo date('Y');?> <?php echo $set['game_owner'];?>.</center></em> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <th colspan='2'>Top 5 Players</th> </tr><?php $selectPlayers = $db->query("SELECT `userid`, `username`, `level` FROM `users` ORDER BY `level` DESC LIMIT 5"); while($row = $db->fetch_row($selectPlayers)) { ?><tr> <td><a href='viewuser.php?u=<?php echo $row['userid'];?>'><?php echo stripslashes(htmlspecialchars($row['username']));?></a></td> <td><?php echo $row['level'];?></td> </tr><?php } ?> <tr> <th colspan='2'>Top 5 Gangs</th> </tr><?php $selectPlayers = $db->query("SELECT `gangID`, `gangNAME`, `gangLEVEL` FROM `gangs` ORDER BY `gangLEVEL` DESC LIMIT 5"); while($row = $db->fetch_row($selectPlayers)) { ?><tr> <td><a href='gang.php?ID=<?php echo $row['gangID'];?>'><?php echo stripslashes(htmlspecialchars($row['gangNAME']));?></a></td> <td><?php echo $row['gangLEVEL'];?></td> </tr><?php } ?> </table> </td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </body> </html>
-
Track which query is pegging that error. As soon as you do that, I'll be able to help you :)
-
I'm not at the moment. I'm quite happy with mysqli_* procedural style functions. I'll convert my database abstraction layer to PDO and post up if requested :)
-
Uses my own database abstraction layer (using mysqli_* procedural style (at the moment)) Bugless (as far as I'm aware) Plenty of features Easily customisable I'm in the process of developing a template engine specifically designed for gRP[MTG] Multiple "multi" detection algorithms The only game currently using it has an active userbase. (323 members, currently 26 online, 72 within the last 24 hours) A very active Changelog that allows players to see exactly what's happening in their game The Staff "Panel" makes extensive use of my Staff Permissions, everything is easily customisable for those with the correct rank permissions The gang system was written from scratch and is very in-depth (yet easy to use). (Gang Perks to come soon) A lot more that I don't currently have the time to write (raking out the house)
-
I present to you: manageable permission-based staff ranks In the old system, they're hard-coded in. Any time you want to give a player/staff member access to something new, you must edit the code. In my new system, you simply edit their Staff Rank in the staff panel and access is granted/denied based on exactly what you want. Screenshots of how this works are available further down in another post (due to original site death). All it uses is 1 SQL table, an addition to the (grpg)users table, and a self-caching function to check staff permissions. I'm open to offers and comes with full installation, custom to your design
-
Use the file I have provided. Upload it to your webroot. Make sure the job is scheduled in your crontab
-
Gotta have an ego somewhere :P
-
Testing and fully working: <?php include(__DIR__ . '/config.php'); global $_CONFIG; if(!array_key_exists('code', $_GET) || $_GET['code'] != $_CONFIG['code']) exit; define("MONO_ON", 1); require(__DIR__ . '/class/class_db_'.$_CONFIG['driver'].'.php'); $db = new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; include(__DIR__ . '/global_funcs.php'); $db->query("UPDATE `fedjail` SET `fed_days` = `fed_days` - 1"); $q = $db->query("SELECT * FROM `fedjail` WHERE `fed_days` = 0"); $ids = array(); while($r = $db->fetch_row($q)) array_push($ids, $r['fed_userid']); if(count($ids) > 0) $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); $db->query("DELETE FROM `fedjail` WHERE `fed_days` = 0"); $db->query("UPDATE `users` SET " . "`daysingang` = IF(`gang` > 0, `daysingang` + 1, 0), " . "`daysold` = `daysold` + 1, " . "`boxes_opened` = 0, " . "`mailban` = IF(`mailban` > 0, `mailban` - 1, 0), " . "`donatordays` = IF(`donatordays` > 0, `donatordays` - 1, 0), " . "`cdays` = IF(`course` > 0, `cdays` - 1, 0), " . "`bankmoney` = IF(`bankmoney` > 0, `bankmoney` + (`bankmoney` * .2), 0) " . "`cybermoney` + IF(`cybermoney` > 0, (`cybermoney` * 0.7), 0)" ); $q = $db->query("SELECT `userid`, `course` FROM `users` WHERE `cdays` = 0 AND `course` > 0"); while($r = $db->fetch_row($q)) { $db->query("INSERT INTO `coursesdone` VALUES(".$r['userid'].", ".$r['course'].")"); $cd = $db->query("SELECT * FROM `courses` WHERE `crID` = ".$r['course']); if($db->num_rows($cd)) { $coud = $db->fetch_row($cd); $upd = ""; $ev = ""; if($coud['crSTR']) { $upd .= ", `strength` = `strength` + ".$coud['crSTR']; $ev .= ", ".number_format($coud['crSTR'])." strength"; } if($coud['crGUARD']) { $upd .= ", `guard` = `guard` + ".$coud['crGUARD']; $ev .= ", ".number_format($coud['crGUARD'])." guard"; } if($coud['crLABOUR']) { $upd .= ", `labour` = `labour` + ".$coud['crLABOUR']; $ev .= ", ".number_format($coud['crLABOUR'])." labour"; } if($coud['crAGIL']) { $upd .= ", `agility` = `agility` + ".$coud['crAGIL']; $ev .= ", ".number_format($coud['crAGIL'])." agility"; } if($coud['crIQ']) { $upd .= ", `IQ` = `IQ` + ".$coud['crIQ']; $ev .= ", ".number_format($coud['crIQ'])." IQ"; } $ev = substr($ev, 1); if($upd) $db->query("UPDATE userstats SET `userid` = `userid` ".$upd." WHERE `userid` = ".$r['userid']); event_add($r['userid'], "Congratulations, you completed the ".$coud['crNAME']." and gained ".$ev."!"); } else event_add($r['userid'], "Unfortunately, the course you were taking was removed from the School's curriculum. Your course has been ended at no extra cost to you"); } $db->query("UPDATE `users` SET `course` = 0 WHERE `cdays` = 0"); $db->query("TRUNCATE TABLE `votes`"); PHP: 5.4 Apache: 2.4.7 SQL: 5.6
-
You've clearly never used output buffer handling then :P
-
Ah, fair enough then :P
-
AJAX Tutorial System! [PAID WORK]
Magictallguy replied to Razor42's topic in Requests & In Production
Thank you, but I believe sniko is better suited to this - his knowledge of AJAX far outranks mine Also, my rate is $15 per hour