chapi wrote:
As XOOPS uses smarty you should also be able to include some php files with it. Look at the following site for more information on this topic ...
http://smarty.php.net/manual/en/language.function.include.php.php
Follow-up:
The include_php function requires an absolute path to the PHP file. That's a bit cumbersome when you're dealing with win32 dev and RH8 prod. I couldn't seem to find any way to get the template's directory pre-pended to the include file (XOOPS vars unavailable, smarty vars not set??)
However, the {php} directive does work as advertised and allows me to accomplish what I wanted. The downside is I need to include the PHP code in my template--less than ideal.
I suppose it's possible the XOOPS vars are available within the smarty PHP block but I didn't check that.
Here's how I included the PHP code in my template, in case anyone wants to try it with theirs.
...
<{php}>
// Include theme-specific functions
function dt_AZtime() {
# Calculate current AZ time -- Server is not in MST time zone
# offset to server = -7h - (server offset)
$MST_to_Server_offset = -7 * 60 * 60 - date( "Z" );
return time() + $MST_to_Server_offset;
}
$this->assign('theme_localtime', date( "g:ia, F j, Y", dt_AZtime()));
<{/php}>
<table cellspacing="0">
...
<td id="headerbar"><a href="<{$xoops_url}>/">GAPT</a>: <{$xoops_pagetitle}></td>
<td id="headerbar-right"><{$theme_localtime}></td>
...
P.S. Many thanks to Chapi to pointing me to the Smarty site and getting me headed in the right direction.