Exemple #1
0
function perch_category($path, $opts = array(), $return = false)
{
    $path = rtrim(ltrim($path, '/'), '/') . '/';
    $opts = PerchUtil::extend(array('set' => false, 'skip-template' => false, 'template' => 'category.html', 'filter' => 'catPath', 'match' => 'eq', 'value' => $path), $opts);
    $Categories = new PerchCategories_Categories();
    $r = $Categories->get_custom($opts);
    if ($opts['skip-template']) {
        $return = true;
    }
    if ($return) {
        return $r;
    }
    echo $r;
}
Exemple #2
0
function perch_blog_recent_posts($count = 10, $return_or_opts = false, $return = false)
{
    if (is_array($return_or_opts)) {
        $opts = $return_or_opts;
    } else {
        $return = $return_or_opts;
        $opts = array();
    }
    $default_opts = array('count' => $count, 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC', 'paginate' => true);
    $opts = PerchUtil::extend($default_opts, $opts);
    $r = perch_blog($opts, $return);
    if ($return) {
        return $r;
    }
    echo $r;
}