'Not Started',
1 => 'Seeding Complete',
2 => 'Download Complete',
3 => 'Seeding',
4 => 'Downloading',
5 => 'Stalled',
6 => 'Stopped',
7 => 'Allocating Diskspace',
8 => 'Error',
9 => 'Queued',
10 => 'Checking Data'
);
if (array_key_exists($status_id, $table)) return $table[$status_id];
else return 'Not supported tqStatus';
}
function generate_button_code($img, $alt, $href='')
{
$img = '';
if (empty($href)) return $img;
else return ''.$img.'';
}
?>
Actions |
File |
tqStatus |
Downloaded |
Size |
Uploaded |
Down Speed |
Up Speed |
Peers |
Complete |
'."\n\t\t\t";
$torrent_name = str_replace("'", "\'", $torrent['torrent_name']);
if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2);
else $perc = 0;
if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ...";
else $display_name=$torrent['torrent_name'];
if ($torrent['num_files']>1) $file_td_content = ''.$display_name.'';
else $file_td_content = $display_name;
echo '';
echo generate_button_code('/stop.png', 'stop', ($torrent['running'])?'interface.php?stop='.$a:'');
echo generate_button_code('/start.png', 'start', ($torrent['running'])?'':'interface.php?start='.$a);
echo '';
echo ' | ';
echo "$file_td_content | ";
echo ''.get_torrent_status_name($torrent['status']).' | ';
echo ''.$torrent['bytes_downloaded'].' | ';
echo ''.$torrent['total_bytes'].' | ';
echo ''.$torrent['bytes_uploaded'].' | ';
echo ''.$torrent['download_rate'].' | ';
echo ''.$torrent['upload_rate'].' | ';
echo ''.$torrent['num_peers'].' | ';
echo ''.$perc.'% | ';
echo "\n\t\t".''."\n";
$a++;
}
?>