Jump to content
MakeWebGames

Melkrow

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Melkrow's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Can somebody please do this part for me? This is the "edit" part of the PHP file. What exactly do I find and replace .... :( (Stupid Redux version)   function edit_item_begin() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</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='" . gen_url('items', true, true) . "&action=edititemform' method='post'> Item: " . item_dropdown($c, '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="' . gen_url('main', true, true) . '">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem1', gen_url('items', true, true) . '&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="' . gen_url('items', true, true) . '&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="' . gen_url('items', true, true) . '&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='" . gen_url('items', true, true) . "&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: <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", "points" => "Points", "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 Defense: <input type='text' name='armor' value='{$itemi['armor']}' /> <hr /> <b>Item Pics</b> <input type='text' name='itmpic' value='{$itemi['itmpic']}' /><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="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem2', gen_url('items', true, true) . '&action=edititem'); $itmname = (isset($_POST['itmname']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['itmname'])) ? strip_tags($db->escape($_POST['itmname'])) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? strip_tags($db->escape($_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; $itmpic = (isset($_POST['itmpic'])) ? strip_tags($db->escape($_POST['itmpic'])) : ''; $_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) OR empty($itmdesc) OR empty($_POST['itmtype']) OR empty($_POST['itmbuyprice']) OR empty($_POST['itmsellprice']) OR empty($_POST['itmid'])) { echo 'You missed one or more of the fields. Please go back and try again.<br />> <a href="' . gen_url('items', true, true) . '&action=edititem">Go Back</a>'; die($h->endpage()); } $q = $db->query( 'SELECT `itmid` FROM `items` WHERE `itmid` = ' . $_POST['itmid']); if ($db->num_rows($q) == 0) { echo 'Invalid item.<br />> <a href="' . gen_url('items', true, true) . '&action=edititem">Go Back</a>'; die($h->endpage()); } $itmbuy = ($_POST['itmbuyable'] == 'on') ? 1 : 0; $_POST['effect1stat'] = (isset($_POST['effect1stat']) && in_array($_POST['effect1stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'main', 'second', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST['effect1stat'] : 'energy'; $_POST['effect2stat'] = (isset($_POST['effect2stat']) && in_array($_POST['effect2stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'main', 'second', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST['effect2stat'] : 'energy'; $_POST['effect3stat'] = (isset($_POST['effect3stat']) && in_array($_POST['effect3stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'main', 'second', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST['effect3stat'] : 'energy'; $_POST['effect1dir'] = (isset($_POST['effect1dir']) && in_array($_POST['effect1dir'], array('pos', 'neg'))) ? $_POST['effect1dir'] : 'pos'; $_POST['effect2dir'] = (isset($_POST['effect2dir']) && in_array($_POST['effect2dir'], array('pos', 'neg'))) ? $_POST['effect2dir'] : 'pos'; $_POST['effect3dir'] = (isset($_POST['effect3dir']) && in_array($_POST['effect3dir'], array('pos', 'neg'))) ? $_POST['effect3dir'] : 'pos'; $_POST['effect1type'] = (isset($_POST['effect1type']) && in_array($_POST['effect1type'], array('figure', 'percent'))) ? $_POST['effect1type'] : 'figure'; $_POST['effect2type'] = (isset($_POST['effect2type']) && in_array($_POST['effect2type'], array('figure', 'percent'))) ? $_POST['effect2type'] : 'figure'; $_POST['effect3type'] = (isset($_POST['effect3type']) && in_array($_POST['effect3type'], array('figure', 'percent'))) ? $_POST['effect3type'] : 'figure'; $_POST['effect1amount'] = (isset($_POST['effect1amount']) && is_numeric($_POST['effect1amount'])) ? abs(intval($_POST['effect1amount'])) : 0; $_POST['effect2amount'] = (isset($_POST['effect2amount']) && is_numeric($_POST['effect2amount'])) ? abs(intval($_POST['effect2amount'])) : 0; $_POST['effect3amount'] = (isset($_POST['effect3amount']) && is_numeric($_POST['effect3amount'])) ? abs(intval($_POST['effect3amount'])) : 0; $_POST['effect1on'] = (isset($_POST['effect1on']) && in_array($_POST['effect1on'], array('1', '0'))) ? $_POST['effect1on'] : 0; $_POST['effect2on'] = (isset($_POST['effect2on']) && in_array($_POST['effect2on'], array('1', '0'))) ? $_POST['effect2on'] : 0; $_POST['effect3on'] = (isset($_POST['effect3on']) && in_array($_POST['effect3on'], array('1', '0'))) ? $_POST['effect3on'] : 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'])))); $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` = "' . $efx1 . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $efx2 . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $efx3 . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ' WHERE `itmid` = ' . $_POST['itmid']); stafflog_add("Edited item {$_POST['itmname']}"); echo 'The ' . $_POST['itmname'] . ' Item was edited successfully.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</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="' . gen_url('main', true, true) . '">Goto Main</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'])) ? strip_tags($db->escape($_POST['name'])) : ''; if (!empty($_POST['name'])) { staff_csrf_stdverify('staff_newitemtype', gen_url('items', true, true) . '&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="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } else { $csrf = request_csrf_html('staff_newitemtype'); echo " <h3>Add Item Type</h3> <hr /> <form action='" . gen_url('items', true, true) . "&action=newitemtype' method='post'> Name: <input type='text' name='name' /> <br /> {$csrf} <input type='submit' value='Add Item Type' /> </form> "; } } function edit_item_type() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } echo " <h3>Editing Item Type</h3> You can edit any aspect of this item.<br /> <form action='" . gen_url('items', true, true) . "&action=edititemtypeform' method='post'> Item: " . itemtype_dropdown($c, 'item_type') . " <br /> <input type='submit' value='Edit Item' /> </form> "; } function edit_item_type_form() { global $db, $ir, $c, $h; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } $_POST['item_type'] = (isset($_POST['item_type']) && is_numeric($_POST['item_type'])) ? abs(intval($_POST['item_type'])) : ''; if (empty($_POST['item_type'])) { echo 'Invalid Item Type.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } $d = $db->query( "SELECT `itmtypename` FROM `itemtypes` WHERE `itmtypeid` = {$_POST['item_type']}"); if ($db->num_rows($d) == 0) { echo 'Item type doesn\'t seem to exist.<br />> <a href="' . gen_url('items', true, true) . '&action=edititemtype">Go Back</a>'; die($h->endpage()); } $itemi = $db->fetch_row($d); echo " <h3>Editing Item Type</h3> <form action='" . gen_url('items', true, true) . "&action=edititemtypesub' method='post'> <input type='hidden' name='item_type' value='{$_POST['item_type']}' /> Item Type Name.: <input type='text' name='itmtypename' value='{$itemi['itmtypename']}' /> <br /> <input type='submit' value='Edit Item Type' /> </form> "; } function edit_item_type_sub() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } $_POST['itmtypename'] = (isset($_POST['itmtypename']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['itmtypename'])) ? strip_tags($db->escape($_POST['itmtypename'])) : ''; $_POST['item_type'] = (isset($_POST['item_type']) && is_numeric($_POST['item_type'])) ? abs(intval($_POST['item_type'])) : ''; if (empty($_POST['itmtypename']) OR empty($_POST['item_type'])) { echo 'You missed one or more of the fields. Please go back and try again.<br />> <a href="' . gen_url('items', true, true) . '&action=edititemtype">Go Back</a>'; die($h->endpage()); } $q = $db->query( 'SELECT `itmtypeid` FROM `itemtypes` WHERE `itmtypeid` = ' . $_POST['item_type']); if ($db->num_rows($q) == 0) { echo 'Invalid item type.<br />> <a href="' . gen_url('items', true, true) . '&action=edititemtype">Go Back</a>'; die($h->endpage()); } $db->query( 'UPDATE `itemtypes` SET `itmtypename` = "' . $_POST['itmtypename'] . '" WHERE `itmtypeid` = ' . $_POST['item_type']); stafflog_add('Edited item type (' . $_POST['itmtypename'] . ')'); echo 'The item type (' . $_POST['itmtypename'] . ') was edited successfully.<br />> <a href="' . gen_url('main', true, true) . '">Goto Main</a>'; die($h->endpage()); } $h->endpage();
  2. I tried that before, and tried it just now again, gives me query error.   $itmdesc = (isset($_POST['itmdesc'])) ? strip_tags($db->escape($_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; $itmpic = (isset($_POST['itmpic'])) ? strip_tags($db->escape($_POST['itmpic'])) : ''; $_POST['itmtype'] = (isset($_POST['itmtype']) && is_numeric($_POST['itmtype'])) ? abs(intval($_POST['itmtype'])) : '';
  3. $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` = "' . $efx1 . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $efx2 . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $efx3 . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ',`itmpic` = ' . $itmpic . ' WHERE `itmid` = ' . $_POST['itmid']);   Like that? (I tried a lot more ways lol) When I put it like that, I don't get the error on edits as long as I don't put anything in the item image box, and as soon as I type anything in the pic box I get that same query error.   My question is...how does the script know what $itmpic is? Can that be defined somewhere separately? I looked through the document and saw that other elements (like $armor, $weapon, $itmdesc etc etc) were defined few hundred lines above the query, like this. $itmname = (isset($_POST['itmname']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['itmname'])) ? strip_tags($db->escape($_POST['itmname'])) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? strip_tags($db->escape($_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; $_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'])) : '';   I tried to do my own version of $itmpic = ..... lol, didn't quite work out.
  4. $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` = "' . $efx1 . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $efx2 . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $efx3 . $_POST['itmpic'] . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ' WHERE `itmid` = ' . $_POST['itmid']);   $db->query( 'UPDATE `items` SET `itmtype` = ' . $_POST['itmtype'] . ',`itmname` = "' . $itmname . '",`itmdesc` = "' . $itmdesc . '",`itmbuyprice` = ' . $_POST['itmbuyprice'] . ',`itmsellprice` = ' . $_POST['itmsellprice'] . ',`itmpic` = ' . $_POST['itmpic'] . ',`itmbuyable` = ' . $itmbuy . ',`effect1_on` = "' . $_POST['effect1on'] . '",`effect1` = "' . $efx1 . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $efx2 . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $efx3 . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ' WHERE `itmid` = ' . $_POST['itmid']);  
  5. Can you help me put that in there? Whenever I try to plug in $_POST['itmpic'] into that update query, it gives me a query error when i try to edit (that's why I completely removed it for now until i figure out how to make it work).
  6. Well right now nothing occurs, just the changes I make to "Item Picture" don't update, everything else does. So if I accidentally put the wrong img name, I can't change it, or the items that I made before this mod, I can't update them to add an image. I'm basically trying to do step 2 in this post by the author of the mod http://makewebgames.io/showthread.php/23914-mccode-v2-Items-Pic-mod?p=153675&viewfull=1#post153675 And to answer your question lol.... because in the link above and in the first "insert" part, the whole code is in one line, and in v2.5.6b, the 'update' part is like I posted it, broken up in a lot of line, and I can't wrap my head around it lol. Please understand that before today I've never done any PHP or SQL. Will be reading some basic tutorials here soon.
  7. That's what I'm trying to do, to include it in the query so it would update. So basically, when creating a new item, I have it able to insert itmpic into the table as such (see the last part in the query). $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,'{$_POST['itmpic']}')");   So that works fine, the image is stored and I can display it on my site. The problem is when I go to "edit" that item, I don't know how to make it so that it 'saves' the changes i make to itmpic (in case I want to use different image or add an image if there wasn't one already when the item was created first). I hope that makes sense.
  8. I said this decade, not this century!
  9. When you put it that way, yeah :(. At least I got it working (partially lol). Some people never got it working tho :P Can somebody help me with this tho. However I try to do it... I get query error. This is when trying to edit the item (posting new item works fine) I'm supposed to update itmpic in the items table with the rest of that stuff down there... seems simple enough..except I can't do it. So how do I put this text box <input type='text' name='itmpic' value='{$itemi['itmpic']}' /><hr />   into this query?   $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` = "' . $efx1 . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $efx2 . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $efx3 . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ' WHERE `itmid` = ' . $_POST['itmid']);   P.S. Just checked your game rulerofzu, it's awesome!! I'm pretty jelly.
  10. So yeah it works but takes some heavy work haha (for me!!!!!...took about 8 hours to implement lol) I hope this helps somebody. Seems like most people are having issues with iteminfo.php, so here's my copy. I don't know how it works, but it does. so yeah. My "EDIT" of new items is still broken, and I'm too tired to try and tackle it.   <?php /** * MCCodes Version 2.5.6 * Copyright (C) 2011-2012 MCCodes * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: Mods/iteminfo.php * Signature: a887c0eb47b326e8e88438bd55263976 * Date: Tue, 13 Mar 12 10:41:51 +0000 */ if (!defined($_CONFIG['define_code'])) { echo 'This file cannot be accessed directly.'; exit; } $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : ''; $itmid = $_GET['ID']; if (!$itmid) { echo 'Invalid item ID'; } else { $q = $db->query( "SELECT i.`itmname`,`itmpic`,`itmdesc`,`itmbuyprice`,`itmsellprice`,it.`itmtypename` FROM `items` i LEFT JOIN `itemtypes` it ON i.`itmtype` = it.`itmtypeid` WHERE i.`itmid` = $itmid LIMIT 1"); if ($db->num_rows($q) == 0) { echo 'Invalid item ID'; } else { $id = $db->fetch_row($q); echo " <br /> <br /> <table width=90% class='table' cellspacing='1'> <tr style='background: gray;'> <th colspan=3 align=center ><img src='itmpics/{$id['itmpic']}' height='45px' width='45px'> <font size='5'><b>{$id['itmname']}</b></font></th> </tr> <tr> <td colspan=3 align=left><strong>Description:</strong><br /> {$id['itmdesc']}<br /></td> </tr> <tr style='background:gray'> <th>Item Buy Price</th> <th>Item Sell Price</th> <th>Item Type</th> </tr> <tr> <td> "; if ($id['itmbuyprice']) { echo money_formatter($id['itmbuyprice']); } else { echo 'N/A'; } echo ' </td> <td> '; if ($id['itmsellprice']) { echo money_formatter($id['itmsellprice']) . ' </td> <td> '; if ($id['itmtypename']) { echo ($id['itmtypename']) . ' </tr> </table> '; } else { echo ' N/A</td> </tr> </table> '; } } } $h->endpage(); }
  11. bump in hopes that somebody will bring this mod to life in this decade :)
  12. An amazing mod Djkanna!! Would this also display item pictures if you had one of those item image mods? (like this one http://makewebgames.io/showthread.php/23914-mccode-v2-Items-Pic-mod )
  13. Is that the one with the forum signature?
  14. did some testing, it turns out 12% of "money" is rewarded as EXP. For anybody that's wondering the same thing. Also. how much xp is needed for each lvl, what's the formula for that and where do I adjust it?
  15. Hello all, me again, with another stupid question. When it comes to crimes, I understand the formula and can easily adjust it for increased(or decreased if i want) "success" chance. That said, when it fails, what determines if you just "fail" or if you go to "jail". How is that calculated? Furthermore... what's the point of "Crime XP". From my testing it has no function at all. All exp is given based on the money amount, however I haven't yet figured out what the formula is for that. If the reward is $100... how much xp is the person getting? Thanks.
×
×
  • Create New...