/** * Display a specific post * * @access private */ private function display_news() { if (!empty($this->_content)) { $cats = explode(',', $this->_content[0]->_category); try { foreach ($cats as &$cat) { $id = $cat; $infos = new Category($id); $cat = Helper\Posts::make_category_link($id, $infos->_name); } } catch (Exception $e) { @error_log($e->getMessage() . ' file: ' . __FILE__ . '; line: ' . __LINE__, 1, WS_EMAIL); } $content = nl2br($this->_content[0]->_content); $tags = explode(',', $this->_content[0]->_tags); foreach ($tags as &$tag) { $tag = Helper\Posts::make_tag_link($tag); } $link = WS_URL . '?ctl=posts&news=' . $this->_content[0]->_title; Html::html5('o', 'id="news_alone">'); Html::article_alone($this->_content[0]->_title, $this->_content[0]->_date, $this->_content[0]->_author_name, $cats, $content, $tags, $link, $this->_content[0]->_updated, $this->_content[0]->_update_author_name); if (VSession::renderer() != 'mobile') { //create comment section if ($this->_content[0]->_allow_comment == 'open') { $c = new Comments($this->_content[0]->_id); $c->display_content(); } else { Html::comment_closed(); } } Html::html5('c'); } }
<?php use Site\Helper\Posts as Helper; ?> <div class="triangle left"></div><div class="triangle right"></div> </section> </section> <footer> Powered by <a href="http://www.lynxpress.org">Lynxpress</a> - <a href="index.php?ctl=contact">Contact</a> <div id="pub_dates"> <?php Helper::pub_dates(); ?> </div> </footer> </body> </html>
/** * Display the posts listing * * @access private */ private function display_listing() { if (!VSession::html5()) { echo '<ul id="listing_articles">'; } if (!empty($this->_content)) { foreach ($this->_content as $article) { $crop_length = Helper\Posts::crop_length($article->_content); $cats = explode(',', $article->_category); try { foreach ($cats as &$cat) { $id = $cat; $infos = new Category($id); $cat = Helper\Posts::make_category_link($id, $infos->_name); } } catch (Exception $e) { @error_log($e->getMessage() . ' file: ' . __FILE__ . '; line: ' . __LINE__, 1, WS_EMAIL); } $content = nl2br(substr($article->_content, 0, $crop_length)); Html::listing_article($article->_title, $article->_permalink, $cats, $article->_date, $article->_author_name, $content); } } if (!VSession::html5()) { echo '</ul>'; } if (VSession::renderer() != 'mobile' && !empty($this->_content)) { Html::navigation($this->_page, $this->_nb_pages, parent::link_navigation()); } }