If anyone is still using this I re did the stock portfolio here's the code
<?php
/**
* MCCodes Version 2.5.6
* Copyright (C) 2011-2012 MCCodes
* All rights reserved.
*
* Redistribution of this code in any form is prohibited, except in
* the specific cases set out in the MCCodes Customer License.
*
* This code license may be used to run one (1) game.
* A game is defined as the set of users and other game database data,
* so you are permitted to create alternative clients for your game.
*
* If you did not obtain this code from MCCodes.com, you are in all likelihood
* using it illegally. Please contact MCCodes to discuss licensing options
* in this case.
*
* File:Mods/mystocks.php
* Signature: f33030f9e2af9f8a5c2d9f1c6cc46c5b
* Date: Tue, 13 Mar 12 10:41:51 +0000
*/
if (!defined($_CONFIG['define_code']))
{
echo 'This file cannot be accessed directly.';
exit;
}
if($ir['location'] > 8)
{
die(
"<font color=black>you can't do this while out of classified</font>");
}
$a=$db->query("SELECT u.*, st.*,s.* FROM users u LEFT JOIN shares s ON u.userid=s.usUSER LEFT JOIN stock st ON st.stID=s.usSTOCK WHERE u.userid=$userid");
echo "<center><div id=second>Your Stock Portfolio</div>
<table width=75% border='1' cellpadding='3'>
<tr bgcolor=gray>
<th>Stock Name</th>
<th>Price per Share (avg)</th>
<th>Total Sell Price</th>
<th>Your Shares</th>
<th>Last Change</th>
</tr>";
while($b=$db->fetch_assoc($a))
{
$total=$b['stCOST']*$b['usSHARES'];
echo "<tr align=center>
<td>{$b['stNAME']}</td>
<td>".money_formatter($b['stCOST'])."</td>
<td>".money_formatter($total)."</td>
<td>{$b['usSHARES']}</td>
<td>";
if ($b['stPERC']>0)
{
echo "<font color=blue>+{$b['stPERC']}%</font>";
}
else
{
echo "<font color=red>{$b['stPERC']}%</font>";
}
echo"</td>
</tr>";
}
echo "</table>";
echo "
<h5>What would you like to do?</h5>
<a href='".gen_url('stockmarket',true)."'>View Stockmarket</a>
<a href='".gen_url('stockmarket',true)."&action=sell_stock'>Sell Stock</a>
";
$h->endpage();
?>