X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Ftagger.php;h=6ae0cebf718ef40774c70e2865aff3e77ce72328;hb=10e84c548cdc3d980b89442f8b69b95910d62442;hp=3ff5d57aa2091af318bbe43fce5b0da8612f14ac;hpb=3d249f0eddb058f74b33d8205202b17ab7555aa6;p=friendica.git diff --git a/mod/tagger.php b/mod/tagger.php old mode 100755 new mode 100644 index 3ff5d57aa2..6ae0cebf71 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -47,17 +47,9 @@ function tagger_content(&$a) { if(local_user() != $owner_uid) return; - if(remote_user()) { - $r = q("select * from contact where id = %d AND `uid` = %d limit 1", - intval(remote_user()), - intval($item['uid']) - ); - } - else { - $r = q("select * from contact where self = 1 and uid = %d limit 1", - intval(local_user()) - ); - } + $r = q("select * from contact where self = 1 and uid = %d limit 1", + intval(local_user()) + ); if(count($r)) $contact = $r[0]; else { @@ -66,14 +58,14 @@ function tagger_content(&$a) { } $uri = item_new_uri($a->get_hostname(),$owner_uid); - + $xterm = xmlify($term); $post_type = (($item['resource-id']) ? t('photo') : t('status')); $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); $link = xmlify('' . "\n") ; - $body = $item['body']; + $body = xmlify($item['body']); $target = <<< EOT @@ -86,7 +78,7 @@ function tagger_content(&$a) { EOT; - $tagid = $a->get_baseurl() . '/search?search=' . $term; + $tagid = $a->get_baseurl() . '/search?tag=' . $term; $objtype = ACTIVITY_OBJ_TAGTERM; $obj = <<< EOT @@ -95,8 +87,8 @@ EOT; 1 $tagid $tagid - $term - $term + $xterm + $xterm EOT; @@ -105,7 +97,7 @@ EOT; if(! isset($bodyverb)) return; - $termlink = html_entity_decode('⌗') . '[url=' . $a->get_baseurl() . '/search?search=' . urlencode($term) . ']'. $term . '[/url]'; + $termlink = html_entity_decode('⌗') . '[url=' . $a->get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]'; $arr = array(); @@ -161,7 +153,7 @@ EOT; if((! $blocktags) && (! stristr($item['tag'], ']' . $term . '[' ))) { q("update item set tag = '%s' where id = %d limit 1", - dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?search=' . $term . ']'. $term . '[/url]'), + dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'), intval($item['id']) ); } @@ -177,7 +169,7 @@ EOT; ); if(count($x) && !$x[0]['blocktags'] && (! stristr($r[0]['tag'], ']' . $term . '['))) { q("update item set tag = '%s' where id = %d limit 1", - dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?search=' . $term . ']'. $term . '[/url]'), + dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'), intval($r[0]['id']) ); }