|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Is there a mod that will show an Online or Offline status under a users avatar or username? I had a user ask me about this and did some digging here but didn't see anything but thouth I would ask.
|
|
|
|
Joined: Feb 2002
Posts: 1,759
Addict
|
Addict
Joined: Feb 2002
Posts: 1,759 |
Hmm.. come to think of it, I don't think I've seen a hack for this, at least not in recent times. I would be interested in something like this as well
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
I've thought about it. Nearest I can figure is you'd have to add a third table to the query where it grabs the posts and users - have it also query the online table and then join them. Haven't had time to play with it to see if I can pull it off without stressing things. A nice substituition is the who's online mod that displays the user's names at the top of the screen on every page.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Yeah, I just saw the same thing on fudforum and thought it would be a nice hack for threads.
One way to not increase the load would be to add a field to the users table that says if they are online or not. Might be a bit tricky to make it update users who are not online though. =]
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
You might have to have the online function update it there as well. Which is another query on every page. I dunno - maybe a join when it's displayed.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Adding an extra join or query on the most heavily used script isn't really a good idea... At least not for a function that doesn't give much extra information.
Maybe every time someone logs in all users online status would be updated? That script isn't run very often, but it should keep it fairly up to date. Also, the online page could do the same thing, so that it is possible to catch users who have left since the last login.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
I'm just not sure how you'd clear them out and change them to offline when they weren't online any more.
Actually now that I think about it - showflat and show threaded already query the online table - to show how many people are browsing this forum. Maybe those queries could be expanded to grab the user iids of who is online - then match them up. I haven't really looked at it. But maybe that could be expanded.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Well, it's just the same way as online.php does it, if online.php wouldn't show them on the list, there online bit shouldn't be set. The user id:s of the users online could be stored (they should be in w3t_Online), and then two update queries on the user table:
UPDATE w3t_Users SET U_Online = 0 WHERE U_Online = 1 AND U_Number NOT IN ( list_of_id:s ) UPDATE w3t_Users SET U_Online = 1 WHERE U_Number IN ( list_of_id:s )
But if showflat/showthreaded already reads the online table your idea should work.
|
|
|
|
Joined: Oct 2003
Posts: 23
User
|
User
Joined: Oct 2003
Posts: 23 |
Please understand me a lot. What must I change or add in showflat? and where I must include "UPDATE w3t_Users SET U_Online = 0 WHERE U_Online = 1 AND U_Number NOT IN ( list_of_id:s ) UPDATE w3t_Users SET U_Online = 1 WHERE U_Number IN ( list_of_id:s )"
Sorry for my english.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
That was just a theory or discussion. So far there's been no efficient way to do this without having to add another JOIN to a heavily used script. Probably need some major script hacking to make this work.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Ignore my queries in this thread, they are unnecessary. The w3t_Online table contains all the info we need already, we don't need to addy any fields to the database or do any update queries. Everytime a page is loaded the Online-table get's updated with the latest stats for that user. To get a list of all current online users (who was active in the last 10 minutes) you only need to do this: $Outdated = $html -> get_date() - 600; <br /> $queryOnline = " <br /> SELECT t1.O_Username,t2.U_Visible,t2.U_Color,t2.U_Number <br /> FROM {$threadspre}Online AS t1, <br /> {$threadspre}Users AS t2 <br /> WHERE t1.O_Username = t2.U_Username <br /> AND O_Last > $Outdated <br /> ORDER BY t1.O_Last DESC <br /> "; Actually, the join isn't necessary, you only need the user id:s to be able to check against it to know if the online image should be lit or not next to each user. Also, I think it would be possible to change the query that reads how many are browsing the current forum so that it also reads info about all who are online. I'll get working on that.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Scrap the query above as well. You can find a finished hack for this called Online Users in the Modifications forum.
|
|
|
|
Joined: Oct 2003
Posts: 23
User
|
User
Joined: Oct 2003
Posts: 23 |
Thank you very-very math !!! this hack is very popular... on such forums as ikonboard invisionboard vbulletin... now it is on ubb.threads - That`s GOOD!!!
Sorry for my english.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|