aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-09 15:02:59 -0800
committerfriendica <info@friendica.com>2012-02-09 15:02:59 -0800
commitec26f88be9876b75044c37219018bf1337f8d61e (patch)
treef36975a9385e2570fdaef16c8f4ab4f776ba0022
parent171249966e68d12a4e2e485d26007de8372e8235 (diff)
downloadvolse-hubzilla-ec26f88be9876b75044c37219018bf1337f8d61e.tar.gz
volse-hubzilla-ec26f88be9876b75044c37219018bf1337f8d61e.tar.bz2
volse-hubzilla-ec26f88be9876b75044c37219018bf1337f8d61e.zip
render_location hook
-rwxr-xr-xinclude/conversation.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 6defefc73..9df7b20e9 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']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
- $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
- if($coord) {
- if($location)
- $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
- else
- $location = '<span class="smalltext">' . $coord . '</span>';
- }
+ $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']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
+ $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
+ if($coord) {
+ if($location)
+ $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
+ else
+ $location = '<span class="smalltext">' . $coord . '</span>';
+ }
+ return $location;
+}
+