From 83e12961b13d1ab1e11a60e30b335d26b1875a25 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 4 Mar 2009 06:25:25 +0000 Subject: Allow url() to return absolute urls --- core/models/item.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index cc242abf..d90f039e 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -145,12 +145,9 @@ class Item_Model extends ORM_MPTT { * * @param string $query the query string (eg "show=3") */ - public function url($query=array()) { - if ($this->is_album()) { - $url = url::site("albums/$this->id"); - } else { - $url = url::site("photos/$this->id"); - } + public function url($query=array(), $full_uri=false) { + $url = ($full_uri ? url::abs_site("{$this->type}s/$this->id") + : url::site("{$this->type}s/$this->id")); if ($query) { $url .= "?$query"; } -- cgit v1.2.3