Jump to content
MakeWebGames

Magictallguy

Administrators
  • Posts

    2,142
  • Joined

  • Last visited

  • Days Won

    148

Everything posted by Magictallguy

  1. Magictallguy

    .

    Please post up your reply() function - it'll, most likely, be something in there
  2. Obviously, that can be changed to a simply $connectionID, or equivalent.
  3. The fact that it's MySQLImproved? I suppose, the only advantages I can think of are that the conversion tool I use is by MySQL themselves, suggesting that their code structure must be to standard (don't quote me on that)
  4. Haha, that was a standard query, with no real connection identifier - when used in a class, it is much, much more efficient
  5. Thank you :)
  6. I can, bear with me, just got back home from my fiancé's mums! Gotta shake off the "Meet the Parents" factor lol
  7. Had a little bit of free time, and I've tested it - works fine :)
  8. And I've just clicked onto what you meant lol, I'll experiment with MySQL's prepared statements, and see what it pulls back
  9. It doesn't change the query itself, just the function it uses. For example: <?php //Assume you're already connected using the variable $conn as your connection ID mysql_query("Some query", $conn) or die(mysql_error()); ?>   Would become <?php mysqli_query( $conn, "Some query") or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false))); ?>   As I've stated previously, it can't convert mysql_result, as there is no mysqli_ equivalent, but you can use a mysqli_data_seek
  10. Guys, leave him be. If you have nothing of any "worth" to say, then don't bother. He's clearly stated what he wants and what he's willing to pay (assuming LearningCoder (OP), is male). Someone might want to just get rid of their game, and come to him for a bit of quick cash - it's rare but it happens. With that being said, unless you're interested, bum off! :P
  11. Using MySQL's own Converter! Admittedly, it's not perfect (for example, mysql_result() doesn't have a MySQLi equivalent, but that's fine, I've got a workaround for that.) Now, obviously, you can download the files from MySQL and install it yourself, convert your own code, etc.. I simply remove those steps and do it all for you. Generally, within 15 minutes (family to time ratio providing!)
  12. The topic title speaks for itself. I offer MySQL to MySQLi conversion for any number of files, absolutely free - whilst you wait! My personal site, and my game engine are both running on purely MySQLi, and the only issues I've had are my own lazy-badly formed queries! There are tools online available, so you don't have to use my services, but if you don't want to go through the trouble of either getting the tools or converting it yourself, speak to me! Keep in mind, I can only work with actual code, nothing obfuscated! If you're interested, give me a shout on Skype! magic_tallguy My PDO wrapper is now available with a short tutorial on how to use it. Bear
  13. Badly coded, badly secured, bad code, for a bad engine.. 'nuff said
  14. Heh, maybe Sniko will get your arses in gear! :D
  15. Thank you Spud! ^.^
  16. I'm aware of that, but he didn't continue updating, so you can safely assume there are still 5 copies left until he says otherwise ;)
  17.   Speaks for itself :)
  18. That code is a mess Peter, fix it! xD
  19. Add into your class_db_{whichever driver you use}.php after the last } (before the ?>)   date_default_timezone_set('YOUR TIMEZONE HERE AS DEFINED BY http://www.php.net/manual/en/timezones.php');
  20. It's been a while since I've used v1, but I remember the tricks. I'd be happy to help :)
  21. And where am I? xD
  22. I've not bug checked or tested, this was on-the-fly. Insert your own security measures. Keep in mind that I haven't worked on an MC Craps system for a while - there most likely will be bugs Insert the cases of editdonpack and deldonpack case 'editdonpack': editDonPack(); break; case 'deldonpack': delDonPack(); break;   Overwrite the previous create_dp_form and create_dp_form2() functions and paste this in <?php #Remove this line <?php function create_dp_form() { global $db, $ir, $h; if(!isset($_POST['submit'])) { ?><h2>Create New DP <h2> <form action='staff_special.php?action=createdpform' method='post'> Package: <input type='text' name='package' /><br /> Dsys: <input type='text' name='days' /><br /> Money: <input type='text' name='money' /><br /> Crystals: <input type='text' name='crystals' /><br /> Items: <input type='text' name='items' /><br /> Cost: <input type='text' name='cost' value='0.00' /><br /> <input type='submit' name='submit' value='Create DP' /> </form><? } else { if($ir['user_level'] != 2) { echo "You're not an administrator"; $h->endpage(); exit; } $dontMiss = array( 'package', 'days', 'cost' ); foreach($dontMiss as $name) { $_POST[$name] = isset($_POST[$name]) && ctype_alnum($_POST[$name]) ? $_POST[$name] : null; if(empty($_POST[$name])) { echo "You missed something: " . $name; $h->endpage(); exit; } } $db->query(sprintf("INSERT INTO `donpage` (`dp_ID`, `package`, `days`, `money`, `crystals`, `items`, `cost`) VALUES ('%s', %u, %u, %u, %u, %s)", $db->escape($_POST['package']), $_POST['days'], $_POST['money'], $_POST['crystals'], $db->escape($_POST['items']), $_POST['cost'])); stafflog_add("Created a donator pack"); echo "Donator Pack Complete"; } } function editDonPack() { global $db, $ir, $h; if($ir['user_level'] != 2) { echo "You're not an administrator"; $h->endpage(); exit; } echo "<h3>Editing a donator pack</h3>"; $_GET['step'] = isset($_GET['step']) && ctype_alpha($_GET['step']) ? abs(@intval($_GET['step'])) : null; switch($_GET['step']) { default: $select = $db->query("SELECT `dp_ID`, `package`, `days` FROM `donpage` ORDER BY `dp_ID` ASC"); if(!$db->num_rows($select)) { echo "There are no donator packs to edit"; $h->endpage(); exit; } echo "Select a pack to edit<br /> <form action='staff_special.php?action=editdonpack&step=1' method='post'> <select name='pID' type='dropdown'>"; while($don = $db->fetch_row($select)) { printf("<option value='%u'>%s (%s Days)</option>", $don['dp_ID'], stripslashes($don['package']), number_format($don['days'])); } echo "</select> <input type='submit' value='Submit' /> </form>"; break; case 1: $_POST['pID'] = isset($_POST['pID']) && ctype_digit($_POST['pID']) ? abs(@intval($_POST['pID'])) : null; if(empty($_POST['pID'])) { echo "You didn't select a valid pack to edit"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT * FROM `donpage` WHERE (`dp_ID` = %u)", $_POST['pID'])); if(!$db->num_rows($select)) { echo "There are no donator packs to edit"; $h->endpage(); exit; } $don = $db->fetch_row($select); echo "<form action='staff_special.php?action=editdonpack&step=2' method='post> <input type='hidden' name='pID' value='" . $_POST['pID'] . "' /> Package: <input type='text' name='package' " . $don['package'] . " /><br /> Dsys: <input type='text' name='days' value='" . $don['days'] . "' /><br /> Money: <input type='text' name='money' value='" . $don['money'] . "' /><br /> Crystals: <input type='text' name='crystals' value='" . $don['crystals'] . "' /><br /> Items: <input type='text' name='items' value='" . $don['items'] . "' /><br /> Cost: <input type='text' name='cost' value='" . $don['cost'] . "' /><br /> <input type='submit' value='Edit Donator Pack' /> </form>"; break; case 2: $_POST['pID'] = isset($_POST['pID']) && ctype_digit($_POST['pID']) ? abs(@intval($_POST['pID'])) : null; if(empty($_POST['pID'])) { echo "You didn't select a valid pack to edit"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT `package` FROM `donpage` WHERE (`dp_ID` = %u)", $_POST['pID'])); if(!$db->num_rows($select)) { echo "That pack doesn't exist"; $h->endpage(); exit; } $pack = $db->fetch_single($select); $dontMiss = array( 'package', 'days', 'cost' ); foreach($dontMiss as $name) { $_POST[$name] = isset($_POST[$name]) && ctype_alnum($_POST[$name]) ? $_POST[$name] : null; if(empty($_POST[$name])) { echo "You missed something: " . $name; $h->endpage(); exit; } } $db->query(sprintf("UPDATE `donpage` SET `package` = '%s', `days` = %u, `money` = %u, `crystals` = %u, `items` = '%s', `cost` = '%s' WHERE (`dp_ID` = %u)", $_POST['package'], $_POST['days'], $_POST['money'], $_POST['crystals'], $_POST['items'], $_POST['cost'], $_POST['pID'])); stafflog_add("Edited a donator pack"); $what = ($pack == $_POST['package']) ? $pack : $pack . " > " . $_POST['package']; echo $what . " has been edited"; break; } } function deleteDonPack() { global $db, $ir, $h; if($ir['user_level'] != 2) { echo "You're not an administrator"; $h->endpage(); exit; } echo "<h3>Deleting a donator pack</h3>There is no confirmation, make sure you select the right pack<br />"; if(!isset($_POST['submit'])) { $select = $db->query("SELECT `dp_ID`, `package`, `days` FROM `donpage` ORDER BY `dp_ID` ASC"); if(!$db->num_rows($select)) { echo "There are no donator packs to edit"; $h->endpage(); exit; } echo "Select a pack to edit<br /> <form action='staff_special.php?action=deldonpack' method='post'> <select name='pID' type='dropdown'>"; while($don = $db->fetch_row($select)) { printf("<option value='%u'>%s (%s Days)</option>", $don['dp_ID'], stripslashes($don['package']), number_format($don['days'])); } echo "</select> <input type='submit' name='submit' value='Submit' /> </form>"; } else { $_POST['pID'] = isset($_POST['pID']) && ctype_digit($_POST['pID']) ? abs(@intval($_POST['pID'])) : null; if(empty($_POST['pID'])) { echo "You didn't select a valid pack to edit"; $h->endpage(); exit; } $select = $db->query(sprintf("SELECT `package` FROM `donpage` WHERE (`dp_ID` = %u)", $_POST['pID'])); if(!$db->num_rows($select)) { echo "That pack doesn't exist"; $h->endpage(); exit; } $pack = $db->fetch_single($select); $db->query(sprintf("DELETE FROM `donpage` WHERE (`dp_ID` = %u)", $_POST['pID'])); stafflog_add("Deleted donator: " . $pack); echo "You have deleted donator pack: " . $pack; } }   smenu.php edit: Add your links staff_special.php?action=editdonpack staff_special.php?action=deldonpack
  23. Ctrl + U, edit where necessary
  24. The link is in my signature. Excuse the layout, I'm attempting to implement a new one, but I'm not having much luck lol - absolute crap with layouts xD
  25. Ah, 'tis just a saying, sniko. Don't worry :P *grins evilly*
×
×
  • Create New...