aboutsummaryrefslogtreecommitdiff
path: root/views/rss/object/album.php
blob: fbe1ab058bd895f0aab1e878741a153dae9dea72 (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
<?php
	/**
	 * Tidypics Album RSS View
	 */

	$album = $vars['entity'];
	
	$title = $album->title;
	if (empty($title)) {
		$subtitle = strip_tags($vars['entity']->description);
		$title = substr($subtitle,0,32);
		if (strlen($subtitle) > 32)
			$title .= " ...";
	}
	
	$base_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=';

	
	$owner_guid = $album->getOwner();
	$images = get_entities("object", "image", 0, "", 10, 0, false, 0, $album->guid);
	
	echo "\n";
	
	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 . '&amp;size=large'; ?>">
			<media:title><?php echo $image->title; ?></media:title>
			<media:description><?php echo $caption; ?></media:description>
			<media:thumbnail url="<?php echo $base_url . $image->guid . '&amp;size=thumb'; ?>"></media:thumbnail>
		</media:content>
	</item>
	
<?php
	}
?>