From 0aa823656bf92ae472cb6780afb24f5a0390b880 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 23 Nov 2011 16:50:04 -0500 Subject: added editing of images --- classes/TidypicsImage.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'classes/TidypicsImage.php') diff --git a/classes/TidypicsImage.php b/classes/TidypicsImage.php index c604d869e..926bc386b 100644 --- a/classes/TidypicsImage.php +++ b/classes/TidypicsImage.php @@ -9,8 +9,8 @@ class TidypicsImage extends ElggFile { - protected function initialise_attributes() { - parent::initialise_attributes(); + protected function initializeAttributes() { + parent::initializeAttributes(); $this->attributes['subtype'] = "image"; } @@ -51,6 +51,17 @@ class TidypicsImage extends ElggFile { return $this->title; } + /** + * Get the URL for the web page of this image + * + * @return string + */ + public function getURL() { + $title = elgg_get_friendly_title($this->getTitle()); + $url = "photos/image/$this->guid/$title"; + return elgg_normalize_url($url); + } + /** * Get the src URL for the image * @@ -312,7 +323,7 @@ class TidypicsImage extends ElggFile { * @param $viewer_guid the guid of the viewer (0 if not logged in) * @return array with number of views, number of unique viewers, and number of views for this viewer */ - public function getViews($viewer_guid) { + public function getViewCount($viewer_guid) { $views = get_annotations($this->getGUID(), "object", "image", "tp_view", "", 0, 99999); if ($views) { $total_views = count($views); -- cgit v1.2.3