Example #1
0
 public function archive($month)
 {
     if ($month != NULL) {
         // only cache public content
         if (!($isAuthenticated = Fari_User::isAuthenticated('realname'))) {
             $this->view->cache('/themes/' . BLOG_THEME . '/archive', 'text/html', $month);
         }
         $articles = Blog::getArchive($month, $isAuthenticated);
         if (empty($articles)) {
             $this->redirect('/error404');
         }
         $this->view->articles = $articles;
         $this->view->title = Fari_Format::titleize($month);
         $this->view->display('/themes/' . BLOG_THEME . '/archive', 'text/html', $month);
     } else {
         $this->redirect('/error404');
     }
 }
Example #2
0
	public function archive($year, $month = null)
	{
		$this->blogs = Blog::getArchive(CoOrg::getLanguage(), $year, $month);
		$this->archiveYear = $year;
		if ($month) $this->archiveMonth = $month;
		$this->render('archive');
	}
Example #3
0
	public function testArchive()
	{
		$archive = Blog::getArchive('br', 2009, 1);
		$this->assertEquals(2, count($archive));
		$this->assertEquals('b', $archive[0]->ID);
		$this->assertEquals('a', $archive[1]->ID);
		
		$archive = Blog::getArchive('br', 2009);
		$this->assertEquals(6, count($archive));
		$this->assertEquals('abba', $archive[0]->ID);
		$this->assertEquals('ccdd', $archive[1]->ID);
	}