Disturbed
09-23-2013, 08:38 AM
1) Script Title: Ultimate Fade-in slideshow (v2.4)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm#.Uj_6Oz8SZNo
3) Describe problem:
Hello dear Dynamicles! I came across your script and I was amazed by its easiness when it came to display static pictures from a folder. But now, as we all know, things amongst programmers are NEVER simple.
I am trying to display images from an Array, the images in that array have a $photo_category that is = to the $id of a parent Item. I am trying to create slideshows automatically to each of those items by giving 1 string to the image array, the images are stored in a DB with a file location, and as images in a folder as well. Maybe with this bit of code you get a further understanding of the goal I am trying to accomplish :
$images = @mysql_query("SELECT photo_id, photo_filename, photo_caption FROM gallery_photos
WHERE photo_category = $id");
if (!$images) {
die('<p> Error retrieving Images from database!<br />' . 'Error: ' . mysql_error() . '</p>');
}
while ($image = mysql_fetch_array($images)) {
$photo_id = $image['photo_id'];
$photo_filename = $image['photo_filename'];
$photo_caption = $image ['photo_caption'];
$photo_category = $image ['photo_category'];
?>
<html>
<head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="fadeslideshow.js">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
var mygallery2 = new fadeSlideShow({
wrapperid: "<?php $id ?>", //ID of blank DIV on page to house Slideshow
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
<?php ["cms/houses/$photo_filename", "", "", "$photo_caption"] ?>
],
displaymode: {type: 'manual', pause: 2500, cycles: 0, wraparound: false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})
</script></head>
</html>
Many slideshows are displayed on the same page, as it is 1 page with a lot of content. Each slideshow should get the $id from the parent Item, as you can see in the wrapperid.
I hope I was able to explain my Idea well enough, if not, I will try to go in to further detail.
*Edit : Has anyone ever tried to archive something like this, or is it not possible to display a Slideshow from an Image Array that is selected from a DB query?
Thanks in Advance,
Dominik
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm#.Uj_6Oz8SZNo
3) Describe problem:
Hello dear Dynamicles! I came across your script and I was amazed by its easiness when it came to display static pictures from a folder. But now, as we all know, things amongst programmers are NEVER simple.
I am trying to display images from an Array, the images in that array have a $photo_category that is = to the $id of a parent Item. I am trying to create slideshows automatically to each of those items by giving 1 string to the image array, the images are stored in a DB with a file location, and as images in a folder as well. Maybe with this bit of code you get a further understanding of the goal I am trying to accomplish :
$images = @mysql_query("SELECT photo_id, photo_filename, photo_caption FROM gallery_photos
WHERE photo_category = $id");
if (!$images) {
die('<p> Error retrieving Images from database!<br />' . 'Error: ' . mysql_error() . '</p>');
}
while ($image = mysql_fetch_array($images)) {
$photo_id = $image['photo_id'];
$photo_filename = $image['photo_filename'];
$photo_caption = $image ['photo_caption'];
$photo_category = $image ['photo_category'];
?>
<html>
<head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="fadeslideshow.js">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
var mygallery2 = new fadeSlideShow({
wrapperid: "<?php $id ?>", //ID of blank DIV on page to house Slideshow
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
<?php ["cms/houses/$photo_filename", "", "", "$photo_caption"] ?>
],
displaymode: {type: 'manual', pause: 2500, cycles: 0, wraparound: false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler"
})
</script></head>
</html>
Many slideshows are displayed on the same page, as it is 1 page with a lot of content. Each slideshow should get the $id from the parent Item, as you can see in the wrapperid.
I hope I was able to explain my Idea well enough, if not, I will try to go in to further detail.
*Edit : Has anyone ever tried to archive something like this, or is it not possible to display a Slideshow from an Image Array that is selected from a DB query?
Thanks in Advance,
Dominik