';
}
}
else {
@@ -219,8 +222,10 @@ function conversation(&$a, $items, $mode, $update) {
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) {
- $o .= '
' . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '
';
+ $o .= '
'
+ . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '
'
+ . '
';
$comments_collapsed = true;
}
}
@@ -228,8 +233,6 @@ function conversation(&$a, $items, $mode, $update) {
$o .= '
';
}
-
-
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
@@ -243,10 +246,14 @@ function conversation(&$a, $items, $mode, $update) {
$osparkle = '';
- if(($item['parent'] == $item['item_id']) && (! $item['self']) && ($mode !== 'profile')) {
+ if(($toplevelpost) && (! $item['self']) && ($mode !== 'profile')) {
if($item['type'] === 'wall') {
- // I do. Put me on the left of the wall-to-wall notice.
+
+ // On the network page, I am the owner. On the display page it will be the profile owner.
+ // This will have been stored in $a->page_contact by our calling page.
+ // Put this person on the left of the wall-to-wall notice.
+
$owner_url = $a->page_contact['url'];
$owner_photo = $a->page_contact['thumb'];
$owner_name = $a->page_contact['name'];
@@ -254,7 +261,9 @@ function conversation(&$a, $items, $mode, $update) {
$commentww = 'ww';
}
if(($item['type'] === 'remote') && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) {
+
// Could be anybody.
+
$owner_url = $item['owner-link'];
$owner_photo = $item['owner-avatar'];
$owner_name = $item['owner-name'];
@@ -273,7 +282,7 @@ function conversation(&$a, $items, $mode, $update) {
$likebuttons = '';
if($page_writeable) {
- if($item['id'] == $item['parent']) {
+ if($toplevelpost) {
$likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
@@ -301,9 +310,10 @@ function conversation(&$a, $items, $mode, $update) {
}
}
- $edpost = '';
- if(($profile_owner == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
- $edpost = '
';
+ $edpost = ((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1))
+ ? '
'
+ : '');
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo'];
@@ -311,7 +321,7 @@ function conversation(&$a, $items, $mode, $update) {
// Post was remotely authored.
- $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
+ $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true);
$profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb);
@@ -343,8 +353,10 @@ function conversation(&$a, $items, $mode, $update) {
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
- $location = (($item['location']) ? '
' . $item['location'] . '' : '');
- $coord = (($item['coord']) ? '
' . $item['coord'] . '' : '');
+ $location = (($item['location']) ? '
' . $item['location'] . '' : '');
+ $coord = (($item['coord']) ? '
' . $item['coord'] . '' : '');
if($coord) {
if($location)
$location .= '
(' . $coord . ')';
@@ -352,13 +364,11 @@ function conversation(&$a, $items, $mode, $update) {
$location = '
' . $coord . '';
}
- $indent = (($item['parent'] != $item['item_id']) ? ' comment' : '');
+ $indent = (($toplevelpost) ? '' : ' comment');
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny';
-
-
// Build the HTML
$tmp_item = replace_macros($template,array(