aboutsummaryrefslogtreecommitdiffstats
path: root/include/ItemObject.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/ItemObject.php')
-rw-r--r--include/ItemObject.php24
1 files changed, 5 insertions, 19 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;
}