30) return substr($string, 0, 30).'...';
else return $string;
}
function get_file_status_name($status_id)
{
$table = array(
60 => 'PREVIEW_PRIORITY',
50 => 'Download First',
40 => 'Download Normally',
30 => 'Download Last',
20 => 'Only Seed',
10 => 'Do Not Download'
);
if (array_key_exists($status_id, $table)) return $table[$status_id];
else return 'Not supported file status';
}
function generate_file_prior_button_code($img, $alt, $href='')
{
$img = '';
if (empty($href)) return $img;
else return ''.$img.'';
}
$display_name=cut_name_if_long($stats[$num_torrent]['torrent_name']);
?>
WebInterface KTorrent plugin
Actions |
File |
tqStatus |
Size |
Complete |
$file)
{
echo "\t\t".''."\n\t\t\t";
echo '';
echo generate_file_prior_button_code('/high_priority.png', 'High Priority', $file['status']==50?'':"details.php?file_hp=$num_torrent-$id&torrent=$num_torrent");
echo generate_file_prior_button_code('/normal_priority.png', 'Normal Priority', $file['status']==40?'':"details.php?file_np=$num_torrent-$id&torrent=$num_torrent");
echo generate_file_prior_button_code('/low_priority.png', 'Low Priority', $file['status']==30?'':"details.php?file_lp=$num_torrent-$id&torrent=$num_torrent");
echo generate_file_prior_button_code('/only_seed.png', 'Stop downloading (Only Seed Priority)', ($file['status']==20||$file['status']==10)?'':"details.php?file_stop=$num_torrent-$id&torrent=$num_torrent");
echo ' | ';
echo ''.htmlspecialchars(cut_name_if_long($file['name'])).' | ';
echo ''.get_file_status_name($file['status']).' | ';
echo ''.$file['size'].' | ';
echo ''.round($file['perc_done'], 2).' % | ';
echo "\n\t\t".'
'."\n";
}
?>