Esempio n. 1
0
 /**
  * Override for the load method
  *
  * @param string $p_sTemplate The template name
  * @param array $p_aOptions Optional options
  */
 function load($p_sTemplate, array $p_aOptions = array())
 {
     if (!isset($p_aOptions['aRecentPosts'])) {
         $oBlog = new APP_Model_Blog();
         $p_aOptions['aRecentPosts'] = $oBlog->getPosts('published = 1')->fetchAll();
     }
     parent::load($p_sTemplate, $p_aOptions);
 }
Esempio n. 2
0
 /**
  * View all blog posts
  * @return void
  */
 function index()
 {
     $oBlog = new APP_Model_Blog();
     $posts = $oBlog->getPosts("published = 1");
     $oTag = new APP_Helper_TagCloud();
     $oTag->setQuery('SELECT count(*) as `count` FROM ppi_blog_tag GROUP BY `title` ORDER BY `count` DESC');
     $tags = $oTag->getTagCloud();
     $this->load('blog/index', compact('posts', 'tags'));
 }
Esempio n. 3
0
 /**
  * Show the list of blogs
  *
  */
 function blogList()
 {
     $oBlog = new APP_Model_Blog();
     // Get the pages
     $posts = $oBlog->getPosts();
     // Load the template.
     $this->adminLoad('admin/blog_list', compact('posts'));
 }