aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php24
-rw-r--r--include/conversation.php4
2 files changed, 7 insertions, 21 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 90c036def..9e694b8ac 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -64,8 +64,6 @@ class Item extends BaseObject {
public function get_template_data($alike, $dlike, $thread_level=1) {
- $t1 = dba_timer();
-
$result = array();
$a = $this->get_app();
@@ -228,15 +226,12 @@ class Item extends BaseObject {
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny';
- $t2 = dba_timer();
-
localize_item($item);
- $t3 = dba_timer();
-
$body = prepare_body($item,true);
- $t4 = dba_timer();
+ $comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
+ $children = $this->get_children();
$tmp_item = array(
'template' => $this->get_template(),
@@ -292,6 +287,8 @@ class Item extends BaseObject {
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
// end toolbar buttons
+ 'comment_count' => $total_children,
+ 'comment_count_txt' => $comment_count_txt,
'like_count' => $like_count,
'like_list' => $like_list,
'like_list_part' => $like_list_part,
@@ -311,15 +308,12 @@ class Item extends BaseObject {
'thread_level' => $thread_level
);
- $t5 = dba_timer();
-
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
$result = $arr['output'];
$result['children'] = array();
- $children = $this->get_children();
$nb_children = count($children);
if($nb_children > 0) {
foreach($children as $child) {
@@ -328,7 +322,7 @@ class Item extends BaseObject {
// Collapse
if(($nb_children > 2) || ($thread_level > 1)) {
$result['children'][0]['comment_firstcollapsed'] = true;
- $result['children'][0]['num_comments'] = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
+ $result['children'][0]['num_comments'] = $comment_count_txt;
$result['children'][0]['hide_text'] = t('[+] show all');
if($thread_level > 1) {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
@@ -350,14 +344,6 @@ class Item extends BaseObject {
$result['flatten'] = true;
$result['threaded'] = false;
}
- $t6 = dba_timer();
-
-// profiler($t1,$t2,'t2');
-// profiler($t2,$t3,'t3');
-// profiler($t3,$t4,'t4');
-// profiler($t4,$t5,'t5');
-// profiler($t5,$t6,'t6');
-// profiler($t1,$t6,'item total');
return $result;
}
diff --git a/include/conversation.php b/include/conversation.php
index c2258c20a..af8780549 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -853,8 +853,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
profiler($t3,$t4,'conversation template');
}
- if($page_mode === 'preview')
- logger('preview: ' . $o);
+// if($page_mode === 'preview')
+// logger('preview: ' . $o, LOGGER_DATA);
return $o;