Slideshow Script
I need a slideshow script implemented into my website that will stop after the third image and check to see if user is logged in, forcing the viewer to register to proceed. I have the slideshow, I just need to implement the check login function after the third image. I will post the code if someone knows how to help. Thanks!
kb posted this at 19:44 — 21st October 2004.
He has: 1,380 posts
Joined: Feb 2002
Check hotscripts.com or resourceindex.com
jcooper posted this at 18:40 — 25th October 2004.
They have: 5 posts
Joined: Aug 2004
I just need it to stop after the third image to check login. Here is the code, you can see where I already tried an if statement, but it makes the page go blank!
<?php
function getArray($listingID){
global $conn, $lang, $config, $style;
// grab the images
$listingID = make_db_extra_safe($listingID);
$sql = \"SELECT ID, caption, file_name, thumb_file_name, description FROM \"
. $config[table_prefix] . \"listingsImages WHERE (listing_id = $listingID) ORDER BY rank\";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
$num_images = $recordSet->RecordCount();
if ($num_images > 0)
{
$Icount = 1;
while (!$recordSet->EOF)
{
$caption = make_db_unsafe ($recordSet->fields[caption]);
$thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]);
$file_name = make_db_unsafe ($recordSet->fields[file_name]);
$imageID = make_db_unsafe ($recordSet->fields[ID]);
$image_description = make_db_unsafe ($recordSet->fields[description]);
// gotta grab the image size
$imagedata = GetImageSize(\"$config[ings_upload_path]/$file_name\");
$imagewidth = $imagedata[0];
$imageheight = $imagedata[1];
$shrinkage = $config[thumbnail_width]/$imagewidth;
$displaywidth = $imagewidth * $shrinkage;
$displayheight = $imageheight * $shrinkage;
echo \" Picture[$Icount] = ' $config[ings_view_images_path]/$file_name '; \";
echo \" PictureLink[$Icount] = 'viewimages.php?imageID=$imageID&type=listing'; \";
echo \" Caption[$Icount] = \\" $caption \\"; \";
echo \" CaptionFull[$Icount] = \\" $image_description \\"; \";
$Icount = $Icount + 1;
if ($Icount == 3)
{
loginCheckVisitor('User');
}
$recordSet->MoveNext();
} // end while
} // end if ($num_images > 0)
}// end function getArray
?>
[/]
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.