]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
provide local_block - block_public as far as content but can connect with the grid.
[friendica.git] / mod / network.php
index 3d8fa7c1443e4849280017246dcc0a68a1c38f74..97f00eeda90ecfb1f3bc665793eac035d96fff6b 100644 (file)
@@ -563,20 +563,27 @@ function network_content(&$a, $update = 0) {
 
        }
        else {
-               $r = q("SELECT COUNT(*) AS `total`
-                       FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-                       WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
-                       AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-                       $sql_extra2 $sql_extra3
-                       $sql_extra $sql_nets ",
-                       intval($_SESSION['uid'])
-               );
-
-               if(count($r)) {
-                       $a->set_pager_total($r[0]['total']);
-                       $itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
-                        $a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40));
+               if(! get_pconfig(local_user(),'system','alt_pager')) {
+                       $r = q("SELECT COUNT(*) AS `total`
+                               FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+                               AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                               $sql_extra2 $sql_extra3
+                               $sql_extra $sql_nets ",
+                               intval($_SESSION['uid'])
+                       );
+
+                       if(count($r)) {
+                               $a->set_pager_total($r[0]['total']);
+                       }
                }
+
+               $itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
+               $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40);
+               if(($a->force_max_items > 0) && ($a->force_max_items < $itemspage_network))
+                       $itemspage_network = $a->force_max_items;
+
+               $a->set_pager_itemspage($itemspage_network);
                $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
        }
 
@@ -688,7 +695,12 @@ function network_content(&$a, $update = 0) {
        $o .= conversation($a,$items,$mode,$update);
 
        if(! $update) {
-               $o .= paginate($a);
+               if(! get_pconfig(local_user(),'system','alt_pager')) {
+                       $o .= paginate($a);
+               }
+               else {
+                       $o .= alt_pager($a,count($items));
+               }
        }
 
        return $o;