Пример #1
0
}
$API->TPL->assign('headeradd', '
<script>
function report(id) {
 ' . $reportjs . '
}
</script>

');
$trackid = $API->getval('trackid', 'int');
$API->TPL->assign('pagetitle', $API->LANG->_('Downloading Content...'));
$API->TPL->assign('footername', $API->LANG->_('Downloading Content...'));
// check that app is uloaded:
$appdata = $API->DB->query_row("SELECT apps.* FROM apps WHERE trackid={$trackid}");
if (!$appdata) {
    app_error_message($trackid);
}
update_app_downloads($trackid);
$decoded_links = $API->DB->query_return("SELECT links.*, IF(verified_crackers.account_id=accounts.id AND accounts.name=links.cracker,1,0) AS verified FROM links LEFT JOIN verified_crackers ON links.uploader_id=verified_crackers.account_id LEFT JOIN accounts ON accounts.id=links.uploader_id WHERE trackid={$trackid} AND state='accepted' ORDER BY verified DESC, links.added ASC, id DESC");
$wait = $API->account ? 0 : $API->CONFIG['redirection_wait'];
//(is_premium()?0:$API->CONFIG['redirection_wait']);
if ($decoded_links) {
    foreach ($decoded_links as $ldetails) {
        $ldata = parse_url($ldetails['link']);
        if ($ldata['scheme'] == 'magnet') {
            $links[] = array('id' => $ldetails['id'], 'no_redirection' => true, 'host' => $API->LANG->_('.torrent magnet link'), 'link_ticket' => $ldetails['link'], 'cracker' => $ldetails['cracker'], 'verified' => $ldetails['verified'] ? true : false, 'di_compatible' => false, 'ss_compatible' => false, 'protected' => $ldetails['protected']);
        } else {
            $link_ticket = urlencode(encrypt(json_encode(array('link' => $ldetails['link'], 'wait' => $wait, 'ua' => $_SERVER['HTTP_USER_AGENT'], 'ip' => $API->getip())), $API->CONFIG['REDIRECTOR_SECRET']));
            $links[] = array('id' => $ldetails['id'], 'no_redirection' => false, 'host' => $API->LANG->_('Download from %s', $ldata['host']), 'link_ticket' => $link_ticket, 'cracker' => $ldetails['cracker'], 'verified' => $ldetails['verified'] ? true : false, 'di_compatible' => $appdata['compatibility'] != 4 && $appdata['type'] != 'book' && is_directinstaller_compatible($ldetails['link']), 'ss_compatible' => $appdata['compatibility'] != 4 && $appdata['type'] != 'book' && is_signservice_compatible($ldetails['link']), 'protected' => $ldetails['protected']);
        }
    }
Пример #2
0
<?php

require_once 'init.php';
$trackid = $API->getval('trackid', 'int');
// check that app is uloaded:
$appdata = $API->DB->query_row("SELECT apps.* FROM apps WHERE trackid={$trackid}");
if (!$appdata) {
    $store = substr($API->getval('store', 'string'), 0, 2);
    $type = htmlspecialchars($API->getval('type'));
    app_error_message($trackid, $type, $store);
}
//$API->DB->debug();
$archived_count = $API->DB->query_row("SELECT COUNT(DISTINCT version) AS archived_count FROM links WHERE trackid={$trackid} AND state='archived'");
$API->TPL->assign('archived_count', $archived_count['archived_count']);
if ($API->account) {
    $trackjs = '
    
    if (!untrack)
    var ready = confirm("' . $API->LANG->_('Do you want to track this app? You will receive emails and push notifications once app will be updated.') . '");
    else var ready = confirm("' . $API->LANG->_('Do you want to STOP track this app? You WILL NOT receive emails and push notifications once app will be updated.') . '");

    if (!ready)
    return;
    else {
    var http = new XMLHttpRequest();
    var url = "trackapp.php?trackid="+trackid+"&untrack="+untrack;
    http.open("HEAD", url);
    http.onreadystatechange = function() {
        if (this.readyState == this.DONE) {
            var trackappa = document.getElementById("trackapp-a");
            var trackappimg = document.getElementById("trackapp-img");