Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    14

    Unanswered: Recordset Paging - being able to click next/previous OR jump to a specific record

    Hoping someone can help me with this one, as my brain is now fried with trying to work this out.

    I have a MySql database which is accessed with some php code. It lists image names, an image title and a caption.

    The image names are used to create the background image for a div, which also contains the other text fields. Along side this are recordset paging for next/previous entry to literally swap the whole div for the next/previous image. This works perfectly.

    Further to this, I wish to have a row of thumbnails of the same recordset along the bottom of the screen which will have 5 images in, along with recordset paging to move to the next/previous group of 5. Again this is working.

    What I can't do is find a way to click an image on the thumbnail's and get the page background/info to change to be that image. In effect I'm trying to get each thumbnail to be a form of recordset paging, but to move to a specific entry rather than next/previous.

    Any guidance as to what I am trying to do would be appreciated.

    HTML Code:
      <div id="image1" style="display: block">
      <div class="into-header" >
      <p><?php 
      if ($row_settings['allowimages']==0)
      {
          echo $row_images['title']; 
      }
      else
      {
          echo $row_imagesunmod['title'];
      }
      ?></p>
      </div>
      <div class="home-page-body3"><?php 
      if ($row_settings['allowimages']==0)
      {
          echo $row_images['caption']; 
      }
      else
      {
          echo $row_imagesunmod['caption'];
      }
      ?></div>
    </div>
    Recordset Paging for Table (this is working fine):

    HTML Code:
    <div class="button-bar">
    
        <div class="buttons"><a href="<?php if ($row_settings['allowimages']==0){printf("%s?pageNum_images=%d%s", $currentPage, min($totalPages_images, $pageNum_images - 1), $queryString_images);}else{printf("%s?pageNum_imagesunmod=%d%s", $currentPage, min($totalPages_imagesunmod, $pageNum_imagesunmod - 1), $queryString_imagesunmod);}?>"><img src='images/image-controls/<?php if ($row_settings['allowimages']==0){if ($pageNum_images > 0){echo"previous-image-button.png' width='59' height='58'";}else{echo "transparent.png' width='59' height='0'";}}else{if ($pageNum_imagesunmod > 0){echo "previous-image-button.png' width='59' height='58'";}else{echo "transparent.png' width='59' height='0'";}}?>/></a>
        </div>   
    
        <div class="buttons"><a href="<?php if ($row_settings['allowimages']==0){printf("%s?pageNum_images=%d%s", $currentPage, min($totalPages_images, $pageNum_images + 1), $queryString_images);}else{printf("%s?pageNum_imagesunmod=%d%s", $currentPage, min($totalPages_imagesunmod, $pageNum_imagesunmod + 1), $queryString_imagesunmod);}?>"><img src='images/image-controls/<?php if ($row_settings['allowimages']==0){if ($pageNum_images < $totalPages_images){echo"next-image-button.png' width='59' height='58'";}else{echo "transparent.png' width='59' height='0'";}}else{if ($pageNum_imagesunmod < $totalPages_imagesunmod){echo "next-image-button.png' width='59' height='58'";}else{echo "transparent.png' width='59' height='0'";}}?>/></a>
        </div>    
    
      </div>


    Row of images... this is not working
    HTML Code:
    <div class="image-wrapper">
    
        <div class="image-band-left">
        <?php if ($pageNum_images > 0) { // Show if not first page ?>
            <a href="<?php printf("%s?pageNum_images=%d%s", $currentPage, max(0, $pageNum_images - 1), $queryString_images); ?>">
            <img src="images/image-controls/left-arrow.png" width="15" height="42" alt=""/></a>
      <?php } // Show if not first page ?>
        </div> 
    
          <?php do { ?>
            <div class="image-padded" onclick="setImage(<?php echo $row_images['name'];?>)";> <img src="images/galleries/art/<?php echo $row_images['name']; ?>" width="76" height="42" alt="" /> </div>
            <?php } while ($row_images = mysql_fetch_assoc($images)); ?>
    
            <div class="image-band-right">
    
            <?php if ($pageNum_images < $totalPages_images) { // Show if not last page ?>
            <a href="<?php printf("%s?pageNum_images=%d%s", $currentPage, min($totalPages_images, $pageNum_images + 1), $queryString_images); ?>"><img src="images/image-controls/right-arrow.png" width="15" height="42" alt=""/></a>
      <?php } // Show if not last page ?>        
            </div>   
        </div>

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    How do you decide which "main" image to display?
    George
    Home | Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •