/** * * */ public function executeIndex($request) { list($year, $month) = phpToolkit::array_splice_values($request->getParameterHolder()->getAll(), array('year', 'month')); if (!$year) { $this->newsPosts = SitenewsPeer::getMostRecentPosts(); $this->title = 'News Archive <span>» Latest News</span>'; } else { if ($month >= 1 && $month <= 12) { $this->newsPosts = SitenewsPeer::getPostsByDate($year, $month); coreToolkit::loadHelpers('Date'); $this->selection = format_date(mktime(0, 0, 0, $month, 1, $year), "F Y"); $this->title = 'News for ' . $this->selection; } else { $this->forward404(); } } }
<div id="homeaction"> <?php echo link_to('<img src="/images/2.0/home/button-register.gif" width="199" height="55" alt="Register (it"s free!)" />', 'account/create'); ?> <?php echo link_to('Learn More', '@learnmore'); ?> </div> </div> <!-- end Homepage v1.5 --> </div> <div class="col-box col-box-bis"> <h2>Site News</h2> <?php include_partial('news/list', array('newsPosts' => SitenewsPeer::getMostRecentPosts())); ?> ...more in the <?php echo link_to('news archive', 'news/index'); ?> . </div> </div> </div>