]> git.mxchange.org Git - friendica.git/commitdiff
Remove some currently unused stuff
authorMichael <heluecht@pirati.ca>
Wed, 3 Jan 2018 13:34:51 +0000 (13:34 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 3 Jan 2018 13:34:51 +0000 (13:34 +0000)
include/conversation.php
src/Module/Global.php

index d54e8d65f0bcc4247f08b72c8f5947d49d71ec1b..0f772c880a72ad27039bf238d5706c6553f82e21 100644 (file)
@@ -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 = '<div id="live-community"></div>' . "\r\n"
 //                             . "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\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
index f5470c2935e9b9a955acea6ead32830016a7975a..ad6526f4df3eebf72c640bdd7eccbdd1e99e8394 100644 (file)
@@ -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;
        }
 }