views:

47

answers:

3

I'm a Drupal nub. I would like to check on every page if user (anonymouse) agreed to somekind of terms. I suppose i should write small custom module ?

Where will this condition be written if(!$_COOKIE('confirm')){ //jQuery show confirmation form //Set cookie for 1hour } maybee in page.tpl.php ? Please, give me some tips ..

A: 

If you don't want to store the info for a long time, you should use $_SESSION variable. Then in preprocess page you could check if the user has accepted and set a variable that you can use in your page.tpl.php.

googletorp
I have many .tpl.php pages and nodes. Where should be the condition written, in every .tpl.php ? Thank you for answering ..
openfree
i should write themeName_preprocess function, right ? and inside should be if statement ...
openfree
A: 

user_save() accepts an array argument which you can put custom data into. This will then be loaded with your $user object and you can use in any template file.

Jeremy French
This won't work for anonymous users.
googletorp
A: 

Check out these modules:

http://drupal.org/project/legal

http://drupal.org/project/terms_of_use

AdamG