private function BuildNav() { /* !!! */ $datafeed = new DataFeed(); $filenames = array(); $keywords = $datafeed->ReturnRandomEntries(rand(OpenBHConf::get('navlinks_min'), OpenBHConf::get('navlinks_max'))); foreach ($keywords as $keyword) { if ($keyword == '') { continue; } /* we need to check if we already generated this page (because of the randomized filename..) */ $tmpPage = Page::GetCache($keyword); if (is_null($tmpPage)) { /* we didnt already created it we need to assign a random filename now !! and store it as empty page..) */ $p = new Page($keyword, false, null, true); // create empty page .. will generate filename array_push($filenames, array('kw' => $keyword, 'filename' => $p->filename)); $p = null; continue; } array_push($filenames, array('kw' => $keyword, 'filename' => $tmpPage->filename)); } $this->navlinks = $filenames; $this->last_kw = $datafeed->ReturnPrevKw($this->keyword); $prevPage = Page::GetCache($this->last_kw); if (is_null($prevPage)) { $prevPage = new Page($this->last_kw, false, null, true); $this->last = $prevPage->filename; } else { $this->last = $prevPage->filename; } $this->next_kw = $datafeed->ReturnNextKw($this->keyword); $nextPage = Page::GetCache($this->next_kw); if (is_null($nextPage)) { $nextPage = new Page($this->next_kw, false, null, true); $this->next = $nextPage->filename; } else { $this->next = $nextPage->filename; } }