]> git.mxchange.org Git - friendica.git/commitdiff
provide the means to tag link a person by full_name
authorMike Macgirvin <mike@macgirvin.com>
Fri, 29 Oct 2010 07:02:26 +0000 (00:02 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 29 Oct 2010 07:02:26 +0000 (00:02 -0700)
mod/item.php
view/jot_geotag.tpl

index 126f8b6a1a8ce6a893ac3f586febbc4f2a4813b1..af2c8d6f69bd864f3e8aab252d85fcaf0ffa465e 100644 (file)
@@ -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]';
                                }
                        }
                }
index c140d5627eb7d9647184ea7a159fb10c1ab02b62..4145c3111eca76b9ea7338403e5f3f9340189754 100644 (file)
@@ -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();
                });
        }