示例#1
0
 public function rss()
 {
     // set headers
     Rss::headers();
     // set content
     Rss::generate();
 }
示例#2
0
 public function rss()
 {
     // set headers
     Response::header('Content-Type', 'application/xml');
     // set content
     $xml = Rss::generate();
     // dump xml tree
     Response::content($xml);
 }
示例#3
0
文件: rss.php 项目: jechiy/PHPWind
                 }
                 if ($rt['ifsign'] < 2) {
                     $description = str_replace("\n", "<br />", $description);
                 }
                 $description = stripPostHideAndSell($description);
                 $description = convert($description, $allow);
                 $description = xmlEscape($description);
                 $item = array('title' => $postTitle, 'description' => $description, 'link' => $link, 'author' => $db_ceoemail . ' (' . $rt['author'] . ')', 'category' => $forum[$rt['fid']]['name'], 'pubDate' => date('r', $rt['postdate']));
                 $Rss->item($item);
             }
         }
         unset($threaddbs);
     }
     $channel['pubDate'] = date('r', $forumLastPostTime);
     $Rss->channel($channel);
     $Rss->generate($cache_path);
 }
 header("Content-type: application/xml");
 if (file_exists($cache_path)) {
     $etag = '"' . md5_file($cache_path) . '"';
     if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $etag == $_SERVER['HTTP_IF_NONE_MATCH']) {
         $statusCode = 304;
     } else {
         header('Etag:' . $etag);
     }
     $fileModifiedTime = pwFilemtime($cache_path);
     if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $fileModifiedTime == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
         $statusCode = 304;
     } else {
         $lastModifiedTime = date('D, d M Y H:i:s', $fileModifiedTime) . ' GMT';
         header("Last-Modified: {$lastModifiedTime}");