From 1ffca59a9ed95bb7bd9c6bf69d8e4392f497da0d Mon Sep 17 00:00:00 2001 From: Domovoy Date: Sat, 11 Aug 2012 17:04:07 +0200 Subject: [PATCH] Item: new method get_thumb --- object/Item.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/object/Item.php b/object/Item.php index b96b7e44f4..c92b5e19eb 100644 --- a/object/Item.php +++ b/object/Item.php @@ -49,8 +49,6 @@ class Item extends BaseObject { $dropping = false; $star = false; $isstarred = "unstarred"; - $photo = $item['photo']; - $thumb = $item['thumb']; $indent = ''; $osparkle = ''; $lastcollapsed = false; @@ -99,7 +97,7 @@ class Item extends BaseObject { if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) $profile_avatar = $a->contacts[$normalised]['thumb']; else - $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb)); + $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_thumb())); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); call_hooks('render_location',$locate); @@ -334,6 +332,10 @@ class Item extends BaseObject { public function get_uid() { return $this->get_data_value('uid'); } + + public function get_thumb() { + return $this->get_data_value('thumb'); + } /** * Get raw data @@ -352,7 +354,7 @@ class Item extends BaseObject { * _ false on failure */ private function get_data_value($name) { - if(!x($this->data[$name])) { + if(!x($this->data, $name)) { logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG); return false; } @@ -413,8 +415,10 @@ class Item extends BaseObject { * Set template */ private function set_template($name) { - if(!x($this->available_templates, $name)) + if(!x($this->available_templates, $name)) { + logger('[ERROR] Item::set_template : Template not available ("'. $name .'").', LOGGER_DEBUG); return false; + } $this->template = $this->available_templates[$name]; } -- 2.39.5