/** * Get the index of this article * * @param string $sortorder * @param bool $sortdirection TRUE for ascending, FALSE for descending * @param bool $sticky If sticky article should come first * @return int */ function getIndex() { global $_zp_zenpage, $_zp_current_zenpage_news; if (func_num_args() != 0) { Zenpage_internal_deprecations::getIndex(); } if ($this->index == NULL) { $articles = $_zp_zenpage->getArticles(0, NULL, true); for ($i = 0; $i < count($articles); $i++) { $article = $articles[$i]; if ($this->getTitlelink() == $article['titlelink']) { $this->index = $i; break; } } } return $this->index; }