TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Trouble with Smarty (http://www.talkphp.com/absolute-beginners/1288-trouble-smarty.html)

obolus 10-10-2007 11:04 PM

Trouble with Smarty
 
Note: I removed the dir names from the file paths below. They are replaced with '--'

I keep getting this error when I try to load my index.php file...

Quote:

Warning: Smarty error: unable to read resource: "news.tpl" in /--/--/lib/php/smarty/Smarty.class.php on line 1095
I'm not sure why I get this error. Everything has the right chmod perms, all the file paths are correct, I haven't touched any of the coding in the class file.

The code for my index.php file is as follows:

PHP Code:

<?php

require('/--/--/lib/php/smarty/Smarty.class.php');

$smarty = new Smarty();

$smarty->template_dir '--/--/inc/smarty/templates';
$smarty->compile_dir '--/--/inc/smarty/templates_c';
$smarty->cache_dir '--/--/inc/smarty/cache';
$smarty->config_dir '--/--/inc/smarty/configs';

$smarty->display('news.tpl');

?>

yea, I'm a newb

obolus 10-11-2007 02:59 AM

Nevermind! I fixed it.

The problem was that some of the filenames in the all important 'internals' dir have extra long filenames. I run an older version of OSX on this computer, and while most of the time I don't have this problem- it pops up sometimes and I don't even realize it. Basically, old versions of OSX (and any Mac OS previous to that), will cutoff long filenames and stick numeric characters at the end. So instead of "really_long_long_long_long_name.php", I'll end up with "really_long_long_lon2392841.php". If you're a mac user, check your filenames!


All times are GMT. The time now is 09:14 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0