Beispiel #1
0
 function allHeadlines()
 {
     $s = new NewsStory();
     $s->orderBy('date desc, rank desc, id desc');
     $res = $s->find(array());
     $out = array();
     foreach ($res as $story) {
         if (strlen($story->title) > 33) {
             $story->title = substr($story->title, 0, 30) . '...';
         }
         $out[$story->id] = Date::format($story->date, 'm/d') . ' - ' . $story->title;
     }
     return $out;
 }
Beispiel #2
0
<?php

loader_import('news.Story');
loader_import('news.Functions');
$story = new NewsStory();
$story->limit($parameters['limit']);
$story->orderBy('date desc, rank desc, id desc');
if (!isset($parameters['sec'])) {
    $params = array();
} else {
    $params = array('category' => $parameters['sec']);
}
$res = $story->find($params);
if (!$res) {
    $res = array();
}
echo template_simple('sidebar.spt', array('list' => $res, 'dates' => $parameters['dates'], 'thumbs' => $parameters['thumbs']));