Photo Gallery

Click photos for a larger view
  • Building & Grounds
    • Church Garden
    • Photo of Stained Glass in Church
    • Photo of statue outside Church
    • Photo of Church Sign at entrance
  • Easter
    • Easter Morning Outside service
    • Photo of Altar for Easter Service
    • Photo of Easter Lilies at Easter Service
    • Photo of Cross decorated for Easter
  • Religious Education
    • Having fun and learning at VBS
    • Learning about the universe at VBS
    • Happy faces at VBS
    • Arts and Crafts at VBS
    • Vacation Bible School at Holy Trinity

Code to achieve this

<?php
print '<ul style="margin:0;padding:0;list-style-type:none;">'; // open the list
$previous = '';
$first = true;
?>
<?php
$wa_startindex = 0;
while ( !$Recordset1->atEnd() ) {
$wa_startindex++;
?>
<?php
if ( $Recordset1->getColumnVal( "category_name" ) != $previous ) { // if current value not the same as $previous
if ( !$first ) {
print '</ul></li>';
} // if not the first time, close the nested list
print '<li class="category">' . $Recordset1->getColumnVal( "category_name" ) . '</a>'; // display the parent link
print '<ul>'; // open the nested list
$previous = $Recordset1->getColumnVal( "category_name" ); // store the current value for comparison next time
}
print '<li style="float:left;width:23%;margin:0 1%;"><a href="photos/' . $Recordset1->getColumnVal( 'photos_file' ) . '" rel="lightbox" title="' . $Recordset1->getColumnVal( "photos_alt" ) . '"><img src="photos/' . $Recordset1->getColumnVal( 'photos_file' ) . '" /></a></li>'; // display the nested links
$first = false; // it's no longer the first time
?>
<?php
$Recordset1->moveNext();
}
if ( $wa_startindex == $Recordset1->Index )$Recordset1->moveFirst(); //return RS to first record
unset( $wa_startindex );
unset( $wa_repeatcount );
?>
<?php
print '</ul></li></ul>'; // finish nested lists
?>