Velocd
12-08-2002, 03:31 PM
I'm attempting to make a hack that if you are a guest, and you visit the forum without having a cookie set (or it is expired), you will be redirected to another page requesting alittle info for quick registration.
I can do this easily with a cookie javascript, but I'm wondering how to integrate it with PHP instead.
The code would reside in the global.php, and then make a couple checks:
1. If the viewer is not registered.
2. If the vBulletin cookie for last visit is greater than 1 day, probably using the cookie bblastvisit.
If both return true, then the following line of code is executed:
eval("dooutput(\"".gettemplate('guest_register')."\");");
And some template like that, not necessarily with that name, is opened. This makes it much more simple than creating a javascript and opening up a separate .html or .php file when the body has loaded.
My only problem is figuring out how to do this, or if my logic is right.
Here is my test run (as ridiculous as it might be) ;)
$dayvalue = 86400;
if($bbuserinfo[userid] == 0){
if($HTTP_COOKIE_VARS['bblastvisit'] == "" || $HTTP_COOKIE_VARS['bblastvisit'] + $dayvalue < date()){
eval("dooutput(\"".gettemplate('guest_register')."\");");
}
}
Does any of this seem plausible? :p
I can do this easily with a cookie javascript, but I'm wondering how to integrate it with PHP instead.
The code would reside in the global.php, and then make a couple checks:
1. If the viewer is not registered.
2. If the vBulletin cookie for last visit is greater than 1 day, probably using the cookie bblastvisit.
If both return true, then the following line of code is executed:
eval("dooutput(\"".gettemplate('guest_register')."\");");
And some template like that, not necessarily with that name, is opened. This makes it much more simple than creating a javascript and opening up a separate .html or .php file when the body has loaded.
My only problem is figuring out how to do this, or if my logic is right.
Here is my test run (as ridiculous as it might be) ;)
$dayvalue = 86400;
if($bbuserinfo[userid] == 0){
if($HTTP_COOKIE_VARS['bblastvisit'] == "" || $HTTP_COOKIE_VARS['bblastvisit'] + $dayvalue < date()){
eval("dooutput(\"".gettemplate('guest_register')."\");");
}
}
Does any of this seem plausible? :p