try mine
function torrenttable($res, $variant="") {
global $site_config, $CURUSER, $THEME, $LANGUAGE; //Define globals
if ($site_config["MEMBERSONLY_WAIT"] && $site_config["MEMBERSONLY"] && in_array($CURUSER["class"], explode(",",$site_config["WAIT_CLASS"]))) {
$gigs = $CURUSER["uploaded"] / (1024*1024*1024);
$ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 0);
if ($ratio < 0 || $gigs < 0) $wait = $site_config["WAITA"];
elseif ($ratio < $site_config["RATIOA"] || $gigs < $site_config["GIGSA"]) $wait = $site_config["WAITA"];
elseif ($ratio < $site_config["RATIOB"] || $gigs < $site_config["GIGSB"]) $wait = $site_config["WAITB"];
elseif ($ratio < $site_config["RATIOC"] || $gigs < $site_config["GIGSC"]) $wait = $site_config["WAITC"];
elseif ($ratio < $site_config["RATIOD"] || $gigs < $site_config["GIGSD"]) $wait = $site_config["WAITD"];
else $wait = 0;
}
// Columns
$cols = explode(",", $site_config["torrenttable_columns"]);
$cols = array_map("strtolower", $cols);
$cols = array_map("trim", $cols);
$colspan = count($cols);
// End
// Expanding Area
$expandrows = array();
if (!empty($site_config["torrenttable_expand"])) {
$expandrows = explode(",", $site_config["torrenttable_expand"]);
$expandrows = array_map("strtolower", $expandrows);
$expandrows = array_map("trim", $expandrows);
}
// End
echo '<table align=center cellpadding="0" cellspacing="0" class="ttable_headinner" width=99%><tr>';
foreach ($cols as $col) {
switch ($col) {
case 'category':
echo "<td class=ttable_head width=80>".TYPE."</td>";
break;
case 'name':
echo "<td class=ttable_head>".NAME."</td>";
break;
case 'dl':
echo "<td class=ttable_head>DL</td>";
break;
case 'uploader':
echo "<td class=ttable_head>".UPLOADER."</td>";
break;
case 'comments':
echo "<td class=ttable_head>Comm</td>";
break;
case 'nfo':
echo "<td class=ttable_head width=20>NFO</td>";
break;
case 'size':
echo "<td class=ttable_head width=80>".SIZE."</td>";
break;
case 'completed':
echo "<td class=ttable_head>C</td>";
break;
case 'seeders':
echo "<td class=ttable_head width=20><img src='images/green.gif' border='0' width='10px' alt='Seedeurs' title='Seedeurs' /></td>";
break;
case 'leechers':
echo "<td class=ttable_head width=20><img src='images/red.gif' border='0' width='10px' alt='Leecheurs' title='Leecheurs' /></td>";
break;
case 'health':
echo "<td class=ttable_head width=60><img src='images/heart.png' border='0' width='10px' alt='Sant