Exemplo n.º 1
0
$filter = 'all';
if (isset($_GET['category']) && $_GET['category'] != '') {
    $filter = 'category';
    $category = $_GET['category'];
}
if (isset($_GET['section']) && $_GET['section'] != '') {
    $filter = 'section';
    $section = $_GET['section'];
}
if (isset($_GET['status']) && $_GET['status'] != '') {
    $filter = 'status';
    $status = $_GET['status'];
}
switch ($filter) {
    case 'category':
        $posts = $Blog->get_by_category_slug_for_admin_listing($category, $Paging);
        break;
    case 'section':
        $posts = $Blog->get_by_section_slug_for_admin_listing($section, $Paging);
        break;
    case 'status':
        $posts = $Blog->get_by_status($status, false, $Paging);
        break;
    default:
        $posts = $Blog->all($Paging);
        // Install
        if ($posts == false) {
            $Blog->attempt_install();
        }
        break;
}