
jjnicholascolwill
Members-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by jjnicholascolwill
-
Hello, so i've just installed this mod on my site to allow users to use a donator pack and get given the items/bonus associated with it. However when the "use" function on the pack it links to this script. however i get the following error: Parse error: syntax error, unexpected T_VARIABLE in /home/a3629762/public_html/dpuse.php on line 5 Can someone help me please, i can't seem to correct the code to remove the error. Here's the link to the original modification posting: http://makewebgames.io/showthread.php/31728-mccode-v2-Donator-Packs-To-Items here's the script "dpuse.php" <?php include "global_func.php"; * $_GET[iD] = abs((int) $_GET[iD]); * if(!$_GET[iD]) { echo '<h2>Oops</h2>Invalid use of file'; } * else * { * $i=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET[iD]} AND iv.inv_userid=$userid"); * } * if(!$db->num_rows($i)) { print "<h2>Oops</h2>Invalid item ID"; } * else * { * $r=$db->fetch_row($i); if($r[itmid] == 8) * { * * $db->query("UPDATE users SET donatordays=donatordays+30 WHERE userid=$userid"); * $db->query("UPDATE users SET money=money+0 WHERE userid=$userid"); * $db->query("UPDATE users SET crystals=crystals+0 WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+120 WHERE userid=$userid"); * * * echo '<h2>Donator Pack</h2>You have used your donator pack!'; * } * item_remove($userid, $r['inv_itemid'], 1); * } $h->endpage(); * ?>
-
[mccode v2] Donator Packs To Items
jjnicholascolwill replied to daveaite's topic in Free Modifications
I've just finished adding this mod onto my game. Can't wait to get it going it seems to be amazing however i've ran into a problem. After uploading the "dpuse.php" file and installing the link into my inventory. I created the 'Donator Pack 1' and added the Item ID to both the "dpuse.php" and in the "Inventory.php". The use link shows up when the pack is in a users inventory, but when i click the use link the following error comes up: Parse error: syntax error, unexpected '"' in /home/a3629762/public_html/dpuse.php on line 5 <?php include "global_func.php"; * $_GET[iD] = abs((int) $_GET[iD]); * if(!$_GET[iD]) { echo '<h2>Oops</h2>Invalid use of file'; } * else * { * $i=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET[iD]} AND iv.inv_userid=$userid"); * } * if(!$db->num_rows($i)) { print "<h2>Oops</h2>Invalid item ID"; } * else * { * $r=$db->fetch_row($i); if($r[itmid] == 8) * { * * $db->query("UPDATE users SET donatordays=donatordays+30 WHERE userid=$userid"); * $db->query("UPDATE users SET money=money+0 WHERE userid=$userid"); * $db->query("UPDATE users SET crystals=crystals+0 WHERE userid=$userid"); $db->query("UPDATE userstats SET IQ=IQ+120 WHERE userid=$userid"); * * * echo '<h2>Donator Pack</h2>You have used your donator pack!'; * } * item_remove($userid, $r['inv_itemid'], 1); * } $h->endpage(); * ?> -
Thanks for the reply, just edited the code and it returned the following error: Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/a3629762/public_html/inventory.php on line 92 New code: print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[<a href='iteminfo.php?ID={$i['itmid']}'>Info</a>] [<a href='itemsend.php?ID={$i['inv_id']}'>Send</a>] [<a href='itemsell.php?ID={$i['inv_id']}'>Sell</a>] [<a href='imadd.php?ID={$i['inv_id']}'>Add To Market</a>]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [<a href='itemuse.php?ID={$i['inv_id']}'>Use</a>]"; } if ($i['itmid'] == 8 ) { print " [<a href='dpuse.php?ID={$i[' target='_blank'>Use</a>]"; } Can't figure out where the ] should be?? Hope you can help again, thanks again :)
-
Hello, I'm not sure if this is the right place to post this so if it isn't can someone direct me to where i should post this. I recently added the Donator packs to items Free mod. Located at: http://makewebgames.io/showthre...Packs-To-Items After adding the code and following the instructions i have received the following error: Parse error: syntax error, unexpected T_STRING in /home/a3629762/public_html/inventory.php on line 92 I've searched and tried re writing various parts of the code and still had no joy and i just can't seem how to fix the problem. Can anyone see where the problem is and what i need to do to resolve this issue?? Here's my code for the inventory.php file: <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); print "<h3>Equipped Items</h3><hr />"; while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } print "<table width='75%' cellspacing='1' class='table'> <tr> <th>Primary Weapon</th> <td>"; if($equip[$ir['equip_primary']]['itmid']) { print $equip[$ir['equip_primary']]['itmname']."</td><td><a href='unequip.php?type=equip_primary'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Secondary Weapon</th> <td>"; if($equip[$ir['equip_secondary']]['itmid']) { print $equip[$ir['equip_secondary']]['itmname']."</td><td><a href='unequip.php?type=equip_secondary'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Armor</th> <td>"; if($equip[$ir['equip_armor']]['itmid']) { print $equip[$ir['equip_armor']]['itmname']."</td><td><a href='unequip.php?type=equip_armor'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> </table><hr /> <h3>Inventory</h3><hr />"; $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print "<b>You have no items!</b>"; } else { print "<b>Your items are listed below.</b><br /> <table width=100% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=4><b>{$lt}</b></td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[<a href='iteminfo.php?ID={$i['itmid']}'>Info</a>] [<a href='itemsend.php?ID={$i['inv_id']}'>Send</a>] [<a href='itemsell.php?ID={$i['inv_id']}'>Sell</a>] [<a href='imadd.php?ID={$i['inv_id']}'>Add To Market</a>]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [<a href='itemuse.php?ID={$i['inv_id']}'>Use</a>]"; } if ($i['itmid'] == 8) { print " [<a href="http://dpuse.php?ID={$i[" target="_blank">Use</a>]"; } if($i['weapon']) { print " [<a href='equip_weapon.php?ID={$i['inv_id']}'>Equip as Weapon</a>]"; } if($i['armor']) { print " [<a href='equip_armor.php?ID={$i['inv_id']}'>Equip as Armor</a>]"; } print "</td></tr>"; } print "</table>"; print "<small><b>NB:</b> Items with a small red </small><font color='red'>*</font><small> next to their name can be used as weapons in combat.<br /> Items with a small green </small><font color='green'>*</font><small> next to their name can be used as armor in combat.</small>"; } $h->endpage(); ?>
-
Hello, I'm not sure if this is the right place to post this so if it isn't can someone direct me to where i should post this. I recently added the Donator packs to items Free mod. Located at: http://makewebgames.io/showthread.php/31728-mccode-v2-Donator-Packs-To-Items After adding the code and following the instructions i have received the following error: Parse error: syntax error, unexpected T_STRING in /home/a3629762/public_html/inventory.php on line 92 I've searched and tried re writing various parts of the code and still had no joy and i just can't seem how to fix the problem. Can anyone see where the problem is and what i need to do to resolve this issue?? Here's my code for the inventory.php file: <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); print "<h3>Equipped Items</h3><hr />"; while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } print "<table width='75%' cellspacing='1' class='table'> <tr> <th>Primary Weapon</th> <td>"; if($equip[$ir['equip_primary']]['itmid']) { print $equip[$ir['equip_primary']]['itmname']."</td><td><a href='unequip.php?type=equip_primary'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Secondary Weapon</th> <td>"; if($equip[$ir['equip_secondary']]['itmid']) { print $equip[$ir['equip_secondary']]['itmname']."</td><td><a href='unequip.php?type=equip_secondary'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> <tr> <th>Armor</th> <td>"; if($equip[$ir['equip_armor']]['itmid']) { print $equip[$ir['equip_armor']]['itmname']."</td><td><a href='unequip.php?type=equip_armor'>Unequip Item</a></td>"; } else { print "None equipped.</td><td> </td>"; } print "</tr> </table><hr /> <h3>Inventory</h3><hr />"; $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print "<b>You have no items!</b>"; } else { print "<b>Your items are listed below.</b><br /> <table width=100% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=4><b>{$lt}</b></td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[<a href='iteminfo.php?ID={$i['itmid']}'>Info</a>] [<a href='itemsend.php?ID={$i['inv_id']}'>Send</a>] [<a href='itemsell.php?ID={$i['inv_id']}'>Sell</a>] [<a href='imadd.php?ID={$i['inv_id']}'>Add To Market</a>]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [<a href='itemuse.php?ID={$i['inv_id']}'>Use</a>]"; } if ($i['itmid'] == 8) { print " [<a href="http://dpuse.php?ID={$i[" target="_blank">Use</a>]"; } if($i['weapon']) { print " [<a href='equip_weapon.php?ID={$i['inv_id']}'>Equip as Weapon</a>]"; } if($i['armor']) { print " [<a href='equip_armor.php?ID={$i['inv_id']}'>Equip as Armor</a>]"; } print "</td></tr>"; } print "</table>"; print "<small><b>NB:</b> Items with a small red </small><font color='red'>*</font><small> next to their name can be used as weapons in combat.<br /> Items with a small green </small><font color='green'>*</font><small> next to their name can be used as armor in combat.</small>"; } $h->endpage(); ?>
-
Thanks for the reply. Could i also create a design/layout for the main layout and style of the game for when players have logged in. E.g. the main menu and donator links and title. Like could i incorporate them together so they all flow as one page? Could this be done in photoshop as well and then sliced up?? Thanks again
-
Hello all, I was just wondering if anyone can help me? I've been playing around on photoshop and managed to start making my own login page, registration page. However i don't know how i would place my current code to use with the images? Also if i want to make a new layout for the initial game its self would i just make the navigation bar and header in photoshop then leave a blank space for the games content to be displayed like in McCodes? I know how to program php and html and a bit of css but i still don't understand how to link all these elements together. If someone could help me or point me to somewhere there that has a tutorial or a walk through for this topic then i would be very grateful. Cheers in advance!
-
Hello there, This is my first post here so i'm a little scarred. I have been browsing different forums and no one really gives any help on this subject. I am wanting to start making my own themes, eg Login, Register, Overall Game theme. But i have NO idea how to code it all together ect. Does anyone have a tutorial or something like that, that i could follow to make a basic one just to get to grips of things. Also i am aiming to make these themes for MCCodes v2 and v1 and then move onto different engines when i become more experienced. I consider my self to have pretty good photoshop and Fireworks skills. Please can someone help me with this, Thank you so much :)