- if($item['deleted']) {
- $atom .= replace_macros($tomb_template, array(
- '$id' => xmlify($item['uri']),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME))
- ));
- }
- else {
- foreach($contacts as $contact) {
- if($item['contact-id'] == $contact['id']) {
- if($item['parent'] == $item['id']) {
- $atom .= replace_macros($item_template, array(
- '$name' => xmlify($contact['name']),
- '$profile_page' => xmlify($contact['url']),
- '$thumb' => xmlify($contact['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' , ATOM_TIME)),
- '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
- '$location' => xmlify($item['location']),
- '$type' => 'text',
- '$verb' => xmlify($verb),
- '$actobj' => $actobj,
- '$content' => xmlify($item['body']),
- '$comment_allow' => (($item['last-child'] && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0)
- ));
- }
- else {
- $atom .= replace_macros($cmnt_template, array(
- '$name' => xmlify($contact['name']),
- '$profile_page' => xmlify($contact['url']),
- '$thumb' => xmlify($contact['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)),
- '$content' => xmlify($item['body']),
- '$location' => xmlify($item['location']),
- '$type' => 'text',
- '$verb' => xmlify($verb),
- '$actobj' => $actobj,
- '$parent_id' => xmlify($item['parent-uri']),
- '$comment_allow' => (($item['last-child']) ? 1 : 0)
- ));
- }
- }
- }
- }