Number of images in album

I've searched the forum on this as i was certain this would have been asked already, but nothing turned up.

Comments

  • Use this wherever you want the number of images to be displayed.

    `(<? $number = getNumImages(); if ($number > 1) $number .= " photos"; else $number .=" photo"; echo$number; ?>)`
  • I am working on the album page of a theme, and I want to set the number of thumbnail images that display to be different values for the first page than for the additional pages:

    Something in this form:
    if (getCurrentPage() == 1) {
    setnumimagesperpage() = 25; <-- I know this doesn't exist, but I am looking for similar
    }

    Thus the first page of the album would display 25 thumbnails, and the others would display whatever the number I set in the Options.

    I haven't come across anything like this so far. Any ideas?

    Thanks
  • This will very likely break the pagination routines. What `MAY` work is to use the firstPageCount parameter in the `nextImage()` loop. To my knowledge this has not been tested with a firstPageCount greater than the images per page option.
  • It seems like firtPageCount and firstPageImages work the same. I tried both with the same results.

    It worked just like you described, and I was able to make the first and successive pages display the correct number of images, no matter if the first or successive had greater numbers.

    And as you described, it breaks the navigation. The navigation seems to account for one less additional page. For example, if you end up with enough images for the first page and a second and third page, the navigation will only take you to the second one. Even though the 3rd one exists. So the next page count seems to get screwed up by 1.

    I'll see if I come up with a hack.
  • acrylian Administrator, Developer
    I guess the problem is probably that these functions are meant to work with the total number of images in an album. Of course this will not lead to the right number of images on the second page if you change the number of images in between. You probably will need to write a customfunction or plugin to really get this working.
  • In my design I only wanted a first and second page for each album, so it was easy enough to use the conditional getNumImages() for tha next navigation and manually appending the link with: <?php echo htmlspecialchars(getAlbumLinkURL());?>./page/2/.
    Not so elegant nor easy to modify, but works in this case.

    If I wanted more than a second page, or better flexibility, I would have to create a better function. If I have time to come back to this, I'll post the function.
  • BTW, thanks for your help. The gallery is now up if you want to check it out:
    http://peep.org/fotos/

    I wrote a blog item too, and mentioned Zenphoto:
    http://peep.org/words/2009/03/cms-fun-with-drupal-wordpress-zenphoto/

    --Mike
  • My albums will only show up to 15 images. Any way I can change this?
  • What do you mean that they will only show up to 15 images? You should explain a bit further.
Sign In or Register to comment.