4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Manfredpaul on December 02, 2002, 09:44:52 AM
-
Bei uns sind alle begeistert von dieser Galerie. was eigentlich nur fehlt, ist eine SLIDESHOW, wo man die Bilder der einzelenen Kategorien ablaufen lassen kann...
...gibt es so ein Modulhack? Oder weiß einer Rat, wie dies zu bewerkstelligen ist?
mfg
ManfredPaul
-
Hm... währe ne Modifikation des Random Image... aber dann sicherlich nur mit Java-Script, da sich die Bilder ja immer ändern müssen... mit PHP geht das sicherlich nicht!
Hier mal ein Beispiel für eine Slightshow
In den Header:
<script>
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// =======================================
// set the following variables
// =======================================
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000
// Duration of crossfade (seconds)
var crossFadeDuration = 3
// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'
Pic[3] = '4.jpg'
Pic[4] = '5.jpg'
// =======================================
// do not edit anything below this line
// =======================================
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
Das kommt nun in den Body Tag:
<body onload="runSlideShow()">
Folgenden Code packst du dahin, wo das Bild erscheinen soll:
Die Größe und die höhe sollten die Größe des Bildes haben (würde also heißen die Tumbs in deiner Gallerie sollen alle gleich groß sein, sonst werden die verzehrt)
Der Name der Grafik sollte der Name der ersten Grafikdatei im
array Pic[] (siehe oben) haben!
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="VU" height=150 width=150>
<img src="1.jpg" name='SlideShow' width=150 height=150></td>
</tr>
</table>
Ist alles nur mal eben so hingeschrieben... aber währe ja mal ein Anfang :-))
-
Hello
I used to use Gallery 1.3.1, but recently switched to 4images. The only thing my users have complained about was that 4images doesn't have a "slideshow" option.
Is it possible for someone to create a mod for a slideshow (for categories, sub-cats, etc) for 4images?
Here's the code from Gallery's slideshow.php page (there is also a slideshow-low.php which is for a low-res sliseshow):
<?
/*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2002 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
?>
<?
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violation\n";
exit;
}
?>
<? require($GALLERY_BASEDIR . "init.php"); ?>
<?
// Hack check
if ($gallery->session->albumName == "") {
header("Location: albums.php");
return;
}
if (!$gallery->user->canReadAlbum($gallery->album)) {
header("Location: " . makeAlbumUrl());
return;
}
if (!$gallery->album->isLoaded()) {
header("Location: " . makeAlbumUrl());
return;
}
// default settings ---
$defaultLoop = 0;
$defaultTransition = 0;
$defaultPause = 3;
$defaultFull = 0;
if (!slide_full) {
$slide_full = $defaultFull;
}
$borderColor = $gallery->album->fields["bordercolor"];
$borderwidth = $gallery->album->fields["border"];
if (!strcmp($borderwidth, "off")) {
$borderwidth = 1;
}
$bgcolor = $gallery->album->fields['bgcolor'];
$title = $gallery->album->fields["title"];
?>
<? if (!$GALLERY_EMBEDDED_INSIDE) { ?>
<head>
<title>Slide Show for album :: <?= $gallery->album->fields["title"] ?></title>
<?= getStyleSheetLink() ?>
<style type="text/css">
<?
// the link colors have to be done here to override the style sheet
if ($gallery->album->fields["linkcolor"]) {
?>
A:link, A:visited, A:active
{ color: <?= $gallery->album->fields[linkcolor] ?>; }
A:hover
{ color: #ff6600; }
<?
}
if ($gallery->album->fields["bgcolor"]) {
echo "BODY { background-color:".$gallery->album->fields[bgcolor]."; }";
}
if ($gallery->album->fields["background"]) {
echo "BODY { background-image:url(".$gallery->album->fields[background]."); } ";
}
if ($gallery->album->fields["textcolor"]) {
echo "BODY, TD {color:".$gallery->album->fields[textcolor]."; }";
echo ".head {color:".$gallery->album->fields[textcolor]."; }";
echo ".headbox {background-color:".$gallery->album->fields[bgcolor]."; }";
}
?>
</style>
</head>
<body>
<? } ?>
<script language="JavaScript" SRC="<? echo $gallery->app->photoAlbumURL ?>/js/client_sniff.js">
</script>
<script language="JavaScript">
var timer;
var current_location = 1;
var next_location = 1;
var pics_loaded = 0;
var onoff = 0;
var direction = 1;
var timeout_value;
var images = new Array;
var photo_urls = new Array;
var photo_captions = new Array;
var transitionNames = new Array;
var transitions = new Array;
var current_transition = <?= $defaultTransition ?>;
var loop = <?= $defaultLoop ?>;
<?php
$numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album));
$numDisplayed = 0;
// Find the correct starting point, accounting for hidden photos
$index = getNextPhoto(0);
$photo_count = 0;
while ($numDisplayed < $numPhotos) {
$photo = $gallery->album->getPhoto($index);
$numDisplayed++;
// Skip movies and nested albums
if ($photo->isMovie() || $photo->isAlbumName) {
$index = getNextPhoto($index);
continue;
}
$photo_count++;
$photoURL = $gallery->album->getPhotoPath($index, $slide_full);
// Now lets get the captions
$caption = $gallery->album->getCaption($index);
/*
* Remove unwanted Characters from the comments,
* We don't use the array based form of str_replace
* because it's not supported on older versions of PHP
*/
$caption = str_replace(";", " ", $caption);
$caption = str_replace("\"", " ", $caption);
$caption = str_replace("\n", " ", $caption);
$caption = str_replace("\r", " ", $caption);
// strip_tags takes out the html tags
$caption = strip_tags($caption);
// Print out the entry for this image as Javascript
print "photo_urls[$photo_count] = \"$photoURL\";\n";
print "photo_captions[$photo_count] = \"$caption\";\n";
// Go to the next photo
$index = getNextPhoto($index);
$photosLeft--;
}
$transitionNames[] = 'Blend';
$transitions[] = 'progid:DXImageTransform.Microsoft.Fade(duration=1)';
$transitionNames[] = 'Blinds';
$transitions[] = 'progid:DXImageTransform.Microsoft.Blinds(Duration=1,bands=20)';
$transitionNames[] = 'Checkerboard';
$transitions[] = 'progid:DXImageTransform.Microsoft.Checkerboard(Duration=1,squaresX=20,squaresY=20)';
$transitionNames[] = 'Diagonal';
$transitions[] = 'progid:DXImageTransform.Microsoft.Strips(Duration=1,motion=rightdown)';
$transitionNames[] = 'Doors';
$transitions[] = 'progid:DXImageTransform.Microsoft.Barn(Duration=1,orientation=vertical)';
$transitionNames[] = 'Gradient';
$transitions[] = 'progid:DXImageTransform.Microsoft.GradientWipe(duration=1)';
$transitionNames[] = 'Iris';
$transitions[] = 'progid:DXImageTransform.Microsoft.Iris(Duration=1,motion=out)';
$transitionNames[] = 'Pinwheel';
$transitions[] = 'progid:DXImageTransform.Microsoft.Wheel(Duration=1,spokes=12)';
$transitionNames[] = 'Pixelate';
$transitions[] = 'progid:DXImageTransform.Microsoft.Pixelate(maxSquare=10,duration=1)';
$transitionNames[] = 'Radial';
$transitions[] = 'progid:DXImageTransform.Microsoft.RadialWipe(Duration=1,wipeStyle=clock)';
$transitionNames[] = 'Rain';
$transitions[] = 'progid:DXImageTransform.Microsoft.RandomBars(Duration=1,orientation=vertical)';
$transitionNames[] = 'Slide';
$transitions[] = 'progid:DXImageTransform.Microsoft.Slide(Duration=1,slideStyle=push)';
$transitionNames[] = 'Snow';
$transitions[] = 'progid:DXImageTransform.Microsoft.RandomDissolve(Duration=1,orientation=vertical)';
$transitionNames[] = 'Spiral';
$transitions[] = 'progid:DXImageTransform.Microsoft.Spiral(Duration=1,gridSizeX=40,gridSizeY=40)';
$transitionNames[] = 'Stretch';
$transitions[] = 'progid:DXImageTransform.Microsoft.Stretch(Duration=1,stretchStyle=push)';
$transitionNames[] = 'RANDOM!';
$transitions[] = 'special case';
$transitionCount = sizeof($transitions) - 1;
$trans_i = 0;
foreach ($transitions as $definition) {
print "transitions[$trans_i] = \"$definition\";\n";
$trans_i++;
}
print "var transition_count = $transitionCount;\n";
?>
var photo_count = <?=$photo_count?>;
var slideShowLow = "<?= makeGalleryUrl('slideshow_low.php',
array('set_albumName' => $gallery->session->albumName)); ?>";
// Browser capabilities detection ---
// - assume only IE4+ and NAV6+ can do image resizing, others redirect to low
if (is_ie4up || is_nav6up) {
//-- it's all good ---
} else {
//-- any other browser we go low-tech ---
document.location = slideShowLow;
}
// - IE5.5 and up can do the blending transition.
var browserCanBlend = (is_ie5_5up);
function stopOrStart() {
if (onoff) {
stop();
} else {
play();
}
}
function toggleLoop() {
if (loop) {
loop = 0;
} else {
loop = 1;
}
}
function changeElementText(id, newText) {
element = document.getElementById(id);
element.innerHTML = newText;
}
function stop() {
changeElementText("stopOrStartText", "play");
onoff = 0;
status = "The slide show is stopped, Click [play] to resume.";
clearTimeout(timer);
}
function play() {
changeElementText("stopOrStartText", "stop");
onoff = 1;
status = "Slide show is running...";
go_to_next_photo();
}
function changeDirection() {
if (direction == 1) {
direction = -1;
changeElementText("changeDirText", "forward");
} else {
direction = 1;
changeElementText("changeDirText", "reverse");
}
preload_next_photo();
}
function change_transition() {
current_transition = document.TopForm.transitionType.selectedIndex;
}
function preload_complete() {
}
function reset_timer() {
clearTimeout(timer);
if (onoff) {
timeout_value = document.TopForm.time.options[document.TopForm.time.selectedIndex].value * 1000;
timer = setTimeout('go_to_next_photo()', timeout_value);
}
}
function wait_for_current_photo() {
/* Show the current photo */
if (!show_current_photo()) {
/*
* The current photo isn't loaded yet. Set a short timer just to wait
* until the current photo is loaded.
*/
status = "Picture is loading...(" + current_location + " of " + photo_count +
"). Please Wait..." ;
clearTimeout(timer);
timer = setTimeout('wait_for_current_photo()', 500);
return 0;
} else {
status = "Slide show is running...";
preload_next_photo();
reset_timer();
}
}
function go_to_next_photo() {
/* Go to the next location */
current_location = next_location;
/* Show the current photo */
if (!show_current_photo()) {
wait_for_current_photo();
return 0;
}
preload_next_photo();
reset_timer();
}
function preload_next_photo() {
/* Calculate the new next location */
next_location = (parseInt(current_location) + parseInt(direction));
if (next_location > photo_count) {
next_location = 1;
if (!loop) {
stop();
}
}
if (next_location == 0) {
next_location = photo_count;
if (!loop) {
stop();
}
}
/* Preload the next photo */
preload_photo(next_location);
}
function show_current_photo() {
/*
* If the current photo is not completely loaded don't display it.
*/
if (!images[current_location] || !images[current_location].complete) {
preload_photo(current_location);
return 0;
}
/* transistion effects */
if (browserCanBlend){
var do_transition;
if (current_transition == (transition_count)) {
do_transition = Math.floor(Math.random() * transition_count);
} else {
do_transition = current_transition;
}
document.images.slide.style.filter=transitions[do_transition];
document.images.slide.filters[0].Apply();
}
document.slide.src = images[current_location].src;
setCaption(photo_captions[current_location]);
if (browserCanBlend) {
document.images.slide.filters[0].Play();
}
return 1;
}
function preload_photo(index) {
/* Load the next picture */
if (pics_loaded < photo_count) {
/* not all the pics are loaded. Is the next one loaded? */
if (!images[index]) {
images[index] = new Image;
images[index].onLoad = preload_complete();
images[index].src = photo_urls[index];
pics_loaded++;
}
}
}
function setCaption(text) {
changeElementText("caption", "[" + current_location + " of " + photo_count + "] " + text);
}
</Script>
<? includeHtmlWrap("slideshow.header"); ?>
<?
$imageDir = $gallery->app->photoAlbumURL."/images";
$pixelImage = "<img src=\"$imageDir/pixel_trans.gif\" width=\"1\" height=\"1\">";
?>
<form name="TopForm">
<?
#-- breadcrumb text ---
$breadCount = 0;
$breadtext[$breadCount] = "Album: <a href=\"" . makeAlbumUrl($gallery->session->albumName) .
"\">" . $gallery->album->fields['title'] . "</a>";
$breadCount++;
$pAlbum = $gallery->album;
do {
if (!strcmp($pAlbum->fields["returnto"], "no")) {
break;
}
$pAlbumName = $pAlbum->fields['parentAlbumName'];
if ($pAlbumName) {
$pAlbum = new Album();
$pAlbum->load($pAlbumName);
$breadtext[$breadCount] = "Album: <a href=\"" . makeAlbumUrl($pAlbumName) .
"\">" . $pAlbum->fields['title'] . "</a>";
} else {
//-- we're at the top! ---
$breadtext[$breadCount] = "Gallery: <a href=\"" . makeGalleryUrl("albums.php") .
"\">" . $gallery->app->galleryTitle . "</a>";
}
$breadCount++;
} while ($pAlbumName);
//-- we built the array backwards, so reverse it now ---
for ($i = count($breadtext) - 1; $i >= 0; $i--) {
$breadcrumb["text"][] = $breadtext[$i];
}
$breadcrumb["bordercolor"] = $borderColor;
$breadcrumb["top"] = true;
include($GALLERY_BASEDIR . "layout/breadcrumb.inc");
$adminbox["commands"] = "<span class=\"admin\">";
$adminbox["commands"] .= " <a href=\"" . makeGalleryUrl("slideshow_low.php",
array("set_albumName" => $gallery->session->albumName)) .
"\">[not working for you? try the low-tech]</a>";
$adminbox["commands"] .= "</span>";
$adminbox["text"] = "Slide Show";
$adminbox["bordercolor"] = $borderColor;
$adminbox["top"] = true;
include ($GALLERY_BASEDIR . "layout/adminbox.inc");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" bgcolor="<?= $borderColor ?>"><?= $pixelImage ?></td>
</tr>
<tr>
<td height="25" width="1" bgcolor="<?= $borderColor ?>"><?= $pixelImage ?></td>
<td align="left" valign="middle">
<span class=admin>
<?
echo " <a href='#' onClick='stopOrStart(); return false;'>[<span id='stopOrStartText'>stop</span>]</a>";
echo " <a href='#' onClick='changeDirection(); return false;'>[<span id='changeDirText'>reverse</span> direction]</a>";
if ($slide_full) {
echo " <a href=\"" . makeGalleryUrl("slideshow.php",
array("set_albumName" => $gallery->session->albumName)) . "\">[normal size]</a>";
} else {
echo " <a href=\"" . makeGalleryUrl("slideshow.php",
array("set_albumName" => $gallery->session->albumName, "slide_full" => 1))
. "\">[full size]</a>";
}
echo " ||";
?>
Delay:
<?=
drawSelect("time", array(1 => "1 second",
2 => "2 second",
3 => "3 second",
4 => "4 second",
5 => "5 second",
10 => "10 second",
15 => "15 second",
30 => "30 second",
45 => "45 second",
60 => "60 second"),
$defaultPause, // default value
1, // select size
array('onchange' => 'reset_timer()', 'style' => 'font-size=10px;' ));
?>
<script language="Javascript">
/* show the blend select if appropriate */
if (browserCanBlend) {
document.write(' Transition: <?
print ereg_replace("\n", ' ', drawSelect("transitionType",
$transitionNames,
$defaultTransition,
1,
array('onchange' => 'change_transition()', 'style' => 'font-size=10px;')));
?>');
}
</script>
Loop:<input type="checkbox" name="loopCheck" <?= ($defaultLoop) ? "checked" : "" ?> onclick='toggleLoop();'>
</span>
</td>
<td width="1" bgcolor="<?= $borderColor ?>"><?= $pixelImage ?></td>
</tr>
<tr>
<td colspan="3" bgcolor="<?= $borderColor ?>"><?= $pixelImage ?></td>
</tr>
</table>
<br>
<div align="center">
<?
if ($photo_count > 0) {
?>
<table width=1% border=0 cellspacing=0 cellpadding=0>
<tr bgcolor="<?=$borderColor?>">
<td colspan=3 height=<?=$borderwidth?>><?=$pixelImage?></td>
</tr>
<tr>
<td bgcolor="<?=$borderColor?>" width=<?=$borderwidth?>><?=$pixelImage?></td>
<script language="JavaScript">
document.write("<td><img border=0 src="+photo_urls[1]+" name=slide></td>");
</script>
<td bgcolor="<?=$borderColor?>" width=<?=$borderwidth?>><?=$pixelImage?></td>
</tr>
<tr bgcolor="<?=$borderColor?>">
<td colspan=3 height=<?=$borderwidth?>><?=$pixelImage?></td>
</tr>
</table>
<br>
<script language="Javascript">
/* show the caption */
document.write("<div class='desc' id='caption'></div>");
/* Load the first picture */
setCaption(photo_captions[1]);
preload_photo(1);
/* Start the show. */
play();
</script>
<?
} else {
?>
<br><b>This album has no photos to show in a slide show.</b>
<br><br>
<span class="admin">
<a href="<?=makeGalleryUrl("view_album.php",
array("set_albumName" => $gallery->session->albumName))?>">[back to album]</a>
</span>
<?
}
?>
</div>
</form>
<? includeHtmlWrap("slideshow.footer"); ?>
<? if (!$GALLERY_EMBEDDED_INSIDE) { ?>
</body>
</html>
<? } ?>
-
Does anyone want to handle this mod? :)
-
Can anyone help with this? Please?
-
My users and those of a couple other webmaster I've spoken with using 4images have requested this feature often. Can someone please help us make a slideshow mod that works?
-
Can anyone help with this? Please?
Just an idea... why don't you try to play with <meta http-equiv="refresh" content="5;URL=next_image_url"> ? Please don't ask me how, if it doesn't work - forget it :)
-
Okay sorry for the confusion but there are now 3 versions of this slideshow mod available for you to choose.
V1) This one uses the file system to return a list of available images for a slideshow. So no database queries for this
V2) Uses the 4images database to return a list of images for the slideshow
(available here http://www.4homepages.de/forum/viewtopic.php?p=20676#20676)
V3) A modification on V2 that allows you to use the slideshow with members LIGHTBOX/Albums
(available here (http://www.4homepages.de/forum/viewtopic.php?p=22293#22293)
The choice is yours.
See Later post by me for latest version. V2 Uses the 4images DB to produce the slide show rather than just a Directory/Folder listing.
Though I'd leave this post as it was as some of you may prefer a file listing slideshow rather than another call to the Database. V2 also allows each image in the slide show to be clicked on as a link to it's Detals page.
I've managed to get a slide show working on my test site if your interested :)
Be warned this is a long post
The way I've set it to work is...
1) You must be logged in (Not a Guest)
Somebody asked me how to let all visitors use the slide show not just registered users. So if you want all visitors to be able to use the slide show then change the script in the categories.php from ...
if ($user_info['user_level'] >= USER) {
$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&".URL_CAT_ID."=".$cat_id);
$slideshow_button = " <a href=\"".$slideshow_url."\"><img src=\"".get_gallery_image("slideshow.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow']."\" /></a>";
}
else {
$slideshow_button = " <img src=\"".get_gallery_image("slideshow_off.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow_off']."\" />";
}
to
$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&".URL_CAT_ID."=".$cat_id);
$slideshow_button = " <a href=\"".$slideshow_url."\"><img src=\"".get_gallery_image("slideshow.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow']."\" /></a>";
2) It's only available from the Categories page when Images are available.
Note I'm no PHP expert, in fact I've only started to use it since I got 4images (Great scripting by the way, just what I was looking for) so use it at your own risk. It also uses Javascipt and may not run correctly if you have other Javascript in your pages.
Functions include....
1) Play button
2) Stop button
3) Manual Forwards or Backward button
4) Manual First Image and Last image
So Here it is then....
*** Step 1 :arrow: *********************************************************************
1) Create a new PHP file called slideshow.php in the ROOT directory.
Here's my code...
<?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'];
}
}
$slideshow_id = $cat_id;
$slideshow_id = MEDIA_DIR."/".$slideshow_id."/";
$main_template = 'slideshow';
$file_array = "";
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$countit = 0;
$file_array = "theimage[0]=[' ','";
$mydir = opendir($slideshow_id) ;
$exclude = array("mp3","php","gif") ;
while($fn = readdir($mydir))
{
if (stristr($fn,$exclude[0]) ||stristr($fn,$exclude[1]) ||stristr($fn,$exclude[2]) || strlen($fn)< 3 ) continue;
$countit = $countit + 1;
$file_array = $file_array."".$slideshow_id."".$fn. "',' ']; theimage[".$countit."]=[' ','";
}
closedir($mydir);
$file_array = substr("$file_array", 0, -19);
if ($countit == 0) {
$msg = "There are no images available for the slideshow. Please try another category";
}
//echo "$file_array";
//-----------------------------------------------------
//--- 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');
?>
*** Step 2 :arrow: *********************************************************************
2) Create a template file called slideshow.html in your Template directory
Here's the code....
{header}
{if countit}
<script type="text/javascript" language="JavaScript1.2" src="./scripts/slide.js"></script>
<SCRIPT LANGUAGE="JavaScript">
theimage = new Array();
{file_array}
</SCRIPT>
{endif countit}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="navbar" height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="50%">
<img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /><font class="navtxt">{clickstream}</font>
</td>
</td>
<td align="right" width="50%">
<a href="{url_top_images}"><font class="navtxt">{lang_top_images}</font></a>
<a href="{url_new_images}"><font class="navtxt">{lang_new_images}</font></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{if random_cat_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1"><br />
{random_cat_image}
<br /><br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_cat_image}
<p align="center">
<?php
echo date("d.m.Y, H:i");
?>
</p>
<br />
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
<td width="100%" valign="top"><br />
{if msg} <b> {msg} </b><br />
<br />
{endif msg}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1"><br>
{if countit}
<FORM NAME="slideshow">
<DIV ALIGN="CENTER">
<TABLE border=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR="black">
<TR>
<TD ALIGN=CENTER>
<TABLE border=0 CELLPADDING=2 CELLSPACING=1>
<TR>
<TD ALIGN=CENTER BGCOLOR="white">
<A HREF="#" onmouseover="this.href=theimage[i][2];return false"><SCRIPT>document.write('<IMG NAME="slideimage" STYLE="filter:'+transtype+'('+transattributes+');" SRC="'+theimage[0][1]+'" BORDER=0>')</SCRIPT></A>
</TD>
</TR>
<TR>
<TD ALIGN=CENTER BGCOLOR="#DDDDDD">
<A HREF="javascript:slideImage(0);" onfocus="this.blur()"><IMG SRC="{template_url}/images/a1.jpg" WIDTH="30" HEIGHT="25" BORDER=0 ALT="To Start"></A>
<A HREF="javascript:slideImage(i-1);" onfocus="this.blur()"><IMG SRC="{template_url}/images/a2.jpg" WIDTH="30" HEIGHT="25" BORDER=0 ALT="Previous Image"></A>
<A HREF="javascript:slidePlay();" onfocus="this.blur()"><IMG SRC="{template_url}/images/a3.jpg" WIDTH="55" HEIGHT="25" BORDER=0 ALT="AutoPlay" NAME="imgPlay"></A>
<A HREF="javascript:slideImage(i+1);"onfocus="this.blur()"><IMG SRC="{template_url}/images/a5.jpg" WIDTH="30" HEIGHT="25" BORDER=0 ALT="Next Image"></A>
<A HREF="javascript:slideImage(theimage.length-1);"onfocus="this.blur()"><IMG SRC="{template_url}/images/a6.jpg" WIDTH="30" HEIGHT="25" BORDER=0 ALT="To End"></A>
<SCRIPT>imgStop=new Image().src='{template_url}/images/a4.jpg';</SCRIPT> </TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</DIV>
</FORM>
{endif countit}
</td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> {category_dropdown_form}</td>
<td align="right"> </td>
</tr>
</table>
<p> </p>
</td>
<td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
{if countit}
<SCRIPT language="javascript">
with(document){
i=0,play=0,di=images,dl=links,form=slideshow,til=theimage.length
}
slideImage(0);
</SCRIPT>
{endif countit}
{footer}
*** Step 3 :arrow: *********************************************************************
3) Create a javascript file called slide.js in a ROOT/scripts directory
Here's the code...
// Configurable Variables
playspeed=5000;// The playspeed determines the delay for the "Play" button in ms
dotrans=1; // if value = 1 then there are transitions played in IE
transtype='blendTrans';// 'blendTrans' or 'revealtrans'
transattributes='duration=1,transition=23';// duration=seconds,transition=#<24
randomorder=0;
linksperline=4; // For the text links
playdiffernce=500; // The speed that the autplay speed is changed by
autostart=1;
preloadslides=0;
// Add extra functions between the brackets if you need other functions that require the onload
window.onload=function(){
if(window.preloadslides)preloadSlide();if(window.autostart)slidePlay();
}
// NS4 resize handler
window.onresize=function(){
if(document.layers)this.location=this.location;
}
function slideImage(num) {
// Required Script
i=num%til;if(i<0)i=til-1;
if(document.all&&dotrans==1)eval('di.slideimage.filters.'+transtype+'.apply()')
di.slideimage.src=theimage[i][1];
if(document.all&&dotrans==1)eval('di.slideimage.filters.'+transtype+'.play()')
// Plug-in handlers
if(form.theimages)form.theimages.selectedIndex = i;
if(form.slidebox)form.slidebox.value = theimage[i][0];
if(form.slidecount)form.slidecount.value = "Image "+(i+1)+" of "+til;
if(form.slidespeed)doSpeed(0);}
function slidePlay() {
if (!window.playing) {
slidePlaying(i+1);
if(form.play)form.play.value=" Stop ";}
else {playing=clearTimeout(playing);
if(form.play)form.play.value=" Play ";}
if(di.imgPlay){
setTimeout('di.imgPlay.src="'+imgStop+'"',1);imgStop=di.imgPlay.src}
}
function slidePlaying(num) {
playing=setTimeout('slidePlaying(i+1);slideImage(i+1);', playspeed);}
*** Step 4 :arrow: *********************************************************************
4) Okay you've created the new files now you need to update existing 4images files so be careful and make a backup of the files you edit first.
Make a backup copy of categories.php
Here's my code - If you've made changes to your categories.php before compare the to and add my changes.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: categories.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$templates_used = 'categories,category_bit,thumbnail_bit';
$main_template = 'categories';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
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;
}
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
$upload_url = "";
$upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"".$lang['alt_upload_off']."\" />";
}
else {
$upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&".URL_CAT_ID."=".$cat_id);
$upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"".$lang['alt_upload']."\" /></a>";
}
//-----------------------------------------------------
//--- Slide Show changes starts here ---------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&".URL_CAT_ID."=".$cat_id);
$slideshow_button = " <a href=\"".$slideshow_url."\"><img src=\"".get_gallery_image("slideshow.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow']."\" /></a>";
}
else {
$slideshow_button = " <img src=\"".get_gallery_image("slideshow_off.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow_off']."\" />";
}
$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;
if ($num_rows_all > 0) {
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
"cat_description" => $cat_cache[$cat_id]['cat_description'],
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"upload_button" => $upload_button,
"slideshow_url" => $slideshow_url,
"slideshow_button" => $slideshow_button,
"random_cat_image" => $random_cat_image
));
}
else {
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
"cat_description" => $cat_cache[$cat_id]['cat_description'],
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"upload_button" => $upload_button,
"random_cat_image" => $random_cat_image
));
}
//-----------------------------------------------------
//--- Slide Show changes ends here ---------
//-----------------------------------------------------
unset($random_cat_image);
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;
$link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$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 ".$config['image_order']." ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$thumbnails = "";
$msg = $lang['no_images'];
}
else {
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover > 0) {
for ($i = 0; $i < $leftover; $i++){
$thumbnails .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$thumbnails .= "</tr>\n";
}
}
$thumbnails .= "</table>\n";
} //end else
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].get_category_path($cat_id)."</span>";
//Update Category Hits
if ($user_info['user_level'] != ADMIN && $page == 1) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_hits = cat_hits + 1
WHERE cat_id = $cat_id";
$site_db->query($sql);
}
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
*** Step 5 :arrow: *********************************************************************
Make a copy of your template categories.html file
Edit categories.html and change this line
<td align="right" valign="bottom">{upload_button}</td>
to this
<td align="right" valign="bottom">{upload_button}{slideshow_button}</td>
*** Step 6 :arrow: *********************************************************************
If you use Alt tags on your buttons then make a copy of your language file main.pnp
and add the following lines...
$lang['alt_slideshow'] = "Click here for category Slide Show";
$lang['alt_slideshow_off'] = "You must be logged in to view Slide Show";
*** Step 7 :arrow: *********************************************************************
You need slideshow buttons for your controls and one similar to the upload button.
You can get a copy of the ones I use from:-
http://www.itwosolutions.com/temp_store/slideshow_images.zip
Place these images in the template_url/images directory.
*** That's it I think :!: ***************************************************
I will try to answer any questions you have but I'm very busy so be patient if I can't get back to you quickly.
Good luck and remember to back up your files before making any changes.
Good luck :wink:
-
Fugaziman: Thanks SO much for your initiative and assistance. Can you post a link to your gallery so I can see how it works first hand before undertaking my own editing process?
Thanks again!
WishX
-
Hello WishX
You can get to my family website site at
http://www.newman.d2g.com/index.php
Just a note: I updated the script yesterday to handle categories with no images and to exclude certain file types eg. "php","mp3","gif"
These values are set in the slideshow.php
I have amended the code in my previous message.
Remember you have to be a registered user to use the slideshow.
Thanks
-
Hi Fugaziman
I just visited ur gallery and see that there is a news archive and the gallery is organized by buttons instead of "/". Can you tell me which mod to do these?Thanks.
-
Hello gato2k,
Have sent you a private message with the answers to your questions.
Thanks for visiting my site 8)
-
Could someone move this mod to the other mod forum?
-
have anyone tryed this mod?
well, I cant get it to work, I think there is one file is missing.
from template calls some slide_newman.php
did I miss something?
-
Delete the line
<?php include("slide_newman.php"); ?>
and everything works fine.
CU
Markus
-
Great mod! It was so easy to install and worked perfect on the first try. Has anyone made this mod work with the lightbox as well? If so, it would be great if you could post the changes needed. Thanks!
-
Another idea - would it be possible to pass in and use the first image on the current page instead of the first image in the category as a starting image? Some of my categories have 100+ images, which would make for a long slide show.
-
Hi,
der Mod läuft super aber wie bekomme ich mein Logo noch oben hin. Das fehlt da leider.
Also der Header halt...
-
Another idea - would it be possible to pass in and use the first image on the current page instead of the first image in the category as a starting image? Some of my categories have 100+ images, which would make for a long slide show.
Sorry but I cheated when I created this MOD. I do a directory listing of the relevant category and build a list of files to use in the slide show. It does not use any information from the 4images DBs other than CatId.
-
This is a great MOD!!!.
But I still have a question :lol:
I have one category with all the picts in it in another URL (different from the 4images URL). Is it possible to do a slideshow with them?
Thanks a lot in advance
Tango_2002
-
This is a great MOD!!!.
But I still have a question :lol:
I have one category with all the picts in it in another URL (different from the 4images URL). Is it possible to do a slideshow with them?
The slide show works by passing down the cat id ie. folder name using the following code in slideshow.php
$slideshow_id = MEDIA_DIR."/".$slideshow_id."/";
If you can find some way of setting the $slideshow_id to be the directory name of your category then you could do it but it would need a little added script probably something like...
if cat_id = "your cat directory" then $slideshow_id = "category folder path"
Hope that helps.
-
(sorry for my english)
If i go to your site hier: http://www.newman.d2g.com/index.php everything works just fine, i can see the slide show.
But in my site, i get Java error message at my IE browser, at corner down left.
boti :)
-
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#22293
SLIDESHOW 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 :D )
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
-
WOW! GREAT JOB, but there is one problem left.
Pictures on an other server cannot be displayed.
i.e. http://4images.domain1.de/data/media/31/http://www.domain2.net/pictures/PIC.JPG
Is there any chance to delete the first domain???
The original picture:http://www.domain2.net/picutres/PIC.JPG
Thank U very much!
Cheers,
Markus
-
WOW! GREAT JOB, but there is one problem left.
Pictures on an other server cannot be displayed.
i.e. http://4images.domain1.de/data/media/31/http://www.domain2.net/pictures/PIC.JPG
Is there any chance to delete the first domain???
The original picture:http://www.domain2.net/picutres/PIC.JPG
Have amended the code above (now V2.1 :D )and tested it. Just added an extra condition to search for "http" in the image file name. If it finds it the first domain is not added to the array.
Just copy and replace the whole slideshow.php script
Hope that helps
Fugaziman 8)
-
The script now does the following..
1)Uses the 4images DB instead of just using a folder/directory listing. (v2.0)
Can you explain what this means in more detail? Will I notice a difference, or will it work like it did before?
-
Now everything works fine! :D
Thanks again!
Cheers,
Markus
-
The script now does the following..
1)Uses the 4images DB instead of just using a folder/directory listing. (v2.0)
Can you explain what this means in more detail? Will I notice a difference, or will it work like it did before?
It works the same as before but it get's the image name and details from the Database instead of a file listing.
There are however 2 modifications from the original version...
1) Each picture in the slideshow is a link to the Details page of the image.
2) If your database has entries to pictures on other servers ie. you've entered a URL for the image rather than uploading it to your server then this image will display in the slide show also.
Hope that helps.
Fugaziman
-
how about using .php file that will show next images?
it's pretty easy to do, the generated page became tiny, it doesnt show the filenames, neither path to them :D (I like that part the most)
I did an example based on random image mod:
HTML page source (http://come.no-ip.com/random.htmls)
PHP file source (http://come.no-ip.com/random.phps)
and when u combine them, it shows this (http://come.no-ip.com/random.html).
-
Great Job Fugaziman!!
-
really a great job but i have the same problem as someone already postet in german...
everything workes fine, but while looking to a slideshow my header with the logo is missing what makes the page look a bit strange ;)
could anyone help to solve the problem?!
thanxxxx
-
really a great job but i have the same problem as someone already postet in german...
everything workes fine, but while looking to a slideshow my header with the logo is missing what makes the page look a bit strange ;)
could anyone help to solve the problem?!
thanxxxx
It looks like you are missing something from your template slideshow.html file.
Have you included at the very top {header} ?
If you have compare one of your other template files like details.html with the slideshow.shtml and see if you can see something missing.
Hope that Helps
Fugaziman
-
how about using .php file that will show next images?
it's pretty easy to do, the generated page became tiny, it doesnt show the filenames, neither path to them :D (I like that part the most)
I did an example based on random image mod:
HTML page source (http://come.no-ip.com/random.htmls)
PHP file source (http://come.no-ip.com/random.phps)
and when u combine them, it shows this (http://come.no-ip.com/random.html).
Great Idea to show the random image on every homepage.
...and it works. :D
Thanks and Cheers,
Markus
By the way: Do U have finished the new Upload-Mod for Users... (URL-fetching, zip-extracting, ...)
URL-fetching where very nice to put the files on an free of charge server.
:wink:
-
(sorry for my poorly english)
how is ist possible to make lightbox-slideshow?
-
SLIDESHOW V2.2 for LIGHTBOX/ALBUM
The latest version of the Slideshow Mod also works for registered users Lightbox/Album now.
WARNING:
This will not work with the lightbox for Guests Mod found here http://www.4homepages.de/forum/viewtopic.php?t=4826
Simply follow the steps in my first post ...
:arrow: Replace step 1 slideshow.php code with this code
<?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');
//-----------------------------------------------------
// Configrable variables ------------------------------
$max_height = "651"; // any images with a greater height will not be included in slide show
$max_width = "651"; // any images with a greater width will not be included in slide show
//-----------------------------------------------------
if ($action == "slideshow") {
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 ($cat_id && isset($cat_cache[$cat_id])) {
$txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
}
if ($action == "slideshowlightbox") {
// $txt_clickstream = $lang['lightbox'];
$txt_clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php")."\" class=\"clickstream\">".$lang['lightbox']."</a>";
}
$msg = "";
//-----------------------------------------------------
//--- New Slide Show ----------------------------------
//-----------------------------------------------------
$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]=[' ','";
$additional_sql = "";
$image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
if ($action == "slideshow"){
$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" ;
}
else {
if (!empty($user_info['lightbox_image_ids'])) {
$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 image_active = 1 AND image_id IN ($image_id_sql) AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
ORDER BY i.image_name" ;
}}
if ($sql == ""){
$num_rows = "";}
else {
$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 (!is_remote($image_row['image_media_file'])) {
$image_info = @getimagesize((MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']));
$width = $image_info[0];
$height = $image_info[1];
}
$slideshow_id = MEDIA_PATH."/".$image_row['cat_id']."/";
if ($width >= $max_width) continue;
if ($height >= $max_height) continue;
if (stristr($image_row['image_media_file'],".jpg") || stristr($image_row['image_media_file'],".jpeg") || stristr($image_row['image_media_file'],".bmp") || stristr($image_row['image_media_file'],".gif")){
$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');
?>
:arrow: Make a copy of your lightbox.php file (just in case)
:arrow: Edit lightbox.php
:arrow: Search for
if (!$num_rows) {
$thumbnails = "";
$msg .= ($msg != "") ? "<p>".$lang['lightbox_no_images'] : $lang['lightbox_no_images'];
:arrow: Replace with
if (!$num_rows) {
$thumbnails = "";
$msg .= ($msg != "") ? "<p>".$lang['lightbox_no_images'] : $lang['lightbox_no_images'];
// added for slideshow mod
$slideshow_button = " <img src=\"".get_gallery_image("slideshow_off.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow_off']."\" />";
// -----------------------
:arrow: Search for
$thumbnails .= "</table>\n";
:arrow: Replace with
$thumbnails .= "</table>\n";
// added for slideshow mod
$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshowlightbox");
$slideshow_button = " <a href=\"".$slideshow_url."\"><img src=\"".get_gallery_image("slideshow.gif")."\" border=\"0\" alt=\"".$lang['alt_slideshow']."\" /></a>";
// added for slideshow mod
:arrow: Search for
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_lightbox" => $lang['lightbox'],
"lang_delete_lightbox" => $lang['delete_lightbox'],
"url_delete_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox"),
"lang_delete_lightbox_confirm" => $lang['delete_lightbox_confirm'],
"lang_lightbox_lastaction" => $lang['lighbox_lastaction'],
"download_button" => $download_button
:arrow: Replace with
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_lightbox" => $lang['lightbox'],
"lang_delete_lightbox" => $lang['delete_lightbox'],
"url_delete_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox"),
"lang_delete_lightbox_confirm" => $lang['delete_lightbox_confirm'],
"lang_lightbox_lastaction" => $lang['lighbox_lastaction'],
"slideshow_button" => $slideshow_button, // added for slideshow mod
"download_button" => $download_button
:arrow: Make a copy of your template lightbox.html
:arrow: edit your lightbox.html and add
{slideshow_button}
Where you want the slideshow button to appear.
That's it. Now your registered members can enjoy viewing their favorite images using the slide show.
-
thank you! ist great!
-
Habe ja schon die SLIDESHOW laufen gesehen. :oops: Nur steht hier alles in Englisch versucht mit übersetzen habe ich nur hast nicht geklapp auch logisch wenn man nur mit Bücher versucht. Wenn einer mal die Zeit hätte könnte er das für mich in Deutsch Übersetzen würden mich sehr freuen.
Gruss Bany
-
hi.. im also using the slideshow and its always a great pleasure....
but i only have one problem.... i don't want visitors that use the slideshow that they are able to acces the details page when clicking on an image in the slideshow... just nothing should happen...
can anyone help me or poste how to modify this that it works?
-
.... i don't want visitors that use the slideshow that they are able to acces the details page when clicking on an image in the slideshow... just nothing should happen...
This should work.....
1)Make a backup copy of your slideshow template file (eg slideshow.html).
2)Edit the slideshow.html template page
2) search for...
<A HREF="#" onmouseover="this.href=theimage[i][2];return false">
3)replace with...
<A HREF="#">
I must admit I haven't tested this but it should work :wink: .
Fugaziman
-
thanks.... works great and now everythings fine!!!! :lol:
-
Hallo, ich habe mal neue Button für die Slideshow erstellt.
Ihr könnt sie hier herunterladen:
(http://www.digitalfotograf.com/temp/a.jpg)
http://www.digitalfotograf.com/temp/button.zip
Weiterhin muß die Datei slideshow.html geändert werden. Hier die Änderungen (auch gleich in deutscher Sprache)
{header}
{if countit}
<script type="text/javascript" language="JavaScript1.2" src="./scripts/slide.js"></script>
<SCRIPT LANGUAGE="JavaScript">
theimage = new Array();
{file_array}
</SCRIPT>
{endif countit}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="navbar" height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="50%">
<img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /><font class="navtxt">{clickstream}</font>
</td>
</td>
<td align="right" width="50%">
<a href="{url_top_images}"><font class="navtxt">{lang_top_images}</font></a>
<a href="{url_new_images}"><font class="navtxt">{lang_new_images}</font></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{if random_cat_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
{random_cat_image}
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_cat_image}
<p align="center">
<?php
echo date("d.m.Y, H:i");
?>
</p>
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
<td width="100%" valign="top">
{if msg} <b> {msg} </b>
{endif msg}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
{if countit}
<FORM NAME="slideshow">
<DIV ALIGN="CENTER">
<TABLE border=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR="black">
<TR>
<TD ALIGN=CENTER>
<TABLE border=0 CELLPADDING=2 CELLSPACING=1>
<TR>
<TD ALIGN=CENTER BGCOLOR="white">
<A HREF="#" onmouseover="this.href=theimage[i][2];return false"><SCRIPT>document.write('<IMG NAME="slideimage" STYLE="filter:'+transtype+'('+transattributes+');" SRC="'+theimage[0][1]+'" BORDER=0>')</SCRIPT></A>
</TD>
</TR>
<TR>
<TD ALIGN=CENTER BGCOLOR="#DDDDDD">
<A HREF="javascript:slideImage(0);" onfocus="this.blur()">
<IMG SRC="{template_url}/images/a1.jpg" WIDTH="35" HEIGHT="35" BORDER=0 ALT="Zum Anfang"></A>
<A HREF="javascript:slideImage(i-1);" onfocus="this.blur()">
<IMG SRC="{template_url}/images/a2.jpg" WIDTH="35" HEIGHT="35" BORDER=0 ALT="Vorheriges Bild"></A>
<A HREF="javascript:slidePlay();" onfocus="this.blur()">
<IMG SRC="{template_url}/images/a3.jpg" WIDTH="35" HEIGHT="35" BORDER=0 ALT="AutoPlay" NAME="imgPlay"></A>
<A HREF="javascript:slideImage(i+1);"onfocus="this.blur()">
<IMG SRC="{template_url}/images/a5.jpg" WIDTH="35" HEIGHT="35" BORDER=0 ALT="Nächstes Bild"></A>
<A HREF="javascript:slideImage(theimage.length-1);"onfocus="this.blur()">
<IMG SRC="{template_url}/images/a6.jpg" WIDTH="35" HEIGHT="35" BORDER=0 ALT="Zum Ende"></A>
<SCRIPT>imgStop=new Image().src='{template_url}/images/a4.jpg';</SCRIPT> </TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</DIV>
</FORM>
{endif countit}
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> {category_dropdown_form}</td>
<td align="right"> </td>
</tr>
</table>
<p> </p>
</td>
<td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
{if countit}
<SCRIPT language="javascript">
with(document){
i=0,play=0,di=images,dl=links,form=slideshow,til=theimage.length
}
slideImage(0);
</SCRIPT>
{endif countit}
{footer}
Gruß Ingo.
http://www.digitalfotograf.com
-
Hallo ich bin mal wieder zu blöde, habe es eigentlich alles so gemacht wie beschrieben aber ich sehe bei der Slideshow keine Bilder, hat es was mit den Kategorien zu tun?
Wäre für jede Art von Hilfe dankbar :oops:
http://www.digitalfotogalerie.de/4images
-
Runtime Error in Line 170
Error : 'transtype' not define.
Runtime Error in Line 276
Error : object require
Please help me to solve the above ERROR.
Jackie
jackie911@so-net.com.hk
Error => http://barndisco.com/album/slideshow.php?action=slideshowlightbox
-
Runtime Error in Line 170
Error : 'transtype' not define.
Runtime Error in Line 276
Error : object require
Please help me to solve the above ERROR.
Jackie
jackie911@so-net.com.hk
Error => http://barndisco.com/album/slideshow.php?action=slideshowlightbox
I have come across this before and 9 times out of 10 it has something to do with some other Javascript you have somewhere in your page.
Just try removing or commenting out any javascript you've added and see if it works then.
If not send me a private messade with a username etc, that I can test it with.
Sorry I couldn't be of more help. :(
Good Luck
Fugaziman 8)
-
bei mir hat sich der Fehler gefunden, ich hatte einfach vergessen das ich einen neuen Ordner "slides" anlegen musste in dem ich dann das slide.js ablegen kann.
vielen Dank an IngoT, der mich darauf aufmerksam machte :P
Gruß, Michael
-
Is it you require the admin username and password to look out the problems.
Runtime Error in Line 170
Error : 'transtype' not define.
Runtime Error in Line 276
Error : object require
Please help me to solve the above ERROR.
Jackie
jackie911@so-net.com.hk
Error => http://barndisco.com/album/slideshow.php?action=slideshowlightbox
I have come across this before and 9 times out of 10 it has something to do with some other Javascript you have somewhere in your page.
Just try removing or commenting out any javascript you've added and see if it works then.
If not send me a private messade with a username etc, that I can test it with.
Sorry I couldn't be of more help. :(
Good Luck
Fugaziman 8)
-
Wie könnte man es machen das bei eine Kategorie die slideshow nicht geht. Geht das über haupt ?
-
hi,
i have videos in 4images too. I want the slideshow disable for videos. What can i do?
-
hi,
i have videos in 4images too. I want the slideshow disable for videos. What can i do?
(I have not installed the mod yet, so do it at your own risk)
in version 2.2. find: if (stristr($image_row['image_media_file'],".jpg") || stristr($image_row['image_media_file'],".jpeg") || stristr($image_row['image_media_file'],".bmp") || stristr($image_row['image_media_file'],".gif")){
replace with: if ($image_info[2] > 0 && $image_info[2] < 4){
-
ja danke, das funzt, aber könnte man den slideshowbutton in dem fall inaktiv machen?
-
Hello All,
FYI
Here's just a little information about the slideshow....
The slideshow is already disable for video and non image files. :)
This is the piece of code (in slideshow.php) that shows what media is allowed....
if (stristr($image_row['image_media_file'],".jpg") || stristr($image_row['image_media_file'],".jpeg") || stristr($image_row['image_media_file'],".bmp") || stristr($image_row['image_media_file'],".gif")){
If you want to allow other media types then you add a line like this
|| stristr($image_row['image_media_file'],".media_ext")
Just before the "){" in the code above.
I have video, mp3s, and flash files that I don't allow in the slideshow, mainly because the files are to large to make a slideshow useful.
The is also a couple of variables that you can set to prevent large resolution images being included in the slideshow..
$max_height = "651";
$max_width = "651";
I use this as many of my images are 1024x768 and it would take to long to load them for people with slow internet connections to work in the slideshow.
Hope that helps
Fugaziman 8)
-
The slideshow is already disable for video and non image files. :)
This is the piece of code (in slideshow.php) that shows what media is allowed....
if (stristr($image_row['image_media_file'],".jpg") || stristr($image_row['image_media_file'],".jpeg") || stristr($image_row['image_media_file'],".bmp") || stristr($image_row['image_media_file'],".gif")){
yes, that's right, exept on some systems it might wot work properly when file has capital letters in the extension (on some systems I belive).
[EDITED]
Thx Fugaziman for the info, I was wrong about that :oops:
maybe I had wroken .mpg files, and it wasnt cause of capital letters in the extension...
stristr -- is Case-insensitive strstr()
(PHP 3>= 3.0.6, PHP 4 )
-
I follow the instructions :
1. created a slideshow.php in the root directory of 4 image script. 2.Created a template file called slideshow.html in my Template directory
3. Created a javascript file called slide.js in a 4 image root directoy/scripts directory (there was no such directory, I created one)
4.Modified categories.php at the 4 image root directory, but (not the categories.php in the admin directory, is that right?)
5.Edited my template categories.html file
6.Didn't change the main.php, I don't use the Alt tags
7.Downloaded my slideshow buttons, put them into templates/image .
Nothing came out, so what's wrong with my mods?Did I miss something? Hope somebody can see what the problem is. :cry:
-
The instruction I followed is one the first page of this post,
What I want the slideshow mod is let the registered user watch detailed pictures of one category in a slideshow way, and user can adjust the speed of slideshow. Just like Gallery 1.33(another image manage system)http://gallery.menalto.com/, I think its slideshow is excellent
-
can viewer have more control? I mean the duration time? Possible to let people to control the duration time?
-
Yes you can :)
:arrow: Edit the slideshow.html file in your template directory
:arrow: Find:
<SCRIPT>imgStop=new Image().src='{template_url}/images/a4.jpg';</SCRIPT>
:arrow: Immediatley after ADD:
<br>Autoplay Speed:<BR>
<INPUT TYPE="button" VALUE=" /\ " CLASS="slideButton" onclick="doSpeed(playdiffernce)" TITLE="+ Speed">
<INPUT TYPE="text" NAME="slidespeed" readonly size=5 onfocus="blur();">
<INPUT TYPE="button" VALUE=" \/ " CLASS="slideButton" onclick="doSpeed(-playdiffernce)" TITLE="- Speed">
<SCRIPT language="javascript">
function doSpeed(num){
if(playspeed+num>0){
playspeed+=num;
form.slidespeed.value=playspeed;
}
}
</SCRIPT>
This will allow users of the slideshow to speed up or slow down the time between each image so they can adjust it to work properly with their internet connection speed.
You can see this working on my site.
Hope that helps
Fugaziman 8)
-
Great!, thanks, man, I will try that. :lol:
-
Fugaziman :(http://www.nowife.com/photo/details.php?image_id=5)
Could you help me when you are available? :(
-
Last pic I want to show you didn't show up, now I tell you what, when the slideshow begins, it will also show left side's register input and random pic, which I don't want it, so how to get rid of this?
Besides, I don't want to dropdown categories and button in the slideshow page, so how to remove that?
http://www.nowife.com/photo/index.php
user: king, pass: king
Thanks a lot. :(
-
By the way, could you tell me how to let the slidshow runs in random sequence, not in date or name order?
Thanks
-
I think this will do it...
Make a backup copy of ./templates/your_templates/slideshow.html
Edit your ./templates/your_templates/slideshow.html
You want to remove several items...
{random_cat_image} - This bit show your random Image
{user_box} - shows the login box
{category_dropdown_form} - show the drop down list box
{setperpage_dropdown_form} - shows images per page drop down list box
If you remove these it should clean up your page as requested.
Just be careful when removing these that the format of your page doesn't change to much. Do one thing at a time and check. You may need to play with your html to get it set out as you want it.
Hope that helps
Fugaziman
-
Anyone still working on this?
I'm trying to use this with 4images 1.7
and I get this error -- it's related to the categories.php mods, when I remove those -- no error (but of course the slideshow doesn't work either).
Parse error: parse error, unexpected '}' in /home/students/public_html/photos/categories.php on line 58
the changed code in categories.php looks like this:
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
$upload_url = "";
$upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&".URL_CAT_ID."=".$cat_id);
$upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
}
//-----------------------------------------------------
//--- Begin SlideShow Change -------------------------------------
//-----------------------------------------------------
$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&".URL_CAT_ID."=".$cat_id);
$slideshow_button = "<a href=\"".$slideshow_url."\"><img src=\"".get_gallery_image("slideshow.gif")."\" border=\"0\" alt=\"\" /></a>";
}
$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;
if ($num_rows_all > 0) {
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
"cat_description" => $cat_cache[$cat_id]['cat_description'],
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"upload_button" => $upload_button,
"slideshow_url" => $slideshow_url,
"slideshow_button" => $slideshow_button,
"random_cat_image" => $random_cat_image
));
}
else {
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
"cat_description" => $cat_cache[$cat_id]['cat_description'],
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"upload_button" => $upload_button,
"random_cat_image" => $random_cat_image
));
//-----------------------------------------------------
//--- End SlideShow Change -------------------------------------
//-----------------------------------------------------
unset($random_cat_image);
//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
-
jo ich hab den gleichen fehler bei 4images 1.71 ... wäre kewl wenn jemand den code daran anpassen könnte ... thx
-
plase help
An unexpected error occured. Please try again later.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/docs/ahmira.com.ar/public_html/includes/db_mysql.php on line 116
:x
-
I dont suppose any one has the image zip file some where do they that they can post please?
I'm just trying to get this mod programmed in and get a blank slideshow page so far but will keep looking. If i cant solve it then i'll come back and ask for help.
Cheers in advance.
-
Hi,
have integrate the slideshow in the lightbox and works fine.
One question:
At the moment it is only possble to view the slideshow when i was logged in
Is it possible to view the slideshow when i was logged out :?:
Search the lightbox images over the user_id
Link like :
www.my-domain.de/slideshow.php?action=slideshowlightbox&user_id=1
Thanks for your help...
cu
Kurt
-
GERMAN:
---------------------------------------------------------------------
Hallo zusammen
Ich habe mir die Slideshow 2 (1.3) installiert (4images 1.7.3).
Die Anweisungen habe ich genau befolgt und nochmals kontrolliert.
Nach der Installation war meine 4images-Galerie nicht mehr abrufbar (leerer Bildschirm).
Ich habe nun alles rückgängig gemacht, leider komme ich nicht mehr auf die Site.....
Slideshow ist nun nicht mehr meine 1. Priorität...ich hätte einfach gerne meine Galerie zurück!!
Irgendwelche Ideen????
Danke!
ENGLISH:
---------------------------------------------------------------------
Hi all
I've installed slideshow 2 (1.3) for 4images (1.7.3).
I made all necessary settings precisely.
After install I wasn't able to connect to my gallery (empty screen).
I've rebuilt all scripts and settings, but still no contact to my site....
Slideshow isn't my first priority now...I just want my old gallery back!!
Any ideas????
Thanks!
-
Hallo,
ein Link zur Page wäre vielleicht hilfreich.
Da laut deiner Aussage nach dem rebuild noch nichts läuft, musst du was übersehen haben.
Gruß
Kurt
-
:oops:
Hallo @all, vielleicht bin ich ja zu blöd, aber ich bekomme keine der Slideshows zum laufen.. :cry: :cry:
Gibt es irgendwo eine fertigen download, der nur in die verzeichnisse zu stellen ist und fertig?? Vielleicht ist ja auch ein user so nett und stellt mir die geänderten dateien zur verfügung. das wäre super geil.......
thx schon mal
-
Ich bin gerade an einer Slideshow dran. Die ersten Gehversuche kann man hier sehen. Ich werde diesen MOD mit einem von Rembrandt kombinieren, damit auch ein wenig Hintergrundgedudel abgespielt wird :-)
http://rinaldos.homeip.net/cat287.htm?l=deutsch
Gruß
Ingo
-
@rinaldos
wie hast du das gemacht? so wie es in deinem Link ist, würde es mir absolut reichen. WIE GEHT DAS ???? kannst du mir das verraten? was muss ich wie ändern und oder hinzufügen?
Gruß liberty
-
i Install but it gives me some error
DB Error: Bad SQL Query: 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, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id = 23 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 25
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in includes\db_mysql.php on line 116.
plz help me to solve this
-
Try to change this
in /categories find:
$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" ;
Replace:
$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
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY i.image_name";
This is good MOD. But i recommended to you try to use this: http://www.4homepages.de/forum/index.php?topic=26815.msg151191#msg151191