• [MOD] Multi Size Download of same image [ver 4.7] 5 0 5 1
Currently:  

Author Topic: [MOD] Multi Size Download of same image [ver 4.7]  (Read 431908 times)

0 Members and 1 Guest are viewing this topic.

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.5]
« Reply #300 on: February 18, 2013, 07:21:02 AM »
Hello

I have problem to insert tag {prepend_head_title}, it show blank instead of image name.
Don't know why its not work in "multi_popup.html" but it work fine in other places.

Please help

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.5]
« Reply #301 on: February 19, 2013, 12:17:25 AM »
Hello

I have problem to insert tag {prepend_head_title}, it show blank instead of image name.
Don't know why its not work in "multi_popup.html" but it work fine in other places.

Please help

I have updated the original code to version 4.6...
in the instructions, look for the last replace in the download.php file and replace it with the updated code.
Let me know if that works or not because I have not tested it yet on my end.
Buddy Duke
www.budduke.com

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #302 on: February 19, 2013, 10:22:20 PM »
Quote
I have updated the original code to version 4.6...
in the instructions, look for the last replace in the download.php file and replace it with the updated code.
Let me know if that works or not because I have not tested it yet on my end.


Its not worked.  it only show - of code "prepend_head_title"        => $image_name . " - "

Like this - sitename

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #303 on: February 20, 2013, 12:25:19 AM »
@kar76,
I must have fell asleep while doing that one. I modified my original code again...
in the download.php file look for this area
Quote
Also on the first line of the "look for" code above (new replace for version 4.4)
add new code to the end of the first line so it looks like this (Updated the code for version 4.6)
I added the ,image_name to that line of code

Now it should be working for you. I tested it on my test server just to make sure  :oops:
Buddy Duke
www.budduke.com

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #304 on: February 20, 2013, 09:07:13 AM »
Yes it working now.

And more problem i noticed in this mode, it related to "0=dropdown"  links.
I noticed that when someone access dropdown links trough mobiles it download nothing
« Last Edit: February 20, 2013, 08:27:15 PM by kar76 »

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #305 on: February 26, 2013, 06:36:24 AM »
Does anyone know why drop down menu link download nothing (0 files ) , when download by mobiles.

I use "0=dropdown" option and check it through mobile "Samsung c3312"  and found that no image are downloading, instead it show blank files in mobile.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #306 on: February 27, 2013, 12:23:19 AM »
Does anyone know why drop down menu link download nothing (0 files ) , when download by mobiles.

I use "0=dropdown" option and check it through mobile "Samsung c3312"  and found that no image are downloading, instead it show blank files in mobile.

Sorry, did not see your edit on the post above this one...
I tested it with my android phone and you are correct. I have been researching, trying to figure out what the difference is between a mobile phone browser and a desktop but not having much luck. It seems the mobile does not get the file size when using the dropdown list but the desktop does.
I do not have any time to play with the code till the weekends but will post it when I figure it out. Unless someone else has a quick idea they can post/PM me?
Buddy Duke
www.budduke.com

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #307 on: February 27, 2013, 11:14:49 AM »
is there major difference between between drop down  links and text link?
Text links work fine, only problem occurred by drop down  links.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #308 on: February 28, 2013, 12:05:56 AM »
is there major difference between between drop down  links and text link?
Text links work fine, only problem occurred by drop down  links.

The dropdown list is submitting a form to the code instead of a download link. Not sure if that is where the problem is or not for the mobile browsers.

Update: If you install the opera mini browser on your phone it works fine with the dropdown lists so it does appear that there are limitations in the other browsers on the phones from what I have been reading. Will look into it further to see if there is a workaround that I can come up with.
« Last Edit: February 28, 2013, 12:45:58 AM by budduke »
Buddy Duke
www.budduke.com

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #309 on: February 28, 2013, 05:58:07 AM »
Quote
If you install the opera mini browser on your phone it works fine with the dropdown lists

I don't know about latest opera mini but i have version 6.5.27510 which also show empty file. And i can not update it 8O
I update it before and my browser started to malfunction so i reset to original.

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.6]
« Reply #310 on: March 02, 2013, 07:31:24 PM »
Quote
If you install the opera mini browser on your phone it works fine with the dropdown lists

I don't know about latest opera mini but i have version 6.5.27510 which also show empty file. And i can not update it 8O
I update it before and my browser started to malfunction so i reset to original.

I have updated the code to version 4.7 with the fix included...
To save yourself all the trouble, I only changed on spot of code in to fix the issue.
in the functions.php file
look for...
Code: [Select]
<form action='".$site_sess->url(ROOT_PATH."download.php")."' method='post'".$multi_download_var['target'].">Change to...
Code: [Select]
<form action='".$site_sess->url(ROOT_PATH."download.php")."' method='get'".$multi_download_var['target'].">
in other words change the method= from 'post' to 'get' and things should start working for you.
Buddy Duke
www.budduke.com

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: [MOD] Multi Size Download of same image [ver 4.7]
« Reply #311 on: March 02, 2013, 07:55:33 PM »
Work perfectly now. :)
You are the best.


I am facing one more trouble and its related to this mode only.

You see i want to use tags  {width}x{height}   and   {image_file_size}  these tags work everywhere except multi_popup.html

Can you fix this issue?

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.7]
« Reply #312 on: March 03, 2013, 08:46:19 PM »
I am facing one more trouble and its related to this mode only.

You see i want to use tags  {width}x{height}   and   {image_file_size}  these tags work everywhere except multi_popup.html

Can you fix this issue?

The popup window was designed because someone requested it so they could put ads above/below the downloaded image and not to recreate the details page all over again.
I do see the reason you are asking for the filesize and dimensions because with this mod they are different then what is displayed on the details page.
I am not trying to recreate ALL the data that is displayed on the details page, at this point the user just wants to download the image...

I am not making this request part of the original MOD but here is the fix for anyone interested in using it. I do not think this will work if your images are stored on remote servers. I have not had time to test that part of it but it works fine for local files...
The last insert in the download.php file...
replace the entire insert with this one...
Code: [Select]
//MOD multi download for popup window
if (($multi_download_var['target']<>"") && $size){
   $meta_keywords  = !empty($image_row['image_keywords']) ? implode(", ", explode(",", $image_row['image_keywords'])) : "";
$meta_description = !empty($image_row['image_description']) ? strip_tags($image_row['image_description']) . ". " : "";
$image_name = format_text($file['file_name'],2);
$file_size = "n/a";
if ($file_size = @filesize($file['file_path'])) {
$file_size = format_file_size($file_size);
}
else {
$file_size = get_remote_file_size($file['file_name']);
}
$image_info= @getimagesize($file['file_path']);
$site_template->register_vars(array(
"img_url" => $file["file_path"],
"site_name" => $config['site_name'],
"charset" => $lang['charset'],
"direction" => $lang['direction'],
"detail_meta_description"   => $meta_description,
            "detail_meta_keywords"      => $meta_keywords,
            "prepend_head_title"        => $image_name . " - ",
"width"=> $image_info[0],
"height"=> $image_info[1],
"image_file_size"=>$file_size,
"image_name"=>$image_name,
"lang_file_size" => $lang['file_size']
));
$site_template->print_template($site_template->parse_template("multi_popup"));
}
else{
        send_file($file['file_name'], $file['file_path']);
     }
//END MOD multi download for popup window

and this is the multi_popup.html I came up with to display the info...
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{prepend_head_title}{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}">
<meta name="description" content="{detail_meta_description}{site_name}">
<meta name="keywords" content="{detail_meta_keywords}">
</head>
<body>
<table align=center">
<TR>
<TD align="center"><img src="{img_url}"></img></TD>
</TR>
<TR>
<TD align="center">{image_name}</TD>
</TR>
<TR>
<TD align="center">{lang_file_size}&nbsp;&nbsp;{image_file_size}</TD>
</TR>
<TR>
<TD align="center">Dimensions:&nbsp;&nbsp;{width} X {height}</TD>
</TR>
</TABLE>
</body>
</html>
« Last Edit: March 05, 2013, 12:07:16 AM by budduke »
Buddy Duke
www.budduke.com

Offline PamBreeze

  • Newbie
  • *
  • Posts: 43
  • I'm Not Crazy...I'm Just Me!
    • View Profile
    • Emanon Creations
Re: [MOD] Multi Size Download of same image [ver 4.7]
« Reply #313 on: July 13, 2013, 09:59:08 AM »
Mod works great except when using the drop down menu there is just a small blank square instead of a button saying download. Is this normal?
« Last Edit: July 13, 2013, 10:27:49 AM by PamBreeze »

Offline budduke

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • http://www.budduke.com
Re: [MOD] Multi Size Download of same image [ver 4.7]
« Reply #314 on: July 13, 2013, 07:41:25 PM »
Mod works great except when using the drop down menu there is just a small blank square instead of a button saying download. Is this normal?
Can I see a link to see it in action? What browser are you using. It should display correctly...
Buddy Duke
www.budduke.com