/** * Extract wanted words and set them in associated attributes * * @access private */ private function build_search() { if (substr(VGet::q(), 0, 4) == 'date') { $this->_by_date = trim(substr(VGet::q(), 5)); } elseif (VGet::q()) { $this->_words_to_find = array_unique(explode(' ', trim(VGet::q()))); $this->_search = implode(' ', $this->_words_to_find); } elseif (VGet::tag()) { $this->_tag = VGet::tag(); } elseif (VGet::cat()) { $this->_cat = VGet::cat(); } else { header('Location: 404.php'); } }
/** * Method to build the complement link for navigation * * @access protected * @return string */ protected function link_navigation() { switch ($this->_pid) { case 'posts': $link = 'ctl=posts&'; break; case 'search': if (VGet::tag()) { $link = 'ctl=search&tag=' . VGet::tag() . '&'; } elseif (VGet::cat()) { $link = 'ctl=search&cat=' . VGet::cat() . '&'; } else { $link = 'ctl=search&q=' . VGet::q() . '&'; } break; default: $link = 'ctl=' . $this->_pid . '&'; break; } return $link; }