diff options
author | friendica <info@friendica.com> | 2012-07-14 20:39:46 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-14 20:39:46 -0700 |
commit | 03209d2d0dc6b0ceed2325bff598fede2c538301 (patch) | |
tree | fb230666b2b79f97ddd744fe155a4b088640ad29 /mod/network.php | |
parent | a20a6377277a985fa596b0ea460d91b97f79b4a5 (diff) | |
download | volse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.tar.gz volse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.tar.bz2 volse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.zip |
updates
Diffstat (limited to 'mod/network.php')
-rw-r--r-- | mod/network.php | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/mod/network.php b/mod/network.php index f058319f4..07b91b1be 100644 --- a/mod/network.php +++ b/mod/network.php @@ -560,21 +560,23 @@ 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)); - } - $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); + 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'); + $a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40)); + $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); } $simple_update = (($update) ? " and `item`.`unseen` = 1 " : ''); @@ -613,7 +615,8 @@ function network_content(&$a, $update = 0) { if($update) { $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND + (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "') and `item`.`moderated` = 0 and `item`.`unseen` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra3 $sql_extra $sql_nets ", @@ -687,7 +690,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; |