<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Quick question to the wisdom of the community... I am not very experience with objects, and I was wondering where will be the right place to define my own smarty functions...<BR>
<BR>
My goal is to have something similar to the sample from the smarty documentation...:<BR>
<BR>
<TABLE cellPadding=5 bgColor=#e0e0e0 border=0>
<TBODY>
<TR>
<TD><CODE><SPAN style="COLOR: #000000"><SPAN style="COLOR: #0000bb"><?php<BR>$smarty</SPAN><SPAN style="COLOR: #007700">-></SPAN><SPAN style="COLOR: #0000bb">register_function</SPAN><SPAN style="COLOR: #007700">(</SPAN><SPAN style="COLOR: #dd0000">'date_now'</SPAN><SPAN style="COLOR: #007700">, </SPAN><SPAN style="COLOR: #dd0000">'print_current_date'</SPAN><SPAN style="COLOR: #007700">);<BR><BR>function </SPAN><SPAN style="COLOR: #0000bb">print_current_date</SPAN><SPAN style="COLOR: #007700">(</SPAN><SPAN style="COLOR: #0000bb">$params</SPAN><SPAN style="COLOR: #007700">, &</SPAN><SPAN style="COLOR: #0000bb">$smarty</SPAN><SPAN style="COLOR: #007700">)<BR>{<BR> if(empty(</SPAN><SPAN style="COLOR: #0000bb">$params</SPAN><SPAN style="COLOR: #007700">[</SPAN><SPAN style="COLOR: #dd0000">'format'</SPAN><SPAN style="COLOR: #007700">])) {<BR> </SPAN><SPAN style="COLOR: #0000bb">$format </SPAN><SPAN style="COLOR: #007700">= </SPAN><SPAN style="COLOR: #dd0000">"%b %e, %Y"</SPAN><SPAN style="COLOR: #007700">;<BR> } else {<BR> </SPAN><SPAN style="COLOR: #0000bb">$format </SPAN><SPAN style="COLOR: #007700">= </SPAN><SPAN style="COLOR: #0000bb">$params</SPAN><SPAN style="COLOR: #007700">[</SPAN><SPAN style="COLOR: #dd0000">'format'</SPAN><SPAN style="COLOR: #007700">];<BR> }<BR> return </SPAN><SPAN style="COLOR: #0000bb">strftime</SPAN><SPAN style="COLOR: #007700">(</SPAN><SPAN style="COLOR: #0000bb">$format</SPAN><SPAN style="COLOR: #007700">,</SPAN><SPAN style="COLOR: #0000bb">time</SPAN><SPAN style="COLOR: #007700">());<BR>}<BR></SPAN><SPAN style="COLOR: #0000bb">?></SPAN> </SPAN></CODE></TD></TR></TBODY></TABLE><BR>
And in the template call the function...<BR>
<TABLE cellPadding=5 bgColor=#e0e0e0 border=0>
<TBODY>
<TR>
<TD><PRE class=programlisting>{date_now}
{* or to format differently *}
{date_now format="%Y/%m/%d"}</PRE></TD></TR></TBODY></TABLE><BR>
<BR>
but I am not sure how/where to connect the php part of the code... <BR>
<BR>
Any help is highly appreciated!!!<BR>
Thanks...<BR>
Ignacio<BR></body>
</html>