ZenphotoCMS Forum
getLatestNews returns more news than what asked for - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html)
+--- Thread: getLatestNews returns more news than what asked for (/thread-7065.html)



getLatestNews returns more news than what asked for - frankm - 17-05-2010

hi,

i was trying to add the latest news on my homepage. because i want to style the output to match my design i was going for the getLatestNews function and not printLatestNews.

in the zenpage option i fix to 1 the number of news i want to show. so if i do getOption('zp_latestnews') i end up with 1. yet if i do getLatestNews( getOption('zp_latestnews') ) it returns more than 1 news. looking at the function itself in the zenpage-template-functions.php file, it seems to me there is a missing breaking point when $counter reaches $number (just as it is in the printLatestNews function which works fine). maybe this should be added to have a consistent behavior between the 2 functions.

frank.




getLatestNews returns more news than what asked for - acrylian - 17-05-2010

Thanks, seems you found a bug. But it is not in getLatestNews but actually in the getArticles() function called within it. That seems to return always 5 articles no matter what you set.




getLatestNews returns more news than what asked for - acrylian - 17-05-2010

Will be fixed in tonight's nightly.