Multiple Album Lists

I am needing to do the normal place 6 or so images that represent albums on the page using the next_album() function. Then I want to place another list with 15 album titles in it. How do I reset the next_album() function to start back at the first album? I am currently on the index.php page. Thanks to whoever can help me out.

Comments

  • trisweb Administrator
    It resets itself :-) That should work fine. You can do this if you want and it should also work, printing four sets of (the same) albums:

    `while(next_album()) { ... }

    while(next_album()) { ... }

    while(next_album()) { ... }

    while(next_album()) { ... }`

    `next_album(true);` will print all albums, if that's what you're looking for. At the moment there's no way to specify the exact number to loop through, but there should be... hmm...
  • I am trying to do something similar on my index page - 3 albums (with thumbs) on left and then a complete list of all albums on the right (minus thumbs). But next_album() is not reseting itself when it is called the second time and is starting from where it left off in the first call.

    Here is the first call;

    <?php $counter = 0; while (next_album() and $counter < 3): ?>
    ...
    <?php $counter++; endwhile; ?>

    This is the second call;

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

    ...
    <?php endwhile; ?>
  • jhenryexp, simple solution might be to do a second but empty loop after the first which just finishes the uncomplete first one and then to call a third one :

    ´<?php $counter = 0; while (next_album() and $counter < 3): ?>
    ...do your thing
    <?php $counter++; endwhile; ?>

    <?php while (next_album(true)): ?>
    <?php $endwhile; ?>

    <?php while (next_album(true)): ?>
    do your thing
    <?php $endwhile; ?>

    ´
Sign In or Register to comment.