/[corp_html]/inc/Smarty.local.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/Smarty.local.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by dpavlin, Mon Jul 9 14:22:07 2001 UTC revision 1.10 by dpavlin, Mon Oct 1 14:05:16 2001 UTC
# Line 3  Line 3 
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    
# Line 15  function smarty_func_img() { Line 24  function smarty_func_img() {
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)) {
# Line 57  function smarty_func_img() { Line 66  function smarty_func_img() {
66  "plivit_b.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25b&show_description=on#results",  "plivit_b.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25b&show_description=on#results",
67  "plivit_b6.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25b6&show_description=on#results",  "plivit_b6.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25b6&show_description=on#results",
68  "plivit_c.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25c&show_description=on#results",  "plivit_c.gif"=>"http://www.pliva.hr/human_health.php?search=plivit%25c&show_description=on#results",
69    "plivazdravlje.gif"=>"http://www.plivazdravlje.hr/",
70    "plivamed.gif"=>"http://www.plivamed.net/",
71          );          );
72    
73          $pic=basename($src);          $pic=basename($src);
# Line 65  function smarty_func_img() { Line 76  function smarty_func_img() {
76                  $add.=" border=\"0\"";                  $add.=" border=\"0\"";
77          }          }
78    
79          $size = GetImageSize(dirname($GLOBALS[SCRIPT_FILENAME])."/$src");          $size = GetImageSize(dir2path($src));
80          $out.="<img src=\"$src\" $size[3]$add>";          $out.="<img src=\"$src\" $size[3]$add>";
81          if ($product_link[$pic]) {          if ($product_link[$pic]) {
82                  $out.="</a>";                  $out.="</a>";
# Line 111  function smarty_func_html_checkboxes() Line 122  function smarty_func_html_checkboxes()
122    
123  function smarty_mod_filesize($file,$dir,$unit="")  function smarty_mod_filesize($file,$dir,$unit="")
124  {  {
125          $path=dirname($GLOBALS[SCRIPT_FILENAME])."/$dir/$file";          $path=dir2path("$dir/$file");
126          $ext=explode(".",$file);          $ext=explode(".",$file);
127          $ext=strtoupper(array_pop($ext));          $ext=strtoupper(array_pop($ext));
128    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26