PDA

View Full Version : PHP and multiple Ultimate slideshow on one page



rkk
02-19-2010, 10:58 PM
1) Script Title:
Ultimate Fade-in slideshow (v2.1)

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...slideshow.htm3)


3) Describe problem:
hi i currently have PHP and ultimate slideshow working on my website but i have one gallery on each page...but i want my site on one html page and i want to call up the slideshow with PHP rather then the manual way which i have succesful done.

going with the normal way to add multiple galleries i have each slideshow have fadeshow1,2 and fadeshow1toggler, fadeshow2toggler...then in the PHP i thought all i would have to do is make a galleryarray1, galleryaray2 but when i test it only generates gallery for the first one...is the PHP file configured correctly or is there more rewriting of ultimate slideshow script needed to make this happen?

below is what i think i need to do to the PHP file



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

function returnimages($dirname="./images/headshots/") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'galleryarray1[' . $curimage .']=["' . $dirname . $file . '"];' . "\n";
$curimage++;
}
}

closedir($handle);
}
return($files);
}

echo "var galleryarray1=new Array();" . "\n";
returnimages();


function returnimages($dirname="./images/weddings/") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'galleryarray2[' . $curimage .']=["' . $dirname . $file . '"];' . "\n";
$curimage++;
}
}

closedir($handle);
}
return($files);
}

echo "var galleryarray2=new Array();" . "\n";
returnimages();
?>

rkk
02-24-2010, 02:32 AM
i have no coding experience with PHP but i figured out how to make it work...basically follow the instructions on creating a PHP version of ultimate slide show here:
http://www.dynamicdrive.com/forums/showthread.php?t=50151

you can see my website with it in use here
http://www.engagephotography.biz/

even though this has greatly reduced my website loading time in relation to using multiple slideshows as the script is given i still would like to find a way to make the page only load the gallery when someone clicks on that tab section, but this will do for now.



<script type="text/javascript" src="index.php"></script>


<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow1toggler"
})

</script>

<script type="text/javascript" src="wedding.php"></script>

<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})
</script>

<script type="text/javascript" src="fashion.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow3", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow3toggler"
})
</script>


<script type="text/javascript" src="nature.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "natureshow1", //ID of blank DIV on page to house Slideshow
dimensions: [746, 497], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true, randomize:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "nature7toggler"
})
</script>

<script type="text/javascript">
var mysite=new ddtabcontent("navtabs")
mysite.setpersist(true)
mysite.setselectedClassTarget("link") //"link" or "linkparent"
mysite.init()
</script>

<script type="text/javascript" src="interiors.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow4", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow4toggler"
})
</script>

<script type="text/javascript" src="events.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow5", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow5toggler"
})
</script>

<script type="text/javascript" src="product.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow6", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow6toggler"
})
</script>

<script type="text/javascript" src="engagement.php"></script>

<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "fadeshow7", //ID of blank DIV on page to house Slideshow
dimensions: [461, 377], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: galleryarray,
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow7toggler"
})
</script>

Sathvika
12-04-2015, 11:44 AM
The following attachment has a PHP code which is working for only two slides.... I want more slides to show up. I am not much familiar with PHP, so can any one please help to sort out?

Beverleyh
12-04-2015, 12:26 PM
The attached code is part of a Wordpress plugin bundled with the 13Floor theme. Nothing in it would appear to be limiting the slides to 2 (there is a limit of 5). I would say the issue lies more with your Wordpress settings (or the theme itself - it's 5 years old so is may be due for an upgrade?), but as I'm not a Wordpress user I cannot advise further. Try searching in the Wordpress forums for issues relating to the slider in the 13Floor theme. Or try contacting the developers of the theme directly https://www.elegantthemes.com/blog/theme-additions/new-theme-13floor . Unfortunately the issue does not appear to be with the script from DD as it is working correctly, so you should approach the Wordpress community for troubleshooting assistance relating to setup.