Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 08:25

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Download Button
PostPosted: 9. Jan 2010, 12:25 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
Hi,

Is it possible to set it up so that there is a small download icon next to the print and slideshow icons that allow all users to download the image they are viewing.

At the moment, if users right click > save as on the intermediate image then they download a non- full size version and after that, the image loads in a lightbox.

Cheers

Simon

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 9. Jan 2010, 12:41 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
You can set that a download box appears when the user clicks on the image - just check the additional options for downloading in the config.php.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 9. Jan 2010, 12:55 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
At the moment, my config looks like:
Code:
$enable_download = true;               
$enable_download_counter=true;       
$enable_direct_download=false;     
$open_as_popup=false;               
$click_on_popup_dl_image = true;   
$open_download_in_browser = true;
$open_in_maximized_view=false;
$open_download_in_new_window=true;
$enable_download_as_zip=true;   


I like the way that when the user clicks for full size it loads in lightbox, but am wanting either a button or link that downloads the files and asks the user where to save them.[/code]

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 9. Jan 2010, 16:44 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
So you want to keep the lightbox?

Then you can use an image.php to generate an extra download link.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 9. Jan 2010, 23:34 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
Yeah,

Im wanting to keep the lightbox, i love that feature! When you say create an image.php what exactly do you mean? Is this an extra file that needs to go inside the pictures folder?

Si.

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 9. Jan 2010, 23:57 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
yes - there is a howto about image.txt - read howto 0 there you find a link to the right howto.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 10. Jan 2010, 17:04 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
Hi,

Thanks for your help. So far i have only set this up for one of my albums until i know it is all working properly.

I have just one more question. At the moment, the code in my image.php file is:

Code:
<?php
   //variables used
   $dir = "pictures/";
   $year = "2009/";
   $type = "Photos/";
   $folder = "0/";
   $file = "$image";
?>
<a target="_blank" href="<?php echo $dir;?><?php echo $year;?><?php echo $type;?><?php echo $folder;?><?php echo $file;?>">Download a copy of this image</a>


and it looks like this. It puts the link underneath the caption but the lightbox still works! :)

#removed_broken_link (its a album specific links as this is the only one where i have implemented it as of yet!)

I know i still need to put the security bit at the top. However, is it possible to make it so that the album ($folder) is a variable like the image ($file) is. This way, i can put the same file into all my albums from one year!

Many Thanks for your help so far,

Simon[/url][/code]

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 10. Jan 2010, 17:46 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
sure:

$directory

contains the directory. In the final if 1.8 I even offer a better ways but this is not documented yet :(.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 10. Jan 2010, 18:00 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
Thanks,

Ill have a play later when i get home on my proper computer and let you know how i get on!

Thanks for your help

Simon

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 10. Jan 2010, 19:35 
Offline
User avatar

Joined: 20. May 2009, 11:46
Posts: 38
Ive now updated my code to have just $directory and $file since the directory takes care of the other variables i initially had :wink: - excellent thankyou!

It now looks like:

Code:
<?php
defined( '_VALID_TWG' ) or die( 'Direct Access to this location is not allowed.' );
   //variables used
   $dir = "pictures/";
   $year = "2009/";
   $type = "Photos/";
   $folder = "$directory/";
   $file = "$image";
?>
<a style="font-weight: bold;" target="_blank" href="<?php echo $folder;?><?php echo $file;?>">Download a copy of this image</a><img
 style="border: 0px solid ; width: 25px; height: 25px;"
 alt="Download Image Icon"
 src="#removed_broken_link/buttons/downloads/download_image.gif">


and everything works as it should.
Thankyou so very much for your help,

Simon. :D

_________________
Simon Tickle
www.anyhowracing.co.uk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 42 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy