From 9ad5c7b5e23b4940e7a3ea3ca3a6fb77e6a8fab0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 02:37:40 +0000 Subject: Updated to final KDE3 ktorrent release (2.2.6) git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1077377 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/webinterface/www/default/interface.php | 152 +++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 plugins/webinterface/www/default/interface.php (limited to 'plugins/webinterface/www/default/interface.php') diff --git a/plugins/webinterface/www/default/interface.php b/plugins/webinterface/www/default/interface.php new file mode 100644 index 0000000..6432798 --- /dev/null +++ b/plugins/webinterface/www/default/interface.php @@ -0,0 +1,152 @@ + '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 Status'; +} + +function generate_button_code($img, $alt, $href='') +{ + $img = ''.htmlspecialchars($alt).''; + if (empty($href)) return $img; + else return ''.$img.''; +} +?> + + + + + + + +<?php echo '(D:'.$globalinfo['download_speed'].') (U:'.$globalinfo['upload_speed'].') KTorrent'; ?> + + + +
WebInterface KTorrent plugin
+
+ + + +
+ + + + + + + + + + + + + +'."\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 ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo "\n\t\t".''."\n"; + $a++; + } + ?> +
ActionsFileStatusDownloadedSizeUploadedDown SpeedUp SpeedPeersComplete
'; + 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 'remove'; + echo '$file_td_content'.get_torrent_status_name($torrent['status']).''.$torrent['bytes_downloaded'].''.$torrent['total_bytes'].''.$torrent['bytes_uploaded'].''.$torrent['download_rate'].''.$torrent['upload_rate'].''.$torrent['num_peers'].''.$perc.'%
+
+ + + + -- cgit v1.2.1