mirror of
https://github.com/friendica/friendica
synced 2024-12-23 08:00:16 +00:00
provide the means to tag link a person by full_name
This commit is contained in:
parent
6301de1032
commit
f34c1ce66a
2 changed files with 18 additions and 8 deletions
14
mod/item.php
14
mod/item.php
|
@ -136,22 +136,32 @@ function item_post(&$a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$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 {
|
else {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($name),
|
dbesc($name),
|
||||||
intval($profile_uid)
|
intval($profile_uid)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$profile = $r[0]['url'];
|
$profile = $r[0]['url'];
|
||||||
$salmon = $r[0]['notify'];
|
$salmon = $r[0]['notify'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($profile) {
|
if($profile) {
|
||||||
$body = str_replace($name,'[url=' . $profile . ']' . $name . '[/url]', $body);
|
$body = str_replace($name,'[url=' . $profile . ']' . $newname . '[/url]', $body);
|
||||||
if(strlen($str_tags))
|
if(strlen($str_tags))
|
||||||
$str_tags .= ',';
|
$str_tags .= ',';
|
||||||
$profile = str_replace(',','%2c',$profile);
|
$profile = str_replace(',','%2c',$profile);
|
||||||
$str_tags .= '[url=' . $profile . ']' . $name . '[/url]';
|
$str_tags .= '[url=' . $profile . ']' . $newname . '[/url]';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
if(navigator.geolocation) {
|
if(navigator.geolocation) {
|
||||||
navigator.geolocation.getCurrentPosition(function(position) {
|
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();
|
$('#profile-nolocation-wrapper').show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue