PDA

View Full Version : Would this be possible?


08-12-2000, 11:43 PM
Before I start, I just want to make sure everyone knows that this is a [request] :D

All kidding aside, here's the dirt: How hard/easy would it be to create a hack that checks to see if a visitor to my website is a member on my forums, and if not to shoot up a pop-up window about registration? The thing is, I don't want to subject my existing members to an annoying popup window - and I'll probably set it in the cookie to only pop up once a day for visitors anyway. But what would be involved with this? Anyone want to give it a go?

-jim

08-13-2000, 01:18 AM
it's actually really easy, but keep in mind that it will pop up for users who are logged out.

If you turn PHP on in your header, you could say:

if (!$bbuserid) {
//$bbuserid is a cookie that has the userid - hence showing that they're logged in. If it doesn't exist, they aren't.
if (!$YourCookieThatPreventsThePopUp) {
//Change that to whatever you call the checking popup, since you don't want it to popup on EVERY forum page
$loggedincheck = ''; //Fill that in with the JavaScript popup code.
}
}
Then reference $loggedincheck wherever you want - header, or cssinclude so it gets stuck in the <head> of the document.

08-13-2000, 05:05 AM
Cool - If I wanted to do this on my main page, would I just have to require global.php or anything like that?

08-13-2000, 05:48 AM
Originally posted by JimF
Cool - If I wanted to do this on my main page, would I just have to require global.php or anything like that?

Nope, the $bbuserid is a cookie. So, there is no need for global, unless you want to print out information from the profile.

08-13-2000, 06:02 AM
well, Jim - you might have to change your cookie path.

Personally, I use "/" as mine, instead of "/cpa/forums", simply because I might want to use it on my site.

If you leave it as "/forums", it might not get pulled from your site.

And actually, if you use forums.bronx-bombers.com, I don't know if it's possible to pull the cookie...