diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-29 00:02:26 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-29 00:02:26 -0700 |
commit | f34c1ce66aae3ba32704840bd106194a5837754f (patch) | |
tree | eca3c71ba0bb82ac2cde853056e9a3c9b5d0412d /mod | |
parent | 6301de10321733a6578e59347b6b54fbd534de06 (diff) | |
download | volse-hubzilla-f34c1ce66aae3ba32704840bd106194a5837754f.tar.gz volse-hubzilla-f34c1ce66aae3ba32704840bd106194a5837754f.tar.bz2 volse-hubzilla-f34c1ce66aae3ba32704840bd106194a5837754f.zip |
provide the means to tag link a person by full_name
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/mod/item.php b/mod/item.php index 126f8b6a1..af2c8d6f6 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]'; } } } |