Imagine you would like to countdown the number of days till the New Year on the start page. The days should be counted automatically and displayed at the place where the user-defined tag is added in the content.
1. In the admin console, click on Extensions | User Defined Tags.
2. At the bottom of the page, click on Add User Defined Tag.
3. Enter countdown as the name of the new user-defined tag and the following code snippet into the field Code:
$target = mktime(0, 0, 0, 1, 1, 2011); $diff = $target time(); $days = floor($diff/86400); echo $days;
4. Click on Submit.
5. Open any page of your website, and add the user-defined tag, shown as follows:
It is {countdown} days until 1. January 2011
6. Click on Apply, and see the result on the page.