General discussion

Locked

More elegant XSSI, please

By Eva the librarian ·
Hello,

I have written an XSSI solution to displaying variable content on a web page.

At differing times each day, a graphic appears. that leads people to an online service. When it's closed, we don't want anything to appear. We are open M-Th from 1-9, F-S from 2-6, and Sunday from 2-10.

I wrote something that works. But I my way seems too "verbose." Is there a more elegant way to say the following?:

<!--#config timefmt="%A %H"-->
<!--#if expr="(\"$DATE_LOCAL\" = /Friday/ ?? \"$DATE_LOCAL\" = /Saturday/) && (\"$DATE_LOCAL\" = /14/ ?? \"$DATE_LOCAL\" = /15/ ?? \"$DATE_LOCAL\" = /16/ ?? \"$DATE_LOCAL\" = /17/ ?? \"$DATE_LOCAL\" = /18/)" -->
<img src="images/button.gif" width="100" height="50" alt="Visit our live informationservice." border="0">

<!--#elif expr="(\"$DATE_LOCAL\" = /Sunday/) && (\"$DATE_LOCAL\" = /14/ ?? \"$DATE_LOCAL\" = /15/ ?? \"$DATE_LOCAL\" = /16/ ?? \"$DATE_LOCAL\" = /17/ ?? \"$DATE_LOCAL\" = /18/ ?? \"$DATE_LOCAL\" = /19/ ?? \"$DATE_LOCAL\" = /20/ ?? \"$DATE_LOCAL\" = /21/ ?? \"$DATE_LOCAL\" = /22/)" -->
<img src="images/button.gif" width="100" height="50" alt="Visit our live information service." border="0">

<!--#elif expr="(\"$DATE_LOCAL\" = /Monday/ ?? \"$DATE_LOCAL\" = /Tuesday/?? \"$DATE_LOCAL\" = /Wednesday/ ?? \"$DATE_LOCAL\" = /Thursday/) && (\"$DATE_LOCAL\" = /13/ ?? \"$DATE_LOCAL\" = /14/ ?? \"$DATE_LOCAL\" = /15/ ?? \"$DATE_LOCAL\" = /16/ ?? \"$DATE_LOCAL\" = /17/ ?? \"$DATE_LOCAL\" = /18/ ?? \"$DATE_LOCAL\" = /19/ ?? \"$DATE_LOCAL\" = /20/ ?? \"$DATE_LOCAL\" = /21/)" -->
<img src="images/button.gif" width="100" height="50" alt="Visit our live information service." border="0">

<!--#else -->
<p>Sorry, we're closed right now. But you can email us your question.</p>
<!--#endif -->

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums