PDA

View Full Version : vB Cookie Detector - Detects if user has cookies switched on in browser.


Erwin
03-04-2003, 10:00 PM
vB Cookie Detector - Detect if user has cookies switched on in browser!

Tired of members getting the no permission page because they have cookies switched off? Want them to have a quick way of checking to see if they have cookies switched on or off?

This is a fairly simple hack really to detect cookies in your user's browser, based on 1 PHP file, and 3 new templates. It was requested.

All you need to do is to upload the cookies.php file in your forum directory, add the 3 new templates. Then link to the cookie.php file, and your member will be told whether cookies are switched on in their browser or not.

The message is based on standard vB templates, so I'm not going to post screenshots as they are redundant.

1) Upload cookies.php to your forum directory.

2) Add the 3 new templates

3) Link to cookies.php

Done! Enjoy! :)

Boofo
03-05-2003, 12:55 AM
I know this is a stupid questions for an about-to-be Admin how would you use this? :)

Jalrock
03-05-2003, 12:56 AM
Troubleshooting errors?

Boofo
03-05-2003, 01:13 AM
It doesn't seem to be calling the templates. It is just opening up a new window with the lines from the cookies.php file. ;)

Erwin
03-05-2003, 01:33 AM
Oops... I uploaded the wrong cookies.php - that was my other PHP version, which did not work as nicely... :) This one is my javascript version, which works better.

Please CLEAR your CACHE, and download the NEW ZIP - the cookies.php will now have reference to the templates.

Boofo
03-05-2003, 01:41 AM
Ahhhh, much better. ;)

Is there a way to have this work in vb without having to go to an outside file?

Erwin
03-05-2003, 01:45 AM
Sure - copy the code into your members.php file, and change cookies.php reference in the cookies_check templaet to members.php - however, I wanted it in a separate file as members.php is so big already. Makes it easier to upgrade too.

MetroSports82
03-05-2003, 02:02 AM
cool, thanks Erwin. :)

GsxrTony
03-05-2003, 01:56 PM
Hey Erwin thanks fro replying to my other post with this link. I just installed it and it worked great.

Dean C
03-05-2003, 03:34 PM
Good idea Erwin. Perhaps a screen on the registration page prior to the form could prompt the removal of the cookie field on registration form if the cookies aren't enabled in that users browser :D

- miSt

gmarik
06-09-2003, 05:55 PM
Cool, keep it going.

Crank
01-28-2004, 02:38 AM
having trouble with this
i have the board setup so only registered members can view. so you cant see anything but the login page unless you are regd. when i tried to just go to the cookies.php it returned me to the login page. and when i tried to add to the member.php file i got a erorr and nobody was able to log in. im on 2.3.4 any help would be appreciated.

wickedfate
01-28-2004, 10:32 PM
it works fine for me :)