/[corp_html]/inc/Smarty.addons.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.addons.php

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

revision 1.2 by dpavlin, Fri Feb 23 13:57:12 2001 UTC revision 1.3 by dpavlin, Sat Mar 3 12:56:17 2001 UTC
# Line 245  function smarty_func_html_select_date() Line 245  function smarty_func_html_select_date()
245          print $html_result;          print $html_result;
246  }  }
247    
 //-----------------------------------------  
 // Custom made by Dobrica Pavlinusic <dpavlin@rot13.org>  
   
 function smarty_func_img() {  
         extract(func_get_arg(0));  
   
         $f=Array();  
   
         global $img_time;  
         if (!isset($img_time)) {  
                 $img_time=time();  
         }  
                   
   
         if (isset($dir)) {  
                 $tdir=dirname($GLOBALS[SCRIPT_FILENAME])."/$dir";  
                 $h=opendir($dir);  
                 $pics=0;  
                 while ($tmp = readdir($h)) {  
                         if (is_file("$tdir/$tmp") && substr($tmp,0,1)!=".") {  
 //                              print "$tdir/$tmp<br>\n";  
                                 $f[]=$tmp;  
                                 $pics++;  
                         }  
                 }  
                 closedir($h);  
 //              $f=shuffle($f);  
                 $ord=($img_time+$nr) % $pics;  
                 $src="$dir/$f[$ord]";  
         }  
   
         $add="";  
         if (isset($border)) {  
                 $add.=" border=\"$border\"";  
         }  
         if (isset($alt)) {  
                 $add.=" alt=\"$alt\"";  
         }  
         if (isset($align)) {  
                 $add.=" align=\"$align\"";  
         }  
         if (isset($hspace)) {  
                 $add.=" hspace=\"$hspace\"";  
         }  
         if (isset($vspace)) {  
                 $add.=" vspace=\"$vspace\"";  
         }  
   
         $size = GetImageSize(dirname($GLOBALS[SCRIPT_FILENAME])."/$src");  
         print "<img src=\"$src\" $size[3]$add>";  
 }  
   
 ?>  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26