diff --git a/mod/item.php b/mod/item.php index 126f8b6a1a..af2c8d6f69 100644 --- a/mod/item.php +++ b/mod/item.php @@ -137,21 +137,31 @@ function item_post(&$a) { } } else { - $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1", - dbesc($name), - intval($profile_uid) - ); + $newname = $name; + if(strstr($name,'_')) { + $newname = str_replace('_',' ',$name); + $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", + dbesc($newname), + intval($profile_uid) + ); + } + else { + $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1", + dbesc($name), + intval($profile_uid) + ); + } if(count($r)) { $profile = $r[0]['url']; - $salmon = $r[0]['notify']; + $salmon = $r[0]['notify']; } } if($profile) { - $body = str_replace($name,'[url=' . $profile . ']' . $name . '[/url]', $body); + $body = str_replace($name,'[url=' . $profile . ']' . $newname . '[/url]', $body); if(strlen($str_tags)) $str_tags .= ','; $profile = str_replace(',','%2c',$profile); - $str_tags .= '[url=' . $profile . ']' . $name . '[/url]'; + $str_tags .= '[url=' . $profile . ']' . $newname . '[/url]'; } } } diff --git a/view/jot_geotag.tpl b/view/jot_geotag.tpl index c140d5627e..4145c3111e 100644 --- a/view/jot_geotag.tpl +++ b/view/jot_geotag.tpl @@ -1,7 +1,7 @@ if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { - $('#jot-coord').val(position.coords.latitude + ',' + position.coords.longitude); + $('#jot-coord').val(position.coords.latitude + position.coords.longitude); $('#profile-nolocation-wrapper').show(); }); }