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.
Comments
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
one more try..
`
`<?php <br />
$photosArray = query_single_row("SELECT count(*) FROM ".prefix('images')); $photosNumber = array_shift($photosArray);
$images = getImageStatistic($photosNumber, "latest");
$album = $_zp_current_album->getFolder();
$x = 1;
foreach ($images as $image) {
$imageURL = getURL($image);
$check = substr_count($imageURL,$album);
if ($check == 1) {
$check = substr_count($imageURL,"flv");
if ($check == 0) {
echo 'getTitle() . '">getCustomImage(null, 30, 30, null, null, null, null) . '" width="30" height="30" style="margin-right:9px;margin-top:16px;margin-bottom:20px;padding:0px;border:1px solid #d2d2d2;" alt="' . $image->getTitle() . ""/>";
}
else{$x=$x-1;}
} else {$x=$x-1;}
if ($x++ >= 5) {
break;
}
}?>
hehe
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
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.
'<?php while (next_album()): ?>'
put code here
'<?php endwhile; ?>'
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 '<?php printAlbumMenuThumbs("list",""); ?>' at the bottom and place that in your index.php at the place were you want it.
but what i really need is `<?php print-AlbumTitlesIntoWordpressSidebar-as-a("list",""); ?>`
I'll keep looking .. haha