Member
Member
Skellington   08-06-2009, 20:02
#1

I'm using my own theme. I'd like to have 'next' and 'previous' buttons on the news page just like the ones on image pages in Zenphoto, but I'm not sure what goes in the if-statement:

For the image pages, it's:

`
if (hasPrevImage()) { ?>
">«

"> »

`
works just fine, as here: http://skellingtonart.com/fine/animals/muskox.gif.php

I thought that "GetNextNewsPageURL" would replace "getNextImageURL", but I don't know what replaces "hasNextImage" in the if statement.

Here's the current news page, with no next/previous buttons:
http://skellingtonart.com/news/More-Musician-Sketches

I tried it without the if-statement, and it the page loads fine, but clicking the button gives a MySQl error:

"MySQL Query ( (SELECT title as albumname, titlelink, date, @type1 as type FROM zp_zenpage_news ORDER BY date) UNION (SELECT albums.folder, albums.title, albums.date, @type2 FROM zp_albums AS albums ORDER BY mtime) ORDER By date DESC LIMIT 10,10 ) failed. Error: Illegal mix of collations for operation 'UNION'"

Administrator
Administrator
acrylian   09-06-2009, 08:20
#2

Please read this http://www.zenphoto.org/2009/03/theming-tutorial/#part-4 and also look at the zenpage-default theme.

Member
Member
Skellington   09-06-2009, 14:23
#3

Sorry, I should have been clearer -- in the default Zenpage theme, "PrintPrevNewsLink" calls a link with the whole article title in it. That works! Bu I'd like it to just say "Prev" or "Next", which requires a different function, and that doesn't work.

Administrator
Administrator
acrylian   09-06-2009, 14:51
#4

Ok, I indeed did not understand. Then you have to build the link yourself using these functions:
http://www.zenphoto.org/documentation/plugins/zenpage/_plugins---zenpage---zenpage-template-functions.php.html#functiongetNextNewsURL
http://www.zenphoto.org/documentation/plugins/zenpage/_plugins---zenpage---zenpage-template-functions.php.html#functiongetPrevNewsURL
Please read the doc carefully as this does not return the url itself but an array with the link/url and also the title of the article.
Example usage (how printNextNewsLink() uses it internally):
$article_url = getNextNewsURL(); if(array_key_exists('link', $article_url) && $article_url['link'] != "") { // needed for checking if there is no next article echo "Next; }
I guess I maybe could also change the function to really just return the url...

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.