/** * Returns a list of News Titlelinks found in the search * * @param int $articles_per_page The number of articles to get * @param bool $published placeholder for consistent parameter list * @param bool $ignorepagination ignore pagination * @param string $sorttype field to sort on * @param string $sortdirection sort order * * @return array */ function getArticles($articles_per_page = 0, $published = NULL, $ignorepagination = false, $sorttype = NULL, $sortdirection = NULL) { $articles = $this->getSearchArticles($sorttype, $sortdirection); if (empty($articles)) { return array(); } else { if ($ignorepagination || !$articles_per_page) { return $articles; } return array_slice($articles, Zenpage::getOffset($articles_per_page), $articles_per_page); } }
$articles_page = sanitize_numeric($_GET['articles_page']); } } // Basic setup for the global for the current admin page first if (!isset($_GET['subpage'])) { $subpage = 0; } else { $subpage = sanitize_numeric($_GET['subpage']); } if ($articles_page) { $total = ceil($articles / $articles_page); //Needed check if we really have articles for page x or not otherwise we are just on page 1 if ($total <= $subpage) { $subpage = 0; } $offset = Zenpage::getOffset($articles_page); $list = array(); foreach ($result as $article) { $list[] = $article[$sortorder]; } if ($sortorder == 'date') { $rangeset = getPageSelector($list, $articles_page, 'dateDiff'); } else { $rangeset = getPageSelector($list, $articles_page); } $options = array_merge(array('page' => 'news', 'tab' => 'articles'), getNewsAdminOption(array('category' => 0, 'date' => 0, 'published' => 0, 'sortorder' => 0, 'articles_page' => 1))); $result = array_slice($result, $offset, $articles_page); } else { $rangeset = $options = array(); } ?>