HITMAN 17 Posted February 22, 2009 Posted February 22, 2009 <?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>[img=".$r[]</td><td>[url='unequip.php?type=equip_primary']Unequip Item[/url]</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>[img=".$r[]</td><td>[url='unequip.php?type=equip_secondary']Unequip Item[/url]</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>[url='unequip.php?type=equip_armor']Unequip Item[/url]</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] <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'>*['itmpic']</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>[[url='iteminfo.php?ID={$i[']Info[/url]] [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [[url='itemuse.php?ID={$i[']Use[/url]]"; } if($i['weapon']) { print " [[url='equip_weapon.php?ID={$i[']Equip as Weapon[/url]]"; } if($i['armor']) { print " [[url='equip_armor.php?ID={$i[']Equip as Armor[/url]]"; } print "</td></tr>"; } print "</table>"; print "[size="1"][b]NB:[/b] Items with a small red [/size]<font color='red'>*</font>[size="1"] next to their name can be used as weapons in combat. Items with a small green [/size]<font color='green'>*</font>[size="1"] next to their name can be used as armor in combat.[/size]"; } $h->endpage(); ?> ok that is my inventory paddy has added item pic so it shows when equipped but the pictures wont show all i get is Primary Weapon Hammer item pic Unequip Item Quote
SpEcKs Posted February 22, 2009 Posted February 22, 2009 Re: Inventory Help i do not know mate sorry Quote
HITMAN 17 Posted February 22, 2009 Author Posted February 22, 2009 Re: Inventory Help why post here then if you dont know jesus man Quote
grimsybaby Posted February 22, 2009 Posted February 22, 2009 Re: Inventory Help i tried this hitman i faild :( sorry im still trying to figure it out, once i do ill post it up, unless someone has already done it XD Quote
HITMAN 17 Posted February 22, 2009 Author Posted February 22, 2009 Re: Inventory Help ok mate cheers Quote
Lithium Posted February 22, 2009 Posted February 22, 2009 Re: Inventory Help Prolly this is an error... $i['itmname']="<font color='red'>*['itmpic']</font>".$i['itmname']; *['itmpic'] shouldn't it be something like *$i['itmpic'] or whatsoever? Quote
HITMAN 17 Posted February 23, 2009 Author Posted February 23, 2009 Re: Inventory Help nope that didnt work :? Quote
AlabamaHit Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help .$r['itmpic']. i see that in your codes. $r is pullin for the items table. if thats right. does your table have the extension if the image? maybe that needs to be in add...You know see that page and you saying soeone added it...does not help anyone to be able to help you everyone codes differetn...so if its a free mod on here. Link to it....so we can see how its coded and may be we can help then...... Quote
grimsybaby Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help well im trying thins not getting any joy :( it should work but it doesnt :( heres what i put :P <?php include "globals.php"; $equip = array( $ir['equip_primary'] => 0, $ir['equip_secondary'] => 0, $ir['equip_armor'] => 0 ); $q = $db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } print "<table width='75%' border='0'> <tr> <td width='25%' align='center'>[b]Primary Weapon[/b]</td> <td width='25%' align='center'>[b]Armour[/b]</td> <td width='25%' align='center'>[b]Secondary Weapon[/b]</td> </tr> <tr> <td align='center'>"; if($equip[$ir['equip_primary']]['itmpic']) { print"[img=/itmpics/{$r[]"; } else { print "No item image."; } print "</td> <td align='center'>"; if($equip[$ir['equip_armor']]['itmpic']) { print"[img=/itmpics/{$r[]"; } else { print "No item image."; } print "</td> <td align='center'>"; if($equip[$ir['equip_secondary']]['itmpic']) { print"[img=/itmpics/{$r[]"; } else { print "No item image."; } print "</td> </tr> <tr> <td align='center'>"; if($equip[$ir['equip_primary']]['itmid']) { print"[url='unequip.php?type=equip_primary']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> <td align='center'>"; if($equip[$ir['equip_armor']]['itmid']) { print"[url='unequip.php?type=equip_armor']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> <td align='center'>"; if($equip[$ir['equip_secondary']]['itmid']) { print"[url='unequip.php?type=equip_secondary']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> </tr> </table><hr width='95%'> <h3>Inventory</h3><hr width='95%'>"; $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] <table width=95% 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>[[url='iteminfo.php?ID={$i[']Info[/url]] [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [[url='itemuse.php?ID={$i[']Use[/url]]"; } if($i['weapon']) { print " [[url='equip_weapon.php?ID={$i[']Equip as Weapon[/url]]"; } if($i['armor']) { print " [[url='equip_armor.php?ID={$i[']Equip as Armor[/url]]"; } print " [[url='displayadd.php?ID=$userid&action=add&itm={$i[']Display[/url]]"; print "</td></tr>"; } print "</table>"; print "[size="1"][b]NB:[/b] Items with a small red [/size]<font color='red'>*</font>[size="1"] next to their name can be used as weapons in combat. Items with a small green [/size]<font color='green'>*</font>[size="1"] next to their name can be used as armor in combat.[/size] "; } $h->endpage(); ?> Quote
Lithium Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help src='itmpics/{$r['itmpic']}' if itmpics/ is on /www folder or... try right clicking on the failed image (see properties) and check if you are placing the correct dir Quote
grimsybaby Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help they are in the correct folder on the www root directory as it works in the iteminfo.php and even in the shops :s thats what i dont understand lol Quote
danger boy Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help First thing is you should make a folder called itmpics and then put the pics in there. Quote
grimsybaby Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help already their as said in post above works in the shops and in the iteminfo ;) heres it working in the shop Quote
Lithium Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help tell me what you have on the itmpic db field you have the filename or /dir/filename.ext ? Quote
Dave Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help This has been fixed by me :) Quote
grimsybaby Posted February 23, 2009 Posted February 23, 2009 Re: Inventory Help yep been fixed by he is wicked :) 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.