RE: [SMARTY] tpl, installation (forgot)
| From: | Patti Ewanski | Date: | Mon, 01 Jul 2002 22:17:42 +0000 |
| Subject: | RE: [SMARTY] tpl, installation (forgot) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5151@lists.php.net to get a copy of this message | ||
Monte, Robert,
Thanks so much for being patient with me.
I think I set up the files correctly and the directory paths. (I
think, I hope).
This is what my Smarty.class.php file looks like now (only part
of it)
define('SMARTY_DIR', './dir2/hro/smarty/');
define('DIR_SEP', DIRECTORY_SEPARATOR);
if (!defined('SMARTY_DIR')) {
define('SMARTY_DIR', dirname(__FILE__) . DIR_SEP);
}
define('SMARTY_PHP_PASSTHRU', 0);
define('SMARTY_PHP_QUOTE', 1);
define('SMARTY_PHP_REMOVE', 2);
define('SMARTY_PHP_ALLOW', 3);
class Smarty
{
/****************************************************************
**********/
/* BEGIN SMARTY CONFIGURATION SECTION
*/
/* Set the following config variables to your liking.
*/
/****************************************************************
**********/
// public vars
var $template_dir = './dir2/hro/smarty/templates';
// name of directory for templates
var $compile_dir = './dir2/hro/smarty/templates_c';
// name of directory for compiled templates
var $config_dir = './dir2/hro/smarty/configs';
// directory where config files are located
var $plugins_dir = './dir2/hro/smarty/plugins';
// directory where plugins are kept
Now, my test page shoots me these errors:
Warning: Unable to access
./users2/hro/smarty/Smarty_Compiler.class.php in
/users2/hro/smarty/Smarty.class.php on line 1026
Fatal error: Failed opening required
'./users2/hro/smarty/Smarty_Compiler.class.php'
(include_path='.:/usr/local/include/php') in
/users2/hro/smarty/Smarty.class.php on line 1026
I looked at line 1026 and it's a function definition:
/*===============================================================
=======*\
Function: _compile_template()
Purpose: called to compile the templates
\*===============================================================
=======*/
function _compile_template($tpl_file, $template_source,
&$template_compiled)
{
require_once SMARTY_DIR.$this->compiler_class .
'.class.php';
$smarty_compiler = new $this->compiler_class;
$smarty_compiler->template_dir =
$this->template_dir;
$smarty_compiler->compile_dir = $this->compile_dir;
$smarty_compiler->plugins_dir = $this->plugins_dir;
$smarty_compiler->config_dir = $this->config_dir;
$smarty_compiler->force_compile =
$this->force_compile;
$smarty_compiler->caching = $this->caching;
$smarty_compiler->php_handling =
$this->php_handling;
$smarty_compiler->left_delimiter =
$this->left_delimiter;
$smarty_compiler->right_delimiter =
$this->right_delimiter;
$smarty_compiler->_version = $this->_version;
$smarty_compiler->security = $this->security;
$smarty_compiler->secure_dir = $this->secure_dir;
$smarty_compiler->security_settings =
$this->security_settings;
$smarty_compiler->trusted_dir = $this->trusted_dir;
$smarty_compiler->_plugins = &$this->_plugins;
$smarty_compiler->_tpl_vars = &$this->_tpl_vars;
if ($smarty_compiler->_compile_file($tpl_file,
$template_source, $template_compiled))
return true;
else {
$this->trigger_error($smarty_compiler->_error_msg);
return false;
}
}
And I don't think I should be changing anything this far down in
the program....
Maybe has to do with my definition of SMARTY_DIR in
Smarty.class.php?
You don't have to answer all these questions right now if you are
squeezed for time.....
I truly appreciate your help. I should send you both something. I
make candles and paper mache things in my spare time....
:)
Patti
-----Original Message-----
From: Monte Ohrt [mailto:monte@ispi.net]
Sent: Monday, July 01, 2002 3:03 PM
To: Patti Ewanski
Cc: Robert Amos; smarty-general@lists.php.net
Subject: Re: [SMARTY] tpl, installation (forgot)
If you're wanting to use relative paths, then you will need
"../smarty/templates" and "../smarty/tempaltes_c" according to
your
setup (paths must be relative to executing script), or fully
qualified
pathnames as Robert suggested.
Patti Ewanski wrote:
> Robert,
> The template is situated in the directory like this:
>
> dir/public_html/..... (open to public view)
>
> dir/smarty/templates (public can't reach these)
> dir/smarty/templates_c
>
> Is it wrong to put these folders outside of public_html maybe?
> Thanks again for responding. I'm determined to get this.....
> :)
>
>
>
> -----Original Message-----
> From: Robert Amos [mailto:bok@ausmac.net]
> Sent: Monday, July 01, 2002 2:20 PM
> To: smarty-general@lists.php.net
> Subject: Re: [SMARTY] tpl, installation (forgot)
>
> oh ok, it just looks like that from what you have there the
> index.tpl file
> isn't sitting in the 'templates' dir. if the PHP script that
you
> have
> displaying the file is in public_html/ then the index.tpl file
> should be in
> public_html/templates/ with the $smarty->template_dir set to
> './templates'
> and simliarly the $compile_dir to './templates_c'
>
> -bok
>
> On 2/7/02 7:11 AM, Patti Ewanski banged a keyboard and produced
> the
> following weird but readable email:
>
>
>>Robert,
>>It's there. Do you know what permissions I'm supposed to have
>
> on
>
>>it? I have
>>-rw-r-r-
>>
>>I also have this in a directory called smarty that is above
>
> (not
>
>>in or under) my public_html folder. I'm wondering if this is
>
> the
>
>>problem too. My test file that is under public_html seems to be
>>looking for the file in it's own file. So I copied a copy of
>>Smarty.class.php and templates and templates_c there but that
>
> is
>
>>a security risk I believe. I wanted to keep the smarty files
>
> off
>
>>of the public site....
>>
>>:) Cheers and many thanks to you for replying.....
>>
>>
>>
>>-----Original Message-----
>>From: Robert Amos [mailto:bok@ausmac.net]
>>Sent: Monday, July 01, 2002 1:03 PM
>>To: smarty-general@lists.php.net
>>Subject: Re: [SMARTY] tpl, installation (forgot)
>>
>>Put the index.tpl file there inside your "templates" directory.
>>
>>-bok
>>
>>On 2/7/02 5:56 AM, Patti Ewanski banged a keyboard and produced
>>the
>>following weird but readable email:
>>
>>
>>>Sorry,
>>>Forgot to list that I have these dir's and files set up in the
>>>directory as well...
>>>
>>>drwxr-xr-x configs
>>>drwxr-xr-x docs
>>>-rw-r--r-- index.tpl
>>>drwxr-xr-x misc
>>>-rw-r--r-- overlib.js
>>>drwxr-xr-x plugins
>>>drwxr-xr-x templates
>>>drwx------ templates_c
>>>
>>>:)
>>>Patti
>>>
>>
>>
>>--
>>Smarty General Mailing List (http://smarty.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php