Author Topic: [mod] Hi-Res pictures  (Read 13903 times)

0 Members and 1 Guest are viewing this topic.

Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
[mod] Hi-Res pictures
« on: May 20, 2005, 04:26:42 PM »
Hi everybody,

a friend of mine created a mod for V 1.7 of 4 images.

This mod diplay an Hi-Res button that appear when you have the status of administrator.

The concept is easy:

- visitors can see the picture in low res.
 
- When you are logged as an administrator you see a button "Hi-Res" with wich you can download the hi-res files who is stored in  a directory called "big".

But there is a problem :

When you move an image(s), the Hi-Res pictures does not follow the low res.
The hi-res stay in his folder "big".

Can you try to find  where come the problem ?

Thanks by advance

Have a nice day:

Code: [Select]
In the file template/default/details.html

// function that allow that the hi res button display when your are in admin mod
 {if media_src_big}
                   
                  <a class="big" href="_javascript:openpopupbig('big')"><img src="{template_url}/images/download_HD.gif" border="0" width="100" height="20">
                {if media_src_big}</a>{endif media_src_big} 

Code: [Select]
In the file include/function.php

function get_file_path($file_name = "", $image_type = "media", $cat_id = 0, $in_admin = 0, $return_icon = 1, $check_remote = CHECK_REMOTE_FILES) {
  $return_code = ($return_icon) ? ICON_PATH."/404.gif" : 0;
  if (empty($file_name)) {
    return $return_code;
  }
  if (is_remote($file_name)) {
    $check_handle = "check_remote_".$image_type;
    return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
  }
  elseif (is_local_file($file_name)) {
    $check_handle = "check_local_".$image_type;
    $file_name = ($in_admin && preg_match("/^([\.]+|[^\/])/", $file_name)) ? "../".$file_name : $file_name;
    if (!file_exists($file_name)) {
      $file_path = preg_replace("/\/{2,}/", "/", get_document_root()."/".$file_name);
      return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
    }
    else {
      return $file_name;
    }
  }
  else {
    $check_handle = "check_".$image_type."_type";
    $path = (($image_type == "media") ? (($cat_id) ? MEDIA_PATH."/".$cat_id : MEDIA_TEMP_PATH) : (($image_type == "big") ? MEDIA_PATH."/".$cat_id."/big" : (($cat_id) ? THUMB_PATH."/".$cat_id : THUMB_TEMP_PATH)))."/".$file_name;
    return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : (($image_type != "big") ? $return_code : "");
  }
}

function check_remote_big($remote_media_file) {
  global $config;
  return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $remote_media_file)) ? 1 : 0;
}
function check_local_big($local_media_file) {
  global $config;
  return (preg_match("#^((\.)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $local_media_file)) ? 1 : 0;
}
function check_big_type($file_name) {
  global $config;
  return (in_array(get_file_extension($file_name), $config['allowed_mediatypes_array'])) ? 1 : 0;
}

Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #1 on: May 22, 2005, 03:17:39 PM »
no idea dudes ?

Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #2 on: May 23, 2005, 09:27:25 AM »
please, help :)

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #3 on: May 23, 2005, 03:47:50 PM »
Please do not double post.  I've deleted your other post topic.

Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #4 on: May 23, 2005, 04:01:30 PM »
oké, no soucy


Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #5 on: May 24, 2005, 10:17:25 AM »
nobody to help me  to resolve this problem ?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #6 on: May 24, 2005, 02:50:20 PM »
I don't have time to provide free consulting today but I can tell you the "problem" is that you need to modify the code that takes care of editing the image.  And that code is not in what you posted here.  Try admin/images.php

Offline flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #7 on: May 24, 2005, 03:40:03 PM »
thanks chris for your answer and for the time you spend to write it.

Can you explain a little more what you said ?

in fact you said that the probleme don't come from the code in this topic, but come from the files /admin/images.php

thanks for your answer


Pierre

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
Re: [mod] Hi-Res pictures
« Reply #8 on: May 25, 2005, 12:03:24 AM »
But there is a problem :

When you move an image(s), the Hi-Res pictures does not follow the low res.
The hi-res stay in his folder "big".

Can you try to find  where come the problem ?

[MOD] Batch Copy/Move/Edit Images supports "big" images.
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 flysurfing

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [mod] Hi-Res pictures
« Reply #9 on: May 25, 2005, 09:11:42 AM »
vano,
i try to download your mod but the link seem to be dead !

have you another link ?

so if i download this, you think this will correct the problem ?