public function __construct($request) { parent::__construct($request, "index.php"); $page = !empty($_GET['page']) ? $_GET['page'] : 1; if (!empty($_GET['s'])) { $this->context['rss_items'] = RSSItem::search_paginated($_GET['s'], $page, RSS_ITEM_PER_PAGE); $this->context['page_count'] = (int) (RSSItem::count_search_results($_GET['s']) / RSS_ITEM_PER_PAGE) + 1; } else { $this->context['rss_items'] = RSSItem::list_paginated($page, RSS_ITEM_PER_PAGE); $this->context['page_count'] = (int) (RSSItem::count_all() / RSS_ITEM_PER_PAGE) + 1; } $this->context['current_page'] = $page; }