X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fitem.php;h=de6bce972ce2d08ad9dfad63caca8bcf4fff1039;hb=4832bc74f55e7d3e6f66d281f5de3a071fe1e071;hp=7d36d7f70aca152a91646dcd4dda5065d51e63a5;hpb=75b92b52d87212f6c3d2310e53c4655c02acaa0f;p=friendica.git diff --git a/mod/item.php b/mod/item.php index 7d36d7f70a..de6bce972c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -994,7 +994,26 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { intval($tagcid), intval($profile_uid) ); - } elseif(strstr($name,'_') || strstr($name,' ')) { //no id + } + else { + $newname = str_replace('_',' ',$name); + + //select someone from this user's contacts by name + $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1", + dbesc($newname), + intval($profile_uid) + ); + + if(! $r) { + //select someone by attag or nick and the name passed in + $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", + dbesc($name), + dbesc($name), + intval($profile_uid) + ); + } + } +/* } elseif(strstr($name,'_') || strstr($name,' ')) { //no id //get the real name $newname = str_replace('_',' ',$name); //select someone from this user's contacts by name @@ -1009,7 +1028,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { dbesc($name), intval($profile_uid) ); - } + }*/ //$r is set, if someone could be selected if(count($r)) { $profile = $r[0]['url'];