How to show a particular intervention page on a specific date

From Lifeguide Wiki
Revision as of 13:19, 15 July 2013 by Judy (talk | contribs)
Jump to navigation Jump to search

You can show a different page to uses according to the date you would like a particular page to be viewed. For example, if you want to end your study on a specific datc, you can replace your home page with a 'study finished' page which will tell users that your study has finished and new users will no longer be able to register. You can keep a login button on the new home page so that existing users can still login.

IMPORTANT: IF YOU USE THE LOGIC BELOW TO CHANGE WHEN A PAGE IS DISPLAYED, YOU CANNOT CHANGE THE DATE ONCE YOUR INTERVENTION HAS GONE LIVE. This logic should only be used when you are absolutely sure that you want a particular page to be displayed at a specific time.

Computers read dates in Unix time (the number of seconds that have elapsed since Midnight on Thursday, 1 January 1970 - Coordinated Universal Time) Therefore, when you want to enter a date into the LifeGuide logic, you will have to enter it in Unix time. Converting a date into Unix time can easily be done here: http://www.onlineconversion.com/unix_time.htm

Example 1 show welcome if (currenttime () < 1398359200) show welcome_studyclosed if (currenttime () >= 1398359200)

This example used the function "currenttime" which is the welcome page will be shown if the current time is earlier than Thursday 24th Apr 2014 17:06:40 GMT (ie. Unix time: 1398359200). After this date, the page welcome_studyclosed will be shown.