1
Phasma
Date and Time SMARTY Variable
  • 2004/4/14 20:58

  • Phasma

  • Just popping in

  • Posts: 9

  • Since: 2004/2/29


is there a date and time smarty variable within xoops, if not how would I go about creating it?

2
Mithrandir
Re: Date and Time SMARTY Variable

Smarty Time functions

Should work with XOOPS as well

3
fatman
Re: Date and Time SMARTY Variable
  • 2004/4/14 21:07

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


le="color: #000000"><?php // in your php file $xoopsTpl->assign('current_date', time()); <!--// in your template //--> <{$current_date|date_format}>


Is one way to it. You could stick the php in your /footer.php file and then the smarty tag would be available to all your pages.


HTH

4
Mithrandir
Re: Date and Time SMARTY Variable

<{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}> is easier, isn't it?

5
fatman
Re: Date and Time SMARTY Variable
  • 2004/4/14 23:03

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


Quote:

Mithrandir wrote:
<{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}> is easier, isn't it?


I never knew about $smarty.now until I saw your reply above, but by then I had already hit send on my suggestion :P

your way certainly is much easier