Results 1 to 7 of 7

Thread: Ultimate Fade-in slideshow (v2.4) PHP MySQL String

  1. #1
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (v2.4) PHP MySQL String

    1) Script Title: Ultimate Fade-in slideshow (v2.4)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...m#.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 :

    Code:
    $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
    Last edited by Disturbed; 09-23-2013 at 09:46 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,165
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    I know next to nothing about database coding. I'm OK with PHP, and very good with javascript.

    I'm sure it can be done. Unfortunately, given my knowledge of database code, I can't help you a lot with that part.

    What you can do is load the page in the browser and use the browser's "View Source". That will show you what the server side code is getting resolved to. It should of course look like what the javascript code requires. If not you will have to figure out why not and fix it. Often there will be error messages from the server, or it might look OK but just have one or more javascript syntax errors in it. If the former, your database/PHP code has server side problems that must be addressed. If the latter, it's just how the PHP is formatting the output. Commas, quotes, braces, etc. must appear in the proper places as expected by the script. If it looks OK to you but is still not working, give me a link to it. I can probably spot the javascript syntax problem(s) and you can work back from there to fix how the output is being formatted.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    381
    Thanks
    6
    Thanked 35 Times in 33 Posts

    Default

    So let me get this right. Are you trying to display certain images, from your array, on certain pages from your database to be loaded at the bottom of this photo gallery?

  4. #4
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yup Crazy, it is an information Accordion, that has an ID assigned to each accordion, each accordion is a <ul> element at the same time. Sooo : Gathering all the information already works like a charm, meaning the information of the article (ID, Summary, Content, etc...) because its pure PHP/MySQL and HTML, but as it seems, this script accepts only fixed values to display images. I wouldn't see it working to pass the ID of the element over with the wrapperid as I have tried there. It seems so incorrectly written.

  5. #5
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Anyone?

  6. #6
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Bump!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,165
    Thanks
    44
    Thanked 3,240 Times in 3,201 Posts
    Blog Entries
    12

    Default

    The key to any conversion from HTML/javascript to PHP/HTML/javascript is often to look at the served source code of the page. If the page isn't working as desired, while viewing it in the browser, use the browser's "View Source". That will show you how the PHP part is being replaced. If that doesn't fit the requirements of the script, the PHP must be changed so that it does.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Ultimate Fade-in Slideshow -- Fade Duration and Pause
    By ellenjones6 in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 02-21-2014, 05:18 PM
  2. How to use Ultimate Fade-in slideshow (v1.5) with PHP/MySQL for img src
    By hyperpilot in forum Dynamic Drive scripts help
    Replies: 11
    Last Post: 11-25-2010, 03:23 PM
  3. Replies: 3
    Last Post: 07-12-2010, 05:04 PM
  4. Replies: 2
    Last Post: 07-27-2009, 08:11 PM
  5. Change fade time in Ultimate Fade In slideshow
    By Zaphodz in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-17-2006, 01:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •