]> git.mxchange.org Git - friendica.git/commitdiff
pagination start off by one
authorfriendica <info@friendica.com>
Mon, 2 Jul 2012 02:17:21 +0000 (19:17 -0700)
committerfriendica <info@friendica.com>
Mon, 2 Jul 2012 02:17:21 +0000 (19:17 -0700)
boot.php
mod/message.php

index 26593bc8f02cf389323515054136935841d21bb8..a6fa8e26c20c7c7295588d47c3b4a0d3a3f29b6d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -442,7 +442,7 @@ if(! class_exists('App')) {
                        $this->pager['page'] = ((x($_GET,'page') && intval($_GET['page']) > 0) ? intval($_GET['page']) : 1);
                        $this->pager['itemspage'] = 50;
                        $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
-                       if($this->pager['start'] < 1)
+                       if($this->pager['start'] < 0)
                                $this->pager['start'] = 1;
                        $this->pager['total'] = 0;
                }
index 519634be5be58d61e4f6ead0e20c6c7fa9ead239..80d2c6d99ab26cd5a465d7dd617ff82e2e4ee800 100644 (file)
@@ -224,6 +224,7 @@ function message_content(&$a) {
                // list messages
 
                $o .= $header;
+
                
                $r = q("SELECT count(*) AS `total` FROM `mail` 
                        WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC",
@@ -232,7 +233,7 @@ function message_content(&$a) {
                );
                if(count($r))
                        $a->set_pager_total($r[0]['total']);
-       
+
                $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, 
                        `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`,
                        count( * ) as count
@@ -243,6 +244,7 @@ function message_content(&$a) {
                        intval($a->pager['start']),
                        intval($a->pager['itemspage'])
                );
+
                if(! count($r)) {
                        info( t('No messages.') . EOL);
                        return $o;