Author Topic: How to disable Lite Box for videos?  (Read 6608 times)

0 Members and 1 Guest are viewing this topic.

Offline rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
How to disable Lite Box for videos?
« on: June 07, 2003, 11:52:33 PM »
have some large vids on my gallery and about 50 of them

noticed that members can easily download all the vids in one go approx 300mb

zipping them up and downloading will cause immenese server load. one of reasons why my gallery is working too slow!

any way to disable lite box for a certain cat or certain file type?

thanks

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
How to disable Lite Box for videos?
« Reply #1 on: June 08, 2003, 03:32:17 AM »
Why not just kill the ability to zip the lightbox?  Just remove the zip button from lightbox.html

Offline rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
How to disable Lite Box for videos?
« Reply #2 on: June 08, 2003, 08:15:37 AM »
But I want the lightbox for images. just not for vids as they are large in size.

anyone can download the whole vid collection by selecting all the vids and as one big 300-400mb zip file

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
How to disable Lite Box for videos?
« Reply #3 on: June 08, 2003, 05:21:58 PM »
ok, here is what u need to do:
open /download.php
find:
Code: [Select]
if (!empty($file_path)) {
add before:
Code: [Select]
$exclude = array("avi", "mpg", "mpeg", "mp3", "zip");
ereg("(.+)\.(.+)", basename($file_path), $regs);
if (in_array(strtolower($regs[2]), $exclude)) {
  continue;
}

add in the $exclude array as many extensions, that u dont want be included into the package, as u want.

that's it ;)
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 Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
How to disable Lite Box for videos?
« Reply #4 on: June 08, 2003, 08:16:35 PM »
Quote from: rohanrohanrohan
But I want the lightbox for images. just not for vids as they are large in size.

anyone can download the whole vid collection by selecting all the vids and as one big 300-400mb zip file

So you don't want the ability to download videos one at a time from the lightbox?  The zip feature is only useful to package up multiple files and download them in a single archive.  For jpgs and other media, zip doesn't provide any significant compression as jpegs are already compressed.

If you exclude the file type, users won't even be able to add just one video to their lightbox and download just the one video.  Just thought I'd add this info in case it might help someone.

Offline rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
How to disable Lite Box for videos?
« Reply #5 on: June 09, 2003, 06:16:54 PM »
thanks veno. howevever that code still adds the videos to the lightbox. although it doesnt downlaod them

any way to stop them being selected frm being added to lightbox in first place?

like disabling the lighbox button for vids, i.e of certain file types?

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
How to disable Lite Box for videos?
« Reply #6 on: June 09, 2003, 10:14:42 PM »
ah, ok...:? (personaly I dont see any advantage of not let ppl fully use lightbox...)

open /includes/functions.php
find:
Code: [Select]
 if ($user_info['user_level'] != GUEST) {
    $lightbox_url = $self_url;

replace with:
Code: [Select]
 $exclude = array("avi", "mpg", "mpeg", "mp3", "zip");
  ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
  if ($user_info['user_level'] != GUEST && !in_array(strtolower($regs[2]), $exclude)) {
    $lightbox_url = $self_url;
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 rohanrohanrohan

  • Full Member
  • ***
  • Posts: 200
    • View Profile
How to disable Lite Box for videos?
« Reply #7 on: June 09, 2003, 11:07:22 PM »
ooh yes veno!! u are the man!

superb!