I'm not sure how to explain this, but I'll do my best. I'm integrating ZenPHOTO into a website of mine and what I want to do is have each album alternate colors. I am using the default theme that comes with ZenPHOTO. I have seen this done before. PHP counts the albums and the odd albums are given class="whatever" and the even albums are given class="somethingelse".
I hope I am explaining myself properly. Anyone have any ideas?
Thanks,
Josh
Comments
<!-- Alternating Album Style Function -->
<?php
$counter = 0;
$remainder = 0;
$myStyle = "";
while (next_album()):
$counter = $counter + 1;
$remainder = $counter % 2;
if($remainder == 1)
{
$myStyle = "albumcontainer";
}
else
{
$myStyle = "albumcontainer2";
}
?>
<!-- Prints the Gallery Albums -->
<div class="<?php echo $myStyle; ?>" >
<div class="albumthumbnail">
" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>" class="albumthumbnail1"><?php printAlbumThumbImage(getAnnotatedAlbumTitle()); ?>
</div>
<div class="albumdescription">
<div class="albumheader">
" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumTitle(); ?>
</div>
<!-- Prints the Album Date -->
<?php //printAlbumDate(""); ?>
<div class="albumdescription">
<?php printAlbumDesc(); ?>
</div>
</div>
</div>
<?php endwhile; ?>