Jump to content
MakeWebGames

My inventory.php


Gucci Mane

Recommended Posts

<?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>[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>[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'>*</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]]";
}
{
print " [[url='dpuse.php?ID={$i[']Open Donator Pack[/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();
?>

 

I need the tables to have a black BG instead of a grey one, I also need the text in #706e57 font color instead of black.

I cant figure out how to do it. I tried messing around with it, but couldnt figure it out. Any help appreciated

Thanks,

TSMW[attach][attach=1368]1368[/attach][/attach]

Link to comment
Share on other sites

The tables in that code seem to mostly have this code:

class='table'

Look for the css associated with that class. If I had to guess, it would probably be in a .css file, or in header.php. You can change the color there with the use of google and the phrase 'changing colors in tables with css' (or some similar phrase)

Link to comment
Share on other sites

not sure if there is any errors, ive not tested it... but here try this one... back the other inventory up first lol.

also you do want all the text #706e57 right?

 

<?php 
include "globals.php"; 
$q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); 
print "<h3> <font color=white>Equipped Items</h3><hr />"; 
while($r=$db->fetch_row($q)) 
{ 
$equip[$r['itmid']]=$r; 
} 
print "<table width=100% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr style='background:black'> 
<th> <font color=#706e57>Primary Weapon</th> 
<td> <font color=#706e57>"; 
if($equip[$ir['equip_primary']]['itmid']) 
{ 
print $equip[$ir['equip_primary']]['itmname']."</td><td>[url='unequip.php?type=equip_primary'] <font color=#706e57>Unequip Item[/url]</td>"; 
} 
else 
{ 
print " <font color='#706e57'>None equipped.</td><td> </td>"; 
} 
print "</tr> 
<tr> 
<th> <font color=#706e57>Secondary Weapon</th> 
<td> <font color=#706e57>"; 
if($equip[$ir['equip_secondary']]['itmid']) 
{ 
print $equip[$ir['equip_secondary']]['itmname']."</td><td>[url='unequip.php?type=equip_secondary'] <font color=#706e57>Unequip Item[/url]</td>"; 
} 
else 
{ 
print " <font color='#706e57'>None equipped.</td><td> </td>"; 
} 
print "</tr> 
<tr> 
<th> <font color=#706e57>Armor</th> 
<td> <font color=#706e57>"; 
if($equip[$ir['equip_armor']]['itmid']) 
{ 
print $equip[$ir['equip_armor']]['itmname']."</td><td>[url='unequip.php?type=equip_armor'] <font color=#706e57>Unequip Item[/url]</td>"; 
} 
else 
{ 
print " <font color=#706e57>None equipped.</td><td> </td>"; 
} 
print "</tr> 
</table><hr /> 
<h3> <font color=white>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] <font color=white>You have no items![/b]"; 
} 
else 
{ 
print "[b] <font color=white>Your items are listed below.[/b]

<table width=100% cellspacing=1 class='table' border='1' bordercolor='#636363'></center>
<tr style='background:black'> 
<td class=\"h\"><font color=#706e57>Item</td> 
<td class=\"h\"><font color=#706e57>Sell Value</td> 
<td class=\"h\"><font color=#706e57>Total Sell Value</td> 
<td class=\"h\"><font color=#706e57>Links</td> 
</tr>"; 
$lt=""; 
while($i=$db->fetch_row($inv)) 
{ 
if($lt!=$i['itmtypename']) 
{ 
$lt=$i['itmtypename']; 
print "\n<tr><td colspan=4>[b]<font color=white>{$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><font color=#706e57>\${$i['itmsellprice']}</td><td>"; 
print "<font color=#706e57>$".($i['itmsellprice']*$i['inv_qty']); 
print "</td><td> 
[[url='iteminfo.php?ID={$i[']<font color=#706e57>Info[/url]] 
[[url='itemsend.php?ID={$i[']<font color=#706e57>Send[/url]] 
[[url='itemsell.php?ID={$i[']<font color=#706e57>Sell[/url]] 
[[url='imadd.php?ID={$i[']<font color=#706e57>Add To Market[/url]]"; 
if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { 
print " [[url='itemuse.php?ID={$i[']<font color=#706e57>Use[/url]]"; 
} 
{ 
print " [[url='dpuse.php?ID={$i[']<font color=#706e57>Open Donator Pack[/url]]"; 
} 
if($i['weapon']) 
{ 
print " [[url='equip_weapon.php?ID={$i[']<font color=#706e57>Equip as Weapon[/url]]"; 
} 
if($i['armor']) 
{ 
print " [[url='equip_armor.php?ID={$i[']<font color=#706e57>Equip as Armor[/url]]"; 
} 
print "</td></tr>"; 
} 
print "</table>"; 
print "[size="1"][b]<font color=#706e57>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(); 
?>
Link to comment
Share on other sites

IF you are posetive you dont have any .css files then i would check the header.php. Simply because your script is using <Style> defined CSS and it has to be located within a file thats being called by your inventory script.

Find the CSS and try editing that. If you have any trouble PM me and ill take a look at the css.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...