diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-19 20:52:05 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-19 20:52:05 -0700 |
commit | a8e4ec7801b5ca8c986febed1f95124b412e92f9 (patch) | |
tree | 02dde668c26d5b932997139537c99de9ca7242ea /mod/network.php | |
parent | 81835acc36f17939b9e202cec2ff8981ca03536b (diff) | |
download | volse-hubzilla-a8e4ec7801b5ca8c986febed1f95124b412e92f9.tar.gz volse-hubzilla-a8e4ec7801b5ca8c986febed1f95124b412e92f9.tar.bz2 volse-hubzilla-a8e4ec7801b5ca8c986febed1f95124b412e92f9.zip |
use browser geolocation when desired
Diffstat (limited to 'mod/network.php')
-rw-r--r-- | mod/network.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/network.php b/mod/network.php index 3a747eac9..97a82a705 100644 --- a/mod/network.php +++ b/mod/network.php @@ -28,9 +28,14 @@ function network_content(&$a, $update = 0) { } $_SESSION['return_url'] = $a->cmd; + $geotag = (($a->user['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); + $tpl = load_view_file('view/jot-header.tpl'); - $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl())); + $a->page['htmlhead'] .= replace_macros($tpl, array( + '$baseurl' => $a->get_baseurl(), + '$geotag' => $geotag + )); require_once('view/acl_selectors.php'); @@ -272,6 +277,14 @@ function network_content(&$a, $update = 0) { $like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); + $location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''); + $coord = (($item['coord']) ? '<a target="map" 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>'; + } // Build the HTML @@ -286,7 +299,7 @@ function network_content(&$a, $update = 0) { '$body' => bbcode($item['body']), '$ago' => relative_date($item['created']), '$lock' => $lock, - '$location' => (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''), + '$location' => $location, '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''), '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, |