I've done some additional editing on the php and template code, to add a view of outbox % too..
The full php enhancement now looks like this:
Quote:
//PM GAUGE HACK BY GOBLIN and Installed by CraZ on September 19, 2002
$inboxpms=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=0 $ignoreusers");
if ($inboxpms < 1) {
$pmpercent = "1"; // stop divisions by zero
} else {
$pmpercent = round(($inboxpms[messages] / $pmquota) * 100,0);
}
if ($pmpercent>75) {
$barimg="{imagesfolder}/red.gif";
} elseif ($pmpercent>50) {
$barimg="{imagesfolder}/yellow.gif";
} else {
$barimg="{imagesfolder}/green.gif";
}
// outbox part by CRAZ
$outboxpms=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid='-1' $ignoreusers");
if ($outboxpms < 1) {
$outpmpercent = "1"; // stop divisions by zero
} else {
$outpmpercent = round(($outboxpms[messages] / $pmquota) * 100,0);
}
if ($outpmpercent>75) {$outbarimg="{imagesfolder}/red.gif";}
elseif ($outpmpercent>50) {$outbarimg="{imagesfolder}/yellow.gif";}
else {$outbarimg="{imagesfolder}/green.gif";}
//PM GAUGE HACK BY GOBLIN
|
To the privfolder template I've added the following (in stead of the original alterations for this hack..
Quote:
<br>
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td width="50%" bgcolor="{secondaltcolor}"><smallfont>Je Inbox is $pmpercent% vol</td>
<td width="50%" bgcolor="{secondaltcolor}"><smallfont>Je Outbox is $outpmpercent% vol</td>
</tr>
<tr>
<td width="50%" bgcolor="{secondaltcolor}"><img src="$barimg" width="$pmpercent%" height="9">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="33%"><smallfont>0%</td>
<td width="34%"><p align="center"><smallfont>50%</td>
<td width="33%"><p align="right"><smallfont>100%</smallfont></p></td>
</tr>
</table>
</td>
<td width="50%" bgcolor="{secondaltcolor}"><img src="$outbarimg" width="$outpmpercent%" height="9">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="33%"><smallfont>0%</td>
<td width="34%"><p align="center"><smallfont>50%</td>
<td width="33%"><p align="right"><smallfont>100%</smallfont></p></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
<br>
|
As you can see, the colspan of 7 is gone.. I've taken the liberty to place the gauges outside of the message table.. so insert the code
above the table declarations (there are two).. and not directly above the $privatemessages
See attachment for a screenshot (never mind the dutch lingo)..