$API->TPL->display('acp-language.tpl'); die; } elseif ($action == 'reparse_itunes_errors') { $API->auth(array('reparse_itunes_errors' => 1)); if (!$trackid) { $API->TPL->assign('progress_image', $API->DB->query_return("SELECT trackid FROM apps WHERE itunes_parse_error=1")); $API->TPL->display('acp-reparse-itunes-errors.tpl'); die; } else { //header('Content-Type: image/png'); $app = $API->DB->query_row("SELECT trackid,type,store FROM apps WHERE trackid={$trackid}"); if (!$app) { die('<span style="color:red;">ERROR: Missing app with trackid $trackid</span>'); } require_once 'itgw.inc.php'; $data = get_itunes_info($app['trackid'], $app['type'], $app['store']); if (!$data) { die("<span style=\"color:red;\">ERROR: Can not find app with trackid {$app['trackid']} on store {$app['store']}"); } $to_app['last_parse_itunes'] = json_encode($data); $to_app['itunes_parse_error'] = '0'; $API->DB->query("UPDATE apps SET " . $API->DB->build_update_query($to_app) . " WHERE trackid={$app['trackid']}"); die("<span style=\"color:green;\">SUCCESS: '{$data['name']}' reparsed"); } } elseif ($action == 'crackers') { $API->auth(array('manage_crackers' => 1)); $section = $API->getval('section'); if (!in_array($section, explode(',', 'verified,proposed'))) { $section = 'verified'; } $mode = $API->getval('mode');
preg_match('/.*\\.torrent$/', $file['name'], $matches); if (!$file['size'] || $file['error'] || !$matches) { $API->error($API->LANG->_('You uploaded invalid .torrent file (zero size, not .torrent extension or upload error)')); } require_once 'classes' . DS . 'Torrent.php'; $torrent = new Torrent($file['tmp_name']); if ($torrent->errors()) { $API->error($API->LANG->_('There is something wrong with your torrent file')); } // do not preform cheks on torrents //$torrent->announce(false); //$torrent->announce(array('http://pixi.appaddict.org:2710/announce')); $magnet = $torrent->magnet(); } require_once 'itgw.inc.php'; $data = get_itunes_info($trackid, $type, $store); if (!$appdata && !$data) { $API->TPL->assign('trackid', $trackid); $API->TPL->display('no-app-error-itunes.tpl'); die; } elseif ($data) { $data['last_parse_itunes'] = $data; update_application($data, $trackid); } if (!$appdata && $data) { if ($data['price'] == 'Free') { $paidfreeapps = $API->DB->query_row("SELECT (SELECT COUNT(DISTINCT links.trackid) FROM links LEFT JOIN apps ON links.trackid=apps.trackid WHERE apps.price='Free' AND links.uploader_id={$API->account['id']}) AS free, (SELECT COUNT(DISTINCT links.trackid) FROM links LEFT JOIN apps ON links.trackid=apps.trackid WHERE apps.price!='Free' AND links.uploader_id={$API->account['id']}) AS paid"); $paid_apps = $paidfreeapps['paid']; $free_apps = $paidfreeapps['free']; if ($free_apps > $paid_apps) { $API->error($API->LANG->_('FREE_CONTENT_UPLOAD_ERROR', $paid_apps, $free_apps));