KyleH112 Posted June 9, 2016 Share Posted June 9, 2016 I am looking for an inventory mod with item slots to show equipped items. The picture below is just a google searched image to show somewhat of what I mean. Also posted below is my current inventory script. <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']}, {$ir['equip_helmet']}, {$ir['equip_boots']}, {$ir['equip_amulet']}, {$ir['equip_braclet']}, {$ir['equip_ring']}, {$ir['equip_special']})"); 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>Helmet</th> <td>"; if($equip[$ir['equip_helmet']]['itmid']) { print $equip[$ir['equip_helmet']]['itmname']."</td><td><a href='unequip.php?type=equip_helmet'>Unequip Item</a></td>"; } else { print "None Equipped.</td><td> </td>"; } print "</tr> <tr> <th>Gloves</th> <td>"; if($equip[$ir['equip_amulet']]['itmid']) { print $equip[$ir['equip_amulet']]['itmname']."</td><td><a href='unequip.php?type=equip_amulet'>Unequip Item</a></td>"; } else { print "None Equipped.</td><td> </td>"; } print "</tr> </tr> <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>Arms</th> <td>"; if($equip[$ir['equip_braclet']]['itmid']) { print $equip[$ir['equip_braclet']]['itmname']."</td><td><a href='unequip.php?type=equip_braclet'>Unequip Item</a></td>"; } else { print "None Equipped.</td><td> </td>"; } print "</tr> <tr> <th>Leggings</th> <td>"; if($equip[$ir['equip_ring']]['itmid']) { print $equip[$ir['equip_ring']]['itmname']."</td><td><a href='unequip.php?type=equip_ring'>Unequip Item</a></td>"; } else { print "None Equipped.</td><td> </td>"; } print "</tr> <tr> <th>Chest</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> <tr> <th>Boots</th> <td>"; if($equip[$ir['equip_boots']]['itmid']) { print $equip[$ir['equip_boots']]['itmname']."</td><td><a href='unequip.php?type=equip_boots'>Unequip Item</a></td>"; } else { print "None Equipped.</td><td> </td>"; } print "</tr> <tr> <th>Shield</th> <td>"; if($equip[$ir['equip_special']]['itmid']) { print $equip[$ir['equip_special']]['itmname']."</td><td><a href='unequip.php?type=equip_special'>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 "You have no items."; } else { print "Your items are listed below. <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>{$lt}</td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } if($i['helmet']) { $i['itmname']="<font color='blue'>*</font>".$i['itmname']; } if($i['boots']) { $i['itmname']="<font color='pink'>*</font>".$i['itmname']; } if($i['amulet']) { $i['itmname']="<font color='brown'>*</font>".$i['itmname']; } if($i['braclet']) { $i['itmname']="<font color='yellow'>*</font>".$i['itmname']; } if($i['ring']) { $i['itmname']="<font color='lime'>*</font>".$i['itmname']; } if($i['special']) { $i['itmname']="<font color='darkorange'>*</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>"; if($i['inv_lent'] == 0) { print" <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> <a href='itemuse.php?ID={$i['inv_id']}'>[use]</a> <strike>[Donate To Gang]</strike>"; } if($ir['gang']>0 && $gangdata['gangARMORY']==1 && $i['inv_lent']==0) { print " [Donate To Gang]"; } if($ir['gang']>0 && $gangdata['gangARMORY']==1 && $i['inv_lent']>0) { print " [Give Back]"; } if($i['itmtypename'] == 'Food' || $i['itmtypename'] == 'Medical' || $i['itmtypename'] == 'Donator Pack') if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " <a href='itemuse.php?ID={$i['inv_id']}'>[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 Chest]</a>"; } if($i['helmet']) { print " <a href='equip_helmet.php?ID={$i['inv_id']}'>[Equip as Helmet]</a>"; } if($i['boots']) { print " <a href='equip_boots.php?ID={$i['inv_id']}'>[Equip as Boots]</a>"; } if($i['amulet']) { print " <a href='equip_amulet.php?ID={$i['inv_id']}'>[Equip as Gloves]</a>"; } if($i['braclet']) { print " <a href='equip_braclet.php?ID={$i['inv_id']}'>[Equip as Arms]</a>"; } if($i['ring']) { print " <a href='equip_ring.php?ID={$i['inv_id']}'>[Equip as Leggings]</a>"; } if($i['special']) { print " <a href='equip_special.php?ID={$i['inv_id']}'>[Equip as Shield]</a>"; } print "</td></tr>"; } print "</table>"; print ""; } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted June 10, 2016 Author Share Posted June 10, 2016 So I decided to start working on this mod myself since no one has replied, im using a css image map, everything is working except the images showing up. Does anyone know the code to show the item on the inventory page for each slot? Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted June 18, 2016 Author Share Posted June 18, 2016 Cool thanks, I put that mod aside and started working on others for right now Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted June 27, 2016 Author Share Posted June 27, 2016 I'll test it out and see if it gets me anywhere, I'll let you know Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted June 30, 2016 Author Share Posted June 30, 2016 Not sure if this is what you were looking for. <td class='itmpic'><img src='/css/images/shops/itmpic/{$equip[$ir['equip_primary']]['itmpic']}'><img src='/css/images/shops/itmpic/hot/{$equip[$ir['equip_primary']]['itmpic']}'></td> .itmpic img:last-child{ display:none;} .itmpic:hover img:first-child{ display:none;} .itmpic:hover img:last-child{ display:inline-block; -webkit-transition: opacity .25s ease; -moz-transition: opacity .25s ease;} Great! I really just needed the code. <img src='itmpic/{$equip[$ir['equip_primary']]['itmpic']}'> Thanks! Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted July 1, 2016 Author Share Posted July 1, 2016 Another question you might be able to answer. The images are showing up perfect but if I set the image position to static I can't move them to the right position, if I set the position to absolute or relative I can line the images up but if the website is resized they don't line up anymore or if the images line up for me they don't line up for other players being on a different resolution Quote Link to comment Share on other sites More sharing options...
KyleH112 Posted July 7, 2016 Author Share Posted July 7, 2016 Never mind I got everything working. Thanks for the help with the code :) Quote Link to comment Share on other sites More sharing options...
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.