diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-02 13:44:37 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-02 13:44:37 -0700 |
| commit | aea34882b4121176a04d2eadba54aedccda5c08a (patch) | |
| tree | a85c6e211b5803175d93e08724966be418ed4ce5 /modules/gallery/models | |
| parent | f2bbb2963a03c7f838772fa89facc0e38c3e4f4e (diff) | |
| parent | 417c983491a7708a1d60e909caead239ef02eadd (diff) | |
Merge branch 'master' into talmdal
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 68e89db6..8905a627 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -188,9 +188,8 @@ class Item_Model extends ORM_MPTT { * photo: http://example.com/gallery3/var/albums/album1/photo.jpg */ public function file_url($full_uri=false) { - return $full_uri ? - url::abs_file("var/albums/" . $this->relative_path()) : - url::file("var/albums/" . $this->relative_path()); + $relative_path = "var/albums/" . $this->relative_path(); + return $full_uri ? url::abs_file($relative_path) : url::file($relative_path); } /** @@ -222,9 +221,8 @@ class Item_Model extends ORM_MPTT { */ public function thumb_url($full_uri=false) { $cache_buster = "?m=" . $this->updated; - $base = ($full_uri ? - url::abs_file("var/thumbs/" . $this->relative_path()) : - url::file("var/thumbs/" . $this->relative_path())); + $relative_path = "var/thumbs/" . $this->relative_path(); + $base = ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)); if ($this->is_photo()) { return $base . $cache_buster; } else if ($this->is_album()) { @@ -250,9 +248,8 @@ class Item_Model extends ORM_MPTT { * photo: http://example.com/gallery3/var/albums/album1/photo.resize.jpg */ public function resize_url($full_uri=false) { - return ($full_uri ? - url::abs_file("var/resizes/" . $this->relative_path()) : - url::file("var/resizes/" . $this->relative_path())) . + $relative_path = "var/resizes/" . $this->relative_path(); + return ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)) . ($this->is_album() ? "/.album.jpg" : ""); } |
