From 7ad27f5737b4c3dc800c8a707a3010ec33672389 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Thu, 30 Sep 2010 16:06:53 -0700 Subject: [PATCH] implement rel alternate, some corresponding last minute touchups on display module --- include/items.php | 2 ++ include/notifier.php | 3 +++ mod/display.php | 13 +++++-------- mod/network.php | 1 - view/atom_cmnt.tpl | 1 + view/atom_item.tpl | 1 + 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/items.php b/include/items.php index 630d9dfbb6..42355cc3cf 100644 --- a/include/items.php +++ b/include/items.php @@ -179,6 +179,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)), '$location' => xmlify($item['location']), '$type' => $type, + '$alt' => xmlify($a->get_baseurl() . '/display/' . $owner_nick . '/' . $item['id']), '$content' => xmlify($item['body']), '$verb' => xmlify($verb), '$actobj' => $actobj, // do not xmlify @@ -196,6 +197,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) { '$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)), '$type' => $type, '$content' => xmlify($item['body']), + '$alt' => xmlify($a->get_baseurl() . '/display/' . $owner_nick . '/' . $item['id']), '$verb' => xmlify($verb), '$actobj' => $actobj, // do not xmlify '$parent_id' => xmlify($item['parent-uri']), diff --git a/include/notifier.php b/include/notifier.php index 92f7395492..967f4ff55b 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -188,6 +188,7 @@ '$type' => 'text', '$verb' => xmlify($verb), '$actobj' => $actobj, + '$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']), '$content' => xmlify($item['body']), '$parent_id' => xmlify($item['parent-uri']), '$comment_allow' => 0 @@ -228,6 +229,7 @@ '$verb' => xmlify($verb), '$actobj' => $actobj, '$content' => xmlify($item['body']), + '$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']), '$comment_allow' => (($item['last-child']) ? 1 : 0) )); } @@ -241,6 +243,7 @@ '$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']), + '$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']), '$location' => xmlify($item['location']), '$type' => 'text', '$verb' => xmlify($verb), diff --git a/mod/display.php b/mod/display.php index 451b9d6443..d8aca43e4d 100644 --- a/mod/display.php +++ b/mod/display.php @@ -155,6 +155,9 @@ function display_content(&$a) { : '
'); if(can_write_wall($a,$a->profile['uid'])) { + if($item['id'] == $item['parent']) { + $likebuttons = replace_macros($like_tpl,array('$id' => $item['id'])); + } if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( '$return_path' => $_SESSION['return_url'], @@ -219,20 +222,14 @@ function display_content(&$a) { $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); $profile_link = $profile_url; - $drop = ''; - if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid())) $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); + else + $drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id'])); $like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); - $likebuttons = ''; - if($item['id'] == $item['parent']) { - $likebuttons = replace_macros($like_tpl,array('$id' => $item['id'])); - } - - $o .= replace_macros($template,array( '$id' => $item['item_id'], diff --git a/mod/network.php b/mod/network.php index ac5664b4fc..9d12d4346d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -234,7 +234,6 @@ function network_content(&$a, $update = 0) { )); } - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); diff --git a/view/atom_cmnt.tpl b/view/atom_cmnt.tpl index 59dff9efa4..a067f50ca7 100644 --- a/view/atom_cmnt.tpl +++ b/view/atom_cmnt.tpl @@ -11,6 +11,7 @@ $published $updated $content + $comment_allow $verb $actobj diff --git a/view/atom_item.tpl b/view/atom_item.tpl index d1eadb4afd..baede636c3 100644 --- a/view/atom_item.tpl +++ b/view/atom_item.tpl @@ -15,6 +15,7 @@ $published $updated $content + $location $comment_allow $verb