ZenphotoCMS Forum
Adding pagination to frontpage for latest added photos - 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: Adding pagination to frontpage for latest added photos (/thread-1890.html)



Adding pagination to frontpage for latest added photos - tomtie - 2007-12-03

Hello,
I would like to not display my albums on the frontpage, but a list of my 10 latest photos added. I've used the printLatestImages() function to display the 10 latest photos, but I'd like to display all my photos this way with 10 latest photos per page. Thanks.




Adding pagination to frontpage for latest added photos - BertSimons - 2007-12-03

hi I did this for my site. you can see them at the bottom of each album-page.

for getImageStatics I had to use the total number of images because other wise you can't get the 10 latest pics for every album. I also have flv movies on my site so I made a line to prevent the imagethumb not found for a flv. movie. change that to mov or whatever you use..

I know..this is not nice code but i am just a starting code paster and i'm sure somebody can make this nicer..but it works see it at www.bertsimons.nl

code for 10 latest images in each individual album.

as always..

I am still not able to paste code here properly..
I have asked in teh forum how to do that but...
so you must see the code at; http://www.bertsimons.nl/wordpress/?p=61




Adding pagination to frontpage for latest added photos - BertSimons - 2007-12-03

hmmm also in worpress between code tags the codes gets broken..it always breaks at an href anchor..

one more try..

`




Adding pagination to frontpage for latest added photos - tomtie - 2007-12-06

Thanks for your reply Bert. I'm sorry, but I think I might have either explained myself incorrectly or I'm viewing your page incorrectly.

What I'm trying to accomplish is display a list of my latest added photos from all albums on one page(index) in descending order. I want to display photos I have taken on vacation from latest to oldest, but the pictures will go into different albums.

example:

  1. picture 1 (album: food)
  2. picture 2 (album: day)
  3. picture 3 (album: night)
  4. picture 4 (album: food)

and I will be taking many photos so I would like to be able to have pagination so I can display 10 photos per page.

example:
1 2 3 4 >>next

Thank you in advance for your help




Adding pagination to frontpage for latest added photos - sbillard - 2007-12-06

Displaying the most recent pictues is fairly easy since there is a function to do this named printImageStatistic() now in the nightly build. It puts out thumbnails, but you can easily modify it to print the images.

The hard part is to do the pagination. There is really nothing that would help you here. You would have to build all the code. You can look at the next_image function to get some idea of how it might be done, but this code is no where near what you will need.




Adding pagination to frontpage for latest added photos - BertSimons - 2007-12-06

if you put my above code between

''

put code here

''

You can make a function from it in your customsfunctions.php or place it as a print_main_album_thumbs.php file in your theme folder like I did and run that as

'http://www.bertsimons.nl/zenphoto/index.php?p=print_latest_main_album_thumbs'

you will get something like
http://www.bertsimons.nl/zenphoto/index.php?p=print_latest_main_album_thumbs

I also hacked the print_album_menu.php to show a list of all albums and sub albums with the five latest thumbs in each

this will generates something like this:

http://www.bertsimons.nl/zenphoto/index.php?p=print_album_menu_thumbs

the code you can get by saving this link:

http://www.bertsimons.nl/files/print_album_menu_thumbs.txt

if you place this code in your customs functions.php you have to remove the function call '' at the bottom and place that in your index.php at the place were you want it.




Adding pagination to frontpage for latest added photos - BertSimons - 2007-12-06

oops..I misunderstood your request tomtie..




Adding pagination to frontpage for latest added photos - Blair - 2007-12-06

Cool stuff anyway Bert.... I've made a copy, [i]just in case I need it later[/i]

[i]but what i really need is [/i] ``

I'll keep looking .. haha




Adding pagination to frontpage for latest added photos - aitf311 - 2007-12-06

Couldn't you just include template-functions in the wordpress file, and use and