]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
admin mail list seems wrong escaped
[friendica.git] / mod / network.php
index a71447e5e5f9bbf5af8fe002d47f7195edf6ae74..b5c218de24a0a80b550887d11a5b54610190fcd6 100644 (file)
@@ -314,7 +314,7 @@ function networkSetSeen($condition)
        $unseen = Item::exists($condition);
 
        if ($unseen) {
-               $r = Item::update(['unseen' => false], $condition);
+               Item::update(['unseen' => false], $condition);
        }
 }
 
@@ -407,12 +407,6 @@ function networkFlatView(App $a, $update = 0)
        // Rawmode is used for fetching new content at the end of the page
        $rawmode = (isset($_GET['mode']) && ($_GET['mode'] == 'raw'));
 
-       if (isset($_GET['last_id'])) {
-               $last_id = intval($_GET['last_id']);
-       } else {
-               $last_id = 0;
-       }
-
        $o = '';
 
        $file = defaults($_GET, 'file', '');
@@ -449,14 +443,13 @@ function networkFlatView(App $a, $update = 0)
 
        $pager = new Pager($a->query_string);
 
-       /// @TODO Figure out why this variable is unused
-       $pager_sql = networkPager($a, $pager, $update);
+       networkPager($a, $pager, $update);
 
        if (strlen($file)) {
                $condition = ["`term` = ? AND `otype` = ? AND `type` = ? AND `uid` = ?",
                        $file, TERM_OBJ_POST, TERM_FILE, local_user()];
                $params = ['order' => ['tid' => true], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
-               $result = DBA::select('term', ['oid'], $condition);
+               $result = DBA::select('term', ['oid'], $condition, $params);
 
                $posts = [];
                while ($term = DBA::fetch($result)) {
@@ -532,7 +525,7 @@ function networkThreadedView(App $a, $update, $parent)
                                }
                        } elseif (intval($a->argv[$x])) {
                                $gid = intval($a->argv[$x]);
-                               $default_permissions = ['allow_gid' => '<' . $gid . '>'];
+                               $default_permissions['allow_gid'] = [$gid];
                        }
                }
        }
@@ -547,18 +540,18 @@ function networkThreadedView(App $a, $update, $parent)
        $nets  =        defaults($_GET, 'nets' , '');
 
        if ($cid) {
-               $default_permissions = ['allow_cid' => '<' . intval($cid) . '>'];
+               $default_permissions['allow_cid'] = [(int) $cid];
        }
 
        if ($nets) {
                $r = DBA::select('contact', ['id'], ['uid' => local_user(), 'network' => $nets], ['self' => false]);
 
-               $str = '';
+               $str = [];
                while ($rr = DBA::fetch($r)) {
-                       $str .= '<' . $rr['id'] . '>';
+                       $str[] = (int) $rr['id'];
                }
                if (strlen($str)) {
-                       $default_permissions = ['allow_cid' => $str];
+                       $default_permissions['allow_cid'] = $str;
                }
        }
 
@@ -621,7 +614,6 @@ function networkThreadedView(App $a, $update, $parent)
        $sql_extra3 = '';
        $sql_table = '`thread`';
        $sql_parent = '`iid`';
-       $sql_order = '';
 
        if ($update) {
                $sql_table = '`item`';