3 |
//----------------------------------------- |
//----------------------------------------- |
4 |
// Custom made by Dobrica Pavlinusic <dpavlin@rot13.org> |
// Custom made by Dobrica Pavlinusic <dpavlin@rot13.org> |
5 |
|
|
6 |
|
// helper function to make full path of relative dir |
7 |
|
function dir2path($dir) { |
8 |
|
if (substr($dir,0,1) != "/") { |
9 |
|
return dirname($GLOBALS[SCRIPT_FILENAME])."/$dir"; |
10 |
|
} else { |
11 |
|
return $dir; |
12 |
|
} |
13 |
|
} |
14 |
|
|
15 |
function smarty_func_img() { |
function smarty_func_img() { |
16 |
extract(func_get_arg(0)); |
extract(func_get_arg(0)); |
17 |
|
|
24 |
|
|
25 |
|
|
26 |
if (isset($dir)) { |
if (isset($dir)) { |
27 |
$tdir=dirname($GLOBALS[SCRIPT_FILENAME])."/$dir"; |
$tdir=dir2path($dir); |
28 |
$h=opendir($dir); |
$h=opendir($dir); |
29 |
$pics=0; |
$pics=0; |
30 |
while ($tmp = readdir($h)) { |
while ($tmp = readdir($h)) { |
74 |
$add.=" border=\"0\""; |
$add.=" border=\"0\""; |
75 |
} |
} |
76 |
|
|
77 |
$size = GetImageSize(dirname($GLOBALS[SCRIPT_FILENAME])."/$src"); |
$size = GetImageSize(dir2path($src)); |
78 |
$out.="<img src=\"$src\" $size[3]$add>"; |
$out.="<img src=\"$src\" $size[3]$add>"; |
79 |
if ($product_link[$pic]) { |
if ($product_link[$pic]) { |
80 |
$out.="</a>"; |
$out.="</a>"; |
120 |
|
|
121 |
function smarty_mod_filesize($file,$dir,$unit="") |
function smarty_mod_filesize($file,$dir,$unit="") |
122 |
{ |
{ |
123 |
$path=dirname($GLOBALS[SCRIPT_FILENAME])."/$dir/$file"; |
$path=dir2path("$dir/$file"); |
124 |
$ext=explode(".",$file); |
$ext=explode(".",$file); |
125 |
$ext=strtoupper(array_pop($ext)); |
$ext=strtoupper(array_pop($ext)); |
126 |
|
|