We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1694
    • 1 Posts
    I’m working with the module and snippet and I’d like to change the PHP file associated with it to have the images in a column of 3 and then repeat down the page until it has shown all the images.

    For the life of me I can’t seem to make it work. Any help would be greatly appreciated.

    Here is the PHP code I’m trying to change...


    <?php
    // MiniGallery
    // Display album as a series of rows
    ?>
    <?php $contents=$album->getContents(); ?>
    <?php if ($contents) : ?>
    <?php if ($includeJS) : ?><script type="text/javascript" src="<?=$mgUrl?>snippet/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="<?=$mgUrl?>snippet/slimbox/js/slimbox2.js"></script>
    <link rel="stylesheet" href="<?=$mgUrl?>snippet/slimbox/css/slimbox2.css" type="text/css" media="screen" /><?php endif; ?>
    <?php if ($includeCSS) : ?><link rel="stylesheet" href="<?=$mgUrl?>snippet/rows.css" type="text/css" /><?php endif; ?>
    <table width="191" class="MiniGalleryTable">

    <?php $altRow=true; ?>
    <?php if ($contents[’albums’]) : foreach ($contents[’albums’] as $subAlbum) : $altRow=!$altRow; ?>
    <tr class="mg-album<?=($altRow)?’ altRow’:’’?>">
    <td class="mg-previewCol">&nbsp;</td>
    <td class="mg-nameCol" colspan="5">&nbsp;</td>
    </tr>
    <?php endforeach; endif; ?>

    <?php if ($contents[’images’]) : foreach ($contents[’images’] as $image) : $altRow=!$altRow; ?>
    <tr class="mg-image<?=($altRow)?’ altRow’:’’?>">
    <td class="mg-previewCol"><a href="<?=$album->url.$image->filename?>" rel="lightbox-gallery" title="<?=$image->name?>"><img src="<?=$album->url?><?=$image->thumb?>" alt="<?=$image->name?>" /></a></td>

    </tr>
    <?php endforeach; endif; ?>
    </tbody>
    </table>
    <p><?php endif; ?>
    </p>
    <p>&nbsp;</p>