/** * Build link for comments permalink * * @access private * @return string */ private function build_link() { switch ($this->_pid) { case 'posts': $link = 'ctl=posts&news=' . VGet::news(); break; case 'albums': $link = 'ctl=albums&&album=' . VGet::album(); break; } return $link; }
/** * Determine maximum pages number * * @access private */ private function get_nb_pages() { $to_read['table'] = $this->_sql_table; $to_read['columns'] = array('COUNT(POST_ID) AS id'); $to_read['condition_columns'][':s'] = 'post_status'; $to_read['condition_select_types'][':s'] = '='; $to_read['condition_values'][':s'] = 'publish'; $to_read['value_types'][':s'] = 'str'; if ($this->_view_type == 'news') { $to_read['condition_types'][':p'] = 'AND'; $to_read['condition_columns'][':p'] = 'post_permalink'; $to_read['condition_select_types'][':p'] = '='; $to_read['condition_values'][':p'] = VGet::news(); $to_read['value_types'][':p'] = 'str'; } $nb = $this->_db->read($to_read); $this->_nb_pages = ceil($nb[0]['id'] / parent::ITEMS_PAGE); }
/** * Method to build page title * * @access protected */ protected function build_title() { switch ($this->_pid) { case 'posts': if (VGet::news()) { $this->_title = $this->_content[0]->_title; } elseif ($this->_page != 1) { $this->_title = 'Posts > Page ' . $this->_page; } else { $this->_title = 'Posts'; } break; case 'albums': if ($this->_page != 1) { $this->_title = 'Albums > Page ' . $this->_page; } else { $this->_title = 'Albums'; } break; case 'video': if ($this->_page != 1) { $this->_title = 'Videos > Page ' . $this->_page; } else { $this->_title = 'Videos'; } break; case 'author': if (VGet::author()) { $this->_title = VGet::author(); } else { $this->_title = 'Authors'; } break; case 'search': if ($this->_page != 1) { $this->_title = 'Search > Page ' . $this->_page; } else { $this->_title = 'Search'; } break; case 'contact': $this->_title = 'Contact'; break; } }