PDA

View Full Version : Full Screen Image Slideshow and PHP 7.x



zorbas2
03-04-2019, 05:16 PM
1) Script Title: Cut & Paste Full Screen Image Slideshow (w/ auto read images from directory)

2) Script URL (on DD): http://www.javascriptkit.com/script/script2/fpslideshow/index.shtml

3) Describe problem: Since the upgrade to PHP 7.x the slideshow is not working anymore. Is there a code update? Or some things I could change by hand?

james438
03-04-2019, 08:22 PM
Are you referring to Full Page Slideshow (http://dynamicdrive.com/dynamicindex14/fullpageslideshow/index.htm)?

zorbas2
03-05-2019, 04:40 AM
Sorry, I am talking about:
Full Screen Image Slideshow (w/ auto read images from directory)- by JavaScript Kit (www.javascriptkit.com)
On their website they are linking to this forum...

james438
03-05-2019, 05:22 AM
Ah. I updated your post to include the link to the script. This should help others who are more familiar with javascript. My area of coding knowledge lies more with PHP and MySQL. Sadly, I am least familiar with js.

zorbas2
03-05-2019, 05:45 AM
It anyway might have to do with the file fpslideshowvar.php
I don't think it is a javascript issue as the problem occured only after the upgrade from PHP 5.6 to 7.0
I have no idea how to check compatibility of the file...

james438
03-05-2019, 06:42 AM
Without seeing your site I suspect that some non-standard characters are no longer being recognized and now appear as black diamonds with a question mark. Try adding the following meta tag and see if that helps:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

I still use PHP 5.6, so I can't really troubleshoot this, but this sort of thing can happen when upgrading PHP versions.

zorbas2
03-06-2019, 03:25 PM
No, no such very well known diamonds.
Just nothing - only the loading... icon - forever...

zorbas2
03-08-2019, 04:58 AM
One issue I found is the following:
In the file fpslideshowvar.php:


<?
Header("content-type: application/x-javascript");

function returnimages($dirname=".") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
$filedate=date ("M d, Y H:i:s", filemtime($file));
echo " [$curimage, \"$file\", \"$filedate\"],\n";
$curimage++;
}
}
echo " [\"placeholder\"]\n";
closedir($handle);
}
return($files);
}

echo "var fpslideshowvar={\n";
echo " baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
echo " images: [\n";
returnimages();
echo " ],\n";
echo " desc: []\n";
echo "}\n";
?>

The line


if(eregi($pattern, $file)){


has to be replaced with


if(preg_match($pattern, $file)){


for PHP7.x

But it still doesn't work...