From: Michael Date: Wed, 3 Jan 2018 13:34:51 +0000 (+0000) Subject: Remove some currently unused stuff X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=243848eec19c8119c666a3c1f7868de31f083858;p=friendica.git Remove some currently unused stuff --- diff --git a/include/conversation.php b/include/conversation.php index d54e8d65f0..0f772c880a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -576,6 +576,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) { } } elseif ($mode === 'community') { $profile_owner = 0; +// Currently deactivated. Will be activated when we can comment on the community page // if (!$update) { // $live_update_div = '
' . "\r\n" // . "\r\n"; @@ -619,10 +620,8 @@ function conversation(App $a, $items, $mode, $update, $preview = false) { } else { $writable = false; } - $writable = true; - if ($mode === 'network-new' || $mode === 'search') { -// || $mode === 'community') { + if ($mode === 'network-new' || $mode === 'search' || $mode === 'community') { /* * "New Item View" on network page or search page results diff --git a/src/Module/Global.php b/src/Module/Global.php index f5470c2935..ad6526f4df 100644 --- a/src/Module/Global.php +++ b/src/Module/Global.php @@ -114,51 +114,5 @@ class GlobalModule extends BaseModule { ); return dba::inArray($r); - - // Currently deactivated - $parents_arr = []; - - while ($rr = dba::fetch($r)) { - if (!in_array($rr['item_id'], $parents_arr)) { - $parents_arr[] = $rr['item_id']; - } - } - - dba::close($r); - - $max_comments = Config::get("system", "max_comments", 100); - - $items = array(); - - foreach ($parents_arr AS $parents) { - $thread_items = dba::p(item_query()." AND `item`.`uid` = 0 - AND `item`.`parent` = ? - ORDER BY `item`.`commented` DESC LIMIT ".intval($max_comments + 1), - $parents - ); - - if (DBM::is_result($thread_items)) { - $items = array_merge($items, dba::inArray($thread_items)); - } - } - - foreach ($items as $index => $item) { - $items[$index]['writable'] = in_array($item['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS]); - if ($item['network'] == NETWORK_DFRN) { - $fields = ['id', 'writable', 'self']; - $condition = ['nurl' => normalise_link($item['author-link']), 'uid' => local_user()]; - $contact = dba::select('contact', $fields, $condition, ['limit' => 1]); - if (DBM::is_result($contact)) { - $items[$index]['contact-id'] = $contact['id']; - $items[$index]['cid'] = $contact['id']; - $items[$index]['writable'] = $contact['writable']; - $items[$index]['self'] = $contact['self']; - } - } - } - - $items = conv_sort($items, "`commented`"); - - return $items; } }