Jump to content

Recommended Posts

Hello Guys

I hope soemone can offer me some advice here

 

I have recently upgraded my server to MYSQL 5 & PHP 5.24 everything has gone smoothly except 1 site

which seems to maybe have an issue with the folowing coding?

 

<?php
$dir = 'images'; // folder with image folders

if(is_dir($dir)) { 
    $fp = opendir($dir); // open folder
    while(false!==($carpeta = readdir($fp))) { // reading folders
        if($carpeta != ".." && $carpeta != ""){
        if($carpeta != "." && $carpeta != ""){
        echo '<div id="'.$carpeta.'" class="galleryElement">';
        echo '<h2>'.$carpeta.'</h2>';
        
        $dir2 = $dir."/".$carpeta; // Image folder
        $dir3 = $dir."/".$carpeta."/tn"; // Thumbnail folder		
        $Ext = array('jpg','png','gif'); // Image types
        $countExt = count($Ext);

        if(is_dir($dir2)) { 
            $fp2 = opendir($dir2);
            while(false!==($file = readdir($fp2))) {
            for($i=0;$i<$countExt;$i++) {
                if(strpos($file,$Ext[$i],1)) { // show all images image types selected
                    echo '<div class="imageElement">';
                    echo '<h3>'.$file.'</h3>';
                    echo '<p>'.$file.'</p>';
                    echo '<a href="#" title="open image" class="open"></a>';
                    echo '<img src="'.$dir2.'/'.$file.'" class="full" alt="'.$file.'">';
                    echo '<img src="'.$dir3.'/'.$file.'" class="thumbnail" alt="'.$file.'">';
                    echo '</div>';
                }
            }
            }
            closedir($fp2); 
        }
        echo '</div>';
        }
        }
    }
}

closedir($fp); ?>

Ok it's a strange one

I have smooth gallery which is a ajax slideshow

 

if I put in there sample code it displays images so I know there gallery works

a few days ago this was all workign before my server upgrade with the code previously posted

 

The only error i am now getting is a JS error elements.0.thumbnail is null or not a valid object

wihich is very stange condiering with the default HTML sample this works

so this has to be down to the server upgrade & the PHP i'm using ???

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.