PHP and javascript slideshow
Posted: Sat Dec 27, 2008 5:21 pm
I have created a custom content management system for a client and i have a small problem with the image manager. When the admin of the site uploads images for the site they can select the slideshow and/or the gallery as a destination. They can further select the image they have uploaded and add a title and description that will display on an overlay in the slideshow. But i want to make it so that a user can quickly upload a photo and worry about a title and description later. The javascript slideshow still looks for a title and description and a blank overlay pops up. I tried the follwing if statement and it seemed to work, the first slide with a title and description has a overlay and returns the title and description and the next slide without a title drops the overlay...but then when more slides with titles appear the overlay doesn't come back.
Anyone have a clue...any advice would be much appreciated.
thanks,
Laurence LaGrange, Developer - Crazypill Studios.
Anyone have a clue...any advice would be much appreciated.
thanks,
Laurence LaGrange, Developer - Crazypill Studios.
Code: Select all
<?php
$query = "SELECT * FROM uploads WHERE slide = '1' AND pub = '1' AND del='1' ORDER BY date_entered DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$img=$row['file_name'];
$alt=$row['alttext'];
$descr=$row['description'];
$title=$row['title'];
if(!empty($descr)){
$slide="<li class=\"s3sliderImage\"><img src=\"$half$img\" alt=\"$alt\"/>".
//this is where the title and description are returned
"<span><h3>$title</h3>$descr</span></li>";
}else{
$slide="<li class=\"s3sliderImage\"><img src=\"$half$img\" alt=\"$alt\"/></li>";
}
echo $slide;
}
?>