? Sparks ?
Members-
Posts
134 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by ? Sparks ?
-
Re: Look at this please LOL is this suppose to be a joke
-
Ok so I got the gangs file, But I need help with a query error. Here Is the file <?php include "globals.php"; if($ir['money'] < 5000000) { die("You don't have enough money. You need \$5,000,000."); } if($ir['gang']) { die ("You're already in a gang!"); } if($_POST['submit']) { $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')"); $i=$db->insert_id(); $db->query("UPDATE users SET gang=$i,money=money-5000000 where userid=$userid"); print "Gang created!"; } else { print "<h3> Create A Gang </h3><form action='creategang.php' method='post'><input type='hidden' name='submit' value='1' />Name:<input type='text' name='name' /> Description: <textarea name='desc' cols='40' rows='7'></textarea> <input type='submit' value='Create Gang for \$500,000' /></form>"; } $h->endpage(); ?> And here Is the error QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO gangs VALUES('','Druggie Drunk Veterans','Welcome','','',0,0,100,6,6,5,0,0,'')
-
Ok for some reason, It says my password Is wrong. Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/a7177971/public_html/config.php on line 5 Now am I using the password that logs me Into phpmyadmin Or what?
-
Re: Staff_items.php I just woke up, But I kinda get what you saying, thanks I will check now
-
Re: I need help Please read asap Well I wanted to show what page had the damn error
-
Re: I need help Please read asap Dude Wth It was in game modifications, Which means It was free so I posted It Get over It champ
-
Re: Staff_items.php $m=$db->query("INSERT INTO items (value1,value2,value3,value4,value5,value6,value7,value8,value9,value10,value11,value12,value13,value14,value15,value16,value17,value18,value19,value20,value21) VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},'$itmbuy',{$_POST['effect1on']},'$efx1',{$_POST['effect2on']},'$efx2',{$_POST['effect3on']},'$efx3', '$weapon', '$armor')"); print "The {$_POST['itmname']} Item was added to the game."; stafflog_add("Created item {$_POST['itmname']}"); I know that's where the error Is
-
Re: Converting V1 to V2 Lol If Its possible to get a +1 for this give me one, because this is teaching the people that don't know how to do it a valuable lesson :lol: :-P
-
Ok so I am really tired of people asking others to convert the code to V2 ( I am not going to lie I used to also But I learned how) Ok so first off In the V1 file Find session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); Then Replace It with include "globals.php"; Then In the V1 file find mysql_ And replace It with $db->
-
Re: [V1][V2] 50/50 Chance Mod. Free Version +1 Nice one dude
-
Re: Staff_items.php <?php include "sglobals.php"; //This contains item stuffs 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: print "Error: This script requires an action."; break; } function new_item_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<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='' /> Item Desc.: <input type='text' name='itmdesc' value='' /> Item Type: ".itemtype_dropdown($c,'itmtype')." Item Buyable: <input type='checkbox' name='itmbuyable' checked='checked' /> Item Price: <input type='text' name='itmbuyprice' /> Item Sell Value: <input type='text' name='itmsellprice' /> <hr /> [b]Usage Form[/b]<hr /> [b]<u>Effect 1</u>[/b] On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No Stat: <select name='effect1stat' 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='crystals'>Crystals</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='effect1dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 2</u>[/b] On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No Stat: <select name='effect2stat' 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='crystals'>Crystals</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='effect2dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 3</u>[/b] On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No Stat: <select name='effect3stat' 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='crystals'>Crystals</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='effect3dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect3amount' value='0' /> <select name='effect3type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='0' /> Armor Defense: <input type='text' name='armor' value='0' /><hr /> <input type='submit' value='Add Item To Game' /></form>"; } function new_item_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='admin.php?action=newitem']> Back[/url]"; $h->endpage(); exit; } $itmname=$db->escape($_POST['itmname']); $itmdesc=$db->escape($_POST['itmdesc']); $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items (value1,value2,value3,value4,value5,value6,value7,value8,value9,value10,value11,value12,value13,value14,value15,value16,value17,value18,value19,value20,value21) VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},'$itmbuy',{$_POST['effect1on']},'$efx1',{$_POST['effect2on']},'$efx2',{$_POST['effect3on']},'$efx3', '$weapon', '$armor')"); print "The {$_POST['itmname']} Item was added to the game."; stafflog_add("Created item {$_POST['itmname']}"); } function give_item_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving Item To User</h3> <form action='staff_items.php?action=giveitemsub' method='post'> User: ".user_dropdown($c,'user')." Item: ".item_dropdown($c,'item')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give Item' /></form>"; } function give_item_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"); } function kill_item_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item</h3> The item will be permanently removed from the game. <form action='staff_items.php?action=killitemsub' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Kill Item' /></form>"; } function kill_item_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($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']}"); print "The {$itemi['itmname']} Item was removed from the game."; stafflog_add("Deleted item {$itemi['itmname']}"); } function edit_item_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing Item</h3> You can edit any aspect of this item. <form action='staff_items.php?action=edititemform' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Edit Item' /></form>"; } function edit_item_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); print "<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='{$itemi['itmname']}' /> Item Desc.: <input type='text' name='itmdesc' value='{$itemi['itmdesc']}' /> Item Type: ".itemtype_dropdown($c,'itmtype',$itemi['itmtype'])." Item Buyable: <input type='checkbox' name='itmbuyable'"; if ($itemi['itmbuyable']) { print " checked='checked'"; } print " /> Item Price: <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> 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", "crystals" => "Crystals", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for($i=1;$i<=3;$i++) { if($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'"; print "[b]<u>Effect {$i}</u>[/b] On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No Stat: <select name='effect{$i}stat' type='dropdown'>"; foreach($stats as $k => $v) { if($k==$efx['stat']) { print "<option value='{$k}' selected='selected'>{$v}</option>\n"; } else { print "<option value='$k'>{$v}</option>\n"; } } if($efx['dir']=="neg") { $str="<option value='pos'>Increase</option><option value='neg' selected='selected'>Decrease</option>"; } else { $str="<option value='pos' selected='selected'>Increase</option><option value='neg'>Decrease</option>"; } if($efx['inc_type']=="percent") { $str2="<option value='figure'>Value</option><option value='percent' selected='selected'>Percent</option>"; } else { $str2="<option value='figure' selected='selected'>Value</option><option value='percent'>Percent</option>"; } print "</select> Direction: <select name='effect{$i}dir' type='dropdown'>{$str} </select> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select><hr />"; } print "[b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> Armor Defense: <input type='text' name='armor' value='{$itemi['armor']}' /><hr /> <input type='submit' value='Edit Item' /></form>"; } function edit_item_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_items.php?action=edititem']> Back[/url]"; $h->endpage(); exit; } $itmname=$_POST['itmname']; $itmdesc=$_POST['itmdesc']; $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $db->query("DELETE FROM items WHERE itmid={$_POST['itmid']}",$c); $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)"); print "The {$_POST['itmname']} Item was edited successfully."; stafflog_add("Edited item {$_POST['itmname']}"); } function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } $h->endpage(); ?> There Is something wrong with It, I went back to the original file and It still has the same error.
-
Re: Staff Items V2 Help Yeah I have the same problem I need help to Msn me please
-
Re: [mccode lite / V1] Basic Forums V2?
-
Re: Staff_items.php Holy Crap I totally forgot I still had It like that, But It still didn't work QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO items VALUES('',6,'Stick (+50)','Rips Ooff a tree and works like a charm',50000,25000,'1',0,'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;}',0,'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;}',0,'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;}', '50', '0', '', '', '', '', '', '')
-
Re: Staff_factions Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/strats/public_html/staff_factions.php on line 581
-
Re: Staff_factions I will check It out thanks
-
Ok I never found one of these Yet and If you have It can I please I have It I have been trying to make my own but It is not coming along If you can fix It up that would be great, I think I got the basic necessities But would love a second look by a better coder, <?php require "sglobals.php"; //This contains faction stuffs switch($_GET['action']) { case 'farecord': admin_faction_record(); break; case 'facredit': admin_faction_credit(); break; case 'fawar': admin_faction_wars(); break; case 'fawardelete': admin_faction_wardelete(); break; case 'faedit': admin_faction_edit_begin(); break; case 'faedit_name': admin_faction_edit_name(); break; case 'faedit_prefix': admin_faction_edit_prefix(); break; case 'faedit_finances': admin_faction_edit_finances(); break; case 'faedit_staff': admin_faction_edit_staff(); break; case 'faedit_capacity': admin_faction_edit_capacity(); break; case 'faedit_crime': admin_faction_edit_crime(); break; case 'faedit_ament': admin_faction_edit_ament(); break; case 'createoc': create_oc_form(); break; case 'createocsub': create_oc_sub(); break; case 'faedit_delete': admin_faction_edit_delete(); break; case 'faedel': admin_faction_delete_begin(); break; default: print "Error: This script requires an action."; break; } function absint($in, $neg=1) { if($neg) { return abs((int) $in); } else { return (int) $in; } } function admin_faction_record() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); if ( $faction ) { $q=$db->query("SELECT g.* FROM factions g WHERE fa.faID=$faction"); if(!$db->num_rows($q)) { $_GET['faction']=0; admin_faction_record(); } else if (!$_GET['reason']) { $_GET['faction']=0; admin_faction_record(); } else { $r=$db->fetch_row($q); print "<table width='100%' border='1'> <tr> <td> Faction Name: {$r['faNAME']} Faction Description: {$r['faDESC']} Prefix: {$r['faPREF']} Money: {$r['faMONEY']} Crystals: {$r['faCRYSTALS']} Respect: {$r['faRESPECT']} Leader: {$r['faLEAD']} Co-Leader: {$r['faCOLEAD']} Capacity: {$r['faCAPACITY']} Crime: {$r['faCRIME']} Hours Left: {$r['faCHOURS']} Annnouncement: {$r['faAMENT']} </td> </tr> </table>"; stafflog_add("{$ir['username']} looked at faction id {$r['faID']} ({$r['faNAME']})'s record. with the reason {$_GET['reason']}"); } } else { print <<<EOF <form action='staff_factions.php' method='get'> <input type='hidden' name='action' value='farecord' /> <h4>Faction Record</h4> Enter a faction ID to view the record of: <input type='text' name='faction' value='1' /> Reason for viewing: <input type='text' name='reason' value='' /> <input type='submit' value='Go' /> </form> EOF; } } function admin_faction_credit() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_POST['faction'] ); $submit = absint( $_POST['submit'] ); $money = absint( $_POST['money'] , 0); $crystals = absint( $_POST['crystals'] , 0); $reason = $_POST['reason']; if ( $submit && $faction && ($money != 0 || $crystals != 0) && $reason) { $db->query("UPDATE factions SET faMONEY=faMONEY+$money, faCRYSTALS=faCRYSTALS+$crystals WHERE faID = $faction"); print "The faction was successfully credited."; stafflog_add("{$ir['username']} credited faction ID {$faction} with {$money} money and/or {$crystals} crystals with the reason {$reason}"); } else if( $faction && ($money != 0 || $crystals != 0)) { $q=$db->query("SELECT faNAME FROM faction WHERE faID = $faction"); print "You are crediting ".$db->fetch_single($q)." with \$$money and/or $crystals crystals. <form action='staff_factions.php?action=facredit' method='post'> <input type='hidden' name='faction' value='$faction' /> <input type='hidden' name='money' value='$money' /> <input type='hidden' name='crystals' value='$crystals' /> <input type='hidden' name='submit' value='1' /> Reason: <input type='text' name='reason' /> <input type='submit' value='Credit' /> </form>"; } else { print "<h3>Credit Faction</h3> <form action='staff_faction.php?action=facredit' method='post'> <table border='1' width='50%'> <tr> <td align='right'>Faction's ID:</td> <td align='left'><input type='text' name='faction' value='1' /></td> </tr> <tr> <td align='right'>Money:</td> <td align='left'><input type='text' name='money' value='1000' /></td> </tr> <tr> <td align='right'>Crystals:</td> <td align='left'><input type='text' name='crystals' value='10' /></td> </tr> <tr> <td align='center' colspan='2'> <input type='submit' value='Credit' /> </td> </tr> </table>"; } } function admin_faction_wars() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Manage faction Wars</h3> <table width=75% border='2'>"; $q=$db->query("SELECT w.*,fa1.faNAME as declarer, fa1.faRESPECT as drespect, fa2.faNAME as defender, fa2.faRESPECT as frespect FROM factionwars w LEFT JOIN factions fa1 ON w.warDECLARER=fa1.faID LEFT JOIN factions fa2 ON w.warDECLARED=fa2.faID"); while($r=$db->fetch_row($q)) { print "<tr> <td width=40%>[url='factions.php?action=view&ID={$r[']{$r['declarer']}[/url] [{$r['drespect']} respect]</a></td> <td width=10%>vs.</td> <td width=40%>[url='factions.php?action=view&ID={$r[']{$r['defender']}[/url] [{$r['frespect']} respect]</a></td> <td>[[url='staff_factions.php?action=fawardelete&war={$r[']Delete[/url]]</td></tr>"; } print "</table>"; } function admin_faction_wardelete() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $q=$db->query("SELECT w.*,fa1.faNAME as declarer, fa1.faRESPECT as drespect, fa2.faNAME as defender, fa2.faRESPECT as frespect FROM factionwars w LEFT JOIN factions fa1 ON w.warDECLARER=fa1.faID LEFT JOIN factions fa2 ON w.warDECLARED=fa2.faID WHERE w.warID={$_GET['war']}"); $r=$db->fetch_row($q); $db->query("DELETE FROM factionwars WHERE warID={$_GET['war']}"); print "War cleared."; stafflog_add("{$ir['username']} deleted war ID {$_GET['war']} ([url='factions.php?action=view&ID={$r[']{$r['declarer']}[/url] [{$r['drespect']} respect]</a> vs. [url='factions.php?action=view&ID={$r[']{$r['defender']}[/url] [{$r['frespect']} respect]</a>)"); } function admin_faction_edit_begin() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_POST['faction'] ); if ( $faction ) { $q=$db->query("SELECT faNAME FROM faction WHERE faID = $faction"); $theirname=$db->fetch_single($q); $edits = array ( 1 => array ( 'Name And Description', 'faedit_name', '4' ), 2 => array ( 'Prefix', 'faedit_prefix', '4' ), 3 => array ( 'Finances + Respect', 'faedit_finances', '4' ), 4 => array ( 'Staff', 'faedit_staff', '4' ), 5 => array ( 'Capacity', 'fadit_capacity', '4' ), 6 => array ( 'Organised Crime', 'faedit_crime', '4' ), 7 => array ( 'Announcement', 'faedit_ament', '4' ) ); print "<h3>Manage Factoion</h3> You are managing the faction: $theirname Choose an edit to perform. <table width='80%' class='table' cellspacing='1'><tr style='background: gray'><th>Edit Type</th> <th>Available For Use</th> <th>Use</th> </tr>\n"; foreach ( $edits as $k => $v) { if ($v[2] >= $ir['user_level']) { $a="green'>Yes";$l="[url='staff_factions.php?action=$v[1]&faction=$faction']Go[/url]"; } else { $a="red'>No";$l="N/A"; } print "<tr> <td>$v[0]</td> <td>[b]<font color='$a</font>[/b]</td> <td>$l</td></tr>\n"; } print "</table>"; } else { print <<<EOF <form action='staff_faction.php?action=gedit' method='post'> <h4>Faction Management</h4> Enter a faction ID to manage: <input type='text' name='faction' value='1' /> <input type='submit' value='Go' /> </form> EOF; } } function admin_faction_edit_name() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $submit = absint( $_POST['submit'] ); $q=$db->query("SELECT * FROM factions WHERE faID = $faction", $c); $r=$db->fetch_row($q); if ( $submit ) { $db->query("UPDATE factions SET faNAME='{$_POST['faNAME']}', faDESC='{$_POST['faDESC']}' WHERE faID=$faction"); print "faction has been successfully modified."; stafflog_add($userid, "{$ir['username']} edited faction ID $faction's name and/or description", $c); } else { print <<<EOF <h3>Faction Management: Name/Description</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action=faedit_name&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Name:</td> <td align=left><input type='text' name='faNAME' value='{$r['faNAME']}' /></td> </tr> <tr> <td align=right>Description:</td> <td align=left><textarea rows='7' cols='40' name='faDESC'>{$r['faDESC']}</textarea></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_prefix() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $submit = absint( $_POST['submit'] ); $q=$db->query("SELECT * FROM faction WHERE faID = $faction"); $r=$db->fetch_row($q); if ( $submit ) { $db->query("UPDATE factions SET faPREF='{$_POST['faPREF']}' WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited faction ID $faction's prefix"); } else { print <<<EOF <h3>Faction Management: Prefix</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action=faedit_prefix&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Prefix:</td> <td align=left><input type='text' name='faPREF' value='{$r['faPREF']}' /></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_finances() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $money = absint( $_POST['money'], 0 ); $crystals = absint( $_POST['crystals'], 0 ); $respect = absint( $_POST['respect'], 0 ); $submit = absint( $_POST['submit'] ); $reason = $_POST['reason']; $q=$db->query("SELECT * FROM factions WHERE faID = $faction"); $r=$db->fetch_row($q); if ( $submit && $reason ) { $db->query("UPDATE factions SET faMONEY=$money, faCRYSTALS=$crystals, faRESPECT=$respect WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited faction ID $faction's finances with the reason $reason"); } else { print <<<EOF <h3>Faction Management: Financial Details</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action=gedit_finances&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Money:</td> <td align=left><input type='text' name='money' value='{$r['faMONEY']}' /></td> </tr> <tr> <td align=right>Crystals:</td> <td align=left><input type='text' name='crystals' value='{$r['faCRYSTALS']}' /></td> </tr> <tr> <td align=right>Respect:</td> <td align=left><input type='text' name='respect' value='{$r['faRESPECT']}' /></td> </tr> <tr> <td align=right>Reason for editing:</td> <td align=left><input type='text' name='reason' value='' /></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_staff() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $leader = absint( $_POST['lead'], 0 ); $colead = absint( $_POST['colead'], 0 ); $submit = absint( $_POST['submit'] ); $reason = $_POST['reason']; $q=$db->query("SELECT * FROM faction WHERE faID = $faction"); $r=$db->fetch_row($q); if ( $submit && $reason ) { $db->query("UPDATE faction SET faLEADER=$lead, faCOLEAD=$colead WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited Faction ID $Faction's staff with the reason $reason"); } else { print <<<EOF <h3>Faction Management: Staff</h3> Editing the faction: {$r['faNAME']} <form action='staff_faction.php?action=faedit_staff&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Leader:</td> <td align=left><input type='text' name='leader' value='{$r['faLEAD']}' /></td> </tr> <tr> <td align=right>Co-Leader:</td> <td align=left><input type='text' name='vicepres' value='{$r['faCOLEAD']}' /></td> </tr> <tr> <td align=right>Reason for editing:</td> <td align=left><input type='text' name='reason' value='' /></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_capacity() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $capacity = absint( $_POST['capacity'], 0 ); $submit = absint( $_POST['submit'] ); $reason = $_POST['reason']; $q=$db->query("SELECT * FROM factions WHERE faID = $faction"); $r=$db->fetch_row($q); if ( $submit && $reason ) { $db->query("UPDATE faction SET faCAPACITY=$capacity WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited faction ID $faction's capacity with the reason $reason"); } else { print <<<EOF <h3>Faction Management: Capacity</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action=faedit_capacity&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Capacity:</td> <td align=left><input type='text' name='capacity' value='{$r['faCAPACITY']}' /></td> </tr> <tr> <td align=right>Reason for editing:</td> <td align=left><input type='text' name='reason' value='' /></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_crime() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $crime = absint( $_POST['crime'], 0 ); $chours = absint( $_POST['chours'], 0 ); $submit = absint( $_POST['submit'] ); $reason = $_POST['reason']; $q=$db->query("SELECT * FROM factions WHERE factionID = $faction"); $r=$db->fetch_row($q); if ( $submit && $reason ) { $db->query("UPDATE factions SET faCRIME=$crime, faCHOURS=$chours WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited faction ID $Faction's organised crime with the reason $reason"); } else { print <<<EOF <h3>Faction Management: Organised Crimes</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action=faedit_crime&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Crime ID:</td> <td align=left><input type='text' name='crime' value='{$r['faCRIME']}' /></td> </tr> <tr> <td align=right>Crime Hours Left:</td> <td align=left><input type='text' name='chours' value='{$r['faCHOURS']}' /></td> </tr> <tr> <td align=right>Reason for editing:</td> <td align=left><input type='text' name='reason' value='' /></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function admin_faction_edit_ament() { global $db,$ir, $userid, $c; if($ir['user_level'] > 3) { die("403"); } $faction = absint( $_GET['faction'] ); $submit = absint( $_POST['submit'] ); $q=$db->query("SELECT * FROM factions WHERE faID = $faction"); $r=$db->fetch_row($q); if ( $submit ) { $db->query("UPDATE factions SET faAMENT='{$_POST['faAMENT']}' WHERE faID=$faction"); print "Faction has been successfully modified."; stafflog_add("{$ir['username']} edited faction ID $faction's announcement"); } else { print <<<EOF <h3>Faction Management: Announcement</h3> Editing the faction: {$r['faNAME']} <form action='staff_factions.php?action faedit_ament&faction=$faction' method='post'> <table width='50%' cellspacing='1' class='table'> <tr> <td align=right>Announcement:</td> <td align=left><textarea rows='7' cols='40' name='faAMENT'>{$r['faAMENT']}</textarea></td> </tr> <tr> <td align=center colspan=2><input type='hidden' name='submit' value='1' /><input type='submit' value='Edit' /></td> </tr> </table> </form> EOF; } } function report_clear() { global $db,$db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } function admin_faction_delete_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] !=2) { die("403"); } print "<form action='staff_factions.php?action=faedit_delete' method='post'> <h4>Faction Management</h4> Enter a faction ID to delete: <input type='text' name='faction' value='1' /> <input type='submit' value='Go' /> </form>"; } function admin_faction_edit_delete() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] !=2) { die("403"); } $db->query("UPDATE users SET faction=0 WHERE faction={$_POST['faction']}"); $db->query("DELETE FROM factions WHERE faID={$_POST['faction']}"); stafflog_add("Deleted Faction {$_POST['faction]}"); print "Faction Succesfully Deleted"; } function create_oc_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 3) { die("403"); } print " <form action='staff_factions.php?action=createocsub' method='POST'> <h4>Create OC</h4> Name: <input type='text' name='ocNAME'/> Minimum users for crime: <input type='text' name='ocUSERS'/> Text: <textarea rows=4 cols=40 name='ocSTARTTEXT' /></textarea> Success Text: <textarea rows=4 cols=40 name='ocSUCCTEXT' /></textarea> Failure Text <textarea rows=4 cols=40 name='ocFAILTEXT' /></textarea> Minimum Possible Money <input type='text' name='ocMINMONEY'/> Maximum Possible Money <input type='text' name='ocMAXMONEY'/> Respect Gain <input type='text' name='ocRESPECT'/> <input type='submit' value='Create' /> </form>"; } function create_oc_sub() { global $ir,$c,$userid,$db,$h; if($ir['user_level'] != 2) { die("403"); } $db->query("INSERT INTO orgcrimes VALUES('', '{$_POST['ocNAME']}', '{$_POST['ocUSERS']}', '{$_POST['ocSTARTTEXT']}', '{$_POST['ocSUCCTEXT']}', '{$_POST['ocFAILTEXT']}', '{$_POST['ocMINMONEY']}', '{$_POST['ocMAXMONEY']}')"); print " The organised crime was successfully created. [url='staff_factions.php?action=createoc']>Back[/url] "; stafflog_add("Created Organise Crime: {$_POST['ocNAME']}"); } $h->endpage(); ?>
-
<?php include "sglobals.php"; //This contains item stuffs 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: print "Error: This script requires an action."; break; } function new_item_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<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='' /> Item Desc.: <input type='text' name='itmdesc' value='' /> Item Type: ".itemtype_dropdown($c,'itmtype')." Item Buyable: <input type='checkbox' name='itmbuyable' checked='checked' /> Item Price: <input type='text' name='itmbuyprice' /> Item Sell Value: <input type='text' name='itmsellprice' /> <hr /> [b]Usage Form[/b]<hr /> [b]<u>Effect 1</u>[/b] On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No Stat: <select name='effect1stat' 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='crystals'>Crystals</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='effect1dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 2</u>[/b] On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No Stat: <select name='effect2stat' 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='crystals'>Crystals</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='effect2dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 3</u>[/b] On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No Stat: <select name='effect3stat' 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='crystals'>Crystals</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='effect3dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect3amount' value='0' /> <select name='effect3type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='0' /> Armor Defense: <input type='text' name='armor' value='0' /> <input type='submit' value='Add Item To Game' /></form>"; } function new_item_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='admin.php?action=newitem']> Back[/url]"; $h->endpage(); exit; } $itmname=$db->escape($_POST['itmname']); $itmdesc=$db->escape($_POST['itmdesc']); $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor, $helmet, $boots, $amulet, $braclet, $ring, $special)"); print "The {$_POST['itmname']} Item was added to the game."; stafflog_add("Created item {$_POST['itmname']}"); } function give_item_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving Item To User</h3> <form action='staff_items.php?action=giveitemsub' method='post'> User: ".user_dropdown($c,'user')." Item: ".item_dropdown($c,'item')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give Item' /></form>"; } function give_item_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$_POST['user']},{$_POST['qty']},0,0)",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"); } function kill_item_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item</h3> The item will be permanently removed from the game. <form action='staff_items.php?action=killitemsub' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Kill Item' /></form>"; } function kill_item_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($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']}"); print "The {$itemi['itmname']} Item was removed from the game."; stafflog_add("Deleted item {$itemi['itmname']}"); } function edit_item_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $query='SELECT * FROM items'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='0' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'>Item Id</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Type</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Name</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Desc</font></th> <th><font face='Arial, Helvetica, sans-serif'>Item Pic</font></th> </tr>"; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'itmid'); $f2=mysql_result($result,$i,'itmtype'); $f3=mysql_result($result,$i,'itmname'); $f4=mysql_result($result,$i,'itmdesc'); $f5=mysql_result($result,$i,'itmpic'); print"<tr> <td><form action='staff_items.php?action=edititemform' method='post'> <input type='text' name='item' value='$f1;' /> <input type='submit' value='Edit By ID' /></form> <font face='Arial, Helvetica, sans-serif'>[url='staff_items.php?action=edititemform'][/url]</font></td> <td><form action='staff_items.php?action=edititemform' method='post'> <input type='text' name='item' value='$f2;' /> <input type='submit' value='Edit By Type' /></form> <font face='Arial, Helvetica, sans-serif'>[url='staff_items.php?action=edititemform'][/url]</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f3;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f4;</font></td> <td><font face='Arial, Helvetica, sans-serif'>$f5;</font></td> </tr>"; $i++; } print ""; } function edit_item_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); print "<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='{$itemi['itmname']}' /> Item Desc.: <input type='text' name='itmdesc' value='{$itemi['itmdesc']}' /> Item Type: ".itemtype_dropdown($c,'itmtype',$itemi['itmtype'])." Item Buyable: <input type='checkbox' name='itmbuyable'"; if ($itemi['itmbuyable']) { print " checked='checked'"; } print " /> Item Price: <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> 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", "crystals" => "Crystals", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for($i=1;$i<=3;$i++) { if($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'"; print "[b]<u>Effect {$i}</u>[/b] On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No Stat: <select name='effect{$i}stat' type='dropdown'>"; foreach($stats as $k => $v) { if($k==$efx['stat']) { print "<option value='{$k}' selected='selected'>{$v}</option>\n"; } else { print "<option value='$k'>{$v}</option>\n"; } } if($efx['dir']=="neg") { $str="<option value='pos'>Increase</option><option value='neg' selected='selected'>Decrease</option>"; } else { $str="<option value='pos' selected='selected'>Increase</option><option value='neg'>Decrease</option>"; } if($efx['inc_type']=="percent") { $str2="<option value='figure'>Value</option><option value='percent' selected='selected'>Percent</option>"; } else { $str2="<option value='figure' selected='selected'>Value</option><option value='percent'>Percent</option>"; } print "</select> Direction: <select name='effect{$i}dir' type='dropdown'>{$str} </select> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select><hr />"; } print "[b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> Armor Defense: <input type='text' name='armor' value='{$itemi['armor']}' /><hr /> <input type='submit' value='Edit Item' /></form>"; } function edit_item_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_items.php?action=edititem']> Back[/url]"; $h->endpage(); exit; } $itmname=$_POST['itmname']; $itmdesc=$_POST['itmdesc']; $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $db->query("DELETE FROM items WHERE itmid={$_POST['itmid']}",$c); $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor, $helmet, $boots, $amulet, $braclet, $ring, $special)"); print "The {$_POST['itmname']} Item was edited successfully."; stafflog_add("Edited item {$_POST['itmname']}"); } function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } $h->endpage(); ?> Can someone see the problem? QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , , , , )' at line 1 Query was INSERT INTO items VALUES('',6,'Stick (+50)','Deadly weapon that you can rip off a tree',50000,25000,1, '0', '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;}', '0', '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;}', '0', '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;}', 50, 0, , , , , , )
-
Re: Announcement error Thanks sir :)
-
Re: Staff.php help Strats didn't want the game no more. So I put hecka work fixing It up
-
<?php require "sglobals.php"; //This contains general thingies switch($_GET['action']) { case 'basicset': basicsettings(); break; case 'announce': announcements(); break; default: index(); break; } function basicsettings() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } if($_POST['submit']) { unset($_POST['submit']); foreach($_POST as $k => $v) { $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'"); } print "Settings updated! [url='staff.php?action=basicset']Back[/url]"; stafflog_add("Updated the basic game settings"); } else { print "<h3>Basic Settings</h3><hr /> <form action='staff.php?action=basicset' method='post'> <input type='hidden' name='submit' value='1' /> Game Name: <input type='text' name='game_name' value='{$set['game_name']}' /> Game Owner: <input type='text' name='game_owner' value='{$set['game_owner']}' /> Game Description: <textarea rows='7' cols='50' name='game_description'>{$set['game_description']}</textarea> Paypal Address: <input type='text' name='paypal' value='{$set['paypal']}' /> Gym/Crimes Validation: <select name='validate_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['validate_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Validation Period: <select name='validate_period' type='dropdown'>"; $opt=array( "5" => "Every 5 Minutes", "15" => "Every 15 Minutes", "60" => "Every Hour", "login" => "Every Login" ); foreach($opt as $k => $v) { if($k == $set['validate_period']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Registration CAPTCHA: <select name='regcap_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['regcap_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Send Crystals: <select name='sendcrys_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendcrys_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Bank Xfers: <select name='sendbank_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendbank_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per crystal: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> Will Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])." <input type='submit' value='Update Settings' /></form>"; } } function announcements() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { echo '<font color="#FF0000>403 - Unauthorized Access</font>'; $h->endpage(); exit; } if($_POST['TITLE']) { if(strlen($_POST['TITLE']) < 5) { echo 'Sorry, the annoucement title is too short. [url="staff_annouce.php?addannouce"]Back[/url]'; $h->endpage(); exit; } $AddAnnouce = sprintf("INSERT INTO mod_announcements (`annouce_NAME`, `annouce_TEXT`, `annouce_TIME`, `annouce_URGENCY`, `annouce_TOPIC`, `annouce_POSTED`)VALUES ('{$_POST['TITLE']}', '{$_POST['TEXT']}', unix_timestamp(), '{$_POST['URGENCY']}', '{$_POST['TOPIC']}', '{$_POST['POSTED']}')"); $db->query ($AddAnnouce); $db->query("UPDATE users SET `new_announcements` = `new_announcements` + 1"); echo 'Announcement added! > [url="annoucements.php"]View It![/url]'; stafflog_add('Posted A New Annoucement'); $h->endpage(); exit; } else { echo 'Adding an announcement... Please try to make sure the announcement is concise and covers everything you want it to. <form action="staff.php?action=announce" method="post"> Announcement Title:<input type="text" name="TITLE"> Announcement Text: <textarea name="TEXT" rows="10" cols="60"></textarea> Announcement Urgency: <select name="URGENCY" type="dropdown"> <option value="No Ugency">No Ugency</option> <option value="Low">Low</option> <option value="Medium">Medium</option> <option value="High">High</option> <option value="Urgent">Urgent</option> </select> Announcement Topic: <select name="TOPIC" type="dropdown"> <option value="Updates">Updates</option> <option value="General News">General News</option> <option value="Fun">Fun</option> <option value="Warnings!">Warnings!</option> <option value="Design Info">Design Info</option> <option value="Edits">Edits</option> </select> <input type="hidden" name="POSTED" value="'.$ir['username'].'"> <input type="submit" value="Add Announcement!" /> </form>'; } } Fatal error: Call to undefined function index() in /home/strats/public_html/staff.php on line 8 Can you figure out the problem?
-
Re: [mccode v2] Annoucements Upgrade! Fatal error: Call to undefined function index() in /home/strats/public_html/staff.php on line 8 Can you tell me what Is wrong with It?
-
Re: [mccode v2] Faction with Armoury +1 Impressive mod :)
-
Re: Announcement error They Both Didn't work
-
<?php require "sglobals.php"; //This contains general thingies switch($_GET['action']) { case 'basicset': basicsettings(); break; case 'announce': announcements(); break; default: index(); break; } function basicsettings() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { die("403"); } if($_POST['submit']) { unset($_POST['submit']); foreach($_POST as $k => $v) { $db->query("UPDATE `settings` SET conf_value='$v' WHERE conf_name='$k'"); } print "Settings updated! [url='staff.php?action=basicset']Back[/url]"; stafflog_add("Updated the basic game settings"); } else { print "<h3>Basic Settings</h3><hr /> <form action='staff.php?action=basicset' method='post'> <input type='hidden' name='submit' value='1' /> Game Name: <input type='text' name='game_name' value='{$set['game_name']}' /> Game Owner: <input type='text' name='game_owner' value='{$set['game_owner']}' /> Game Description: <textarea rows='7' cols='50' name='game_description'>{$set['game_description']}</textarea> Paypal Address: <input type='text' name='paypal' value='{$set['paypal']}' /> Gym/Crimes Validation: <select name='validate_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['validate_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Validation Period: <select name='validate_period' type='dropdown'>"; $opt=array( "5" => "Every 5 Minutes", "15" => "Every 15 Minutes", "60" => "Every Hour", "login" => "Every Login" ); foreach($opt as $k => $v) { if($k == $set['validate_period']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Registration CAPTCHA: <select name='regcap_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['regcap_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Send Crystals: <select name='sendcrys_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendcrys_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Bank Xfers: <select name='sendbank_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendbank_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per crystal: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> Will Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])." <input type='submit' value='Update Settings' /></form>"; } } function announcements() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { echo '<font color="#FF0000>403 - Unauthorized Access</font>'; $h->endpage(); exit; } if($_POST['TITLE']) { if(strlen($_POST['TITLE']) < 5) { echo 'Sorry, the annoucement title is too short. [url="staff_annouce.php?addannouce"]Back[/url]'; $h->endpage(); exit; } $AddAnnouce = sprintf("INSERT INTO mod_announcements (`annouce_NAME`, `annouce_TEXT`, `annouce_TIME`, `annouce_URGENCY`, `annouce_TOPIC`, `annouce_POSTED`)VALUES ('{$_POST['TITLE']}', '{$_POST['TEXT']}', unix_timestamp(), '{$_POST['URGENCY']}', '{$_POST['TOPIC']}', '{$_POST['POSTED']}')"); $db->query ($AddAnnouce); $db->query("UPDATE users SET `new_announcements` = `new_announcements` + 1"); echo 'Announcement added! > [url="annoucements.php"]View It![/url]'; 9; foreach($opt as $k => $v) { if($k == $set['sendcrys_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Bank Xfers: <select name='sendbank_on' type='dropdown'>"; $opt=array( "1" => "On", "0" => "Off" ); foreach($opt as $k => $v) { if($k == $set['sendbank_on']) { print "<option value='{$k}' selected='selected'>{$v}</option>"; } else { print "<option value='{$k}'>{$v}</option>"; } } print "</select> Energy Refill Price (crystals): <input type='text' name='ct_refillprice' value='{$set['ct_refillprice']}' /> IQ per crystal: <input type='text' name='ct_iqpercrys' value='{$set['ct_iqpercrys']}' /> Money per crystal: <input type='text' name='ct_moneypercrys' value='{$set['ct_moneypercrys']}' /> Will Potion Item: ".item_dropdown($c, "willp_item", $set['willp_item'])." <input type='submit' value='Update Settings' /></form>"; } } function announcements() { global $db,$ir,$c,$h,$userid,$set; if($ir['user_level'] != 2) { echo '<font color="#FF0000>403 - Unauthorized Access</font>'; $h->endpage(); exit; } if($_POST['TITLE']) { if(strlen($_POST['TITLE']) < 5) { echo 'Sorry, the annoucement title is too short. [url="staff_annouce.php?addannouce"]Back[/url]'; $h->endpage(); exit; } $AddAnnouce = sprintf("INSERT INTO mod_announcements (`annouce_NAME`, `annouce_TEXT`, `annouce_TIME`, `annouce_URGENCY`, `annouce_TOPIC`, `annouce_POSTED`)VALUES ('{$_POST['TITLE']}', '{$_POST['TEXT']}', unix_timestamp(), '{$_POST['URGENCY']}', '{$_POST['TOPIC']}', '{$_POST['POSTED']}')"); $db->query ($AddAnnouce); $db->query("UPDATE users SET `new_announcements` = `new_announcements` + 1"); echo 'Announcement added! > [url="annoucements.php"]View It![/url]'; It says the error Is on line 215, It wasn't broken earliar, Can you fix me up please :)