ZenphotoCMS Forum
Pagination doesn't work - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Pagination doesn't work (/thread-1534.html)



Pagination doesn't work - llapa - 2007-07-09

I’m having problem with pagination. On the main page, the numbering has reached 21 and from 1 to 21 there are all numbers between. The word “back” now has slipped into the second row, because the first line is so: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Can somebody help to stop “marching of numbers”?




Pagination doesn't work - sbillard - 2007-07-09

The code which generates this list is the function printPageListWithNav in template-functions.php

it currently reads:
` for ($i=1; $i




Pagination doesn't work - llapa - 2007-07-10

sbillard, thanks for the replay.
It doesn’t work. The gallery disappears.




Pagination doesn't work - sbillard - 2007-07-10

That means there is a syntax error on the line.

it should read
for (&#36;i=min(1,&#36;current-5); &#36;i < max(&#36;total, (&#36;current+5)); &#36;i++) {




Pagination doesn't work - llapa - 2007-07-11

Hi sbillard,
I put the code in, but it still doesn't work, looks so: -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20




Pagination doesn't work - sbillard - 2007-07-11

Sorry, I am dislexic so got the min/max wrong. Try this.

` for (&#36;i=max(1, (&#36;current-5)); &#36;i




Pagination doesn't work - sbillard - 2007-07-11

` for (&#36;i=(&#36;j=max(1, &#36;current-5)); &#36;i




Pagination doesn't work - llapa - 2007-07-11

Hi sbillard,
It now works somehow, but doesn’t look like a “classic” pagination.
Under this code: `for (&#36;i=max(1, (&#36;current-5)); &#36;i




Pagination doesn't work - sbillard - 2007-07-13

OK, I don't have enough albums to really try this but replace the code which reads:
` for (&#36;i=(&#36;j=max(1, &#36;current-5)); &#36;i




Pagination doesn't work - llapa - 2007-07-13

The gallery disappears.




Pagination doesn't work - sbillard - 2007-07-13

I see the problem. The WEB page swallowed some slashes. Everywhere it says echo "n it should be echo "\n

Here is the complete function:

`function printPageListWithNav(&#36;prevtext, &#36;nexttext, &#36;nextprev=true, &#36;class="pagelist", &#36;id=NULL) {

echo "";

&#36;total = getTotalPages();

&#36;current = getCurrentPage();

echo "\n";

if (&#36;nextprev) {

  echo "\n  "; 

    printPrevPageLink(&#36;prevtext, "Previous Page");

  echo "";

}

for (&#36;i=(&#36;j=max(1, &#36;current-2)); &#36;i 



Pagination doesn't work - llapa - 2007-07-13

It still disappears.
The original code I have there is:
`function printPageListWithNav(&#36;prevtext, &#36;nexttext, &#36;nextprev=true, &#36;class="pagelist", &#36;id=NULL) {

echo "";

&#36;total = getTotalPages();

&#36;current = getCurrentPage();

echo "\n";

if (&#36;nextprev) {

  echo "\n  ";

    printPrevPageLink(&#36;prevtext, "Previous Page");

  echo "";

}

for (&#36;i=1; &#36;i




Pagination doesn't work - sbillard - 2007-07-13

Probably still a transcription error. You can download effervescence_simpleviewer from the WIKI themes page http://www.zenphoto.org/trac/wiki/ZenphotoThemes and copy the code from the included file in version 2.1 of the theme.




Pagination doesn't work - llapa - 2007-07-13

Now it works perfectly. You really are great. Thank you very much for your help. I sincerely appreciate it.




Pagination doesn't work - sbillard - 2007-07-13

Glad to help, It was a good idea of yours.