From e14d5574b6861314c2133b156c8f2c9c94aeb1b6 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 19 Nov 2008 06:05:38 +0000 Subject: Cleanup media rss feed added parameters to thumbnail_url and resizes_url to be passed to the url::base call to generate ful urls --- core/models/item.php | 12 ++++++------ modules/media_rss/views/feed.mrss.php | 19 +++++++------------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/core/models/item.php b/core/models/item.php index 485975cb..5fcd16d0 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -65,11 +65,11 @@ class Item_Model extends ORM_MPTT { * album: http://example.com/gallery3/var/resizes/album1/.thumb.jpg * photo: http://example.com/gallery3/var/albums/album1/photo.thumb.jpg */ - public function thumbnail_url() { + public function thumbnail_url($index = FALSE, $protocol = FALSE) { if ($this->is_album()) { - return $this->_relative_path(url::base() . "var/resizes", "", "/.thumb.jpg"); + return $this->_relative_path(url::base($index, $protocol) . "var/resizes", "", "/.thumb.jpg"); } else { - return $this->_relative_path(url::base() . "var/resizes", ".thumb", ""); + return $this->_relative_path(url::base($index, $protocol) . "var/resizes", ".thumb", ""); } } @@ -89,11 +89,11 @@ class Item_Model extends ORM_MPTT { * album: http://example.com/gallery3/var/resizes/album1/.resize.jpg * photo: http://example.com/gallery3/var/albums/album1/photo.resize.jpg */ - public function resize_url() { + public function resize_url($index = FALSE, $protocol = FALSE) { if ($this->is_album()) { - return $this->_relative_path(url::base() . "var/resizes", "", "/.resize.jpg"); + return $this->_relative_path(url::base($index, $protocol) . "var/resizes", "", "/.resize.jpg"); } else { - return $this->_relative_path(url::base() . "var/resizes", ".resize", ""); + return $this->_relative_path(url::base($index, $protocol) . "var/resizes", ".resize", ""); } } diff --git a/modules/media_rss/views/feed.mrss.php b/modules/media_rss/views/feed.mrss.php index 3728afeb..4ccde722 100644 --- a/modules/media_rss/views/feed.mrss.php +++ b/modules/media_rss/views/feed.mrss.php @@ -4,7 +4,7 @@ xmlns:atom="http://www.w3.org/2005/Atom"> <?= $item->title ?> - id}") ?> + id}", "http") ?> description ?> en-us @@ -15,22 +15,17 @@ - <?= $child->title ?> - - id ?> - description ?> - - title ?> + resize_url(false, "http") ?> + id ?> + description ?> + " type="mime_type ?>" height="resize_height ?>" width="resize_width ?>" -- cgit v1.2.3