From ec26f88be9876b75044c37219018bf1337f8d61e Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 9 Feb 2012 15:02:59 -0800 Subject: [PATCH] render_location hook --- include/conversation.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 6defefc731..9df7b20e93 100755 --- a/include/conversation.php +++ b/include/conversation.php @@ -262,15 +262,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { else $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
(' . $coord . ')'; - else - $location = '' . $coord . ''; - } + $locate = array('location' => $item_location, 'coord' => $item['coord'], 'html' => ''); + call_hooks('render_location',$locate); + $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); localize_item($item); if($mode === 'network-new') @@ -1008,3 +1003,17 @@ function find_thread_parent_index($arr,$x) { return $k; return false; } + +function render_location_google($item) { + $location = ''; + $location = (($item['location']) ? '' . $item['location'] . '' : ''); + $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); + if($coord) { + if($location) + $location .= '
(' . $coord . ')'; + else + $location = '' . $coord . ''; + } + return $location; +} +