/** * Retrieve wanted posts * * @access private */ private function get_content() { try { $to_read['table'] = $this->_sql_table; $to_read['columns'] = array('POST_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'; } if (VGet::preview()) { $to_read['condition_values'][':s'] = 'draft'; } $to_read['order'] = array('post_date', 'DESC'); $to_read['limit'] = array($this->_limit_start, parent::ITEMS_PAGE); $this->_content = $this->_db->read($to_read); if (!empty($this->_content)) { foreach ($this->_content as &$post) { $post = new Post($post['POST_ID']); $user = new User(); $user->_id = $post->_author; $user->read('_publicname'); $post->_author_name = $user->_publicname; $updated = $post->_updated; if ($updated == 'yes') { $user->_id = $post->_update_author; $user->read('_publicname'); $post->_update_author_name = $user->_publicname; } } } elseif (empty($this->_content) && $this->_view_type == 'news' && !VGet::preview()) { header('Location: 404.php'); } } catch (Exception $e) { @error_log($e->getMessage() . ' file: ' . __FILE__ . '; line: ' . __LINE__, 1, WS_EMAIL); header('Location: 404.php'); } }