function get_peer_list($hash) { if (rtorrent_xmlrpc_cached('system.client_version') == '0.7.9') { return array(); } return rtorrent_multicall('p', array($hash, ''), array('get_address', 'get_client_version', 'get_completed_percent', 'get_down_rate', 'get_down_total', 'get_id', 'get_id_html', 'get_options_str', 'get_peer_rate', 'get_peer_total', 'get_port', 'get_up_rate', 'get_up_total', 'is_encrypted', 'is_incoming', 'is_obfuscated', 'is_snubbed')); }
<?php include_stylesheet('common.css', true); include_stylesheet('form-controls.css', true); include_stylesheet('dialogs.css', true); include_stylesheet('add-torrents.css', true); include_script('jquery.js'); include_script('jquery.hsjn.js'); include_script('jquery.form.js'); include_script('jquery.MultiFile.js'); include_script('jquery.mousewheel.js'); include_script('json2.min.js'); include_script('php.min.js'); include_script('add-torrents.js'); if (!$_GET['dialog']) { // Need to get the hashes of all torrents that have already been downloaded $torrents = rtorrent_multicall('d', 'main', array('get_hash'), 'hash', true); $torrents = array_map('is_numeric', array_flip(array_keys($torrents))); $data = array('torrents' => $torrents); $data_str = json_encode($data); echo <<<HTML <script type="text/javascript"> var data = {$data_str}; </script> HTML; } ?> </head> <body class="modal"> <?php