Okay, so I've got a splash page module that needs to be modified so that the cookie gets set only when the user clicks an "Accept these terms and continue" button. (Don't ask, the client wants a user agreement on the splash page.) Once the cookie is set, the page won't show up again.
I'm not being very familiar with Drupal modules and I don't have an expert around to help me, so if anyone can provide some insight, it would be much appreciated! Thanks!
Here's the module:
/*
USAGE:
In module settings:
- define the HTML for the splash page in the module settings.
- define the path alias for the front page of the site. Change
In site configuration:
- change the front page of the site to be "splash"
In config.php or somewhere similar:
- start output buffering ( add ob_start() )
*/
function echosplash_help($section){
switch($section){
case 'admin/modules#description':
return t('Enables the creation of a splash page');
break;
}
}
function echosplash_menu($type){
$links[] = array(
'access' => true,
'type' => MENU_CALLBACK,
'path' => 'splash',
'callback' => 'echosplash_page'
);
return $links;
}
function echosplash_page($bypass=false){
$page = variable_get("echosplash_page","");
if (empty($page)){
menu_set_active_item("node");
menu_execute_active_handler();