Angelfire
Username:    Password:   
Build > Script Library > Timely Content Script

Script Library: Timely Content

This script lets you display different content on your page depending on the time of day, date, or day of the week.

Example:

Be as specific as you want - include a time, date, or day of the week. Use text, an image tag, or any valid HTML. The choice is yours!

Follow the editing instructions after the // and after the <!--comment tags--> to customize the script, after you copy and paste it into your HTML editor.

Step One
First, you need to build a configuration file. This file contains information about what you want to display and when you want to display it. You can use any text editor on your desktop to build the file, or create a new file in the Web Shell using the Advanced editor. The contents of the file should include the following elements. Each element should be separated by a carriage return.

BEGIN: Date, day of the week, or time you want to begin showing the content
END: Date, day of the week, or time you want to stop showing the content
Text, image tag, or HTML for the content you want to show
DEFAULT
Content you want to show the rest of the time

Here's the configuration file for the example above:

Things to keep in mind:
  • You should specify a BEGIN and END line for each piece of content you want to display.
  • You should specify DEFAULT content to cover any period of time that does not fall in any of the BEGIN and END lines.
  • Choose either a beginning and end time, a beginning and end date or a beginning and day for your content.
  • If you choose both a date and time, the script will only pay attention to the date.
Date
  • Dates should follow the "month/day/year" format; the script will accept 09/09/1999, 9/9/1999, and 9/9/99 equally well.
  • Days need to be spelled out (ex. "Wednesday", not "Wed.").
Time
  • Times are listed as hours:minutes -- the script will read both 09:34 and 9:34 formats.
  • Times can be either 24-hour or 12-hour; if you choose the 12-hour format, the time should be followed by an "AM" or "PM". The "a.m. and "p.m." formats will NOT work.
Step Two
Save/upload the configuration file.

Save the configuration file you created in Step One as a text file. If you created the file with an offline editor, upload it to your homepage directory using the Web Shell or FTP.


Step Three
Put the HTML in your page

Copy and paste this text into your HTML editor: