Jump to content
MakeWebGames

Samurai Legend

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Samurai Legend

  1. My friend Phantom. I am going to tell you somethings about Reak City. Mailed you.
  2. Go to phpmyadmin and go to education_courses table. Find the field MustBeTakenBefore and make the field -1 on the course you inserted
  3. [MENTION=50378]Guest[/MENTION] - Demo Website <br /> <b>Warning</b>: move_uploaded_file(uploads/Screen Shot 2014-10-28 at 12.08.58 1.png): failed to open stream: Permission denied in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br /> <br /> <b>Warning</b>: move_uploaded_file(): Unable to move '/tmp/php81e8Vg' to 'uploads/Screen Shot 2014-10-28 at 12.08.58 1.png' in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br />
  4. [ATTACH=CONFIG]1717[/ATTACH]   I am trying to find out how I can make this? I want my game to have an Social Page. But I can't seem to find out how?
  5. Thank you guys so much! You guys are amazing
  6. $ir wouldn't work as it is in a cron file...
  7. I can do this for you. I can also throw in shared housing for you. All for $20
  8. Your game is...not clear
  9. Four Lions watched it many times! So funny it was on yesterday too! Haha
  10. Thanks for the advice! I updated my post :D I am just trying to find out how would I send an event to the users saying how much they paid.
  11. Run this in phpmyadmin - ALTER TABLE users ADD hosp_bill INT(11) DEFAULT 0 ; ALTER TABLE users ADD hosp_policy INT(11) DEFAULT 0 ; Create a file called insurance_agent.php - <?php require('globals.php'); echo "<h3><u>Medical Insurance</u></h3>"; if ($ir['jail'] or $ir['hospital']) { error('This page cannot be accessed while in jail or hospital.'); } if (!isset($_GET['x'])) { $_GET['x'] = ''; } switch ($_GET['x']) { case 'money': money(); break; case 'coins': coins(); break; default: index(); break; } function index() { global $ir, $goback; echo "<hr width ='75%'>Welcome to the Insurance Agency!<br/> You have <b>{$ir['hosp_policy']}</b> days left before you can renew your policy.<br/> How would you like to pay for your policy?<br/><br/> <a href='insurance_agent.php?x=money'>30 days of insurance policy - " . money_formatter(3500) . "</a><br/> <a href='insurance_agent.php?x=coins'>30 days of insurance policy - 500 coins</a><hr width ='75%'>$goback<hr width ='75%'>"; } function money() { global $db, $ir, $userid; if ($ir['money'] < 3500) { error('You need ¥3500.'); } else if ($ir['hosp_policy'] > 0) { error("You have {$ir['hosp_policy']} days left before you must renew your policy."); } else { $db->query("UPDATE `users` SET `hosp_policy` = `hosp_policy` + 30, `money` = `money` - 2500 WHERE `userid` = $userid"); confirmation("You have paid ¥3500 for 30 days of insurance policy."); } } function coins() { global $db, $ir, $userid; if ($ir['coins'] < 500) { error('You need 500 coins.'); } else if ($ir['hosp_policy'] > 0) { error("You have {$ir['hosp_policy']} days left before you must renew your policy."); } else { $db->query("UPDATE `users` SET `hosp_policy` = `hosp_policy` + 30, `coins` = `coins` - 500 WHERE `userid` = $userid"); confirmation("You have paid 500 coins for 30 days of insurance policy."); } } $h->endpage(); ?> Open up hospital.php and add this somewhere - echo"Medical Bill: " . money_formatter($ir['hosp_bill']) . ""; Open up cron_day.php and add this somewhere - $db->query("UPDATE `users` SET `hosp_policy` = `hosp_policy` - 1 WHERE `hosp_policy` > 0",$c); $db->query("UPDATE `users` SET `money` = `money` - `hosp_bill` WHERE hosp_policy > 0",$c); $db->query("UPDATE `users` SET `hosp_bill` = 0 WHERE `hosp_bill` > 0",$c); Open up attackbeat.php, attackwon.php and attacktake.php and find - $db->query( "UPDATE `users` SET `hp` = 1, `hospital` = $hosptime, `hospreason` = '$hospreason' WHERE `userid` = {$r['userid']}"); Replace with - $db->query( "UPDATE `users` SET `hp` = 1, `hospital` = $hosptime, `hospreason` = '$hospreason', `hosp_bill` = `hosp_bill` + $hosptime * 10 WHERE `userid` = {$r['userid']}");
  12. How would I make a drop down list of users from a clan? Has to be a drop down list of their members in their clan. [ATTACH=CONFIG]1715[/ATTACH] I want to replace that to a drop down list
  13. His stealing the design off me! Hybrid! How dare you! Take it down. if you look at my login and his login its quite similar. Please take down the css and login html or I will go into further action. [ATTACH=CONFIG]1710[/ATTACH] [ATTACH=CONFIG]1711[/ATTACH]
  14. Oh, alright haha! Thank you all for helping me out! But I got it fixed :D
  15. I get this error :(   1054: Unknown column 'string' in 'field list' Action taken: Attempted to execute query: UPDATE `items` SET `itmtype` = 5,`itmname` = "Reserve Collectables #1",`itmdesc` = "Reserve Collectables #1",`itmbuyprice` = string,`itmsellprice` = 250,`itmbuyable` = 0,`effect1_on` = "0",`effect1` = "a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}",`effect2_on` = "0",`effect2` = "a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}",`effect3_on` = "0",`effect3` = "a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}",`weapon` = 0,`armor` = 0,`shield` = 0 WHERE `itmid` = 19
  16. Kyles method worked great! Thanks man. The first one infact actually fixed it. Also how can I make this - $_POST['$itmbuyprice'] = (isset($_POST['itmbuyprice']) && is_numeric($_POST['itmbuyprice'])) ? abs(intval($_POST['itmbuyprice'])) : 0;   Accepte 0s? At the moment it does not accepte 0 any other numbers work apart from 0. Apparently 0 is an empty field?
  17. The staff items file is a bit annoying. When ever I don't tick item buyable I get errors. One error -   A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined index: itmbuyable (8) Line executed: /home/****/public_html/staff/staff_items.php:174   Another error is when i just leave the itembuyprice = 0 or blank - You missed one or more of the fields. Please go back and try again.   Code (http://pastebin.com/6hgqSVEq) -   <?php require_once('sglobals.php'); //This contains item stuffs if (!isset($_GET['action'])) { $_GET['action'] = ''; } switch ($_GET['action']) { case 'newitem': new_item_form(); break; case 'newitemsub': new_item_submit(); break; case 'giveitem': give_item_form(); break; case 'giveitemsub': give_item_submit(); break; case 'killitem': kill_item_form(); break; case 'killitemsub': kill_item_submit(); break; case 'edititem': edit_item_begin(); break; case 'edititemform': edit_item_form(); break; case 'edititemsub': edit_item_sub(); break; case 'newitemtype': newitemtype(); break; default: echo "Error: This script requires an action."; break; } function new_item_form() { global $db, $ir, $c; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $csrf = request_csrf_html('staff_newitem'); echo " <h3>Adding an item to the game</h3> <form action='staff_items.php?action=newitemsub' method='post'> Item Name: <input type='text' name='itmname' value='' /> <br /> Item Desc.: <input type='text' name='itmdesc' value='' /> <br /> Item Type: " . itemtype_dropdown(NULL, 'itmtype') . " <br /> Item Buyable: <input type='checkbox' name='itmbuyable' checked='checked' /> <br /> Item Price (Value have to be greater then -1): <input type='text' name='itmbuyprice' /> <br /> Item Sell Value: <input type='text' name='itmsellprice' /> <br /> <br /> <hr /> <b>Usage Form</b>"; for ($i = 1; $i <= 3; $i++) { echo "<hr /> <b><u>Effect {$i}</u></b> <br /> On? <input type='radio' name='effect{$i}on' value='1' /> Yes <input type='radio' name='effect{$i}on' value='0' checked='checked' /> No <br /> Stat: <select name='effect{$i}stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='coins'>Coins</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect{$i}dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> <br /> Amount: <input type='text' name='effect{$i}amount' value='0' /> <select name='effect{$i}type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select>"; } echo " <hr /> <b>Combat Usage</b> <br /> Weapon Power: <input type='text' name='weapon' value='0' /> <br /> Armor Defence: <input type='text' name='armor' value='0' /> <br /> Shield Defence: <input type='text' name='shield' value='0' /> <hr /> {$csrf} <input type='submit' value='Add Item To Game' /> </form> "; } function new_item_submit() { global $db, $ir, $c, $h; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_newitem', 'staff_items.php?action=newitem'); $itmname = (isset($_POST['itmname'])) ? $db->escape(strip_tags(stripslashes($_POST['itmname']))) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? $db->escape(strip_tags(stripslashes($_POST['itmdesc']))) : ''; $weapon = (isset($_POST['weapon']) && is_numeric($_POST['weapon'])) ? abs(intval($_POST['weapon'])) : 0; $armor = (isset($_POST['armor']) && is_numeric($_POST['armor'])) ? abs(intval($_POST['armor'])) : 0; $shield = (isset($_POST['shield']) && is_numeric($_POST['shield'])) ? abs(intval($_POST['shield'])) : 0; $_POST['itmtype'] = (isset($_POST['itmtype']) && is_numeric($_POST['itmtype'])) ? abs(intval($_POST['itmtype'])) : ''; $_POST['itmbuyprice'] = (isset($_POST['itmbuyprice']) && is_numeric($_POST['itmbuyprice'])) ? abs(intval($_POST['itmbuyprice'])) : ''; $_POST['itmsellprice'] = (isset($_POST['itmsellprice']) && is_numeric($_POST['itmsellprice'])) ? abs(intval($_POST['itmsellprice'])) : ''; if (empty($itmname) || empty($itmdesc) || empty($_POST['itmtype']) || empty($_POST['itmsellprice']) || empty($_POST['itembuyprice'])) { echo 'You missed one or more of the fields. Please go back and try again.<br /> > <a href="staff_items.php?action=newitem">Go Back</a>'; pr_arr($_POST); die($h->endpage()); } $itmbuy = ($_POST['itmbuyable'] == 'on') ? 1 : 0; $effects = array(); for ($i = 1; $i <= 3; $i++) { $efxkey = "effect{$i}"; $_POST[$efxkey . 'stat'] = (isset($_POST[$efxkey . 'stat']) && in_array($_POST[$efxkey . 'stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'money', 'coins', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST[$efxkey . 'stat'] : 'energy'; $_POST[$efxkey . 'dir'] = (isset($_POST[$efxkey . 'dir']) && in_array($_POST[$efxkey . 'dir'], array('pos', 'neg'))) ? $_POST[$efxkey . 'dir'] : 'pos'; $_POST[$efxkey . 'type'] = (isset($_POST[$efxkey . 'type']) && in_array($_POST[$efxkey . 'type'], array('figure', 'percent'))) ? $_POST[$efxkey . 'type'] : 'figure'; $_POST[$efxkey . 'amount'] = (isset($_POST[$efxkey . 'amount']) && is_numeric($_POST[$efxkey . 'amount'])) ? abs(intval($_POST[$efxkey . 'amount'])) : 0; $_POST[$efxkey . 'on'] = (isset($_POST[$efxkey . 'on']) && in_array($_POST[$efxkey . 'on'], array('1', '0'))) ? $_POST[$efxkey . 'on'] : 0; $effects[$i] = $db->escape( serialize( array("stat" => $_POST[$efxkey . 'stat'], "dir" => $_POST[$efxkey . 'dir'], "inc_type" => $_POST[$efxkey . 'type'], "inc_amount" => abs( (int) $_POST[$efxkey . 'amount'])))); } $m = $db->query( "INSERT INTO `items` VALUES(NULL, {$_POST['itmtype']}, '$itmname', '$itmdesc', {$_POST['itmbuyprice']}, {$_POST['itmsellprice']}, $itmbuy, '{$_POST['effect1on']}', '{$effects[1]}', '{$_POST['effect2on']}', '{$effects[2]}', '{$_POST['effect3on']}', '{$effects[3]}', $weapon, $armor, $shield)"); stafflog_add("Created item {$_POST['itmname']}"); echo 'The ' . $_POST['itmname'] . ' Item was added to the game.<br /> > <a href="staff_items.php?action=newitem">Go Home</a>'; die($h->endpage()); } function give_item_form() { global $db, $ir, $c; if (!in_array($ir['user_level'], array(2, 3))) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $csrf = request_csrf_html('staff_giveitem'); echo " <h3>Giving Item To User</h3> <form action='staff_items.php?action=giveitemsub' method='post'> User: " . user_dropdown(NULL, 'user') . " <br /> Item: " . item_dropdown(NULL, 'item') . " <br /> Quantity: <input type='text' name='qty' value='1' /> <br /> {$csrf} <input type='submit' value='Give Item' /> </form> "; } function give_item_submit() { global $db, $ir, $c, $h; if (!in_array($ir['user_level'], array(2, 3))) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_giveitem', 'staff_items.php?action=giveitem'); $_POST['item'] = (isset($_POST['item']) && is_numeric($_POST['item'])) ? abs(intval($_POST['item'])) : ''; $_POST['user'] = (isset($_POST['user']) && is_numeric($_POST['user'])) ? abs(intval($_POST['user'])) : ''; $_POST['qty'] = (isset($_POST['qty']) && is_numeric($_POST['qty'])) ? abs(intval($_POST['qty'])) : ''; if (empty($_POST['item']) || empty($_POST['user']) || empty($_POST['qty'])) { echo 'Something was inputted incorrectly, please try again.<br /> > <a href="staff_items.php?action=giveitem">Go Back</a>'; die($h->endpage()); } $q = $db->query( 'SELECT COUNT(`itmid`) FROM `items` WHERE `itmid` = ' . $_POST['item']); $q2 = $db->query( 'SELECT COUNT(`userid`) FROM `users` WHERE `userid` = ' . $_POST['user']); if ($db->fetch_single($q) == 0 OR $db->fetch_single($q2) == 0) { $db->free_result($q); $db->free_result($q2); echo 'Item/User doesn\'t seem to exist.<br /> > <a href="staff_items.php?action=giveitem">Go Back</a>'; die($h->endpage()); } $db->free_result($q); $db->free_result($q2); item_add($_POST['user'], $_POST['item'], $_POST['qty']); stafflog_add( "Gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"); echo 'You gave ' . $_POST['qty'] . ' of item ID ' . $_POST['item'] . ' to user ID ' . $_POST['user'] . '<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } function kill_item_form() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $csrf = request_csrf_html('staff_killitem'); echo " <h3>Deleting Item</h3> The item will be permanently removed from the game. <br /> <form action='staff_items.php?action=killitemsub' method='post'> Item: " . item_dropdown(NULL, 'item') . " <br /> {$csrf} <input type='submit' value='Kill Item' /> </form> "; } function kill_item_submit() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_killitem', 'staff_items.php?action=killitem'); $_POST['item'] = (isset($_POST['item']) && is_numeric($_POST['item'])) ? abs(intval($_POST['item'])) : ''; if (empty($_POST['item'])) { echo 'Invalid Item.<br /> > <a href="staff_items.php?action=killitem">Go Back</a>'; die($h->endpage()); } $d = $db->query( "SELECT `itmname` FROM `items` WHERE `itmid` = {$_POST['item']}"); if ($db->num_rows($d) == 0) { $db->free_result($d); echo 'Item doesn\'t seem to exist.<br /> > <a href="staff_items.php?action=killitem">Go Back</a>'; die($h->endpage()); } $itemname = $db->fetch_single($d); $db->free_result($d); $db->query("DELETE FROM `items` WHERE `itmid` = {$_POST['item']}"); $db->query( "DELETE FROM `shopitems` WHERE `sitemITEMID` = {$_POST['item']}"); $db->query( "DELETE FROM `inventory` WHERE `inv_itemid` = {$_POST['item']}"); $db->query( "DELETE FROM `itemmarket` WHERE `imITEM` = {$_POST['item']}"); stafflog_add("Deleted item {$itemi['itmname']}"); echo 'The ' . $itemi['itmname'] . ' Item was removed from the game.<br /> > <a href="staff.php">Go Home</a>'; die($h->endpage()); } function edit_item_begin() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="staff.php">Go Back</a>'; die($h->endpage()); } $csrf = request_csrf_html('staff_edititem1'); echo " <h3>Editing Item</h3> You can edit any aspect of this item.<br /> <form action='staff_items.php?action=edititemform' method='post'> Item: " . item_dropdown(NULL, 'item') . " <br /> {$csrf} <input type='submit' value='Edit Item' /> </form> "; } function edit_item_form() { global $db, $ir, $c, $h; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem1', 'staff_items.php?action=edititem'); $_POST['item'] = (isset($_POST['item']) && is_numeric($_POST['item'])) ? abs(intval($_POST['item'])) : ''; if (empty($_POST['item'])) { echo 'Invalid Item.<br /> > <a href="staff_items.php?action=killitem">Go Back</a>'; die($h->endpage()); } $d = $db->query( "SELECT * FROM `items` WHERE `itmid` = {$_POST['item']}"); if ($db->num_rows($d) == 0) { $db->free_result($d); echo 'Item doesn\'t seem to exist.<br /> > <a href="staff_items.php?action=edititem">Go Back</a>'; die($h->endpage()); } $itemi = $db->fetch_row($d); $db->free_result($d); $csrf = request_csrf_html('staff_edititem2'); $itmname = addslashes($itemi['itmname']); $itmdesc = addslashes($itemi['itmdesc']); echo " <h3>Editing Item</h3> <form action='staff_items.php?action=edititemsub' method='post'> <input type='hidden' name='itmid' value='{$_POST['item']}' /> Item Name: <input type='text' name='itmname' value='{$itmname}' /> <br /> Item Desc.: <input type='text' name='itmdesc' value='{$itmdesc}' /> <br /> Item Type: " . itemtype_dropdown(NULL, 'itmtype', $itemi['itmtype']) . " <br /> Item Buyable: <input type='checkbox' name='itmbuyable' " . (($itemi['itmbuyable']) ? "checked='checked'" : '') . " /> <br /> Item Price (Value have to be greater then -1): <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> <br /> Item Sell Value: <input type='text' name='itmsellprice' value='{$itemi['itmsellprice']}' /> <hr /> <b>Usage Form</b> <hr /> "; $stats = array("energy" => "Energy", "will" => "Will", "brave" => "Brave", "hp" => "Health", "strength" => "Strength", "agility" => "Agility", "guard" => "Guard", "labour" => "Labour", "IQ" => "IQ", "hospital" => "Hospital Time", "jail" => "Jail Time", "money" => "Money", "coins" => "Coins", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for ($i = 1; $i <= 3; $i++) { if (!empty($itemi["effect" . $i])) { $efx = unserialize($itemi["effect" . $i]); } else { $efx = array("inc_amount" => 0); } $switch1 = ($itemi['effect' . $i . '_on'] > 0) ? " checked='checked'" : ""; $switch2 = ($itemi['effect' . $i . '_on'] > 0) ? "" : " checked='checked'"; echo " <b><u>Effect {$i}</u></b> <br /> On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No <br /> Stat: <select name='effect{$i}stat' type='dropdown'> "; foreach ($stats as $k => $v) { echo ($k == $efx['stat']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } $str = ($efx['dir'] == "neg") ? '<option value="pos">Increase</option> <option value="neg" selected="selected">Decrease</option>' : '<option value="pos" selected="selected">Increase</option> <option value="neg">Decrease</option>'; $str2 = ($efx['inc_type'] == "percent") ? '<option value="figure">Value</option> <option value="percent" selected="selected">Percent</option>' : '<option value="figure" selected="selected">Value</option> <option value="percent">Percent</option>'; echo " </select> Direction: <select name='effect{$i}dir' type='dropdown'> {$str} </select> <br /> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select> <hr /> "; } echo " <b>Combat Usage</b> <br /> Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> <br /> Armor Defence: <input type='text' name='armor' value='{$itemi['armor']}' /> <br /> Shield Defence: <input type='text' name='shield' value='{$itemi['shield']}' /> <hr /> {$csrf} <input type='submit' value='Edit Item' /> </form> "; } function edit_item_sub() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem2', 'staff_items.php?action=edititem'); $itmname = (isset($_POST['itmname'])) ? $db->escape(strip_tags(stripslashes($_POST['itmname']))) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? $db->escape(strip_tags(stripslashes($_POST['itmdesc']))) : ''; $weapon = (isset($_POST['weapon']) && is_numeric($_POST['weapon'])) ? abs(intval($_POST['weapon'])) : 0; $armor = (isset($_POST['armor']) && is_numeric($_POST['armor'])) ? abs(intval($_POST['armor'])) : 0; $shield = (isset($_POST['shield']) && is_numeric($_POST['shield'])) ? abs(intval($_POST['shield'])) : 0; $_POST['itmtype'] = (isset($_POST['itmtype']) && is_numeric($_POST['itmtype'])) ? abs(intval($_POST['itmtype'])) : ''; $_POST['itmbuyprice'] = (isset($_POST['itmbuyprice']) && is_numeric($_POST['itmbuyprice'])) ? abs(intval($_POST['itmbuyprice'])) : ''; $_POST['itmsellprice'] = (isset($_POST['itmsellprice']) && is_numeric($_POST['itmsellprice'])) ? abs(intval($_POST['itmsellprice'])) : ''; $_POST['itmid'] = (isset($_POST['itmid']) && is_numeric($_POST['itmid'])) ? abs(intval($_POST['itmid'])) : ''; if (empty($itmname) || empty($itmdesc) || empty($_POST['itmtype']) || empty($_POST['itmsellprice']) || empty($_POST['itmsellprice']) || empty($_POST['itmid'])) { echo 'You missed one or more of the fields. Please go back and try again.<br /> > <a href="staff_items.php?action=edititem">Go Back</a>'; die($h->endpage()); } $q = $db->query( 'SELECT COUNT(`itmid`) FROM `items` WHERE `itmid` = ' . $_POST['itmid']); if ($db->fetch_single($q) == 0) { $db->free_result($q); echo 'Invalid item.<br /> > <a href="staff_items.php?action=edititem">Go Back</a>'; die($h->endpage()); } $db->free_result($q); $itmbuy = ($_POST['itmbuyable'] == 'on') ? 1 : 0; $effects = array(); for ($i = 1; $i <= 3; $i++) { $efxkey = "effect{$i}"; $_POST[$efxkey . 'stat'] = (isset($_POST[$efxkey . 'stat']) && in_array($_POST[$efxkey . 'stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'money', 'coins', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST[$efxkey . 'stat'] : 'energy'; $_POST[$efxkey . 'dir'] = (isset($_POST[$efxkey . 'dir']) && in_array($_POST[$efxkey . 'dir'], array('pos', 'neg'))) ? $_POST[$efxkey . 'dir'] : 'pos'; $_POST[$efxkey . 'type'] = (isset($_POST[$efxkey . 'type']) && in_array($_POST[$efxkey . 'type'], array('figure', 'percent'))) ? $_POST[$efxkey . 'type'] : 'figure'; $_POST[$efxkey . 'amount'] = (isset($_POST[$efxkey . 'amount']) && is_numeric($_POST[$efxkey . 'amount'])) ? abs(intval($_POST[$efxkey . 'amount'])) : 0; $_POST[$efxkey . 'on'] = (isset($_POST[$efxkey . 'on']) && in_array($_POST[$efxkey . 'on'], array('1', '0'))) ? $_POST[$efxkey . 'on'] : 0; $effects[$i] = $db->escape( serialize( array("stat" => $_POST[$efxkey . 'stat'], "dir" => $_POST[$efxkey . 'dir'], "inc_type" => $_POST[$efxkey . 'type'], "inc_amount" => abs( (int) $_POST[$efxkey . 'amount'])))); } $db->query( 'UPDATE `items` SET `itmtype` = ' . $_POST['itmtype'] . ',`itmname` = "' . $itmname . '",`itmdesc` = "' . $itmdesc . '",`itmbuyprice` = ' . $_POST['itmbuyprice'] . ',`itmsellprice` = ' . $_POST['itmsellprice'] . ',`itmbuyable` = ' . $itmbuy . ',`effect1_on` = "' . $_POST['effect1on'] . '",`effect1` = "' . $effects[1] . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $effects[2] . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $effects[3] . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ',`shield` = ' . $shield . ' WHERE `itmid` = ' . $_POST['itmid']); stafflog_add("Edited item {$_POST['itmname']}"); echo 'The ' . $_POST['itmname'] . ' Item was edited successfully.<br /> > <a href="staff.php">Go Home</a>'; die($h->endpage()); } function newitemtype() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } $_POST['name'] = (isset($_POST['name']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name'])) ? $db->escape(strip_tags(stripslashes($_POST['name']))) : ''; if (!empty($_POST['name'])) { staff_csrf_stdverify('staff_newitemtype', 'staff_items.php?action=newitemtype'); $db->query( "INSERT INTO `itemtypes` VALUES(NULL, '{$_POST['name']}')"); stafflog_add('Added item type ' . $_POST['name']); echo 'Item Type ' . $_POST['name'] . ' added.<br /> > <a href="staff.php">Go Home</a>'; die($h->endpage()); } else { $csrf = request_csrf_html('staff_newitemtype'); echo " <h3>Add Item Type</h3> <hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <br /> {$csrf} <input type='submit' value='Add Item Type' /> </form> "; } } $h->endpage();
  18. I'm also blacklisted. Stupid Paypal say I have more than one account :/
  19. http://www.speedtest.net/result/3820577198.png
  20. Okay benlucraft. Why make a new account?
  21. I use, mobile,tablet and PC. I say I equally use them.
  22. Replace "£" with "£"
  23. [MENTION=50378]Guest[/MENTION] - Thanks so much! That work out and helped me a lot! I have solved my problem thanks to you! love you man!
  24. So, I was trying to create a staff file for the education courses I have for my game, however when ever I hit submit the fields reset and nothing happens.   function addcourse() { global $db, $ir, $c, $h, $userid; $name = (isset($_POST['name']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['name'])) ? $db->escape(strip_tags(stripslashes($_POST['name']))) : ''; $description = (isset($_POST['description']) && preg_match( "/^[a-z0-9_.]+([\\s]{1}[a-z0-9_.]|[a-z0-9_.])+$/i", $_POST['description'])) ? $db->escape(strip_tags(stripslashes($_POST['description']))) : ''; $clicks_needed_total = (isset($_POST['clicks_needed_total']) && is_numeric($_POST['clicks_needed_total'])) ? abs(intval($_POST['clicks_needed_total'])) : ''; $clicks_max_hourly = (isset($_POST['clicks_max_hourly']) && is_numeric($_POST['clicks_max_hourly'])) ? abs(intval($_POST['clicks_max_hourly'])) : ''; $clicks_max_daily = (isset($_POST['clicks_max_daily']) && is_numeric($_POST['clicks_max_daily'])) ? abs(intval($_POST['clicks_max_daily'])) : ''; $cost_money = (isset($_POST['cost_money']) && is_numeric($_POST['cost_money'])) ? abs(intval($_POST['cost_money'])) : ''; $award_STR = (isset($_POST['award_STR']) && is_numeric($_POST['award_STR'])) ? abs(intval($_POST['award_STR'])) : ''; $award_GUARD = (isset($_POST['award_GUARD']) && is_numeric($_POST['award_GUARD'])) ? abs(intval($_POST['award_GUARD'])) : ''; $award_LABOUR = (isset($_POST['award_LABOUR']) && is_numeric($_POST['award_LABOUR'])) ? abs(intval($_POST['award_LABOUR'])) : ''; $award_AGIL = (isset($_POST['award_AGIL']) && is_numeric($_POST['award_AGIL'])) ? abs(intval($_POST['award_AGIL'])) : ''; $award_IQ = (isset($_POST['award_IQ']) && is_numeric($_POST['award_IQ'])) ? abs(intval($_POST['award_IQ'])) : ''; $_POST['mustBeTakenBefore'] = (isset($_POST['mustBeTakenBefore']) && is_numeric($_POST['mustBeTakenBefore'])) ? abs(intval($_POST['mustBeTakenBefore'])) : ''; if ($name && $description && $mustBeTakenBefore && $clicks_needed_total && $clicks_max_hourly && $clicks_max_daily && $cost_money && $award_STR && $award_GUARD && $award_LABOUR && $award_AGIL && $award_IQ) { staff_csrf_stdverify('staff_addcourse', 'staff_education.php?action=addcourse'); $q = $db->query( "SELECT COUNT(`ID`) FROM `education_courses` WHERE `name` = '{$name}'"); if ($db->fetch_single($q) > 0) { $db->free_result($q); error('Sorry, you cannot have two courses with the same name.'); } $db->free_result($q); $db->query( "INSERT INTO `education_courses` VALUES('', '$name', '$description', '$mustBeTakenBefore', '$clicks_needed_total', '$clicks_max_hourly', '$clicks_max_daily', '$cost_money', '$award_STR', '$award_GUARD', '$award_LABOUR', '$award_AGIL', '$award_IQ')"); confirmation('Course ' . $name . ' added to the game.'); stafflog_add("Created course $name"); } else { $csrf = request_csrf_html('staff_addcourse'); echo " <h3>Add Course</h3> <hr /> <form action='staff_education.php?action=addcourse' method='post'> Name: <input type='text' name='name' /> <br /> Previous Course Required: " . course_dropdown(NULL, "mustBeTakenBefore") . " <br /> Total Clicks: <input type='text' name='clicks_needed_total' /> <br /> Maximum Clicks Hourly: <input type='text' name='clicks_max_hourly' /> <br /> Maximum Clicks Daily: <input type='text' name='clicks_max_daily' /> <br /> Course Cost: <input type='text' name='cost_money' /> <br /> Strength Reward: <input type='text' name='award_STR' /> <br /> Agility Reward: <input type='text' name='award_AGIL' /> <br /> Guard Reward: <input type='text' name='award_GUARD' /> <br /> Labour Reward: <input type='text' name='award_LABOUR' /> <br /> IQ Reward: <input type='text' name='award_IQ' /> <br /> {$csrf} <input type='submit' value='Add Course' /> </form> "; } }   [ATTACH=CONFIG]1705[/ATTACH]
  25. Everything stats etc.
×
×
  • Create New...