Archiv view

Hy, i still got a problem with my realisation....

My index.php now leads directly to image.php (thanks to acrylian) where i got a big view image and the thumbs under it.

The last thing i want to ask if it´s possible to style the archiv view, or maybe the album.php (unless i don´t use it right now) to get the following structure:

Album1
Thumbs:Imager1,2,3,4,5,6,7,8....

Album2
Thumbs:Imager1,2,3,4,5,6,7,8....

Album3
Thumbs:Imager1,2,3,4,5,6,7,8....

etc.

You know, what i mean....

So the idea is if someone comes to my page he choses on index a Album, zenphoto leads him directly to image.php and if he want´s to view all images he should get a list of all albums with all image-thumbs below.

is that possible?

Comments

  • acrylian Administrator, Developer
    As I stated on your other thread, it is possible. So here a little code:
    `

    <?php<br />
    $album = query_single_row("SELECT folder from". prefix('albums')." WHERE id = ".getAlbumID());

    $images = $_zp_current_album->getImages();

    foreach($images as $image) {

    echo "";

    echo "image";

    echo "
    ";

    }

    ?>

    `

    Add this to the `next_album()`loop on index.php and it will print thumbs (80x80 cropped) of all images in that album.
  • Even better: I added this directly to my archiv view:
    `

    <?php while (next_album()): ?>

    <br /> <?php $album = query_single_row("SELECT folder from". prefix('albums')." WHERE id = ".getAlbumID());<br /> $images = $_zp_current_album->getImages();<br /> foreach($images as $image) {<br /> echo "<a href='".getAlbumLinkURL().$image.".php'>";<br /> echo "<img src='".WEBPATH."/".ZENFOLDER."/i.php?a=".$album['folder']."&i=".$image."&h=50&w=50&t' />";echo "</a>"; }?><br />

    <?php endwhile; ?>`

    How can i manage now to seperate this thumbs by album title? and giving them as a headline the actual album title?
  • acrylian Administrator, Developer
    I don't know exactly what you mean. The code above (both mine and your mod) should print the thumbs to each album in the loop.
  • @PierreSnugg at the start of your while(next_album()) loop you could print the album title, and you could make each section (album title and it's thumbs) a paragraph,
    so in some pseudo code just like this:

    while (next_album)
    <.p>
    print album title;
    foreach (image) { draw the thumb }
    </.p>
    endwhile
  • Here we go! Works perfect...

    i wrote:

    `<?php while (next_album()): ?>

    <?php printAlbumTitle();?>


    <?php $album = query_single_row("SELECT folder from". prefix('albums')." WHERE id = ".getAlbumID());<br />
    $images = $_zp_current_album->getImages();

    foreach($images as $image) {

    echo "";

    echo "image";echo "
    "; }?>

    `

    So now i get first my AlbumTitle and in the next line all the thumbs of it.

    Thanx a lot!
  • acrylian Administrator, Developer
    Ok, if that was all, you could have looked at index.php or album.php to see how to get the album title.
    Let us know when the site is ready..:-)
Sign In or Register to comment.