From 9e8053e3bdb4669132a142cd2542956c01352ee5 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 24 Nov 2011 16:42:12 -0800 Subject: [PATCH] fixing conversation updates --- include/conversation.php | 18 ++++++++---------- js/main.js | 2 +- view/conversation.tpl | 4 ++-- view/theme/duepuntozero/conversation.tpl | 4 ++-- view/theme/loozah/conversation.tpl | 4 ++-- view/theme/testbubble/conversation.tpl | 4 ++-- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index d8adb27c3c..f7c8d5168e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -291,7 +291,8 @@ function conversation(&$a, $items, $mode, $update) { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $threads[$threadsid] .= $arr['output']; + $threads[$threadsid]['id'] = $threadsid; + $threads[$threadsid]['html'] .= $arr['output']; } @@ -374,7 +375,9 @@ function conversation(&$a, $items, $mode, $update) { $comments_collapsed = false; $threadsid++; - $threads[$threadsid] = ""; + $threads[$threadsid]['id'] = $threadsid; + $threads[$threadsid]['html'] = ""; + } else { // prevent private email from leaking into public conversation @@ -393,7 +396,7 @@ function conversation(&$a, $items, $mode, $update) { // IMPORTANT: the closing in the hide_comments template // is supplied below in code. - $threads[$threadsid] .= replace_macros($hide_comments_tpl,array( + $threads[$threadsid]['html'] .= replace_macros($hide_comments_tpl,array( '$id' => $item['parent'], '$num_comments' => sprintf( tt('%d comment','%d comments',$comments[$item['parent']]), $comments[$item['parent']]), @@ -404,7 +407,7 @@ function conversation(&$a, $items, $mode, $update) { } } if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { - $threads[$threadsid] .= ''; + $threads[$threadsid]['html'] .= ''; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; @@ -621,17 +624,12 @@ function conversation(&$a, $items, $mode, $update) { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $threads[$threadsid] .= $arr['output']; + $threads[$threadsid]['html'] .= $arr['output']; } } } - // if author collapsing is in force but didn't get closed, close it off now. - - /*if($blowhard_count >= 3) - $threads[$threadsid] .= '';*/ - $page_template = get_markup_template("conversation.tpl"); $o .= replace_macros($page_template, array( '$threads' => $threads, diff --git a/js/main.js b/js/main.js index af63ac0baa..ba4bb36efc 100644 --- a/js/main.js +++ b/js/main.js @@ -233,7 +233,7 @@ // $('#' + ident).hide(); // } //}); - $('.wall-item-outside-wrapper',data).each(function() { + $('.tread-wrapper',data).each(function() { var ident = $(this).attr('id'); if($('#' + ident).length == 0) { $('img',this).each(function() { diff --git a/view/conversation.tpl b/view/conversation.tpl index 86445aab8e..7d4e7d2621 100644 --- a/view/conversation.tpl +++ b/view/conversation.tpl @@ -1,6 +1,6 @@ {{ for $threads as $thread }} -
- $thread +
+ $thread.html
{{ endfor }} diff --git a/view/theme/duepuntozero/conversation.tpl b/view/theme/duepuntozero/conversation.tpl index 1a0fb33a82..33cedfb1ec 100644 --- a/view/theme/duepuntozero/conversation.tpl +++ b/view/theme/duepuntozero/conversation.tpl @@ -1,6 +1,6 @@ {{ for $threads as $thread }} -
- $thread +
+ $thread.html
{{ endfor }} diff --git a/view/theme/loozah/conversation.tpl b/view/theme/loozah/conversation.tpl index 1a0fb33a82..33cedfb1ec 100644 --- a/view/theme/loozah/conversation.tpl +++ b/view/theme/loozah/conversation.tpl @@ -1,6 +1,6 @@ {{ for $threads as $thread }} -
- $thread +
+ $thread.html
{{ endfor }} diff --git a/view/theme/testbubble/conversation.tpl b/view/theme/testbubble/conversation.tpl index 1a0fb33a82..33cedfb1ec 100644 --- a/view/theme/testbubble/conversation.tpl +++ b/view/theme/testbubble/conversation.tpl @@ -1,6 +1,6 @@ {{ for $threads as $thread }} -
- $thread +
+ $thread.html
{{ endfor }}