pspotential Posted May 27, 2007 Posted May 27, 2007 Fatal error: Cannot redeclare item_remove() (previously declared in C:\Domains\psp-customs.com\wwwroot\mafialegends\itemmarket.php:48) in C:\Domains\psp-customs.com\wwwroot\mafialegends\global_func.php on line 323 i get tht error when trying to access item market anyone got any ideas how to fix it :mrgreen: :mrgreen: EDIT:FIXED P.S if your like me ad think how the hell did you fix it when you see people posting fixed i suggest your search this site (like i should of in the first place) you will find your answer Quote
Dabomstew Posted July 12, 2007 Posted July 12, 2007 Re: Some Body Help Me Plz NO, that fix posted there is bad. It actually removes the item_remove function in itemmarket.php so you cant take items off the itemmarket! Use this fix instead (on a clean v2 itemmarket.php with the redeclaring glitch still there): Find: function item_remove() Replace With: function itemm_remove() Find: case "remove": item_remove(); Replace With: case "remove": itemm_remove(); Quote
parelem Posted August 3, 2007 Posted August 3, 2007 Re: Some Body Help Me Plz that function is actually backwards, here's a working one: function itemm_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or you are not the owner. [url='itemmarket.php']> Back[/url]"; } $r=$db->fetch_row($q); item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')"); print "Item removed from market! [url='itemmarket.php']> Back[/url]"; $h->endpage(); exit; } Quote
whitescout Posted August 23, 2007 Posted August 23, 2007 Re: Some Body Help Me Plz Just to be clear about this fix, after doing this, : that function is actually backwards, here's a working one: function itemm_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or you are not the owner. [url='itemmarket.php']> Back[/url]"; } $r=$db->fetch_row($q); item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')"); print "Item removed from market! [url='itemmarket.php']> Back[/url]"; $h->endpage(); exit; } You must still do this: Find: Code: case "remove": item_remove();Replace With: Code: case "remove": itemm_remove(); Then, your players will be able to remove items from the market. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.