• [MOD] Alternate directory for download files. 5 0 5 1
Currently:  

Author Topic: [MOD] Alternate directory for download files.  (Read 223551 times)

0 Members and 1 Guest are viewing this topic.

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Alternate directory for download files.
« Reply #75 on: February 20, 2007, 04:44:47 PM »
Code: [Select]
   
if (!isset($download_height)) {
$download_height = "";
}
if (!isset($download_width)) {
$download_width = "";
}

 $site_template->register_vars(array(
      "media_src" => $media_src,
      "media_icon" => $media_icon,
      "image_name" => $image_name,
      "width_height" => $width_height,
      "width" => $width,
      "height" => $height,
      "download_width" => $download_width, // Download file
      "download_height" => $download_height, // Download file
      "iptc_info" => $iptc_info,
      "new_limit" => $new_limit,
      "limit_var" => $limit_var,
      "exif_info" => $exif_info
    ));

Teste das mal...

rinaldos

  • Guest
Re: [MOD] Alternate directory for download files.
« Reply #76 on: February 20, 2007, 08:04:13 PM »
Hi Acidgod :-)

Ich danke dir für die schnelle Antwort. Die Lösung hat funktioniert. Der Fehler beim suchen ist nun weg :-) Nun können endlich die User die Bilder in der grösseren Version laden :-)

Dank diesem Forum habe ich schon den ein oder andere Hinweis gefunden und innerhalb kürzester Zeit etwas gelernt. Am Anfang hatte ich noch keinen Plan von PHP, aber so langsam sehe ich einen Zusammenhang in vielen Dingen. Bin leider ein blutiger Anfänger  was das Programmieren angeht.

Danke nochmal für die schnelle Hilfe :-)

Gruß
Ingo

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #77 on: February 21, 2007, 04:33:53 PM »
also ich komme irgendwie mit diesem Mod nicht klar. Ich würde gerne einfach ohne viel Schnickschnak das Foto aus meinem BigFolder-Ordner gedownloadet bekommen, wenn ich auf den stinknormalen Downloadbutton klicke. Das müsste doch theoretisch durch eine simple Änderung in der download.php möglich sein, indem man dort den Standart-Downloadpfad um "/bigfolder" ergänzt. Oder liege ich da falsch? Ich hoffe, mir kann jemand helfen.

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #78 on: May 14, 2007, 10:16:43 AM »
any suggestions?

Offline nobita

  • Jr. Member
  • **
  • Posts: 61
  • ondesktop.org
    • View Profile
    • Car Wallpapers
Re: [MOD] Alternate directory for download files.
« Reply #79 on: June 25, 2007, 09:27:14 AM »
Code: [Select]
  $file_size = "n/a";
  if (!is_remote($image_row['image_media_file'])) {
    if ($file_size = @filesize(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
      $file_size = format_file_size($file_size);
    }
  }
  elseif ($detailed_view) {
    $file_size = get_remote_file_size($image_row['image_media_file']);
  }

I can find this code in functions.php (I'm using version 1.7.4)

Offline urmasmuld

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #80 on: August 08, 2007, 11:32:48 AM »
Ill get this error :
Code: [Select]
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/www/htdocs/) is not within the allowed path(s): (/www/02/***:/www/data/***:/tmp) in /www/02/***/album/includes/functions.php on line 547


Line 547 is :
Code: [Select]
$src_download = (!file_exists($download_file_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$download_file_src))) ? preg_replace
("/\/{2,}/", "/", get_document_root()."/".$download_file_src) : $download_file_src;


How to solve this ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #81 on: August 08, 2007, 02:36:39 PM »
FAQ
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline urmasmuld

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #82 on: August 09, 2007, 03:15:00 PM »
FAQ?
but where :?: Could you be more specific plz... :?
-----------------
I just cant find anything from FAQ forums....is it Safe Mode problem ?
« Last Edit: August 09, 2007, 03:37:56 PM by urmasmuld »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #83 on: August 09, 2007, 06:07:57 PM »
Ok this mean host restrict your site. Must send ticket to host.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #84 on: September 19, 2007, 11:37:21 PM »
Quote
but i can't get good result of this work.
who can help me?

Very short post ... please read my signature for get help in forum (+ Nicky 3 steps signature)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline kujayhawk

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #85 on: April 22, 2008, 08:29:31 PM »
Hi all,

I have somewhat successfully added Chris' "Alternate directory for download files." The problem I am having is that when I click the download button on images that I know there is a matching filename within the 'big' folder, the resized image still downloads. It shows the correct filesize for the big file too. I have looked through all the pages in that forum thread and can not find the solution. Any help would be great as I am sure it is some small change I am not catching.

Thanks!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #86 on: April 22, 2008, 08:32:03 PM »
... but without URL ...  :roll:
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline kujayhawk

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #87 on: April 22, 2008, 08:35:51 PM »
Woops, sorry.

http://www.4homepages.de/forum/index.php?topic=7499.0 is the topic and about 4 or 5 posts down is Chris' code in reply to the original message.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #88 on: April 22, 2008, 09:08:19 PM »
... not the thread url ... I know Chris' code for alternate directory for download files ....
... your website url ... !
... where can I see your problems with the mod .... ?
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline kujayhawk

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Alternate directory for download files.
« Reply #89 on: April 22, 2008, 09:41:31 PM »
Right, ha. That would be photographybyweston.com/ku. The folder with the big images is under tennis, iowa state, iowa state player. That is the only folder on the server with big images along with regular images.

Every other category on the site has just regular resized images with no big folder.

I am not getting any errors at all while downloading without changes to Chris' code, it just downloads the regularly sized file. What would be the ultimate is on the details page, knowing how to get a link or make a button to where if there is a big file associated with the resized version to have that display in addition to the regular download size.

Below this is the code I noticed in download.php, I changed the last ending '/' to be '/big/' and it downloaded the big files in that Iowa State Player folder, but on a regular image without the BIG size it did not download properly. Hope all this information helps, and I really appreciate you giving me a hand with this!

Thanks,
Weston

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'];
    // Let the user download the "<cat_id>/download/<fname>", "<cat_id>/big/<fname>", or "<cat_id>/<fname>" version of the image
$temp = get_file_path($file['file_name'], "download", $image_row['cat_id'], 0, 1);
if( !file_exists($temp) )
  $temp = (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'];
$file['file_path'] = $temp;
  }