Rev Author Line No. Line
228 kaklik 1 <?php
2  
3 /**
4 * RSS 2.0 output for singapore.
5 *
6 * @author Ross Howard <abitcloser.com
7 * @copyright (c)2006 Tamlyn Rhodes
8 * @version 0.8
9 */
10  
11 if(headers_sent())
12 die("ERROR: Unable to send XML content-type header.");
13 else
14 header("Content-type: application/rss+xml; charset=".$sg->character_set);
15  
16 echo '<?xml version="1.0" encoding="ISO-8859-1"?>'; ?>
17 <rss version="2.0"
18 xmlns:content="http://purl.org/rss/1.0/modules/content/"
19 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
20 xmlns:dc="http://purl.org/dc/elements/1.1/">
21 <channel>
22 <title><?php echo $sg->gallery->name(); ?></title>
23 <link><?php echo "http://".$_SERVER['HTTP_HOST'].($sg->config->use_mod_rewrite ? '' : dirname($_SERVER['PHP_SELF']).'/').str_replace("template=rss", "", $sg->gallery->URL()); ?></link>
24 <description><?php echo $sg->gallery->name(); ?> Feed</description>
25 <?php if(($timestamp = @strtotime($sg->gallery->date())) !== false && $timestamp != -1)
26 echo '<pubDate>'.date('r', $timestamp).'</pubDate>'; ?>
27 <generator>http://www.sgal.org/</generator>
28 <?php if($sg->isAlbumPage()) { ?>
29 <?php for($index = $sg->gallery->startat; $index < $sg->gallery->imageCountSelected()+$sg->gallery->startat; $index++): ?>
30 <item>
31 <title><?php echo $sg->gallery->images[$index]->name; ?></title>
32 <link><?php echo "http://".$_SERVER['HTTP_HOST'].str_replace("?template=rss", "", $sg->gallery->images[$index]->url()); ?></link>
33 <?php if(($timestamp = @strtotime($sg->gallery->images[$index]->date())) !== false && $timestamp != -1)
34 echo '<pubDate>'.date('r', $timestamp).'</pubDate>'; ?>
35 <dc:creator><?php echo $sg->gallery->images[$index]->artist(); ?></dc:creator>
36 <description>
37 <![CDATA[ <?php echo $sg->gallery->images[$index]->description(); ?> ]]>
38 </description>
39 </item>
40 <?php endfor; ?>
41 <?php } elseif($sg->isGalleryPage()) { ?>
42 <?php for($index = $sg->gallery->startat; $index < $sg->gallery->galleryCountSelected()+$sg->gallery->startat; $index++): ?>
43 <item>
44 <title><![CDATA[<?php echo $sg->gallery->galleries[$index]->name(); ?> ]]></title>
45 <link><?php echo "http://".$_SERVER['HTTP_HOST'].str_replace("?template=rss", "", $sg->gallery->galleries[$index]->url()); ?></link>
46 <?php if(($timestamp = @strtotime($sg->gallery->date())) !== false && $timestamp != -1)
47 echo '<pubDate>'.date('r', $timestamp).'</pubDate>'; ?>
48 <dc:creator><?php echo $sg->gallery->galleries[$index]->artist(); ?></dc:creator>
49 <description>
50 <![CDATA[ <?php echo $sg->gallery->galleries[$index]->description(); ?>]]>
51 </description>
52 </item>
53 <?php endfor; ?>
54 <?php } ?>
55 </channel>
56 </rss>