HUSTLE HARD Posted October 14, 2012 Posted October 14, 2012 Okay for some reason my equipped item does not display, how ever if unequipepd it will display... can some one help me please.. <?php include_once "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); echo" <div class='equipped'> "; while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } echo "<br /><div class='primary'>"; if($equip[$ir['equip_primary']]['itmid']) { print' <img src="'.$equip[$ir['equip_primary']]['itmname'].'"> <br /><a href="unequip.php?type=equip_primary">Unequip Item</a>'; } else { echo "No primary weapon!"; } echo"</div>"; echo "<div class='armour'>"; if($equip[$ir['equip_armor']]['itmid']) { print' <img src="'.$equip[$ir['equip_armour']]['itmid'].'"> <a href="unequip.php?type=equip_armor">Unequip Item</a>'; } else { echo "No Armour!"; } echo"</div>"; echo "<div class='secondary'>"; if($equip[$ir['equip_secondary']]['itmid']) { print' <img src="'.$equip[$ir['equip_secondary']]['itmname'].'"> <br /> <a href="unequip.php?type=equip_secondary">Unequip Item</a>'; } else { echo "No Secondary weapon!"; } echo"</div></div>"; echo " <h3>My Inventory</h3> <a href='merge.php'>>Merge your inventory!</a><br><br />"; $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) { echo "<b>You have no items!</b> "; } else { echo "<b>Your items are listed below.</b><br /> <style type='text/css'> #h { background-color:#333; } #table{ background-color:#444; } </style> <table width=95% class=table border='0' cellspacing='1'> <tr> <td id='table'><font style=color:white;><b>Item</b></font></td> <td id='table'><font style=color:white;><b>Sell Value</b></font></td> <td id='table'><font style=color:white;><b>Total Sell Value</b></font></td> <td id='table'><font style=color:white;><b>Links</b></font></td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { $usershop=$db->query("select * from usershops where userid=$userid"); if(mysql_num_rows($usershop)!=0) { $addtoshop="[<a href='addtoshop.php?ID={$i['inv_id']}'>Put in Shop</a>]"; } if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; echo "\n<tr><td colspan=4 id='h'><font style=color:white;><b>{$lt}</b></font></td></tr>"; } echo '<tr><td><img src="'.$i['itmname'].'">'; if ($i['inv_qty'] > 1) { echo " x{$i['inv_qty']}"; } echo "</td><td> \$ ".number_format($i['itmsellprice'])."</td><td>"; echo "$".number_format($i['itmsellprice']*$i['inv_qty']); echo "</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['itmtype'] == 9) { print " [<a href='dogattack.php?ID={$i['inv_id']}'>Dog attack</a>]"; } if($i['itmid']=='3') { print " [<a href='russianroulette.php'>Play First Blood</a>]"; } print"$addtoshop"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { echo " [<a href='itemuse.php?ID={$i['inv_id']}'>Use</a>]"; } if($i['weapon']) { echo " [<a href='equip_weapon.php?ID={$i['inv_id']}'>Equip as Weapon</a>]"; } if($i['armor']) { echo " [<a href='equip_armor.php?ID={$i['inv_id']}'>Equip as Armor</a>]"; } echo "</td></tr>"; } echo "</table>"; } $h->endpage(); ?> Quote
HUSTLE HARD Posted October 14, 2012 Author Posted October 14, 2012 (edited) what does that meanm? you mean .png .jpeg? my image is in the item folder so would it be something like this <img src="items/'.$equip[$ir['equip_armour']]['itmid'].'.png"> ^^ i tried it did not work Edited October 14, 2012 by HUSTLE HARD Quote
sniko Posted October 14, 2012 Posted October 14, 2012 what does that meanm? you mean .png .jpeg? my image is in the item folder so would it be something like this <img src="items/'.$equip[$ir['equip_armour']]['itmid'].'.png"> ^^ i tried it did not work See if the image actually exists. Right click > copy image URL > open new tab > paste > compare result with images Quote
HUSTLE HARD Posted October 14, 2012 Author Posted October 14, 2012 it does exist, for some reason its not displaying.. Quote
sniko Posted October 14, 2012 Posted October 14, 2012 Are you still using the code shown in #1? Quote
realmoflegends Posted October 14, 2012 Posted October 14, 2012 <img src="'.$equip[$ir['equip_primary']]['itmname']. Wouldn't this need to tell it the image is in a folder, like this: <img src="items/'.$equip[$ir['equip_primary']]['itmname'].'.png"> Quote
sniko Posted October 14, 2012 Posted October 14, 2012 <img src="'.$equip[$ir['equip_primary']]['itmname']. Wouldn't this need to tell it the image is in a folder, like this: <img src="items/'.$equip[$ir['equip_primary']]['itmname'].'.png"> Exactly. -tooshort- Quote
HUSTLE HARD Posted October 14, 2012 Author Posted October 14, 2012 i updated that bit still did not work, im thinking it either the script is unable to pull out the correct item id to display the image Quote
HUSTLE HARD Posted October 14, 2012 Author Posted October 14, 2012 fixed the error was a spelling mistake ['equip_armour']]['itmid'] it was meant to be ['equip_armor']]['itmid'] that how Mccodes spelt armour. Quote
Uridium Posted October 15, 2012 Posted October 15, 2012 you will find a lot of americanised words miss out the U after an O.. example colour = color neighbour = neighbor and s on :) 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.