>         $template_file = "".$template_root."".$template_file."";

What are those empty strings supposed to do?  This is the same thing:

          $template_file = $template_root.$template_file;

>         return implode("",(@file($template_file)));

Ack!  That's horrible.  Do this instead:

          $fp = fopen($template_file) or die("Unable to open $template_file");
          $file = fread($fp, filesize($template_file));
          fclose($fp);
          return $file;

> /* ******************************************************
>    * $template_type decides weather

Cool, make it snow.

>         if ( $template_type == '0' )
>                         $template_contents =
> implode("",(@file($template_root.$template_file)));

See above

>
>         if ( is_array ( $template_data ) && is_array ( $template_replace
> ) )
>                 {
>
>                 for ( $i=0; $i < count ( $template_replace ); $i++ )
>                         {
>
>                         $template_contents =
> str_replace("{".$template_replace[$i]."}", $template_data[$i],
> $template_contents);
>
>                         }

Whoa..

                  foreach($template_replace as $key=>$val) {
                          $template_contents =
str_replace('{'.$val.'}',$template_data[$key], $template_contents);
                  }


-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to