Beispiel #1
0
 public function global_status()
 {
     $info = globalinfo();
     $common = new Common();
     $down_speed = $info['download_speed'];
     $up_speed = $info['upload_speed'];
     $down_total = $common->bytes_to_readable($info['bytes_downloaded']);
     $up_total = $common->bytes_to_readable($info['bytes_uploaded']);
     $dht = $info['dht_support'] ? "on" : "off";
     $encryption = $info['use_encryption'] ? "on" : "off";
     $xml = new KTorrentXML('status_bar');
     $elements = array($xml->new_element('download_speed', $down_speed), $xml->new_element('upload_speed', $up_speed), $xml->new_element('downloaded_total', $down_total), $xml->new_element('uploaded_total', $up_total), $xml->new_element('dht', null, array('status' => $dht)), $xml->new_element('encryption', null, array('status' => $encryption)));
     foreach ($elements as $element) {
         $xml->append_to_root($element);
     }
     return $xml->saveXML();
 }
Beispiel #2
0
	</table>
</div>
<!-- end torrent's details -->


<!-- Preferences -->
<div id="preferences" style="display : none;">
	<h2>Preferences</h2>
	<form action="interface.php" method="get">
	<div class="simple_form">
		<img src="icons/64x64/down.png" alt="" />

		<h2>Downloads</h2>

		<?php 
$globalinfo = globalinfo();
?>
		<div class="item" style="margin-top : 0em;">
		Upload speed:
		<div class="option">
			<input type="text" name="maximum_upload_rate" 
				value="<?php 
echo $globalinfo['max_upload_speed'];
?>
" />
		</div>
		</div>

		<div class="item">
		Download speed:
		<div class="option">