4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Manfredpaul on December 02, 2002, 09:44:52 AM

Title: [Mod] Slideshow
Post 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
Title: [Mod] Slideshow
Post by: Bastian_W on December 07, 2002, 02:17:31 PM
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:
Code: [Select]

<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:  
Code: [Select]

<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!

Code: [Select]

<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 :-))
Title: Slideshow mod please?
Post by: wishx on December 30, 2002, 08:10:55 AM
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):

Code: [Select]
<?
/*
 * 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>
<? } ?>
Title: [Mod] Slideshow
Post by: wishx on December 30, 2002, 08:10:58 PM
Does anyone want to handle this mod? :)
Title: Please help.
Post by: wishx on January 05, 2003, 02:32:22 PM
Can anyone help with this? Please?
Title: [Mod] Slideshow
Post by: wishx on January 18, 2003, 11:05:16 PM
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?
Title: Re: Please help.
Post by: SLL on January 19, 2003, 01:25:41 AM
Quote from: wishx
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  :)
Title: Slide Show Mod
Post by: Fugaziman on January 20, 2003, 06:44:55 PM
Quote
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 ...
Code: [Select]
if ($user_info['user_level'] >= USER) {
  $slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&amp;".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

Code: [Select]

$slideshow_url = $site_sess->url(ROOT_PATH."slideshow.php?action=slideshow&amp;".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...
Code: [Select]
<?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_id1).$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)< ) 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....
Code: [Select]
{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>&nbsp;
<a href="{url_new_images}"><font class="navtxt">{lang_new_images}</font></a>&nbsp;&nbsp;
</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">&nbsp;</td>
</tr>
        </table>
        <p>&nbsp;</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...

Code: [Select]
// 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.
Code: [Select]
<?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&amp;".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&amp;".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++ % == 0) ? 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&nbsp;\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
Code: [Select]
<td align="right" valign="bottom">{upload_button}</td>
to this
Code: [Select]
<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...
Code: [Select]
$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:
Code: [Select]
Code: [Select]
Quote
Title: [Mod] Slideshow
Post by: wishx on January 21, 2003, 03:46:24 AM
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
Title: [Mod] Slideshow
Post by: Fugaziman on January 21, 2003, 03:33:43 PM
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
Title: [Mod] Slideshow
Post by: gato2k on January 22, 2003, 07:52:25 AM
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.
Title: [Mod] Slideshow
Post by: Fugaziman on January 22, 2003, 03:53:33 PM
Hello gato2k,

Have sent you a private message with the answers to your questions.

Thanks for visiting my site  8)
Title: move to other mod forum
Post by: jengwen on January 25, 2003, 06:30:13 PM
Could someone move this mod to the other mod forum?
Title: [Mod] Slideshow
Post by: V@no on February 04, 2003, 05:29:53 AM
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?
Title: [Mod] Slideshow
Post by: Maweryk on February 04, 2003, 12:36:52 PM
Delete the line
Code: [Select]
<?php include&#40;"slide_newman.php"&#41;; ?>
and everything works fine.

CU

Markus
Title: [Mod] Slideshow
Post by: jengwen on March 14, 2003, 05:26:55 AM
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!
Title: [Mod] Slideshow
Post by: jengwen on March 15, 2003, 09:53:43 PM
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.
Title: [Mod] Slideshow
Post by: KleinerDrache on March 24, 2003, 04:48:30 PM
Hi,

der Mod läuft super aber wie bekomme ich mein Logo noch oben hin. Das fehlt da leider.
Also der Header halt...
Title: [Mod] Slideshow
Post by: Fugaziman on March 25, 2003, 03:27:25 AM
Quote from: jengwen
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.
Title: [Mod] Slideshow
Post by: tango_2002 on March 25, 2003, 09:12:18 AM
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
Title: [Mod] Slideshow
Post by: Fugaziman on March 25, 2003, 05:39:23 PM
Quote from: 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
Code: [Select]
$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.
Title: [Mod] Slideshow
Post by: rustynet on March 31, 2003, 12:50:20 PM
(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 :)
Title: Slideshow V2
Post by: Fugaziman on March 31, 2003, 11:25:17 PM
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...

 
Code: [Select]
<?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_id1).$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'])< ) 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
Title: [Mod] Slideshow
Post by: Maweryk on March 31, 2003, 11:50:02 PM
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
Title: [Mod] Slideshow
Post by: Fugaziman on April 01, 2003, 02:30:34 AM
Quote from: Maweryk
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)
Title: [Mod] Slideshow
Post by: jengwen on April 01, 2003, 06:50:56 AM
Quote
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?
Title: [Mod] Slideshow
Post by: Maweryk on April 01, 2003, 10:30:03 AM
Now everything works fine!  :D

Thanks again!

Cheers,

Markus
Title: [Mod] Slideshow
Post by: Fugaziman on April 01, 2003, 04:32:03 PM
Quote from: jengwen
Quote
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
Title: [Mod] Slideshow
Post by: V@no on April 02, 2003, 05:52:05 AM
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).
Title: [Mod] Slideshow
Post by: matthew on April 03, 2003, 02:07:14 AM
Great Job Fugaziman!!
Title: [Mod] Slideshow
Post by: Snooky on April 03, 2003, 10:32:29 PM
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
Title: [Mod] Slideshow
Post by: Fugaziman on April 03, 2003, 10:42:00 PM
Quote from: Snooky
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
Title: [Mod] Slideshow
Post by: Maweryk on April 04, 2003, 08:33:05 PM
Quote from: V@no
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:
Title: Lightbox Slideshow
Post by: geza on April 17, 2003, 09:43:46 AM
(sorry for my poorly english)

how is ist possible to make lightbox-slideshow?
Title: SLIDE SHOW NOW WORKS WITH LIGHTBOX/ALBUM
Post by: Fugaziman on April 19, 2003, 05:24:12 AM
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
Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; slideshow.php                                        *
 *        Copyright&#58;                                   *
 *            Email&#58;                                        *
 *              Web&#58;                                *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *                                                                        *
 *************************************************************************/

$templates_used 'slideshow';
$main_template 'slideshow';

define&#40;'GET_CACHES', 1&#41;;
define&#40;'ROOT_PATH', './'&#41;;
define&#40;'MEDIA_DIR', 'data/media'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;
include&#40;ROOT_PATH.'includes/page_header.php'&#41;;

//-----------------------------------------------------
// 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 &#40;$action == "slideshow"&#41; &#123;
if &#40;!$cat_id || !isset&#40;$cat_cache[$cat_id&#93;&#41; || !check_permission&#40;"auth_viewcat", $cat_id&#41;&#41; &#123;
header&#40;"Location&#58; ".$site_sess->url&#40;ROOT_PATH."index.php", "&"&#41;&#41;;
exit;
&#125;

if &#40;$cat_id && isset&#40;$cat_cache[$cat_id&#93;&#41;&#41; &#123;
    
$txt_clickstream .= get_category_path&#40;$cat_id, 1&#41;.$config['category_separator'&#93;;
&#125;
&#125;

if &#40;$action == "slideshowlightbox"&#41; &#123;
// $txt_clickstream = $lang['lightbox'&#93;;
$txt_clickstream "<a href=\"".$site_sess->url&#40;ROOT_PATH."lightbox.php"&#41;."\" class=\"clickstream\">".$lang['lightbox'&#93;."</a>";
&#125;

$msg "";

//-----------------------------------------------------
//--- New Slide Show ----------------------------------
//-----------------------------------------------------

$main_template  'slideshow';
$random_cat_image = &#40;defined&#40;"SHOW_RANDOM_IMAGE"&#41; && SHOW_RANDOM_IMAGE == 0&#41; ? "" &#58; get_random_image&#40;$cat_id&#41;;

$additional_sql "";
$countit  0;
$file_array  "theimage[0&#93;=[' ','";
$additional_sql "";

$image_id_sql str_replace&#40;" ", ", ", trim&#40;$user_info['lightbox_image_ids'&#93;&#41;&#41;;

if &#40;$action == "slideshow"&#41;&#123;
$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&#40;", u.", "user_name"&#41;." 
        
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND i.cat_id $cat_id AND c.cat_id i.cat_id 
        ORDER BY i
.image_name" ;
&#125;
else &#123;
if &#40;!empty&#40;
$user_info['lightbox_image_ids'&#93;&#41;&#41;  &#123;
$sql = "SELECT i.image_idi.cat_idi.user_idi.image_namei.image_descriptioni.image_keywordsi.image_datei.image_activei.image_media_filei.image_thumb_filei.image_download_urli.image_allow_commentsi.image_commentsi.image_downloadsi.image_votesi.image_ratingi.image_hits".$additional_sql."c.cat_name".get_user_table_field&#40;"u.", "user_name"&#41;." 
        
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41;  
        
WHERE image_active AND image_id IN &#40;$image_id_sql&#41; AND c.cat_id = i.cat_id AND i.cat_id IN &#40;".get_auth_cat_sql&#40;"auth_viewcat"&#41;."&#41; 
        
ORDER BY i.image_name" ;
&#125;&#125;

if &#40;
$sql == ""&#41;&#123;
$num_rows = "";&#125;
else &#123;  
$result  $site_db->query&#40;$sql&#41;;
$num_rows  $site_db->get_numrows&#40;$result&#41;;
&#125;

if &#40;!
$num_rows&#41;  &#123;
$msg = "<div align=\"center\"> Sorry but there are no suitable images available for a slideshow. <br>Please try another category</div>";
&
#125;
else &#123;
while &#40;$image_row = $site_db->fetch_array&#40;$result&#41;&#41;
&#123; 
    
if &#40;!is_remote&#40;$image_row['image_media_file'&#93;&#41;&#41; &#123;
      
$image_info = @getimagesize&#40;&#40;MEDIA_PATH."/".$image_row['cat_id'&#93;."/".$image_row['image_media_file'&#93;&#41;&#41;; 
      
$width $image_info[0&#93;;
      
$height $image_info[1&#93;;
    
&#125; 

    
$slideshow_id MEDIA_PATH."/".$image_row['cat_id'&#93;."/";

    
if &#40;$width  >= $max_width&#41; continue;
    
if &#40;$height >= $max_height&#41; continue;

if &#40;stristr&#40;$image_row['image_media_file'&#93;,".jpg"&#41; || stristr&#40;$image_row['image_media_file'&#93;,".jpeg"&#41; || stristr&#40;$image_row['image_media_file'&#93;,".bmp"&#41; || stristr&#40;$image_row['image_media_file'&#93;,".gif"&#41;&#41;&#123;
$countit $countit 1;
if &#40;stristr&#40;$image_row['image_media_file'&#93;,'http'&#41;&#41;
&#123;
   
$file_array $file_array."".$image_row['image_media_file'&#93;. "','./details.php?image_id=".$image_row['image_id'&#93;. " '&#93;; theimage[".$countit."&#93;=[' ','"; 
&#125;
else 
&#123;
   
$file_array $file_array."".$slideshow_id."".$image_row['image_media_file'&#93;. "','./details.php?image_id=".$image_row['image_id'&#93;. " '&#93;; theimage[".$countit."&#93;=[' ','"; 
&#125;
&#125;
&#125;


$file_array substr&#40;"$file_array", 0, -19&#41;; 
if &#40;!$countit&#41;  &#123;
$msg "<div align=\"center\"> Sorry but there are no suitable images available for a slideshow. <br>Please try another category</div>";
&
#125;
&#125;

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\" class=\"clickstream\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.$txt_clickstream."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"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'&#93;
&#41;&#41;;

unset&#40;$random_cat_image&#41;;
unset&#40;$file_array&#41;;
unset &#40;$countit&#41;;

$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;
include&#40;ROOT_PATH.'includes/page_footer.php'&#41;;
?>



 :arrow: Make a copy of your lightbox.php file (just in case)
 :arrow: Edit lightbox.php
 :arrow: Search for
Code: [Select]

if (!$num_rows)  {
  $thumbnails = "";
  $msg .= ($msg != "") ? "<p>".$lang['lightbox_no_images'] : $lang['lightbox_no_images'];


 :arrow: Replace with
Code: [Select]

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
Code: [Select]

$thumbnails .= "</table>\n";


 :arrow: Replace with
Code: [Select]

  $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
Code: [Select]

$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

Code: [Select]

$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
Code: [Select]
{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.
Title: [Mod] Slideshow
Post by: geza on April 19, 2003, 12:27:50 PM
thank you! ist great!
Title: [Mod] Slideshow
Post by: Bany on April 21, 2003, 12:32:31 PM
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
Title: [Mod] Slideshow
Post by: Snooky on April 27, 2003, 06:02:26 PM
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?
Title: [Mod] Slideshow
Post by: Fugaziman on April 27, 2003, 06:22:19 PM
Quote from: Snooky
.... 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...
Code: [Select]
<A HREF="#" onmouseover="this.href=theimage[i][2];return false">
3)replace with...
Code: [Select]
<A HREF="#">

I must admit I haven't tested this but it should work  :wink: .
Fugaziman
Title: [Mod] Slideshow
Post by: Snooky on April 28, 2003, 02:34:44 PM
thanks.... works great and now everythings fine!!!!  :lol:
Title: new Buttons / neue Button
Post by: IngoT on April 30, 2003, 01:57:50 PM
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)

Code: [Select]

{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>&nbsp;
                <a href="{url_new_images}"><font class="navtxt">{lang_new_images}</font></a>&nbsp;&nbsp;
            </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&#40;"d.m.Y, H&#58;i"&#41;;  
          
?>

                  </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">&nbsp;</td>
    </tr>
        </table>
        <p>&nbsp;</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
Title: zu blöd?
Post by: Michael on May 01, 2003, 10:46:03 PM
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
Title: Slideshow for 4images 1.7
Post by: jackie911 on May 02, 2003, 04:52:26 AM
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
Title: Re: Slideshow for 4images 1.7
Post by: Fugaziman on May 02, 2003, 07:00:52 AM
Quote from: jackie911
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)
Title: Fehler behoben
Post by: Michael on May 02, 2003, 10:18:02 AM
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
Title: Re: Slideshow for 4images 1.7
Post by: jackie911 on May 02, 2003, 11:54:27 AM
Is it you require the admin username and password to look out the problems.


Quote from: Fugaziman
Quote from: jackie911
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)
Title: [Mod] Slideshow
Post by: Bany on May 02, 2003, 06:04:33 PM
Wie könnte man es machen das bei eine Kategorie die slideshow nicht geht. Geht das über haupt ?
Title: @Fugaziman
Post by: geza on May 04, 2003, 10:10:44 AM
hi,
i have videos in 4images too. I want the slideshow disable for videos. What can i do?
Title: Re: @Fugaziman
Post by: V@no on May 04, 2003, 11:45:10 AM
Quote from: geza
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:
Code: [Select]
   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:
Code: [Select]
   if ($image_info[2] > 0 && $image_info[2] < 4){
Title: [Mod] Slideshow
Post by: geza on May 04, 2003, 12:16:34 PM
ja danke, das funzt, aber könnte man den slideshowbutton in dem fall inaktiv machen?
Title: Slideshow Media
Post by: Fugaziman on May 04, 2003, 05:27:46 PM
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..
Code: [Select]
$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)
Title: Re: Slideshow Media
Post by: V@no on May 04, 2003, 06:00:20 PM
Quote from: Fugaziman
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...
Quote from: Fugaziman
stristr -- is Case-insensitive strstr()
(PHP 3>= 3.0.6, PHP 4 )
Title: [Mod] Slideshow
Post by: noyou on May 12, 2003, 01:39:13 AM
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:
Title: [Mod] Slideshow
Post by: noyou on May 12, 2003, 01:48:56 AM
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
Title: [Mod] Slideshow
Post by: noyou on May 13, 2003, 07:32:00 PM
can viewer have more control? I mean the duration time? Possible to let people to control the duration time?
Title: Speed control for slide show
Post by: Fugaziman on May 13, 2003, 11:12:08 PM
Yes you can   :)

 :arrow: Edit the slideshow.html file in your template directory
 :arrow: Find:
Code: [Select]
<SCRIPT>imgStop=new Image().src='{template_url}/images/a4.jpg';</SCRIPT>

 :arrow: Immediatley after ADD:
Code: [Select]
<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)
Title: [Mod] Slideshow
Post by: noyou on May 14, 2003, 06:39:00 PM
Great!, thanks, man, I will try that. :lol:
Title: [Mod] Slideshow
Post by: noyou on May 17, 2003, 06:06:04 PM
Fugaziman :(http://www.nowife.com/photo/details.php?image_id=5)

Could you help me when you are available? :(
Title: [Mod] Slideshow
Post by: noyou on May 17, 2003, 06:12:12 PM
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. :(
Title: [Mod] Slideshow
Post by: noyou on May 17, 2003, 06:16:45 PM
By the way, could you tell me how to let the slidshow runs in random sequence, not in date or name order?

Thanks
Title: Here's the answer
Post by: Fugaziman on May 17, 2003, 06:23:38 PM
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
Title: Re: [Mod] Slideshow
Post by: redhead_tn on March 16, 2005, 09:40:47 PM
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).

Code: [Select]
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:

Code: [Select]
//-----------------------------------------------------
//--- 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&amp;".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&amp;".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 -------------------------------------
//-----------------------------------------------------
Title: Re: [Mod] Slideshow
Post by: DirtyCycloN on March 24, 2005, 08:17:12 PM
jo ich hab den gleichen fehler bei 4images 1.71 ... wäre kewl wenn jemand den code daran anpassen könnte ... thx
Title: Re: [Mod] Slideshow
Post by: theolbap on September 07, 2006, 12:18:57 AM
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
Title: Re: [Mod] Slideshow
Post by: zaine68 on November 15, 2006, 09:45:58 PM
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.
Title: Re: [Mod] Slideshow
Post by: KurtW on January 07, 2007, 11:18:13 AM
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
Title: Re: [Mod] Slideshow
Post by: rangitoto on February 14, 2007, 09:08:01 PM
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!
Title: Re: [Mod] Slideshow
Post by: KurtW on February 28, 2007, 02:54:09 PM
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
Title: Re: [Mod] Slideshow
Post by: liberty on August 12, 2009, 04:12:44 PM
 :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
Title: Re: [Mod] Slideshow
Post by: rinaldos on August 12, 2009, 05:06:31 PM
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
Title: Re: [Mod] Slideshow
Post by: liberty on August 13, 2009, 03:07:30 AM
@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
Title: Error Repor
Post by: wasimkhan on September 25, 2010, 05:53:34 AM
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
Title: Re: [Mod] Slideshow
Post by: MrAndrew on October 01, 2010, 11:05:15 PM
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