aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-27 19:12:30 -0700
committerFriendika <info@friendika.com>2011-10-27 19:12:30 -0700
commite5a7b3e24b5eccf31be7ef5b78580b599a94952f (patch)
tree190e705b539c698fdcb5a198c48e0cc6172b16d7 /mod/item.php
parent056fe0a3aabecdc3a236ce9350e4e6f54ef52758 (diff)
downloadvolse-hubzilla-e5a7b3e24b5eccf31be7ef5b78580b599a94952f.tar.gz
volse-hubzilla-e5a7b3e24b5eccf31be7ef5b78580b599a94952f.tar.bz2
volse-hubzilla-e5a7b3e24b5eccf31be7ef5b78580b599a94952f.zip
add contact-id to auto-complete response to resolve duplicates
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/mod/item.php b/mod/item.php
index 0e855d54d..2c8704a31 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -407,7 +407,17 @@ function item_post(&$a) {
else {
$newname = $name;
$alias = '';
- if(strstr($name,'_') || strstr($name,' ')) {
+ $tagcid = 0;
+ if(strrpos($newname,'+'))
+ $tagcid = intval(substr($newname,strrpos($newname,'+') + 1));
+
+ if($tagcid) {
+ $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ intval($tagcid),
+ intval($profile_uid)
+ );
+ }
+ elseif(strstr($name,'_') || strstr($name,' ')) {
$newname = str_replace('_',' ',$name);
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
dbesc($newname),