How to show a particular intervention page on a specific date, e.g. showing a 'study has finished' page

From Lifeguide Wiki
Jump to navigation Jump to search

You can show a different page 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 date, 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 THIS 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 uses the function "currenttime ()" , which represents the exact time at the present moment. The first line of logic will show the page welcome if the current time is earlier (< less than) than Thursday 24th Apr 2014 17:06:40 GMT (ie. Unix time: 1398359200). The second line will show the page welcome_studyclosed on or after (>= greater than or equal to) this date.