• Different download options / Verschiedene Download Möglichkeiten 5 0 5 1
Currently:  

Author Topic: Different download options / Verschiedene Download Möglichkeiten  (Read 168539 times)

0 Members and 2 Guests are viewing this topic.

Offline skink

  • Newbie
  • *
  • Posts: 34
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #15 on: September 24, 2002, 07:50:36 AM »
oops, maybe I should think it over about wearing my glasses  :oops:

I've got one question to go. How do you get the buttons to look blurred? I mean which option do you use with photoshop (in case you use that programm at all)?

Thanks again for your help and patience with dummies like me. ;-)

Steve

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Different download options / Verschiedene Download Möglichke
« Reply #16 on: September 24, 2002, 08:43:16 AM »
Open the normal button in Photoshop, duplicate the background layer, fill the background layer with white and set the transparency of the duplicated layer to 50%.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline skink

  • Newbie
  • *
  • Posts: 34
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #17 on: September 25, 2002, 09:03:08 AM »
Hey Jan,

I'm finally getting into programming with php.  :lol:

I just modified the code you gave me with a new feature. Instead of just showing a blurred "download button" when an image is not available, it now shows a blurred "not available button".  This even works when the user has guest status.

Question: I noticed that the download statistics (control panel) doesn't work anymore with this new piece of code. Is there a work around for this?

Steve

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Different download options / Verschiedene Download Möglichke
« Reply #18 on: September 25, 2002, 09:52:19 AM »
Are you sure? Note: Admin downloads will not be counted!

Greets Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline skink

  • Newbie
  • *
  • Posts: 34
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #19 on: September 25, 2002, 12:14:04 PM »
Sorry, your right. I didn't realize that admin downloads were not counted.

Steve

Offline Fox Mulder

  • Newbie
  • *
  • Posts: 13
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #20 on: October 07, 2002, 03:55:02 PM »
I also uses this script right now but when i tried it i had 3 new download
buttons which all look the same so i changed the script a bit like this:

befor:
Code: [Select]
"<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />"

after:
Code: [Select]
"<img src=\"".get_gallery_image("download_off_$size.gif")."\" border=\"0\" alt=\"\" />"

And this change had to be done for each "<img src...>" line. Then i
created new buttons like "download_off_75.gif", "download_75.gif",
"download_zip_off_75.gif", "download_zip_75.gif" and this for all
three resolutions. Now i have 3 different buttons for each download link.
Therefor i won't have to write a text description next to the button
because i named the buttons inside "Download 75dpi" for example. :)
Maybe someone wants to do this so i wrote it.

Ciao,
Fox

Offline Kollega

  • Pre-Newbie
  • Posts: 9
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #21 on: November 29, 2002, 02:10:46 PM »
ok - all things discussed in these topic done and running - but

when i "check new images" in the admin menue - i´m going to find all new added 'picture_150.jpg'

is it possible to exclude all images ending with *_150.jpg in /admin/checkimages.php - so my pictures are only with "normal" names checked & listed in the Database?

att all - great script! take care

Offline Fox Mulder

  • Newbie
  • *
  • Posts: 13
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #22 on: November 29, 2002, 02:32:10 PM »
Hmm i got the same problem when chekcking new images that i find
also the _75 and all other resolutions.
At the moment i check manually only the wanted new images when
i do a "check for new images" or i first copy the low res images in the
folder, check them in and after that i copy the high-res images in
the folder so them are not found by "check for new images".

Offline Kollega

  • Pre-Newbie
  • Posts: 9
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #23 on: November 29, 2002, 02:56:43 PM »
o.k. I see! but if u add only one new image in this categorie u are going to get the whole list for "new" images - including the _150.jpg

an easier way is to check images and then deaktivate them before adding to database! so the db have all images listed but only the low resolution is shown for the users! - isn´t it?  :?:

Offline Fox Mulder

  • Newbie
  • *
  • Posts: 13
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #24 on: November 29, 2002, 03:17:16 PM »
Hehe i think so, but i can't programm php so this had to be done by Jan.
I only do copy&paste and some minor changes to get this whole thing to
work. ;)

Offline Kollega

  • Pre-Newbie
  • Posts: 9
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #25 on: November 29, 2002, 03:39:04 PM »
@Fox Mulder

only my first post needs to be done in php
the second suggestion is already possible in V1.7 - go in admin menue - check for new images - take all images to "add images" and mark the option "deaktivate"  for the *_75.jpg ore *_150.jpg! the images will be added to ur database but will not be shown - not ur users and not you if u ckeck again in this categorie for new images!

but an exclusion in php would be the better way i think - cause u will go into trouble with the "auto image resizer"! great trouble!
have fun! 8O

Offline MrWante

  • Newbie
  • *
  • Posts: 11
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #26 on: February 04, 2003, 12:40:43 AM »
Thanx for this mod...

I have a suggestion... I am trying to mod this so that instead of having to put the same files in the same folder with a new extension, one could make a new folder called 150 or 300... (in my case for resolution, like 800 and 1024)

I have managed for it to find if there is a file with the same name in the folder, but I just can't seem to get new version of the picture from a different folder when clicking on the icon...

Still trying... but I am sadly not very good at php... yet...
Anyone else can do this??

If I succed I will post it here.... if not... well....

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
Different download options / Verschiedene Download Möglichke
« Reply #27 on: February 04, 2003, 02:16:08 AM »
if anyone interesting use different folders for different size images, then here is modifyed mod:
change original mod code to this:
Code: [Select]
 $additional_download_sizes = array(72, 120, 300);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);

I dont know if size= also uses somewhere else, so I just add one more, size2=
so, then open download.php file.
find
Code: [Select]
 if (isset($HTTP_GET_VARS['size']) || isset($HTTP_POST_VARS['size'])) {
    $size = (isset($HTTP_GET_VARS['size'])) ? intval($HTTP_GET_VARS['size']) : intval($HTTP_POST_VARS['size']);
  }
  else {
    $size = 0;
  }
add after:
Code: [Select]
 if (isset($HTTP_GET_VARS['size2']) || isset($HTTP_POST_VARS['size2'])) {
    $size2 = (isset($HTTP_GET_VARS['size2'])) ? intval($HTTP_GET_VARS['size2']) : intval($HTTP_POST_VARS['size2']);
  }
  else {
    $size2 = 0;
  }

then find:
Code: [Select]
   $file['file_path'] = dirname($image_row['image_media_file'])."/".$file['file_name'];
change to this:
Code: [Select]
   $file['file_path'] = dirname($image_row['image_media_file'])."/".(($size2) ? $size2."/" : "").$file['file_name'];
few lines down find:
Code: [Select]
   $file['file_path'] = (is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/".$file['file_name'] : MEDIA_PATH."/".$image_row['cat_id']."/".$file['file_name'];
change to this:
Code: [Select]
   $file['file_path'] = (is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/".(($size2) ? $size2."/" : "").$file['file_name'] : MEDIA_PATH."/".$image_row['cat_id']."/".(($size2) ? $size2."/" : "").$file['file_name'];
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 Clow Read

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://vectorcandy.com
Different download options / Verschiedene Download Möglichke
« Reply #28 on: February 06, 2003, 01:53:17 AM »
interesting mod but could you help me make the same mod but without the licensing thingy and be able to use different folders for different image sizes???

Offline MrWante

  • Newbie
  • *
  • Posts: 11
    • View Profile
Different download options / Verschiedene Download Möglichke
« Reply #29 on: February 06, 2003, 02:29:54 AM »
Thank you V@no, for that modification to the mod!!

With some modding of my own, I got it working the way I wanted it... though yours did most of the work...

The problem is if you want to use a folder that is not an integer, that is a whole number. That is because intval is used... So, I remover that from.... this... part

Code: [Select]
 if (isset($HTTP_GET_VARS['size2']) || isset($HTTP_POST_VARS['size2'])) {
    $size2 = (isset($HTTP_GET_VARS['size2'])) ? intval($HTTP_GET_VARS['size2']) : intval($HTTP_POST_VARS['size2']);
  }
  else {
    $size2 = 0;
  }


I changed it to...

Code: [Select]
if (isset($HTTP_GET_VARS['size2']) || isset($HTTP_POST_VARS['size2'])) {
    $size2 = (isset($HTTP_GET_VARS['size2'])) ? ($HTTP_GET_VARS['size2']) : ($HTTP_POST_VARS['size2']);
  }
  else {
    $size2 = 0;
  }


This way it doesn't matter if you use "1024" or "big" as the foldername....

The reason I wanted this is that I wanted to combine it with V@no's hack...
[Mod] Show original image in new window by clicking on image!

In that mod there is a folder is named big and put into the same folder as the images(1,2,3,4...). In the big folder images are put that are (surprisingly) bigger (could of course use smaller too, but what would the point be) Then that image will pop up in a new window... Great mod, I got it working!

Now, I also wanted the option to have a download button for big and also maybe other sizes like 1024 and so on...

But in the big modification there is no extension _big placed after each imagename (and no reason to if you have it in a different foler)... so I had to remove some code from this one as well...

 
Code: [Select]
$additional_download_sizes = array(72, 120, 300);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);


this I changed to...

 
Code: [Select]
 $additional_download_sizes = array(800, 1024, 1280, 1600, big);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size)."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);


The difference lies in that I don't want to send the size value, only the size2 value because size gives the "_big" extension and size2 the name of the folder... I guess it could be changed more, to take away that function all together, but this was an easy change...

so the thing I removed was
Code: [Select]
."&amp;size=".$size from 2 places...

Of course you might want to incorporate Fox Mulder's change to have seperate buttons made for each SIZE or in this case foldername... then the code would look like this... (remember to make buttons named "download_(foldername).gif" and "download_zip_(foldername).gif" Same thing for the ones with "_off". In my case I made an image called "download_big.gif" and one called "download_off_big.jpg)

Code: [Select]
 $additional_download_sizes = array(800, 1024, 1280, 1600, big);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off_$size.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off_$size.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size)."\"".$target."><img src=\"".get_gallery_image("download_$size.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip_$size.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);



Now, I can have a folder named big that works with other mod, I also now have the option of having a download button for getting the biggest file placed in the big folder...
I also have the option of having different folders with different sizes, and downloadbuttons for them...

All in all! I am very pleased!

We are here to share... right??

Thanx!