 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
Budda Smarty Regular
Joined: 19 Apr 2003 Posts: 53 Location: Lymm, Cheshire. UK
|
Posted: Wed Aug 13, 2003 12:52 pm Post subject: 2.6RC1 causes plugins to fail |
|
|
Hi,
Just installed RC1 of Smarty but its causing one of the plugins i use to fail.
The error message is: | Code: | Fatal error: Call to a member function on a non-object in c:\php4\pear\Smarty\plugins\modifier.date.php on line 14
|
Its not a plugin distributed with the core archive of Smarty so it hasn't been tweaked. I'd like ot know what is needed to fix it though.
modifier.date.php...
[php:1:35c152fbbb]<?php
require_once $this->_get_plugin_filepath('shared','make_timestamp');
function smarty_modifier_date($string, $format="%b %e, %Y", $default_date=null)
{
if($string != '') {
return date($format, smarty_make_timestamp($string));
} elseif (isset($default_date) && $default_date != '') {
return date($format, smarty_make_timestamp($default_date));
} else {
return;
}
}
?>[/php:1:35c152fbbb]
Hope somebody can explain what happened to $this in the first line then (this is what line 14 is)  |
|
| Back to top |
|
andre Smarty Pro

Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Aug 13, 2003 1:40 pm Post subject: |
|
|
Try to replace the second line | Code: | | require_once $this->_get_plugin_filepath('shared','make_timestamp'); | with | Code: | | require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); |
I think they renamed $this to $smarty ... if I remember correctly. |
|
| Back to top |
|
Budda Smarty Regular
Joined: 19 Apr 2003 Posts: 53 Location: Lymm, Cheshire. UK
|
Posted: Wed Aug 13, 2003 5:13 pm Post subject: |
|
|
Seems to have worked a treat. Cheers!  |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|