Esempio n. 1
0
}
if (isset($_GET["exit"])) {
    unset($_SESSION["tumblr"]);
    header("location: index.php");
}
if (isset($_SESSION["tumblr"])) {
    $f->dispTumblrHead($_SESSION["tumblr"]);
    if (isset($_GET["p"])) {
        $p = htmlspecialchars($_GET["p"]);
        $gifAndTitle = processPage($p);
    } else {
        $gifAndTitle = processPage();
    }
    $f->dispPosts($gifAndTitle);
    if (isset($p)) {
        $f->dispBtnPagination($p);
    } else {
        $f->dispBtnPagination();
    }
} else {
    $f->dispTumblrForm();
}
$f->dispFoot();
function processPage($p = 0)
{
    $tumblr = new Tumblr($_SESSION["tumblr"], "fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4");
    $giflib = new GifLib();
    $clean_array = $tumblr->load($p);
    $clean_array_compressed = array();
    foreach ($clean_array as $key => $post) {
        $clean_array_compressed[]["title"] = $post["title"];