The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Custom PHP - Prevent vBulletin from timing users out?
Hello, I run a PHP-based Ajax chatroom on my forum that uses existing vBulletin logins for the chat. By design when users logout of the forums, they are automatically logged out from the chat as well. Unfortunately the auto-logout will occur to vB's timeout option (AdminCP -> Cookie Options -> Session Timeout).
The issue here is that many of my users will just want to chat and not browse the forums. They will be constantly logged out because vB "thinks" that they aren't being active. Is there any sort of PHP function or plugin I can set on the chat script so that they will not be timed-out? Thanks, Mike |
#2
|
|||
|
|||
I assume your chat script is including global.php? If you add a call to exec_shut_down() (sometime after you're done with the vb stuff), it should keep the users active.
|
#3
|
|||
|
|||
For some reason it's causing errors to occur. I am placing the function call under my global.php call - require(AJAX_CHAT_PATH.'../global.php');
This is what I get when trying to access the chat when already logged in to the forums: Code:
Query: SELECT userID, userName, userRole, channel, UNIX_TIMESTAMP(dateTime) AS timeStamp, ip FROM ajax_chat_online ORDER BY userName; Error-Report: Error-Code: Code:
Database error in vBulletin 4.2.0: Invalid SQL: SELECT forumid, title FROM forum WHERE options & 4 AND password='';; MySQL Error : Error Number : Request Date : Tuesday, February 5th 2013 @ 01:44:14 PM Error Date : Tuesday, February 5th 2013 @ 01:44:14 PM Script : http://www.x.com/forums/chat/ Referrer : http://www.x.com/forums/forum.php IP Address : 72.226.103.183 Username : Unregistered Classname : vB_Database_MySQLi MySQL Version : |
#4
|
||||
|
||||
an easy way to keep users active would be to write an easy script that calls global.php and refreshes every X minutes inside a 1x1 iframe in your chat page.
|
#5
|
|||
|
|||
Tried some Javascript functions that re-creates an iframe with the src pointed to globals.php at an interval. I still get timed out.
|
#6
|
|||
|
|||
I'm not sure why that's happening, but you would need to put the call to exec_shut_down() after anything that uses the vbulletin variables or functions. Maybe try moving it to the bottom.
|
#7
|
|||
|
|||
Hmm. Well the chat uses multiple PHP files to run, so finding the end of the vBulletin functions may be out of the question here.
--------------- Added [DATE]1360186567[/DATE] at [TIME]1360186567[/TIME] --------------- Refreshing global.php in an iframe doesn't keep users active (nor does refreshing global.php in its own browser tab). Anything else I could try? |
#8
|
|||
|
|||
I had the same problem and I solved it with installing a plugin called keep me log in. So basically, if you don't push the log out button from forum , the cookie never expire and you can chat until you close or the browser or you log out from forum.
|
#9
|
|||
|
|||
Quote:
Maybe it will work if you use a script that includes global.php followed by a call to exec_shut_down(). |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|