Re: Address Book Pagination [SVN 13876]

Craig Shelley <[email protected]>
Newsgroups gmane.mail.squirrelmail.devel
Message-ID <[email protected]>
This certainly was not the way to fix it. This alternative approach
seems to work better, but is still probably not the correct method.

Index: src/addressbook.php
===================================================================
--- src/addressbook.php	(revision 13876)
+++ src/addressbook.php	(working copy)
@@ -47,6 +47,9 @@
 if (!sqGetGlobalVar('show_all', $show_all, SQ_FORM))
     $show_all = 0;
 
+if ($page_number < 1)
+	$page_number = 1;
+
 /* Get sorting order */
 $abook_sort_order = get_abook_sort();


On Sat, 2009-11-28 at 21:59 +0000, Craig Shelley wrote:
> Hi,
> 
> I am having a problem with the address book showing "Address book is
> empty".
> 
> After narrowing this down, I eventually found that the variable
> $page_number was 0. The pagination routine in src/addressbook.php
> assumes that the page numbers start at 1, hence missing the first page
> of addresses.
> 
> I fixed the problem as shown below, but don't know if this was the
> correct way to fix it.
> 
> Regards,
> Craig
> 
> Index: src/addressbook.php
> ===================================================================
> --- src/addressbook.php	(revision 13876)
> +++ src/addressbook.php	(working copy)
> @@ -389,7 +389,7 @@
>      $new_address_list = array();
>      $total_pages = ceil($total_addresses / $page_size);
>      if ($page_number > $total_pages) $page_number = $total_pages;
> -    $page_count = 1;
> +    $page_count = 0;
>      $page_item_count = 0;
>      foreach ($addresses[$current_backend]['Addresses'] as $addr) {
>          $page_item_count++;
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ----- squirrelmail-devel mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: [email protected] List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAksRuZYACgkQ5OI9vmOoVqFZzgCg1M5i+kdGSZtdDmLs4sPmZFDJ
fh4An3UL818T5hFv61q+3IB+jcYDzc9S
=s2rr
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.