PDA

View Full Version : PHP help with Tab Content Script (v 2.2) and Ultimate Fade-in slideshow (v2.1)



rkk
02-18-2010, 11:01 PM
1) Script Title:
Tab Content Script (v 2.2)
Ultimate Fade-in slideshow (v2.1)

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm3)

Describe problem:
i currently have Ultimate Fade-in slideshow (v2.1) working with PHP for multiple web pages. However i just found this tab script and want to put all my web galleries on one html page but am having a problem getting the slideshow to generate the multiple galleries

heres link to test page. i tried setting up the html file to render headshot and wedding galleries. only the headshot one is displaying images...in all i will need 7 different galleries.
http://www.engagedesign.com/index2.html

i tried adding fadeshow1, fadeshow2, fadeshow1toggler, fadeshow2toggler assuming it would want different names for each gallery.



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

<script type="text/javascript">

var mygallery1=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: galleryarray1,
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">

var mygallery2=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: galleryarray2,
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>


i created an index2.php and copied my other php gallery codes into this one php code in hopes it would generate them all but it didnt..im not a coder so im sure its more complicated then that.



<?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-18-2010, 11:15 PM
on a second note, i am using my own css to control the look of the nav, for some reason the text size is incorrect by default, then when you click text the correct size is displayed...i havent touched my CSS and the nav CSS are all coded to be 7pt?