Example #1
0
    if ($proper && login()) {
        $file = from($_REQUEST, 'file');
        $destination = from($_GET, 'destination');
        delete_page($file, $destination);
    }
});
// Show the tag page
get('/tag/:tag', function ($tag) {
    if (!login()) {
        file_cache($_SERVER['REQUEST_URI']);
    }
    $page = from($_GET, 'page');
    $page = $page ? (int) $page : 1;
    $perpage = config('tag.perpage');
    $posts = get_tag($tag, $page, $perpage, false);
    $total = get_tagcount($tag, 'basename');
    $ttag = new stdClass();
    $ttag->title = tag_i18n($tag);
    if (empty($posts) || $page < 1) {
        // a non-existing page
        not_found();
    }
    render('main', array('title' => 'Posts tagged: ' . tag_i18n($tag) . ' - ' . blog_title(), 'description' => 'All posts tagged: ' . tag_i18n($tag) . ' on ' . blog_title() . '.', 'canonical' => site_url() . 'tag/' . strtolower($tag), 'page' => $page, 'posts' => $posts, 'tag' => $ttag, 'bodyclass' => 'intag', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Posts tagged: ' . tag_i18n($tag), 'pagination' => has_pagination($total, $perpage, $page), 'is_tag' => true));
});
// Show the archive page
get('/archive/:req', function ($req) {
    if (!login()) {
        file_cache($_SERVER['REQUEST_URI']);
    }
    $page = from($_GET, 'page');
    $page = $page ? (int) $page : 1;
Example #2
0
        render('updated-to', array('title' => 'Updated - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'info' => $updater->getCurrentInfo(), 'bodyclass' => 'updatepage', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Update HTMLy'));
    } else {
        $login = site_url() . 'login';
        header("location: {$login}");
    }
});
// Show the tag page
get('/tag/:tag', function ($tag) {
    if (!login()) {
        file_cache($_SERVER['REQUEST_URI']);
    }
    $page = from($_GET, 'page');
    $page = $page ? (int) $page : 1;
    $perpage = config('tag.perpage');
    $posts = get_tag($tag, $page, $perpage, false);
    $total = get_tagcount($tag, 'filename');
    if (empty($posts) || $page < 1) {
        // a non-existing page
        not_found();
    }
    render('main', array('title' => 'Posts tagged: ' . $tag . ' - ' . blog_title(), 'description' => 'All posts tagged: ' . $tag . ' on ' . blog_title() . '.', 'canonical' => site_url() . 'tag/' . $tag, 'page' => $page, 'posts' => $posts, 'bodyclass' => 'intag', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Posts tagged: ' . $tag, 'pagination' => has_pagination($total, $perpage, $page), 'is_tag' => is_tag(true)));
});
// Show the archive page
get('/archive/:req', function ($req) {
    if (!login()) {
        file_cache($_SERVER['REQUEST_URI']);
    }
    $page = from($_GET, 'page');
    $page = $page ? (int) $page : 1;
    $perpage = config('archive.perpage');
    $posts = get_archive($req, $page, $perpage);