allow tagging of people by name or nickname

This commit is contained in:
Zach Prezkuta 2012-09-29 17:55:40 -06:00
commit ce73cd560f
3 changed files with 52 additions and 5 deletions

View file

@ -101,7 +101,7 @@ function profiles_post(&$a) {
}
else {
$newname = $lookup;
if(strstr($lookup,' ')) {
/* if(strstr($lookup,' ')) {
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
dbesc($newname),
intval(local_user())
@ -112,6 +112,17 @@ function profiles_post(&$a) {
dbesc($lookup),
intval(local_user())
);
}*/
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
dbesc($newname),
intval(local_user())
);
if(! $r) {
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
dbesc($lookup),
intval(local_user())
);
}
if(count($r)) {
$prf = $r[0]['url'];