public static function display() { $y1 = substr(GWF_Website::getBirthdate(), 0, 4); $y2 = date('Y'); $years = $y1 === $y2 ? $y1 : "{$y1}-{$y2}"; return GWF_HTML::lang('copy', array($years)); }
public function guessRSSDate() { if (count($this->items) === 0) { $date = GWF_Website::getBirthdate(); } else { $item = $this->items[0]; return $item->getRSSPubDate(); } }
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; }