[ic] Adding a system wide module

Duane Hinkley duane at dhwd.com
Mon Jan 31 09:57:36 EST 2005


Jeff Fearn wrote:

>Hi, I want to allow the Date::Calc modules functions to be used in the
>HTML pages on my site. Is there one place I can put this that will
>allow it to be run on any store on the server?
>
>Jeff
>_______________________________________________
>interchange-users mailing list
>interchange-users at icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
>  
>
Jeff,

That's a piece of cake.  You just need a user tag.  Look in your 
Interchange directory under /usr/lib/interchange/code and you'll find a 
bunch of examples.  The ones that will be closest to what you'll want is 
in /usr/lib/interchange/code/SystemTag.

Once you write the user tag, copy it to 
/usr/lib/interchange/code/UserTag, add it to the requires line in the 
catalog.cfg and restart Interchange.  There's more in the documentation 
on UserTags.

If you want an easier route, here's some date examples I have:

- Reformat date

[convert-date fmt="%b %e, %Y %l:%M %P"][loop-data transactions 
order_date][/convert-date]


- Perl Time:

[perl ]
       return $Tag->time({sortable =>'true'});
 [/perl]
[perl]
       return $Tag->time('',{ format => '%Y%m%d%H%M%S'});
[/perl]


- Tag Time:

[tag time]%Y%m%d %H:%M:%S[/tag]


- Date Calculations (Date two months ago today):

[seti start_date][query sql="SELECT  DATE_FORMAT( DATE_SUB( NOW(  ) ,  
INTERVAL 2 MONTH  ) ,  '%Y%m%d'  ) as date " list=1][sql-param 
date][/query][/seti]

-- 

Sincerely,

Duane Hinkley
Down Home Web Design, Inc.
(208) 424-0572 Fax(208) 587-0738

duane at downhomewebdesign.com
www.downhomewebdesign.com



More information about the interchange-users mailing list