if($dfrn_id != '*') {
- $r = q("SELECT * FROM `contact` WHERE `issued-id` = '%s' LIMIT 1",
- dbesc($dfrn_id)
+ $r = q("SELECT * FROM `contact` WHERE ( `issued-id` = '%s' OR ( `duplex` = 1 AND `dfrn-id` = '%s' )) AND `uid` = %d LIMIT 1",
+ dbesc($dfrn_id),
+ dbesc($dfrn_id),
+ intval($owner_id)
);
if(! count($r))
return false;
$atom .= replace_macros($feed_template, array(
- '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
- '$feed_title' => xmlify($owner['name']),
- '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
- '$name' => xmlify($owner['name']),
+ '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
+ '$feed_title' => xmlify($owner['name']),
+ '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
+ '$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']),
- '$photo' => xmlify($owner['photo']),
- '$thumb' => xmlify($owner['thumb']),
- '$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
- '$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z')) ,
- '$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , 'Y-m-d\TH:i:s\Z'))
-
+ '$photo' => xmlify($owner['photo']),
+ '$thumb' => xmlify($owner['thumb']),
+ '$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , ATOM_TIME)) ,
+ '$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , ATOM_TIME)) ,
+ '$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME))
));
if($item['deleted']) {
$atom .= replace_macros($tomb_template, array(
- '$id' => xmlify($item['uri']),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z'))
+ '$id' => xmlify($item['uri']),
+ '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME))
));
}
else {
if($item['parent'] == $item['id']) {
$atom .= replace_macros($item_template, array(
- '$name' => xmlify($item['name']),
- '$profile_page' => xmlify($item['url']),
- '$thumb' => xmlify($item['thumb']),
- '$owner_name' => xmlify($item['owner-name']),
+ '$name' => xmlify($item['name']),
+ '$profile_page' => xmlify($item['url']),
+ '$thumb' => xmlify($item['thumb']),
+ '$owner_name' => xmlify($item['owner-name']),
'$owner_profile_page' => xmlify($item['owner-link']),
- '$owner_thumb' => xmlify($item['owner-avatar']),
- '$item_id' => xmlify($item['uri']),
- '$title' => xmlify($item['title']),
- '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
- '$location' => xmlify($item['location']),
- '$type' => $type,
- '$content' => xmlify($item['body']),
- '$verb' => xmlify($verb),
- '$actobj' => $actobj, // do not xmlify
- '$comment_allow' => (($item['last-child'] && strlen($contact['dfrn-id'])) ? 1 : 0)
+ '$owner_thumb' => xmlify($item['owner-avatar']),
+ '$item_id' => xmlify($item['uri']),
+ '$title' => xmlify($item['title']),
+ '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
+ '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
+ '$location' => xmlify($item['location']),
+ '$type' => $type,
+ '$content' => xmlify($item['body']),
+ '$verb' => xmlify($verb),
+ '$actobj' => $actobj, // do not xmlify
+ '$comment_allow' => ((($item['last-child']) && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0)
));
}
else {
$atom .= replace_macros($cmnt_template, array(
- '$name' => xmlify($item['name']),
- '$profile_page' => xmlify($item['url']),
- '$thumb' => xmlify($item['thumb']),
- '$item_id' => xmlify($item['uri']),
- '$title' => xmlify($item['title']),
- '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , 'Y-m-d\TH:i:s\Z')),
- '$type' => $type,
- '$content' =>xmlify($item['body']),
- '$verb' => xmlify($verb),
- '$actobj' => $actobj, // do not xmlify
- '$parent_id' => xmlify($item['parent-uri']),
+ '$name' => xmlify($item['name']),
+ '$profile_page' => xmlify($item['url']),
+ '$thumb' => xmlify($item['thumb']),
+ '$item_id' => xmlify($item['uri']),
+ '$title' => xmlify($item['title']),
+ '$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
+ '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
+ '$type' => $type,
+ '$content' => xmlify($item['body']),
+ '$verb' => xmlify($verb),
+ '$actobj' => $actobj, // do not xmlify
+ '$parent_id' => xmlify($item['parent-uri']),
'$comment_allow' => (($item['last-child']) ? 1 : 0)
));
}
// html.
-echo "test1" . $res['body'];
if(strpos($res['body'],'<')) {
$res['body'] = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s',
$purifier = new HTMLPurifier($config);
$res['body'] = $purifier->purify($res['body']);
}
-echo "test2" . $res['body'];
+
$res['body'] = html2bbcode($res['body']);
-echo "test3" . $res['body'];
+
$allow = $item->get_item_tags(NAMESPACE_DFRN,'comment-allow');
if($allow && $allow[0]['data'] == 1)
//print_r($arr);
+
+ if($arr['gravity'])
+ $arr['gravity'] = intval($arr['gravity']);
+ elseif($arr['parent-uri'] == $arr['uri'])
+ $arr['gravity'] = 0;
+ elseif($arr['verb'] == ACTIVITY_POST)
+ $arr['gravity'] = 6;
+
if(! x($arr,'type'))
$arr['type'] = 'remote';
+ $arr['wall'] = ((intval($arr['wall'])) ? 1 : 0);
$arr['uri'] = notags(trim($arr['uri']));
$arr['author-name'] = notags(trim($arr['author-name']));
$arr['author-link'] = notags(trim($arr['author-link']));