function count_descendants($item) {
$total = count($item['children']);
+ if($item['verb'] === ACTIVITY_LIKE || $item['verb'] === ACTIVITY_DISLIKE)
+ return 0;
+
if($total > 0) {
foreach($item['children'] as $child) {
$total += count_descendants($child);
* Recursively prepare a thread for HTML
*/
-function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $thread_level=1) {
+function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, $thread_level=1) {
$result = array();
$wall_template = 'wall_thread.tpl';
$nb_items--;
continue;
}
+
+ if($item['verb'] === ACTIVITY_LIKE || $item['verb'] === ACTIVITY_DISLIKE) {
+ $nb_items --;
+ continue;
+ }
$items_seen++;
- $alike = array();
- $dlike = array();
$comment = '';
$template = $wall_template;
$commentww = '';
$tag = trim($tag);
if ($tag!="") $tags[] = bbcode($tag);
}
-
- like_puller($a,$item,$alike,'like');
- like_puller($a,$item,$dlike,'dislike');
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
$item_result['children'] = array();
if(count($item['children'])) {
- $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, ($thread_level + 1));
+ $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, ($thread_level + 1));
}
$item_result['private'] = $item['private'];
$item_result['toplevel'] = ($toplevelpost ? 'toplevel_item' : '');
$threads = array();
foreach($items as $item) {
+
+ like_puller($a,$item,$alike,'like');
+ like_puller($a,$item,$dlike,'dislike');
+
if($item['id'] == $item['parent']) {
$threads[] = $item;
}
}
- $threads = prepare_threads_body($a, $threads, $cmnt_tpl, $page_writeable, $mode, $profile_owner);
+ $threads = prepare_threads_body($a, $threads, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike);
}
}
</div>
{{ if $item.drop.dropping }}<input type="checkbox" onclick="checkboxhighlight(this);" title="$item.drop.select" class="item-select" name="itemselected[]" value="$item.id" />{{ endif }}
<div class="wall-item-delete-end"></div>
+ </div>
+ </div>
+ <div class="wall-item-wrapper-end"></div>
+ <div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
+ <div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
+
{{ if $item.threaded }}
{{ if $item.comment }}
- <div class="wall-item-comment-wrapper" >
+ <div class="wall-item-comment-wrapper$item.indent" >
$item.comment
</div>
{{ endif }}
{{ endif }}
- </div>
- </div>
- <div class="wall-item-wrapper-end"></div>
- <div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
- <div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
+
<div class="wall-item-outside-wrapper-end$item.indent" ></div>
</div>
{{ for $item.children as $item }}
{{ endif }}
</div>
{{if $item.comment_lastcollapsed}}</div>{{endif}}
+
</div>
{{ if $item.drop.dropping }}<input type="checkbox" onclick="checkboxhighlight(this);" title="$item.drop.select" class="item-select" name="itemselected[]" value="$item.id" />{{ endif }}
<div class="wall-item-delete-end"></div>
+ </div>
+ </div>
+ <div class="wall-item-wrapper-end"></div>
+ <div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
+ <div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
+
{{ if $item.threaded }}
{{ if $item.comment }}
- <div class="wall-item-comment-wrapper" >
+ <div class="wall-item-comment-wrapper$item.indent" >
$item.comment
</div>
{{ endif }}
{{ endif }}
- </div>
- </div>
- <div class="wall-item-wrapper-end"></div>
- <div class="wall-item-like $item.indent" id="wall-item-like-$item.id">$item.like</div>
- <div class="wall-item-dislike $item.indent" id="wall-item-dislike-$item.id">$item.dislike</div>
+
<div class="wall-item-outside-wrapper-end$item.indent" ></div>
</div>
{{ for $item.children as $item }}