aboutsummaryrefslogtreecommitdiff
path: root/classes/TidypicsImage.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/TidypicsImage.php')
-rw-r--r--classes/TidypicsImage.php17
1 files changed, 14 insertions, 3 deletions
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";
}
@@ -52,6 +52,17 @@ class TidypicsImage extends ElggFile {
}
/**
+ * 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
*
* @return string
@@ -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);