Page 3 of 4
Posted: Mon Jun 07, 2004 6:28 am
by launchcode
It can be renamed to anything - so your guess is as good as mine. But looking for the wrong variable won't help, it's called: $config['tpl_cache_level'] - do a multi-file search for it?
Posted: Mon Jun 07, 2004 7:44 am
by NewfieBilko
Ok, will do.. Ok, i am at work now, and the setting of permissions seems to have solved most of my agony. Besides one little thing of not being able to update my header.tpl, i can fully make use of the templating system now it seems.
Although with being able to use the templates, I have run into another interesting occurance. Now, whenever I update a template. I will load it in explorer, and get this error:
But with a refresh it is gone, and the page is fine. My boss was wondering why we get error on first occorance of load, and if whenenver any template is updated we will have to see an error on first load.
Posted: Mon Jun 07, 2004 7:50 am
by launchcode
Smarty has tried to change the permissions on a file which has failed and raised that warning. Look in the Smarty documentation to find out how to stop it from performing a chmod.
Posted: Mon Jun 07, 2004 7:55 am
by NewfieBilko
I see, its trying to change it here:
function _write_file($filename, $contents, $create_dirs = false)
{
if ($create_dirs)
$this->_create_dir_structure(dirname($filename));
if (!($fd = @fopen($filename, 'w'))) {
$this->trigger_error("problem writing '$filename.'");
return false;
}
// flock doesn't seem to work on several windows platforms (98, NT4, NT5, ?),
// so we'll not use it at all in windows.
if ( strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' || (flock($fd, LOCK_EX)) ) {
fwrite( $fd, $contents );
fclose($fd);
chmod($filename, 0644); <!--- Right here-- --->
}
return true;
}
How do I stop this?
Posted: Mon Jun 07, 2004 7:59 am
by launchcode
Comment it out?
Posted: Mon Jun 07, 2004 8:01 am
by NewfieBilko
Also, here is my directory structure:
Any ideas where that 'tpl_cache_level' variable might reside?

thx
Posted: Mon Jun 07, 2004 8:01 am
by NewfieBilko
LOL good guess LOL
Posted: Mon Jun 07, 2004 8:02 am
by NewfieBilko
LOL no i shouldn't comment it out though should I? Its a function, so obviously it is getting called from somewherre...../
Ignore, i already commented it out lol
Posted: Mon Jun 07, 2004 8:13 am
by NewfieBilko
may need the function for something else... hmm, wheres it calling to that _write_file function i wonder...hmmm
Posted: Mon Jun 07, 2004 8:16 am
by NewfieBilko
Ok, as u can see here I commented out just the chmod. It seems now that it works!!
I just hope that taking out that chmod, will not effect anything down the road.

Posted: Mon Jun 07, 2004 8:22 am
by NewfieBilko
Ok guys..
Everything seems fine.. I can update all templates. EXCEPT ONE
The header.tpl. When i update this template, which has all the info that goes at the top of my page <html> through <body>, it gives me this error:

Posted: Mon Jun 07, 2004 8:24 am
by NewfieBilko
and here is the refering code:
Posted: Mon Jun 07, 2004 8:26 am
by NewfieBilko
and the code for header:
I was thinking maybe that my javascript is fooling this up.
Posted: Mon Jun 07, 2004 8:50 am
by NewfieBilko
Ok, once I took out the java, it seems like it fixes, and I can now edit my header.tpl and it will be REFLECTED and changed. Guess smarty doesn't like having java IF's in the templates.. In order to load this java, in which level do i want it?
Posted: Mon Jun 07, 2004 9:55 am
by launchcode
It might not be the Javascript - it might just be what you're using as the Smarty delimeter, it can use <!-- which might be why the JS is confusing it. Delimeter = telling Smarty when to jump into/out of PHP mode, so obviously not something you'd want to do if you're about to feed it a load of JS.