Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16720

Re: Pagination isn't working

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: Pagination isn't working
Date 2016-04-04 11:35 +0200
Message-ID <57023577.6020103@arnowelzel.de> (permalink)
References <super70s-3A8AC1.16045102042016@boina.datemas.de> <hrn0gbdfgkbqece174v4ilosa4pr5m1qnp@4ax.com> <super70s-906E83.20083802042016@boina.datemas.de>

Show all headers | View raw


super70s schrieb am 2016-04-03 um 03:08:

> In article <hrn0gbdfgkbqece174v4ilosa4pr5m1qnp@4ax.com>,
>  Richard Yates <richard@yatesguitar.com> wrote:
> 
>> On Sat, 02 Apr 2016 16:04:51 -0500, super70s
>> <super70s@super70s.invalid> wrote:
>>
>>> I have a little PHP article directory script with pagination at the 
>>> bottom, but it isn't working when you click on pages 2, 3, 4, etc., -- 
>>> it always shows the same 10 entries on the first page. Anyone have an 
>>> idea how I can fix this?
>>>
>>> </table><font class=bodylinks>Go To Page :
>>> &nbsp; [1]
>>> &nbsp;<a href="?pg=2&page=category&category_id=86" 
>>> class=bodylinks><strong>2</strong></a>
>>> &nbsp;<a href="?pg=3&page=category&category_id=86" 
>>> class=bodylinks><strong>3</strong></a>
>>> &nbsp;<a href="?pg=4&page=category&category_id=86" 
>>> class=bodylinks><strong>4</strong></a>
>>
>> You have not shown any php code, particularly what is done with
>> "?pg=x".
> 
> I came up with a quick & dirty workaround, I changed 10 to 50 in 
> func.php...
> 
> if (!empty($_GET["ps"]))
>          $this->ps = (int) $_GET["ps"];
>       else
>          $this->ps = 50;

So - "ps" ist used. But where is "pg"? Maybe this is just a typo and it
should be:

if (!empty($_GET["pg"]))
         $this->ps = (int) $_GET["pg"];
      else
         $this->ps = 50;

> No pagination, but at least all the articles are showing. I doubt I'll 
> ever have any more than 50 articles in one category (and if I do I can 
> just increase it).

Why does the script assume, that a missing "pg" parameter should be
handled as "show page 50"? Why not just page 0 (or 1, if 1 is the first
page)?


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-02 16:04 -0500
  Re: Pagination isn't working Richard Yates <richard@yatesguitar.com> - 2016-04-02 17:12 -0700
    Re: Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-02 20:08 -0500
      Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-03 09:46 +0200
        Re: Pagination isn't working super70s <super70s@super70s.invalid> - 2016-04-03 14:05 -0500
          Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-03 23:09 +0200
      Re: Pagination isn't working Arno Welzel <usenet@arnowelzel.de> - 2016-04-04 11:35 +0200
        Re: Pagination isn't working "R.Wieser" <address@not.available> - 2016-04-04 12:44 +0200
  Re: Pagination isn't working "J.O. Aho" <user@example.net> - 2016-04-03 10:30 +0200

csiph-web