I wrote a whole response, based on an incorrect assumption of what you're trying to do, then I realized I was way off. So here I try again
Note that the "functions" that live in the plugins directory are not arbitrary PHP functions, but need to use the function API to work!
I think you won't have much luck including directly into a template with require_once. I think using user-defined tags is a better bet. To pass data, I'd put my values into the cms global's "variables" array.
For example, if I create user tag "test" containing:
Code: Select all
global $gCms;
$vars = &$gCms->variables;
$vars['number'] = 4;
and another user tag "test2" containing:
Code: Select all
global $gCms;
echo $gCms->variables['number'];
and put {test}{test2} into my page or template, it will replace those two tags with a "4".
If you want to do more complex stuff, you might want to create a function. The equivalent function "function.test.php" would look like this (the file would need to live in CMS_ROOT/plugins):
Code: Select all
<?php
function smarty_cms_function_test($params, &$smarty)
{
global $gCms;
$foo = &$gCms->variables;
$foo['number'] = 4;
}
function smarty_cms_help_function_test() {
echo 'whatever Help info';
}
function smarty_cms_about_function_test() {
echo 'whatever author info';
}
?>
Hope that helps!
___Samuel___