X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ftagger.php;h=e0ef1ceb02091496c4cf6d963daf02d903d4d88d;hb=724f9c80e79783957d75d011a0393f6d6bb1949e;hp=3f470a1797033741f55c8f819f3a8106f449f089;hpb=11d1c1ae8eaf9b91fd2478abc7b089f9c0877845;p=friendica.git diff --git a/mod/tagger.php b/mod/tagger.php index 3f470a1797..e0ef1ceb02 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -60,9 +60,9 @@ 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 ); + $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); - $link = xmlify('' . "\n") ; $body = xmlify($item['body']); @@ -95,12 +95,13 @@ EOT; $bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s'); if(! isset($bodyverb)) - return; + return; $termlink = html_entity_decode('⌗') . '[url=' . $a->get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]'; $arr = array(); + $arr['guid'] = get_guid(32); $arr['uri'] = $uri; $arr['uid'] = $owner_uid; $arr['contact-id'] = $contact['id']; @@ -115,7 +116,7 @@ EOT; $arr['author-name'] = $contact['name']; $arr['author-link'] = $contact['url']; $arr['author-avatar'] = $contact['thumb']; - + $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; $plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]'; @@ -136,20 +137,20 @@ EOT; $arr['last-child'] = 1; $arr['origin'] = 1; - $post_id = item_store($arr); + $post_id = item_store($arr); + +// q("UPDATE `item` set plink = '%s' where id = %d", +// dbesc($a->get_baseurl() . '/display/' . $owner_nick . '/' . $post_id), +// intval($post_id) +// ); - q("UPDATE `item` set plink = '%s' where id = %d limit 1", - dbesc($a->get_baseurl() . '/display/' . $owner_nick . '/' . $post_id), - intval($post_id) - ); - if(! $item['visible']) { - $r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1", + $r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d", intval($item['id']), intval($owner_uid) ); - } + } $term_objtype = (($item['resource-id']) ? TERM_OBJ_PHOTO : TERM_OBJ_POST ); $t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'", @@ -157,7 +158,7 @@ EOT; dbesc($term) ); if((! $blocktags) && $t[0]['tcount']==0 ) { - /*q("update item set tag = '%s' where id = %d limit 1", + /*q("update item set tag = '%s' where id = %d", dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'), intval($item['id']) );*/ @@ -171,7 +172,7 @@ EOT; intval($owner_uid) ); } - + // if the original post is on this site, update it. $r = q("select `tag`,`id`,`uid` from item where `origin` = 1 AND `uri` = '%s' LIMIT 1", @@ -185,8 +186,6 @@ EOT; intval($r[0]['id']), dbesc($term) ); - echo "
"; var_dump($t); killme();
-		// not really sure about this...
 		if(count($x) && !$x[0]['blocktags'] && $t[0]['tcount']==0){
 			q("INSERT INTO term (oid, otype, type, term, url, uid) VALUE (%d, %d, %d, '%s', '%s', %d)",
 	                   intval($r[0]['id']),
@@ -199,20 +198,20 @@ EOT;
 		}
 
 		/*if(count($x) && !$x[0]['blocktags'] && (! stristr($r[0]['tag'], ']' . $term . '['))) {
-			q("update item set tag = '%s' where id = %d limit 1",
+			q("update item set tag = '%s' where id = %d",
 				dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'),
 				intval($r[0]['id'])
 			);
 		}*/
 
 	}
-		
+
 
 	$arr['id'] = $post_id;
 
 	call_hooks('post_local_end', $arr);
 
-	proc_run('php',"include/notifier.php","tag","$post_id");
+	proc_run(PRIORITY_HIGH, "include/notifier.php", "tag", $post_id);
 
 	killme();