+ if ($item['verb']===ACTIVITY_TAG){
+ $r = q("SELECT * from `item`,`contact` WHERE
+ `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
+ dbesc($item['parent-uri']));
+ if(count($r)==0) return;
+ $obj=$r[0];
+
+ $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
+ $objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]';
+
+ switch($obj['verb']){
+ case ACTIVITY_POST:
+ switch ($obj['object-type']){
+ case ACTIVITY_OBJ_EVENT:
+ $post_type = t('event');
+ break;
+ default:
+ $post_type = t('status');
+ }
+ break;
+ default:
+ if($obj['resource-id']){
+ $post_type = t('photo');
+ $m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
+ $rr['plink'] = $m[1];
+ } else {
+ $post_type = t('status');
+ }
+ }
+ $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
+
+ $parsedobj = parse_xml_string($xmlhead.$item['object']);
+
+ $tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content);
+ $item['body'] = sprintf( t('%1$s tagged %2$s\'s %3$s with %4$s'), $author, $objauthor, $plink, $tag );
+
+ }