zenphoto forums » Usage Support

printRandomImages does not always display the correct number of images

(3 posts)
  1. elrol

    Member
    Joined: Jan '09
    Posts: 42

    Hi..

    on http://www.adamtstein.com/gallery/ i would like to have a random image show on the right of the logo. but sometimes it does and other times it does not.. you may have to refresh several times for proof.

    here is my code on the index page:

    <?php
    if (!defined('WEBPATH')) die();
    include_once('header.php');
    ?>
    <div id="content">
    <img src="http://www.adamtstein.com/backgrounds/ATS-Photography-Logo.jpg"> 
    
    <?php printRandomImages(1, 'randomtopimage', 'all', '', 275, 158,true); ?>
    
    <div class="breadcrumbs">
    <a href="/">adamtstein.com</a> &raquo;
    <a href="/gallery/" title="<?php echo 'gallery main page'; ?>">
    <?php echo strtolower(getGalleryTitle());?></a>
    </div>
    
    <!--<h1>&raquo; Albums</h1>-->
    <div class="albums">
    <ul>
    <?php
    setOption("albums_per_page",10,false);
    
    while (next_album()):
    ?>
    <li><div class="album">
    <a class="albumLink" href="<?php echo getAlbumLinkURL();?>" title="<?php echo getAlbumTitle();?>" >
    <?php printCustomAlbumThumbImage( null, 250, null, null, 250, 150); ?>
    <!--<img class="albumThumb" height="150" width="150" src="<?php echo getAlbumThumb()?>" />-->
    </a>
    <h4><a href="<?php echo getAlbumLinkURL();?>" title="<?php echo getAlbumTitle();?>"><?php echo getAlbumTitle();?></a></h4>
    <!--<p>
    <?
    $subalbumcnt = getNumSubalbums();
    $photocnt = getNumImages();
    ?>
    <span class="albumInfo">
    <?php if($subalbumcnt > 0) { ?>
    <strong><?php echo $subalbumcnt?></strong> sub-albums <br />
    <?php } ?>
    <?php if($photocnt >0){ ?>
    <strong><?php echo $photocnt ?></strong> photos</span>
    <?php } ?>
    </p>-->
    </div></li>
    <?php endwhile ?>
    </ul><div style="clear:both;"></div>
    </div>
    
    <?php if(hasPrevPage() || hasNextPage() ) { printPageListWithNav('<Prev', 'Next>', false , 'pagelist', 'pagelist');} ?>
    </div>
    
    <?php include_once('footer.php') ?>
    Posted 3 years ago #
  2. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,368

    Might be the browser cache playing tricks. I did saw always one. Best you look at the source code when actually none is appearing as expected and look that the image url. It might be related to the empty albums (although I would not know why it should).

    Btw, you did load jQuery twice. It is, although an older version for several reasons, already loaded by zenphoto itself as it is the default js libary.

    Don't forget to read the Forum rules and usage resources
    Posted 3 years ago #
  3. elrol

    Member
    Joined: Jan '09
    Posts: 42

    Thanks for the tip.. i did remove the extra jquery references.. I also deleted the empty folders. I have tested that page about 40 times and an image showed up each time..

    thanks.. hopefully this will continue to be correct.

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.