The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How can I get a list of userids of users online?
Hi,
Can somebody please tell me the easiest way to get a list of the userids of the users currently logged in? Thank you. |
#2
|
||||
|
||||
Hi,
I think that the only way to achieve that will be to go through the session table with a bit of coding to get only the real online user (not those with session that is timeout). Clément |
#3
|
||||
|
||||
Where do you want this list? Do you just mean you want to know the userids of the users when you look at the Who's Online list? If so, that can probably be achieved with just a template edit to add the userid next to their name.
|
#4
|
|||
|
|||
Thanks for writing back, guys.
The list would be used to either exclude or include online users in various games, extras, etc., that I am adding to the forum. For instance, anyone logged in at any given time might be given a bonus this or that, or anyone offline might lose points in a game while anyone online might be "protected" from the event. I need an array of the online userids so I can add something to my database queries such as Code:
foreach($offlineUsers as $user) { $sql .= " AND userid != '$user'; } Any advice for how to get this array of online users would be greatly appreciated. Thanks! |
#5
|
||||
|
||||
Take a look at the online.php script. It does a query to get the array (around line 245), so just steal the same query.
|
#6
|
|||
|
|||
Easy enough, thanks so much for pointing me in the right direction!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|