+ if(get_config('system', 'old_pager')) {
+ $r = q("SELECT COUNT(*) AS `total`
+ FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
+ $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ WHERE `thread`.`uid` = %d AND `thread`.`visible` = 1 AND `thread`.`deleted` = 0
+ and `thread`.`moderated` = 0
+ AND `thread`.`wall` = 1
+ $sql_extra $sql_extra2 ",
+ intval($a->profile['profile_uid'])
+ );
+
+ if(count($r)) {
+ $a->set_pager_total($r[0]['total']);
+ }
+ }
+
+ // check if we serve a mobile device and get the user settings
+ // accordingly
+ if ($a->is_mobile) {
+ $itemspage_network = get_pconfig(local_user(),'system','itemspage_mobile_network');
+ $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 10);
+ } else {
+ $itemspage_network = get_pconfig(local_user(),'system','itemspage_network');
+ $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);