Пример #1
0
 private function templateFeed(GWF_Language $lang)
 {
     header("Content-Type: application/xml; charset=UTF-8");
     $items = $this->getItems($lang);
     if (count($items) > 0) {
         $rss_date = $items[key($items)]['pub_date'];
     } else {
         $rss_date = GWF_Time::rssDate(GWF_Website::getBirthdate());
     }
     $tVars = array('items' => $items, 'title_link' => Common::getAbsoluteURL('news/feed'), 'language' => $lang->displayName(), 'image_url' => Common::getAbsoluteURL('favicon.ico'), 'image_link' => Common::getAbsoluteURL('news'), 'image_width' => '32', 'image_height' => '32', 'pub_date' => $rss_date, 'build_date' => $rss_date);
     echo '<?xml version="1.0" encoding="UTF-8" ?>' . PHP_EOL . $this->module->templatePHP('feed.php', $tVars);
     die;
 }
Пример #2
0
 public function rssDate()
 {
     return GWF_Time::rssDate($this->getVar('news_date'));
 }
Пример #3
0
 public static function displayDate($date)
 {
     return GWF_Time::rssDate($date);
 }