Beispiel #1
0
                $contents = $app->getArchives($res);
                $pager = $app->getPager($totalItemsCount, $pageNumberToShow, $date, $expand);
                $result = new Loggix_View($pathToIndex . '/theme/' . $resultViewFile);
                $item = $app->setSearchItems($res, $totalItemsCount, $previousItemNumber, $date);
                $result->assign('item', $item);
                $result->assign('lang', $lang);
                $result = $result->render();
            }
            // Contents, Pager, and Results
            $item['contents'] = $contents;
            $item['pager'] = $pager;
            $item['result'] = $result;
            $item['title'] = !empty($_GET['c']) ? $app->setTitle(array($item['keyword'], $lang['archive'])) : $app->setTitle($lang['archive']);
        }
        // (2) Index View (Show Recent Entries)
    } else {
        $sql = 'SELECT ' . '* ' . 'FROM ' . TRACKBACK_TABLE . ' ' . 'GROUP BY ' . 'blog_id ' . 'ORDER BY ' . 'date DESC ' . 'LIMIT ' . $config['page_max'];
        $countTotalItemsSql = 'SELECT ' . 'COUNT(id) ' . 'FROM ' . TRACKBACK_TABLE . ' ' . 'GROUP BY ' . 'blog_id';
        //        $totalItemsCount = $app->getTotalItemsCount($countTotalItemsSql);
        $countRes = $app->db->query($countTotalItemsSql);
        $totalItemsCount = count($countRes->fetchAll());
        //echo $totalItemsCount;
        $item = array('title' => $app->setTitle('Trackbacks'), 'contents' => $app->getArchives($app->db->query($sql)), 'pager' => $app->getPager($totalItemsCount, $pageNumberToShow = '1', $date = '', $expand = '0'), 'result' => '');
    }
} catch (Exception $e) {
    $templateFile = $pathToIndex . '/theme/errors/data-not-found.html';
    $contentsView = new Loggix_View($templateFile);
    $item = array('title' => $app->setTitle('404 Not Found'), 'contents' => $contentsView->render(), 'pager' => '', 'result' => '');
}
$app->display($item, $sessionState);