• [Mod] Slideshow 4 0 5 1
Currently:  

Author Topic: [Mod] Slideshow  (Read 139931 times)

0 Members and 1 Guest are viewing this topic.

Offline jengwen

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • http://www.jenrichardsphotography.com
[Mod] Slideshow
« Reply #15 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!

Offline jengwen

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • http://www.jenrichardsphotography.com
[Mod] Slideshow
« Reply #16 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.

Offline KleinerDrache

  • Newbie
  • *
  • Posts: 46
    • View Profile
[Mod] Slideshow
« Reply #17 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...

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Slideshow
« Reply #18 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.
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline tango_2002

  • Pre-Newbie
  • Posts: 1
    • View Profile
[Mod] Slideshow
« Reply #19 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

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Slideshow
« Reply #20 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.
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline rustynet

  • Addicted member
  • ******
  • Posts: 1.031
  • {if msg}{msg}{endif msg}
    • View Profile
    • rustynet.de
[Mod] Slideshow
« Reply #21 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 :)

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
Slideshow V2
« Reply #22 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
« Last Edit: August 13, 2005, 07:08:27 AM by V@no »
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
[Mod] Slideshow
« Reply #23 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

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Slideshow
« Reply #24 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)
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline jengwen

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • http://www.jenrichardsphotography.com
[Mod] Slideshow
« Reply #25 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?

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
[Mod] Slideshow
« Reply #26 on: April 01, 2003, 10:30:03 AM »
Now everything works fine!  :D

Thanks again!

Cheers,

Markus

Offline Fugaziman

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.1024x768wallpapers.com
[Mod] Slideshow
« Reply #27 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
Please take time to visit us at ...
http://www.1024x768wallpapers.com
And don't forget to leave a comment or message.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Slideshow
« Reply #28 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
PHP file source

and when u combine them, it shows this.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline matthew

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.seclusion.org
[Mod] Slideshow
« Reply #29 on: April 03, 2003, 02:07:14 AM »
Great Job Fugaziman!!