aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-02-13 09:46:42 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2012-02-13 09:46:42 +0100
commit850560519a4bbe9949368933e115f767aeb90b73 (patch)
tree6f162b4b0130a5f829d40f7ebd9d18442ad18921 /include/conversation.php
parent16d3bc9deb5cb80f438a53f1bf483c79351674af (diff)
parent85c831bcbf6f4cc2793d91e4e3fb3da5828a3f60 (diff)
downloadvolse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.tar.gz
volse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.tar.bz2
volse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.zip
Merge remote-tracking branch 'friendica/master' into mobile
Diffstat (limited to 'include/conversation.php')
-rwxr-xr-xinclude/conversation.php39
1 files changed, 21 insertions, 18 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 947a9b040..b44d4acd6 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')
@@ -594,16 +589,10 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
- $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));
$indent = (($toplevelpost) ? '' : ' comment');
@@ -1014,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;
+}
+