Exemplo n.º 1
0
    unlink($filepath);
    rename($tempname, $filepath);
    // Overwrite original picture with thumbnail.
    return true;
}
try {
    mergeDeprecatedConfig($GLOBALS, isLoggedIn());
} catch (Exception $e) {
    error_log('ERROR while merging deprecated options.php file.' . PHP_EOL . $e->getMessage());
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=genthumbnail')) {
    genThumbnail();
    exit;
}
// Thumbnail generation/cache does not need the link database.
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=rss')) {
    showRSS();
    exit;
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=atom')) {
    showATOM();
    exit;
}
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"], 'do=dailyrss')) {
    showDailyRSS();
    exit;
}
if (!isset($_SESSION['LINKS_PER_PAGE'])) {
    $_SESSION['LINKS_PER_PAGE'] = $GLOBALS['config']['LINKS_PER_PAGE'];
}
renderPage();
foreach ($query as $k => $v) {
    $q = "{$q}{$k}={$v}&";
}
$_SERVER['REQUEST_URI'] = substr($q, 0, strlen($q) - 1);
////////////
require 'cache.php';
fnxHtmlCache::readCache("[[random_string]]");
if (!fnxHtmlCache::hayCache()) {
    if (isset($_GET['up'])) {
        showIdea();
    } else {
        if (!empty($_GET['id']) && is_numeric($_GET['id'])) {
            showComments($rss, $_GET['id']);
        } else {
            if (isset($_GET['rss'])) {
                showRSS($rss, $_GET['lang']);
            }
        }
    }
}
fnxHtmlCache::savePage();
exit;
function showIdea()
{
    $str = getContentHttps("https://xifrat.pirata.cat/ideatorrent2json.php");
    //$str = file_get_contents("toString.json");
    print $str;
}
function showComments($rss, $id)
{
    $V = array();