Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to use Ultimate Fade-in slideshow (v1.5) with PHP/MySQL for img src

  1. #1
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to use Ultimate Fade-in slideshow (v1.5) with PHP/MySQL for img src

    1) Script Title: Ultimate Fade-in slideshow (v1.5)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem:
    I love the Ultimate Fade-in slideshow script. It has greatly improved the look of my static pages. However, the project I am currently working on needs an automatic fading slideshow that uses specific images that correlate to data that is already housed in MySQL database. I'm using php and all the data pulls just fine for text. (i.e.<?php echo $row_Recordset1['var']; ?> ) When I attempt to insert a <?php echo ;?> command to the javascript "fadeimages[0]=" such as "fadeimages[0]=[".<?php echo $row_Recordset1['photo1']; ?> ", "", ""]" the script breaks and I get nothing.

    Could you assist me with solving this problem, such that the really great Ultimate Fade-in slideshow (v1.5) script works with php/MySQL for my project?

    Thanks so much in advance

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,126
    Thanks
    44
    Thanked 3,228 Times in 3,189 Posts
    Blog Entries
    12

    Default

    It looks like you have a dot and a space that don't belong:

    Code:
    fadeimages[0]=[".<?php echo $row_Recordset1['photo1']; ?> ", "", ""]
    However, there is a fairly easy way to troubleshoot what you are attempting. Setup the page and view it in the browser. Then, if there are no server errors reported, look at the browser's 'view source' to see the javascript array being served. If it doesn't conform to the script's example array, modify your PHP part so that it does.
    Last edited by jscheuer1; 08-30-2007 at 03:03 PM.
    - John
    ________________________

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

  3. #3
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Copious quantities for your very helpful assistance. It works now. Most happy.
    Cheers.

  4. #4
    Join Date
    Mar 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey, I'm working on the same piece of code currently, and I was wondering if you could show the entire chunk of code that you have written for it. Mine is broken beyond repair now, and seeing yours would help immensely.

  5. #5
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    I'm trying to load all my images listed in the database table to cycle through the slide show. The application is to cycle thumbnails that will link to a detail page.

    Is there a way the "var fadeimages = new Array()" can be manipulated instead of the "fadeimages[0]=[".<?php echo $row_Recordset1['photo1']; ?> ", "", ""]"?

    my database query is:
    mysql_select_db($database_smartmove, $smartmove);
    $query_rsSlideshow = "SELECT PropertyID, Property_address, Price, Property_Thumb1 FROM property";
    $rsSlideshow = mysql_query($query_rsSlideshow, $smartmove) or die(mysql_error());
    $row_rsSlideshow = mysql_fetch_assoc($rsSlideshow);
    $totalRows_rsSlideshow = mysql_num_rows($rsSlideshow);

    $result = $query_rsSlideshow;

    Any input is appreciated
    Last edited by strikerbear; 04-25-2008 at 06:27 PM.

  6. #6
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi hyperpilot or anyone,

    I am trying to achieve a similar slideshow using php+mysql. I am a newbie and it would be great if hyperpilot you can give me help or your script. It would be highly appreciated.....

    Waiting for your reply,

    Thanks,
    Danny

  7. #7
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP, MySQL, Slideshow

    Hi,

    I used the SQL from my previos post. I used this viewer in a PHP page. Then used this script in the head section of the web page:


    <script>

    // Set the javascript slideshow speed (in milliseconds)
    var SlideShowSpeed = 8000;

    // Set the javascript slideshowduration of crossfade (in seconds)
    var CrossFadeDuration = 3;
    // Set javascript slideshow var array from php and mysql
    <?php
    echo "var Picture = new Array();\n";
    if($totalRows_rsSlideshow > 0) {
    mysql_data_seek($rsSlideshow,0);
    for($i=1;$row_rsSlideshow = mysql_fetch_array($rsSlideshow);$i++) {
    echo "Picture[" . $i . "]=\"" . $row_rsSlideshow['Property_Thumb1'] . "\"\n";
    }
    }
    echo "var Price = new Array();\n";
    if($totalRows_rsSlideshow > 0) {
    mysql_data_seek($rsSlideshow,0);
    for($i=1;$row_rsSlideshow = mysql_fetch_array($rsSlideshow);$i++) {
    echo "Price[" . $i . "]=\"" . $row_rsSlideshow['Price'] . "\"\n";
    }
    }
    echo "var Caption = new Array();\n";
    if($totalRows_rsSlideshow > 0) {
    mysql_data_seek($rsSlideshow,0);
    for($i=1;$row_rsSlideshow = mysql_fetch_array($rsSlideshow);$i++) {
    echo "Caption[" . $i . "]=\"" . $row_rsSlideshow['Property_address'] . "\"\n";
    }
    }
    echo "var PropertyID = new Array();\n";
    if($totalRows_rsSlideshow > 0) {
    mysql_data_seek($rsSlideshow,0);
    for($i=1;$row_rsSlideshow = mysql_fetch_array($rsSlideshow);$i++) {
    echo "PropertyID[" . $i . "]=\"" . $row_rsSlideshow['PropertyID'] . "\"\n";
    }
    }
    ?>

    var tss;
    var iss;
    var jss = 1;
    var pss = Picture.length-1;

    var preLoad = new Array();
    for (iss = 1; iss < pss+1; iss++){
    preLoad[iss] = new Image();
    preLoad[iss].src = Picture[iss];}

    function runSlideShow(){
    if (document.all){
    document.images.PictureBox.style.filter="blendTrans(duration=2)";
    document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
    document.images.PictureBox.filters.blendTrans.Apply();}
    document.images.PictureBox.src = preLoad[jss].src;
    if (document.getElementById) document.getElementById("Price").innerHTML= Price[jss];
    if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
    if (document.all) document.images.PictureBox.filters.blendTrans.Play();
    jss = jss + 1;
    if (jss > (pss)) jss=1;
    tss = setTimeout('runSlideShow()', SlideShowSpeed);
    }
    </script>

    </head>

    The script is run by the top of the body tag:

    <body onload=runSlideShow() class="mySyleCSS">

    Then where the viewer is to go in the body:

    <table width="160" border=0 cellpadding=0 cellspacing=0>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 id=CaptionBox3>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 class=Caption id=CaptionBox3>
    Featured Listing</td>
    </tr>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 id=CaptionBox3></td>
    </tr>
    <tr>
    <td width=10 >&nbsp;</td>
    <td width=140 ><img src=Image001.jpg name=PictureBox width=140 class="PictureBox" /></td>
    <td width=10 >&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 id=CaptionBox3></td>
    </tr>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 class=Caption id=Price></td>
    </tr>
    <tr>
    <td colspan="3" align=center bgcolor=#000000 class=Caption id=CaptionBox></td>
    </tr>
    </table>

    Hope this gives you a starting point!

  8. #8
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How to use Ultimate Fade-in slideshow (v1.5) with PHP/MySQL for img src

    Hello all,
    Newbie to posting here but I have a question:

    I've used the code above and when i view source the image location is "images\testpic.jpg" which is correct as that's the image location entered into the record that has been input.

    When I wish to display a dynamic image on a webpage i.e. viewcostume.php the image displays correctly but when I use the script it doesn't display the image because the file location is "images\testpic.jpg" instead of "testpic.jpg" which is what is required for the script in order to work correctly.

    Has their been an update to resolve this issue / is their a work around that will mead that I have to alter the database structure in order to compensate for the "images\"part of the database record.

    I'm also looking for a simple image upload script that will allow the image to be uploaded after the record has been added to the database.

    Any help would be greatly appreciated.

    netwiseit.

  9. #9
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by netwiseit View Post
    Hello all,
    Newbie to posting here but I have a question:

    I've used the code above and when i view source the image location is "images\testpic.jpg" which is correct as that's the image location entered into the record that has been input.

    When I wish to display a dynamic image on a webpage i.e. viewcostume.php the image displays correctly but when I use the script it doesn't display the image because the file location is "images\testpic.jpg" instead of "testpic.jpg" which is what is required for the script in order to work correctly.

    Has their been an update to resolve this issue / is their a work around that will mead that I have to alter the database structure in order to compensate for the "images\"part of the database record.

    I'm also looking for a simple image upload script that will allow the image to be uploaded after the record has been added to the database.

    Any help would be greatly appreciated.

    netwiseit.
    Hi,

    I'm a little slow, so please forgive this question if it sounds to simple or goofy. Where are your images stored on the server? For example, is it in an images folder? Also where in relation to the script is it? Finally what address location does the database have in it? The database entry could be: testpic.jpg or images/testpic.jpg or /images/testpic.jpg or ../images/testpic.jpg -- this all depending on the location relationships between image, script, and/or web page locations. Hope this dosen't confuse the issue more. Like I said I'm kind of slow.....

  10. #10
    Join Date
    Nov 2010
    Location
    Pakistan Lahore. City of Live hearts
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Hello To Every One

    Hello Friends. I am New here and i was trying top add this script in page.

    Can any one tell me how can i use the -Auto playing slideshow with descriptions shown automatically using the "peekaboo" option.

    I want to use this with MySQL images.

    I am trying from last 4 Days. but cant find any solution. i hope any one can tell me how can i use this

    my Data base is


    CREATE TABLE `gallery_photos` (
    `photo_id` bigint(20) unsigned NOT NULL auto_increment,
    `photo_filename` varchar(25) default NULL,
    `photo_caption` text,
    `photo_category` bigint(20) unsigned NOT NULL default '0',
    PRIMARY KEY (`photo_id`),
    KEY `photo_id` (`photo_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;



    insert into gallery_photos values
    (1, '1.jpg', 'this his his ihgfhg', 1),
    (2, '2.jpg', 'this his his ihgfhg', 1),
    (3, '3.jpg', 'this his his ihgfhg', 1),
    (4, '4.jpg', 'this his his ihgfhg', 1),
    (5, '5.jpg', 'this his his ihgfhg', 1),
    (6, '6.jpg', 'dfggfsdf', 1);

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
  •