PDA

View Full Version : Need Help with a Hack


Michael Morris
10-25-2004, 07:11 PM
I have created a template based tip of the day module and it's fully functional, but I need help with one finishing touch. I only want it to launch once per day or once per session.

I've tried to use $bbuserinfor['lastvisit'], but that won't update until you go inactive for awhile.

I only want one launch per visit. How?

AN-net
10-25-2004, 07:16 PM
did u try using the cookies left by vb?

Xenon
10-25-2004, 07:41 PM
try the lastactivity value instead of lastvisit :)

Michael Morris
10-25-2004, 11:04 PM
I think last activity gets reset before PHPINCLUDE_START gets to parse.

Anyway, I think I've thought up a solution - use a cookie to store the date of the last time it launched the pop-up.

I would like to store the cookie using vbulletin's inbuilt functions for handling cookies:

fetch_bbarray_cookie($cookiename, $id)
set_bbarray_cookie($cookiename, $id, $value, $permanent = 0)

What should I know about these functions before calling them?

Michael Morris
10-26-2004, 12:14 AM
Solved the problems, I'll get the writeup ready and release this puppy later tonight.