diff --git a/3.0/modules/tag_albums/models/tag.php b/3.0/modules/tag_albums/models/tag.php index e02a72c5..6ea6c17c 100644 --- a/3.0/modules/tag_albums/models/tag.php +++ b/3.0/modules/tag_albums/models/tag.php @@ -141,7 +141,7 @@ class Tag_Model_Core extends ORM { /** * Return the server-relative url to this item, eg: - * /gallery3/index.php/tags/35 + * /gallery3/index.php/tag_albums/tags/35/0/Bob * * @param string $query the query string (eg "page=3") */ @@ -157,4 +157,22 @@ class Tag_Model_Core extends ORM { } return $url; } -} \ No newline at end of file + + /** + * Return the full url to this item, eg: + * http://example.com/gallery3/index.php/tag_albums/tag/35/0/Bob + * + * @param string $query the query string (eg "page=3") + */ + public function abs_url($query=null) { + $album_id = Input::instance()->get("album"); + if (!($album_id)) { + $album_id = 0; + } + $url = url::abs_site("/tag_albums/tag/{$this->id}/{$album_id}/" . urlencode($this->name)); + if ($query) { + $url .= "?$query"; + } + return $url; + } +}