diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-19 18:23:30 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-19 18:23:30 +0000 |
commit | b3314fc1dcfd73c36c4bab82a5ebabca629845c8 (patch) | |
tree | 0f2a53f914302f59a7c8215884b0a6482abbd1b2 /core/models | |
parent | 161998dde6d976c45cfcea31f1128147acc3d64f (diff) |
Update the media rss template to include the resize and the fullsize
added descendants by type method to the item model to allow for the selection of children by type
Diffstat (limited to 'core/models')
-rw-r--r-- | core/models/item.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/models/item.php b/core/models/item.php index 5fcd16d0..f03d1a91 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -50,6 +50,14 @@ class Item_Model extends ORM_MPTT { } /** + * album: http://example.com/gallery3/var/resizes/album1/ + * photo: http://example.com/gallery3/var/albums/album1/photo.jpg + */ + public function url($index = FALSE, $protocol = FALSE) { + return $this->_relative_path(url::base($index, $protocol) . "albums", "", ""); + } + + /** * album: /var/resizes/album1/.thumb.jpg * photo: /var/albums/album1/photo.thumb.jpg */ @@ -183,6 +191,9 @@ class Item_Model extends ORM_MPTT { } catch (Exception $e) { return null; } + } else if ($column == "height" || $column == "width") { + $dims = getimagesize($this->file_path()); + return $column == "width" ? $dims[0] : $dims[1]; } else { return parent::__get($column); } |