I am busy making a website in which something of an intro page should be included. Once shown it won't be seen again untill you clear your cookies.
Since I am using CMSMS it complicates that a bit. I would like to use some module functionality on that page (calendar items). Any ideas on how to make a intro page that only shows once?
Anyone done this before?
[solved]Intro page, cookie?[/solved]
[solved]Intro page, cookie?[/solved]
Last edited by vinyl on Wed Jul 06, 2011 6:02 pm, edited 1 time in total.
Re: Intro page, cookie?
You know the name? I have been looking for "Cookie", "Intro", "Splash" etc..
Re: Intro page, cookie?
just create a UDT that checks if the cookie is set, then redirects to another page, else set the cookie.
Re: Intro page, cookie?
I solved this doing the following (some of it I written myself other part is from the web, possible Calguy?)
You include this in your default page. What it does is check if the intro cookie is there. If it is not, it will set the cookie and redirect you to an intro page.
Code: Select all
if(!$_COOKIE["intro"]) {
// page alias for the intro page
$redirect = 'intro';
// cookie settings
$c_name = "intro";
$c_days = 30; //in days
$c_expire = 86400 * $c_days;
global $gCms;
setcookie("intro",1, time()+$c_expire,'/','.your_web_page');
$manager =& $gCms->GetHierarchyManager();
$node =& $manager->sureGetNodeByAlias($redirect);
$content =& $node->GetContent();
if (isset($content) && is_object($content))
{
if ($content->GetURL() != '')
{
redirect($content->GetURL());
}
}
}