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:
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}
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;
}