IF YOU WANT THE SLIDE SHOW TO WORK WITH MEMBERS LIGHTBOX skip to the next version V2.2 here http://www.4homepages.de/forum/viewtopic.php?p=22293#22293SLIDESHOW V2.1
I have just re-scripted the Slideshow.php part of this Mod. Only took an hour and worked first time (That makes a change
)
The script now does the following..
1)
Uses the 4images DB instead of just using a folder/directory listing. (v2.0)
2)Each image in the slideshow is a link to it's Details page. (v2.0)
3)Allows images on other servers used in slideshow. (v2.1)
It currently sorts by image_name but can easily be changed by modifying the SQL or passing an extra parameter down.
So if you want to install this Mod follow the instructions from my previous version and just replace step 1 script with this...
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: slideshow.php *
* Copyright: *
* Email: *
* Web: *
* Scriptversion: 1.7 *
* *
* *
*************************************************************************/
$templates_used = 'slideshow';
$main_template = 'slideshow';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('MEDIA_DIR', 'data/media');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
if (!$cat_id || !isset($cat_cache[$cat_id]) || !check_permission("auth_viewcat", $cat_id)) {
header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
exit;
}
if ($action == "slideshow") {
$txt_clickstream = "";
if ($cat_id && isset($cat_cache[$cat_id])) {
$txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
}
$msg = "";
//-----------------------------------------------------
//--- New Slide Show ----------------------------------
//-----------------------------------------------------
$slideshow_id = $cat_id;
$slideshow_id = MEDIA_DIR."/".$slideshow_id."/";
$main_template = 'slideshow';
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$additional_sql = "";
$countit = 0;
$file_array = "theimage[0]=[' ','";
$exclude = array("mp3","php","gif","1024","800","Thumbs","htm","mpeg","wmv","avi") ;
$additional_sql = "";
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY i.image_name" ;
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$msg = "<div align=\"center\"> Sorry but there are no suitable images available for a slideshow. <br>Please try another category</div>";
}
else {
while ($image_row = $site_db->fetch_array($result))
{
if (stristr($image_row['image_media_file'],$exclude[0]) ||stristr($image_row['image_media_file'],$exclude[1]) ||stristr($image_row['image_media_file'],$exclude[2]) ||stristr($image_row['image_media_file'],$exclude[3]) ||stristr($image_row['image_media_file'],$exclude[4]) ||stristr($image_row['image_media_file'],$exclude[5]) ||stristr($image_row['image_media_file'],$exclude[6]) ||stristr($image_row['image_media_file'],$exclude[7]) ||stristr($image_row['image_media_file'],$exclude[8])||stristr($image_row['image_media_file'],$exclude[9])|| strlen($image_row['image_media_file'])< 3 ) continue;
$countit = $countit + 1;
if (stristr($image_row['image_media_file'],'http'))
{
$file_array = $file_array."".$image_row['image_media_file']. "','./details.php?image_id=".$image_row['image_id']. " ']; theimage[".$countit."]=[' ','";
}
else
{
$file_array = $file_array."".$slideshow_id."".$image_row['image_media_file']. "','./details.php?image_id=".$image_row['image_id']. " ']; theimage[".$countit."]=[' ','";
}
}
$file_array = substr("$file_array", 0, -19);
if (!$countit) {
$msg = "<div align=\"center\"> Sorry but there are no suitable images available for a slideshow. <br>Please try another category</div>";
}
}
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"file_array" => $file_array,
"slideshow_id" => $slideshow_id,
"random_cat_image" => $random_cat_image,
"msg" => $msg,
"countit" => $countit,
"clickstream" => $clickstream,
"lang_control_panel" => $lang['control_panel']
));
unset($random_cat_image);
unset($file_array);
unset ($countit);
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
Thanks