Exemple #1
0
<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$id = intval($_GPC['id']);
template_page($id);
Exemple #2
0
if ($_SERVER['REQUEST_METHOD'] != 'GET') {
    header('location: ' . $_SERVER['SCRIPT_NAME']);
    exit;
}
send_string($s, sprintf('d6:action10:get status10:admin pass%d:%s10:admin user%d:%se', strlen($config['client_pass']), $config['client_pass'], strlen($config['client_user']), $config['client_user']));
$v = recv_bvalue($s);
$aggregate = array();
$rows = '';
foreach ($v['value']['files']['value'] as $info_hash => $file) {
    $aggregate['left'] += $file['value']['left']['value'];
    $aggregate['size'] += $file['value']['size']['value'];
    $aggregate['total downloaded'] += $file['value']['total downloaded']['value'];
    $aggregate['total uploaded'] += $file['value']['total uploaded']['value'];
    $aggregate['down rate'] += $file['value']['down rate']['value'];
    $aggregate['up rate'] += $file['value']['up rate']['value'];
    $aggregate['incomplete'] += $file['value']['incomplete']['value'];
    $aggregate['incomplete total'] += $file['value']['incomplete total']['value'];
    $aggregate['complete'] += $file['value']['complete']['value'];
    $aggregate['complete total'] += $file['value']['complete total']['value'];
    $rows .= template_torrent(array_merge($file['value'], array('info_hash' => array('value' => $info_hash))));
    if ($info_hash == pack('H*', $_REQUEST['torrent'])) {
        $torrent_events .= template_torrent_events($file['value']['events']['value']);
    }
}
$torrents = template_torrents(array('aggregate' => $aggregate, 'rows' => $rows));
$version = $v['value']['version']['value'];
send_string($s, sprintf('d6:action11:get options10:admin pass%d:%s10:admin user%d:%se', strlen($config['client_pass']), $config['client_pass'], strlen($config['client_user']), $config['client_user']));
$v = recv_bvalue($s);
$options = template_options($v['value']);
echo template_page(array('options' => $options, 'torrent_events' => $torrent_events, 'torrents' => $torrents, 'version' => $version));