The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Use "global.php" without updating lasactivity and lastvisit
I want to use some vBulletin functions in my own PHP Script. So i have included the global.php in my script. But when my script become executed Vbulletin refreshes the user.lastactivity and user.lastvisit informations in the databse. Is there a way to prevent this? I want to use vBulletin functions but vBulletin shouldn´t regocnizes me as an visitor in the forum.
Many many thanks for some hints. |
#2
|
|||
|
|||
I found notes in includes/session.php
PHP Code:
|
#3
|
|||
|
|||
I am not sure I am 100% correct, but I did this for a script I have and which I didn't want to update the lastactivity or the lastvisit:
In sessions.php find: Code:
if (!SESSION_BYPASS) { if (TIMENOW - $bbuserinfo['lastactivity'] > $vboptions['cookietimeout']) { // see if session has 'expired' and if new post indicators need resetting $DB_site->shutdown_query(" UPDATE " . TABLE_PREFIX . "user SET lastvisit = lastactivity, lastactivity = " . TIMENOW . " WHERE userid = $bbuserinfo[userid] ", 'lastvisit'); $bbuserinfo['lastvisit'] = $bbuserinfo['lastactivity']; } else { Code:
if (!SESSION_BYPASS) { if (TIMENOW - $bbuserinfo['lastactivity'] > $vboptions['cookietimeout']) { // see if session has 'expired' and if new post indicators need resetting if (THIS_SCRIPT != 'yourscriptname') { $DB_site->shutdown_query(" UPDATE " . TABLE_PREFIX . "user SET lastvisit = lastactivity, lastactivity = " . TIMENOW . " WHERE userid = $bbuserinfo[userid] ", 'lastvisit'); $bbuserinfo['lastvisit'] = $bbuserinfo['lastactivity']; } } else { Code:
if (THIS_SCRIPT != 'yourscriptname') [code]define('THIS_SCRIPT', 'yourscriptname'); Mind you I am using vB 3.0.xx so the code may be different if you are using a later version. |
#4
|
|||
|
|||
No need to edit vb's files. Add the following before calling global.php:
PHP Code:
|
#5
|
|||
|
|||
Sorry for reviving an old thread, I admit I didn't check the date.
Can you please let me know if the above are for vB 3.0.xx or later? I can't find the NOCOOKIES parameter nowhere, so I have to assume that it is for later vB releases? |
#6
|
|||
|
|||
That define was added in vB 3.5
|
#7
|
|||
|
|||
Well, if you use those parameters, then the external program doesn't get any $bbuserinfo. With my clumsy solution it does, the only thing that doesn't happen is to update the lastvisit and lastactivity parameters, which is what the original question was about.
|
#8
|
|||
|
|||
I was assuming that belinea didn't want to be seen as a visitor to the forum (full stop, meaning no sessions either). However, it appears (although I haven't tested this) you can bypass the user (member) activity update using:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|