/** * * */ public function executeDetail($request) { $this->forward404Unless($request->getParameter('id') > 0, "This news post does not exist."); $this->post = SitenewsPeer::getPostById($request->getParameter('id')); $this->newsPosts = $this->post ? array($this->post) : array(); $this->title = $this->post ? $this->post->subject : 'News post not found'; }
<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>
<?php use_helper('Date'); ?> <div class="col-news col-box col-box-top"> <div class="app-header"> <h2>News by Month</h2> <div class="clearboth"></div> </div> <div class="content"> <ul> <?php foreach (SitenewsPeer::getArchiveIndex() as $p) { ?> <li><?php echo link_to(format_date(mktime(0, 0, 0, $p->month, 1, $p->year), "M Y"), 'news/index?year=' . $p->year . '&month=' . $p->month) . ' (' . $p->count . ')'; ?> </li> <?php } ?> </ul> </div> </div>