ZenphotoCMS Forum
Prev and next links on index.php page - 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: Prev and next links on index.php page (/thread-274.html)



Prev and next links on index.php page - plodz1 - 2006-02-03

If there are more albums - than in one page - the link on second page is broken.

for example I have 2 pages - on front page I have good links to next » /page/2/

but - on the second page - links to page 1 ( prev) are also /page/2/ - so they link to the actual page - not previous.

Anybody help?
(used last ver.)

Plodz




Prev and next links on index.php page - Guest - 2006-02-21

I'm having the same problem. Are there any fixes in the works for this? :-)




Prev and next links on index.php page - trisweb - 2006-02-22

Thanks for the bug report, I'll look into it for the next release.




Prev and next links on index.php page - tuds89 - 2006-02-25

I had the same problem and figured out the following solution.
I think that this only happened when installing to a subdomain or directly to a domain, but am not sure.
In the remplate-functions.php file go to this area of code:
`

function getPageURL($page) {

global $_zp_current_album, $_zp_gallery;

$total = getTotalPages();

if ($page 0) {

if (in_context(ZP_ALBUM)) {

  if (zp_conf('mod_rewrite')) {

    return WEBPATH . "/" . urlencode($_zp_current_album->name) . (($page > 1) ? "/page/" . $page .  "/" : "");

  } else {

    return WEBPATH . "/index.php?album=" . urlencode($_zp_current_album->name) . (($page > 1) ? "&page=" . $page : "");

  }

} else if (in_context(ZP_INDEX)) {

  if (zp_conf('mod_rewrite')) {

    return WEBPATH . (($page > 1) ? "/page/" . $page . "/" : "/");

  } else {

    return WEBPATH . "/index.php" . (($page > 1) ? "?page=" . $page : "");

  }

}

}

return null;

}

The change was made in this area:

return WEBPATH . (($page > 1) ? "/page/" . $page . "/" : "");

The code originally has nothing in the last set of quotes if you simple add a slash in there it fixes the problem.

return WEBPATH . (($page > 1) ? "/page/" . $page . "/" : "/");

`
What was happening is that it wouldn't put anything in for the link. It would be like putting «a href=""» It doesn't go anywhere and thus just refreshes the current page.