aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-16 20:23:22 -0800
committerfriendica <info@friendica.com>2014-11-16 20:23:22 -0800
commitb3383a2547846e14c79cf59a3a0a0b1939e2aa71 (patch)
tree61c1fa2a0d675b585c15160607ee2d2afb7309f3 /include
parentacc8c692421581c2516bbe5d91d86ad2f3f12c27 (diff)
downloadvolse-hubzilla-b3383a2547846e14c79cf59a3a0a0b1939e2aa71.tar.gz
volse-hubzilla-b3383a2547846e14c79cf59a3a0a0b1939e2aa71.tar.bz2
volse-hubzilla-b3383a2547846e14c79cf59a3a0a0b1939e2aa71.zip
speed things up a wee bit
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php15
-rw-r--r--include/conversation.php8
2 files changed, 16 insertions, 7 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index ee7676bd4..4aa6857c1 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -28,6 +28,7 @@ class Item extends BaseObject {
private $threaded = false;
private $visiting = false;
private $channel = null;
+ private $display_mode = 'normal';
public function __construct($data) {
@@ -226,9 +227,10 @@ class Item extends BaseObject {
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny';
- localize_item($item);
+ localize_item($item);
$body = prepare_body($item,true);
+
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
$children = $this->get_children();
@@ -316,7 +318,8 @@ class Item extends BaseObject {
$result['children'] = array();
$nb_children = count($children);
- if($nb_children > 0) {
+
+ if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
foreach($children as $child) {
$result['children'][] = $child->get_template_data($alike, $dlike, $thread_level + 1);
}
@@ -353,6 +356,14 @@ class Item extends BaseObject {
return $this->get_data_value('id');
}
+ public function get_display_mode() {
+ return $this->display_mode;
+ }
+
+ public function set_display_mode($mode) {
+ $this->display_mode = $mode;
+ }
+
public function is_threaded() {
return $this->threaded;
}
diff --git a/include/conversation.php b/include/conversation.php
index af8780549..ada2cbbd6 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -793,12 +793,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
// $tx1 = dba_timer();
$item_object = new Item($item);
$conv->add_thread($item_object);
- if($page_mode === 'list')
+ if($page_mode === 'list') {
$item_object->set_template('conv_list.tpl');
-
-// $tx2 = dba_timer();
-// if($mode === 'network')
-// profiler($tx1,$tx2,'add thread ' . $item['id']);
+ $item_object->set_display_mode('list');
+ }
}
}
$t2 = dba_timer();