From 4ab2400d18e1625cebbf94310bee265b272f6fba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 2 Jan 2010 13:47:28 -0800 Subject: Add a cache buster to the resize and file urls. This fixes ticket --- modules/gallery/models/item.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/gallery/models') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 2d62c386..414181d9 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -237,7 +237,8 @@ class Item_Model extends ORM_MPTT { */ public function file_url($full_uri=false) { $relative_path = "var/albums/" . $this->relative_path(); - return $full_uri ? url::abs_file($relative_path) : url::file($relative_path); + return ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)) + . "?m={$this->updated}"; } /** @@ -268,7 +269,7 @@ class Item_Model extends ORM_MPTT { * photo: http://example.com/gallery3/var/albums/album1/photo.thumb.jpg */ public function thumb_url($full_uri=false) { - $cache_buster = "?m=" . $this->updated; + $cache_buster = "?m={$this->updated}"; $relative_path = "var/thumbs/" . $this->relative_path(); $base = ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)); if ($this->is_photo()) { @@ -298,7 +299,8 @@ class Item_Model extends ORM_MPTT { public function resize_url($full_uri=false) { $relative_path = "var/resizes/" . $this->relative_path(); return ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)) . - ($this->is_album() ? "/.album.jpg" : ""); + ($this->is_album() ? "/.album.jpg" : "") + . "?m={$this->updated}"; } /** -- cgit v1.2.3