Previous Thread
Next Thread
Print Thread
Rate Thread
#252320 06/24/2003 7:37 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

Sponsored Links
BlarC #252321 06/24/2003 7:45 PM
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
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

palmen #252322 06/24/2003 8:32 PM
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.

Daine #252323 06/25/2003 4:26 PM
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. =]

c0bra #252324 06/25/2003 4:27 PM
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.

Sponsored Links
Daine #252325 06/25/2003 4:31 PM
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.

c0bra #252326 06/25/2003 4:47 PM
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.

Daine #252327 06/25/2003 4:56 PM
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.

c0bra #252328 10/16/2003 5:48 PM
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.
wht #252329 10/16/2003 5:52 PM
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.

Sponsored Links
Daine #252330 10/17/2003 6:26 AM
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:
Code
   $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.

c0bra #252331 10/17/2003 7:42 AM
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.

c0bra #252332 10/17/2003 8:26 AM
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.

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)