Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Help with image output, one image missing!

    Hello,

    I have a piece of code that outputs images to the browser and alternates
    them in a table for instance:

    Image 1 Image 2 Image 3

    Image 4 Image 5 Image 6

    and so on. However it is not showing all the images it is dropping one of them
    from the data. So if I have 9 images I only see 8. I am not sure why this is
    and cannnot come up with a fix. Any help would be greatly apopreciated.

    Here is the block of code I am having trouble with:
    PHP Code:
    $frontimgresults $db->MySQLQuery("SELECT * FROM ".$config['database']['tblimages']." WHERE vid='".$vehinfo['stock']."'");
    $y 1;    
    while(
    $showimages mysql_fetch_array($frontimgresults)) {                                                        
        if(
    $y % 4) {
            
    $thisfilename basename($showimages['image']);
             if(!
    is_file("images/vehimages/".$thisfilename)) {
                 
    $newfilename $db->copyFile($showimages['image'], "images/vehimages/");
             }else{
                 
    $newfilename $thisfilename;    
             }
                              
    // Lets see if there is a thumbnail already
             
    if(!is_file("images/vehimages/thumbs/small/thumbnail_".$newfilename)) {
                 
    // If no thumbnail then we will creeate one.
                 
    if($showimages['offsite']) {
                     
    $db->create_small_thumbnail("images/vehimages/",$newfilename,"images/vehimages/thumbs/small/");
                 }else{
                     
    $db->create_small_thumbnail("images/vehimages/",$showimages['image'],"images/vehimages/thumbs/small/");
                 }
             }
            if(
    $showimages['offsite']) {
                echo 
    "<td align=\"center\"><a href=\"".MAIN_URL."/images/vehimages/".basename($showimages['image'])."\" onmouseover=\"showImage2('".MAIN_URL."/images/vehimages', '".basename($showimages['image'])."');\" style=\"border: 0; cursor: hand;\" rel=\"lightbox[cars]\"><img src=\"".MAIN_URL."/images/vehimages/thumbs/small/thumbnail_".basename($showimages['image'])."\" width=\"72\" height=\"72\" class=\"border\" alt=\"Click for larger image\"></a></td>\n";
            }else{
                echo 
    "<td align=\"center\"><a href=\"".MAIN_URL."/images/vehimages/".$showimages['image']."\" onmouseover=\"showImage2('".MAIN_URL."/images/vehimages', '".$showimages['image']."');\" style=\"border: 0; cursor: hand;\" rel=\"lightbox[cars]\"><img src=\"".MAIN_URL."/images/vehimages/thumbs/small/thumbnail_".$showimages['image']."\" width=\"72\" height=\"72\" class=\"border\" alt=\"Click for larger image\"></a></td>\n";
            }
        }else{
            
    $thisfilename basename($showimages['image']);
             if(!
    is_file("images/vehimages/".$thisfilename)) {
                 
    $newfilename $db->copyFile($showimages['image'], "images/vehimages/");
             }else{
                 
    $newfilename $thisfilename;    
             }
                              
    // Lets see if there is a thumbnail already
             
    if(!is_file("images/vehimages/thumbs/small/thumbnail_".$newfilename)) {
                 
    // If no thumbnail then we will creeate one.
                 
    if($showimages['offsite']) {
                     
    $db->create_small_thumbnail("images/vehimages/",$newfilename,"images/vehimages/thumbs/small/");
                 }else{
                     
    $db->create_small_thumbnail("images/vehimages/",$showimages['image'],"images/vehimages/thumbs/small/");
                 }
             }
            if(
    $showimages['offsite']) {
                echo 
    "<td align=\"center\"><a href=\"".MAIN_URL."/images/vehimages/".basename($showimages['image'])."\" onmouseover=\"showImage2('".MAIN_URL."/images/vehimages', '".basename($showimages['image'])."');\" style=\"border: 0; cursor: hand;\" rel=\"lightbox[cars]\"><img src=\"".MAIN_URL."/images/vehimages/thumbs/small/thumbnail_".basename($showimages['image'])."\" width=\"72\" height=\"72\" class=\"border\" alt=\"Click for larger image\"></a></td></tr><tr>";
            }else{
                echo 
    "<td align=\"center\"><a href=\"".MAIN_URL."/images/vehimages/".$showimages['image']."\" onmouseover=\"showImage2('".MAIN_URL."/images/vehimages', '".$showimages['image']."');\" style=\"border: 0; cursor: hand;\" rel=\"lightbox[cars]\"><img src=\"".MAIN_URL."/images/vehimages/thumbs/small/thumbnail_".$showimages['image']."\" width=\"72\" height=\"72\" class=\"border\" alt=\"Click for larger image\"></a></td></tr><tr>\n";
            }
        }   
     
    $y++;

    Thanks in advance for any help you can give.

    Regards,
    Ray
    Last edited by idealws; 05-21-2008 at 01:50 AM.

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    118
    Thanks
    3
    Thanked 9 Times in 9 Posts
    Which image is being left out? Like, if you had 9 images and they were going into the table in the order of most recent to least recent, which is getting lost, the most recent one or the least recent one?


  •  

    Posting Permissions

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