Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #16713 > unrolled thread
| Started by | super70s <super70s@super70s.invalid> |
|---|---|
| First post | 2016-04-02 16:04 -0500 |
| Last post | 2016-04-03 10:30 +0200 |
| Articles | 9 — 5 participants |
Back to article view | Back to comp.lang.php
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
| From | super70s <super70s@super70s.invalid> |
|---|---|
| Date | 2016-04-02 16:04 -0500 |
| Subject | Pagination isn't working |
| Message-ID | <super70s-3A8AC1.16045102042016@boina.datemas.de> |
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 : [1] <a href="?pg=2&page=category&category_id=86" class=bodylinks><strong>2</strong></a> <a href="?pg=3&page=category&category_id=86" class=bodylinks><strong>3</strong></a> <a href="?pg=4&page=category&category_id=86" class=bodylinks><strong>4</strong></a>
[toc] | [next] | [standalone]
| From | Richard Yates <richard@yatesguitar.com> |
|---|---|
| Date | 2016-04-02 17:12 -0700 |
| Message-ID | <hrn0gbdfgkbqece174v4ilosa4pr5m1qnp@4ax.com> |
| In reply to | #16713 |
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 : > [1] > <a href="?pg=2&page=category&category_id=86" >class=bodylinks><strong>2</strong></a> > <a href="?pg=3&page=category&category_id=86" >class=bodylinks><strong>3</strong></a> > <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".
[toc] | [prev] | [next] | [standalone]
| From | super70s <super70s@super70s.invalid> |
|---|---|
| Date | 2016-04-02 20:08 -0500 |
| Message-ID | <super70s-906E83.20083802042016@boina.datemas.de> |
| In reply to | #16714 |
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 :
> > [1]
> > <a href="?pg=2&page=category&category_id=86"
> >class=bodylinks><strong>2</strong></a>
> > <a href="?pg=3&page=category&category_id=86"
> >class=bodylinks><strong>3</strong></a>
> > <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;
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).
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2016-04-03 09:46 +0200 |
| Message-ID | <5700ca33$0$5884$e4fe514c@news.xs4all.nl> |
| In reply to | #16715 |
super70s, > I doubt I'll ever have any more than 50 articles in one > category (and if I do I can just increase it). ... and this is why your "solution" is called a "Hack". Worse: I stead of fixing the origional problem you now have *two* of them. You also have not answered Richard Yates question: what the f*ck are you doing, in your receiving PHP page/code, with the send "pg" variable ? Also, where are the contents of the first page coming from ? Entries from some sort of database ? Static pages (not common, but possible) ? Anything else ? I short: At least *try* to paint a full picture. Without it we only can *guess* to what the actual problem is, and experience has teached me that that is most often a wasted effort. :-( And a funny thing: When you try to "paint a full picture" (to make the problem clear to all of us NON-mindreaders here) you will most often realize the cause of the problem yourself. In this case : you haven't got the sightest idea what happens, in the receiving PHP page, with the "pg" data, and you should start with trying to find that out first. Regards, Rudy Wieser -- Origional message: super70s <super70s@super70s.invalid> schreef in berichtnieuws super70s-906E83.20083802042016@boina.datemas.de... > 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 : > > > [1] > > > <a href="?pg=2&page=category&category_id=86" > > >class=bodylinks><strong>2</strong></a> > > > <a href="?pg=3&page=category&category_id=86" > > >class=bodylinks><strong>3</strong></a> > > > <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; > > 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).
[toc] | [prev] | [next] | [standalone]
| From | super70s <super70s@super70s.invalid> |
|---|---|
| Date | 2016-04-03 14:05 -0500 |
| Message-ID | <super70s-78EFCD.14053803042016@boina.datemas.de> |
| In reply to | #16716 |
In article <5700ca33$0$5884$e4fe514c@news.xs4all.nl>, "R.Wieser" <address@not.available> wrote: > In this case : you haven't got the sightest idea what happens, in > the receiving PHP page, with the "pg" data, and you should start > with trying to find that out first. You're right, Mr. Warmth, I don't have the slightest idea. I'm not a PHP programmer, this is someone else's script. That's why I asked for advice in here. > Worse: I stead of fixing the origional problem you now have *two* of > them. As long as all the articles in all the categories are showing now I have no problem far as I'm concerned. Actually I happen to prefer that over pagination, which is usually isn't necessary and mostly only used to get more page/ad views. Regards, proud hacker
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2016-04-03 23:09 +0200 |
| Message-ID | <5701867d$0$5898$e4fe514c@news.xs4all.nl> |
| In reply to | #16718 |
super70s, > You're right, Mr. Warmth, I don't have the slightest idea. True. No idea how to read PHP for starters. Thats not the real problem though, as we all started that way. But you also do not "have the slightest idea" how to formulate anything near to a usefull question. Number two is that Richard Yates puts a straight question forward, which you have ignored. Number three is that you think its a good idea to put your big mouth open against someone who actually tried to inform you you that neither of the above is a good idea. > I'm not a PHP programmer, this is someone else's script. It would have been nice if you mentioned both in your first post, as well as where we could find that script. And thats number four: You have absolutily no clue that without that script there is *absolutily nothing* we could advice you to fix your problem. Problem number five: You're not even able to write a truthfull subjectline: pagination is probably working allright, you just haven't got the slightest how to use it. And yes, that is a *big* difference. > That's why I asked for advice in here. And you got that. Richard tried to help you, but you ignored it. I tried to warn you that that isn't the way to go and also gave you some pointers to what we need (and why!), and you think its a good idea to complain. > As long as all the articles in all the categories are showing now > I have no problem far as I'm concerned. Oh yes, your immediate problem of not seeing all entries *now* is solved. The problem still exists though, and will probably bite you in the ass some day. At which moment you will most likely have all but forgotten your arbitrary "lets change that to 50" choice, and again will post a fully inadequate question asking for some magical help. Bub, you're making so many mistakes that its simply painfull to read. Regards, Rudy Wieser super70s <super70s@super70s.invalid> schreef in berichtnieuws super70s-78EFCD.14053803042016@boina.datemas.de... > In article <5700ca33$0$5884$e4fe514c@news.xs4all.nl>, > "R.Wieser" <address@not.available> wrote: > > > In this case : you haven't got the sightest idea what happens, in > > the receiving PHP page, with the "pg" data, and you should start > > with trying to find that out first. > > You're right, Mr. Warmth, I don't have the slightest idea. I'm not a PHP > programmer, this is someone else's script. That's why I asked for advice > in here. > > > Worse: I stead of fixing the origional problem you now have *two* of > > them. > > As long as all the articles in all the categories are showing now I have > no problem far as I'm concerned. > > Actually I happen to prefer that over pagination, which is usually isn't > necessary and mostly only used to get more page/ad views. > > Regards, > proud hacker
[toc] | [prev] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2016-04-04 11:35 +0200 |
| Message-ID | <57023577.6020103@arnowelzel.de> |
| In reply to | #16715 |
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 :
>>> [1]
>>> <a href="?pg=2&page=category&category_id=86"
>>> class=bodylinks><strong>2</strong></a>
>>> <a href="?pg=3&page=category&category_id=86"
>>> class=bodylinks><strong>3</strong></a>
>>> <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
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2016-04-04 12:44 +0200 |
| Message-ID | <57024591$0$5884$e4fe514c@news.xs4all.nl> |
| In reply to | #16720 |
Arno, > So - "ps" ist used. But where is "pg"? Nowhere, he couldn't find where its used fast enough, so he dropped it. From the kids further talk it looks like the "ps" argument determines the number of entries on a page. His "fix" consists outof changing the number of displayed entries on the only page he can reach (the first one). Regards, Rudy Wieser -- Origional message: Arno Welzel <usenet@arnowelzel.de> schreef in berichtnieuws 57023577.6020103@arnowelzel.de... > 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 : > >>> [1] > >>> <a href="?pg=2&page=category&category_id=86" > >>> class=bodylinks><strong>2</strong></a> > >>> <a href="?pg=3&page=category&category_id=86" > >>> class=bodylinks><strong>3</strong></a> > >>> <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
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2016-04-03 10:30 +0200 |
| Message-ID | <dmc2lkFt3liU1@mid.individual.net> |
| In reply to | #16713 |
On 04/02/2016 11:04 PM, super70s 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 : > [1] > <a href="?pg=2&page=category&category_id=86" > class=bodylinks><strong>2</strong></a> > <a href="?pg=3&page=category&category_id=86" > class=bodylinks><strong>3</strong></a> > <a href="?pg=4&page=category&category_id=86" > class=bodylinks><strong>4</strong></a> > you need to add $this->ps to the variable you use for setting the ?pg= > if (!empty($_GET["ps"])) > $this->ps = (int) $_GET["ps"]; > else > $this->ps = 50; I wouldn't use empty() to verify that the user input is correct, use a regular expression or in worst case is_numeric() to validate the input. -- //Aho
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web