global variable in include_php script?
| From: | Kai-Uwe Beyer | Date: | Wed, 11 Dec 2002 11:37:44 +0000 |
| Subject: | global variable in include_php script? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6731@lists.php.net to get a copy of this message | ||
Hi,
i use a external script, which i include in my tpl file like
{include_php file = $PathAndNameToTheScript}
There are some function in this external script, which works with
outside defined global variables.
function formatpost($post) {
global $path2smileys;
global $smiley;
global $smiley_code;
and so on.
$post = str_replace("$smiley_code","<img
src=\"$path2smileys"."$smiley\">",$post);
}
The replace doesn't work with smarty. The script works find, if i called
outside the smarty template.
Is it possible to work with the values of these variables in the
function?
$GLOBALS[...] didn't also work.
bye Kai