Example #1
0
// Have we displayed any posts yet?
$posts_displayed = false;
/* 
    perch_get() is used to get options from the URL.
    
    e.g. for the URL 
        /blog/archive.php?cat=news

    perch_get('cat') would return 'news' because cat=news.


    The code below looks for different options in the URL, and then displays different types of listings based on it.
*/
/* --------------------------- POSTS BY CATEGORY --------------------------- */
if (perch_get('cat')) {
    echo '<h2 class="page-title">Archive of: ' . perch_blog_category(perch_get('cat'), true) . '</h2>';
    perch_blog_custom(array('category' => perch_get('cat'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order, 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
    $posts_displayed = true;
}
/* --------------------------- POSTS BY TAG --------------------------- */
if (perch_get('tag')) {
    echo '<h2 class="page-title">Archive of: ' . perch_blog_tag(perch_get('tag'), true) . '</h2>';
    perch_blog_custom(array('tag' => perch_get('tag'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order, 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
    $posts_displayed = true;
}
/* --------------------------- POSTS BY DATE RANGE --------------------------- */
if (perch_get('year')) {
    $year = intval(perch_get('year'));
    $date_from = $year . '-01-01 00:00:00';
    $date_to = $year . '-12-31 23:59:59';
    $title_date_format = '%Y';
Example #2
0
// Have we displayed any posts yet?
$posts_displayed = false;
/*
	perch_get() is used to get options from the URL.

					e.g. for the URL
						/blog/archive.php?cat=news

					perch_get('cat') would return 'news' because cat=news.


					The code below looks for different options in the URL, and then displays different types of listings based on it.
*/
/* --------------------------- POSTS BY CATEGORY --------------------------- */
if (perch_get('cat')) {
    echo '<h1>Archive of: ' . perch_blog_category(perch_get('cat'), true) . '</h1>';
    perch_blog_custom(array('category' => perch_get('cat'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order));
    $posts_displayed = true;
}
/* --------------------------- POSTS BY TAG --------------------------- */
if (perch_get('tag')) {
    echo '<h1>Archive of: ' . perch_blog_tag(perch_get('tag'), true) . '</h1>';
    perch_blog_custom(array('tag' => perch_get('tag'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order));
    $posts_displayed = true;
}
/* --------------------------- POSTS BY DATE RANGE --------------------------- */
if (perch_get('year')) {
    $year = intval(perch_get('year'));
    $date_from = $year . '-01-01 00:00:00';
    $date_to = $year . '-12-31 23:59:59';
    $title_date_format = '%Y';
Example #3
0
                <a name="comments"></a>
                <?php 
    perch_blog_post_comments(perch_get('post'));
    ?>
                <?php 
    perch_blog_post_comment_form(perch_get('post'));
    ?>
            </footer>
            </article>
            </section>
        <?php 
} else {
    if (perch_get('cat')) {
        ?>
            <h1><span class="arrow detail">Kategorie</span> <?php 
        print perch_blog_category(perch_get('cat'), true);
        ?>
</h1>
            <section>
        <?php 
        perch_blog_custom(array('category' => perch_get('cat'), 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
        ?>
            </section>
        <?php 
    } else {
        if (perch_get('author')) {
            ?>
            <h1><span class="arrow detail">Author</span> <nobr><?php 
            print perch_blog_author(perch_get('author'), array('template' => 'author_name.html'), true);
            ?>
</nobr></h1>