Jump to content

[SOLVED] Coding compatibility after server upgrade


amwd07

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 ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.