View Full Version : logging users off when they leave the DOMAIN?
Is it possible?
Basically onlineDJ.com is a big site and doesnt only have the vBulletin forum on it. Users generally spend time reading articles and tutorials and are going in and out the board pages.
I would like to keep these members and guests listed in my $loggedinusers unless they leave the DOMAIN not the boards...
Is there anyone who would have an idea about a process to achieve this? Not all the site uses PHP by the way.
Maybe checking for the vBulletin cookie, etc..?
Thanks for helping me out
To use the logout script youl have to do a exit button Or a popup that pops when users are leving your site.
wait wait...
i am not sure to understand here..
i would like my visitors to be considered as logged in (or guests) even when they are not in the board, but visiting other pages on the domain.
Something that would avoid peopel from being removed from the "active users" list until they leave the domain itself.
Maybe adding a cookie thing?
please let me know if you can figure this out
Mine appears to do this, quite by accident I might add. I believe it has to do with the online hack that is called through my header file to display how many users are online -- it appears on every page of the site.
I'd be happy to try to recreate how I got to that point if you still need it!
it would be great! I would like any visitor who is browsing the domain to be logged as a guest at least (And prompted to log in if they visit the forums).
I found this hack somewhere here on the VB boards, but can't remember where exactly.
I made a file called online.php which consists of the following:
-----------------------------------------------------------------------
<?php
chdir($DOCUMENT_ROOT . "/forums");
require($DOCUMENT_ROOT . "/forums/global.php");
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
$guests=$loggedins[sessions];
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
$members=$loggedins[sessions];
echo "There are currently $members forum members and
$guests guests online. <a href=/forums/index.php>Join us!</a>";
?>
-----------------------------------------------------------------------
I uploaded this to the forums directory. Then I inserted the following into my header file on my non-vb pages (I use SSI)
<!--#include virtual="/forums/online.php3"-->
I don't know if it includes ALL guests, but it does appear to include all members. If they are anywhere within my site, their user name shows in the who's online on the main forums page.
Hope this does the trick for you!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.