From c9cfc5229379689fc1814f95568d2cb8466382be Mon Sep 17 00:00:00 2001 From: Domovoy Date: Fri, 24 Aug 2012 04:57:32 +0200 Subject: [PATCH] method, not property --- include/conversation.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 9468832db8..be7327fbef 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -521,7 +521,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $owner_url = zrl($matches[0][1]); $owner_name = $matches[0][2]; // Use the nosign - $owner_photo = $a->get_baseurl .'/images/nosign.jpg'; + $owner_photo = $a->get_baseurl() .'/images/nosign.jpg'; } } } @@ -910,22 +910,41 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { // Normal View $page_template = get_markup_template("threaded_conversation.tpl"); + require_once('object/Conversation.php'); + require_once('object/Item.php'); + + $conv = new Conversation($mode); + // get all the topmost parents - // this shouldn't be needed, as we should have only them in ou array + // this shouldn't be needed, as we should have only them in our array // But for now, this array respects the old style, just in case $threads = array(); foreach($items as $item) { + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); + // Only add what is visible + if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) { + continue; + } + if($item['verb'] === ACTIVITY_LIKE || $item['verb'] === ACTIVITY_DISLIKE) { + continue; + } + if($item['id'] == $item['parent']) { - $threads[] = $item; + $item_object = new Item($item); + $conv->add_thread($item_object); } } - $threads = prepare_threads_body($a, $threads, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike); + $threads = $conv->get_template_data($alike, $dlike); + if(!$threads) { + logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); + $threads = array(); + } } } -- 2.39.5