Forum Moderators: phranque
<cfif DateDiff('d',atnArticle.dt,Now()) gt 365*2>
<a href="../atnSupport/search.cfm"><img src="../atnImages/atnWarn.gif" border="0"></a>
<cfelse>
<img src="../atnImages/atnLogo.gif" border="0"><br><!-- #BeginLibraryItem "/Library/sendatn.lbi" -->
<CFELSE> indicates to only execute sendatn.lbi IF the article is greater than 2 years old.
WHAT I NEED: if article is greater than 2 years old, then it displays atnWarn.gif. BUT ALSO, I need for sendatn.lbi be available on ALL pages - and not just those 2 years old.
Can someone possibly help me out quickly?
Thanks,
//Gary
<!-- set value for date -->
<cfset atnArticle.dt = "9/12/2002 10:15:28 PM"><cfif DateDiff('d',atnArticle.dt,Now()) gt 365*2>
<!-- Use this if older than 2 years -->
<a href="../atnSupport/search.cfm"><img src="../atnImages/atnWarn.gif" border="0">Warning!</a>
<cfelse>
<!-- Use this if within 2 years -->
<img src="../atnImages/atnLogo.gif" border="0">! OK!<br><!-- #BeginLibraryItem "/Library/sendatn.lbi" -->
</cfif>
Not sure if you got it working but you were close, not sure if the library item is supposed to be used if the article is older than two years. IF so the library item needs to be before the <cfelse>.
The way it is coded is IF older than 2 years do warning ELSE do atnLogo.gif and Library Item.
Hope this helps.
XtendScott