blob: 7afb19d3440333ddc58fc8572f24d4c087078763 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
/**
* Tidypics Album RSS View
*/
$album = $vars['entity'];
$base_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=';
// insert cover image if it exists image
if ($album->cover) {
// Set title
$vars['title'] = $album->title;
if (empty($vars['title'])) {
$title = $vars['config']->sitename;
} else if (empty($vars['config']->sitename)) {
$title = $vars['title'];
} else {
$title = $vars['config']->sitename . ": " . $vars['title'];
}
$album_cover_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb';
?> <image>
<url><?php echo $album_cover_url; ?></url>
<title><![CDATA[<?php echo $title; ?>]]></title>
<link><?php echo $album->getURL() . '?view=rss'; ?></link>
</image>
<?php
}
$images = get_entities("object", "image", 0, "", 10, 0, false, 0, $album->guid);
foreach ($images as $image) {
$caption = $image->description;
if (!$caption)
$caption = "No caption";
?>
<item>
<title><?php echo $image->title; ?></title>
<link><?php echo $image->getURL(); ?></link>
<description><?php echo $caption; ?></description>
<pubDate><?php echo date("r", $image->time_created); ?></pubDate>
<guid isPermaLink="true"><?php echo $image->getURL(); ?></guid>
<media:content url="<?php echo $base_url . $image->guid . '&size=large'; ?>" medium="image" type="<?php echo $image->getMimeType(); ?>">
<media:title><?php echo $image->title; ?></media:title>
<media:description><?php echo $caption; ?></media:description>
<media:thumbnail url="<?php echo $base_url . $image->guid . '&size=thumb'; ?>"></media:thumbnail>
</media:content>
</item>
<?php
}
?>
|