Previous Thread
Next Thread
Print Thread
Rating: 10
#262227 11/06/2003 10:10 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Mod Name / Version: Online Users 2.1

Description: This is a modification that adds information on about the online status of users next to their username on posts made by them.

[:"red"]Version 2.0 is only an update to make it work with UBB.threads 6.4.

Version 2.1 is a small bugfix to make sure everyone is listed as online.[/]

Working Under: UBB.Threads 6.4

Mod Status: Beta

Any pre-requisites: PHP 4

Author(s): Gardener

Date: 11 Dec 2003

Credits: ericgtr for updating to 6.4, Catshadow for requesting it the last time.

Files Altered: showthreaded.php, showflat.php, templates/default/showthreaded.tmpl, templates/default/showflat.tmpl

New Files: None

Database Altered: No

Info/Instructions: I don't have any pictures for this so you will have to provide them yourself if you don't like the text. If anyone has any appropriate pictures I would glagly add them to the code and update the instructions if they send them to me.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Attachments
98992-Online_Users_for_6_4.txt (0 Bytes, 227 downloads)

Last edited by Gardener; 12/10/2003 7:48 PM.
Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Sweet work!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
All credits go to ericgtr who updated it, I just released it. =]

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Thanks Ericgtr running on my 6.4

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
NP guys but all I did was update the instructions to 6.4br1, mostly just placement. This baby is 100% Gardener's and a very cool mod at that

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Ok thanks to gardner too.. Members loving it already

Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
I found a lot of users were not showing as online even though the online screen showed them, upon investigation thier U_visible wasnt set at all, so I have changed:
$Visible == "yes" to $Visible != "no" in the showflat and show threaded.php files.

I also ran this query to make sure everyone was set to yes


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, thanks for the bug report and fix, I'll update the first post of the thread with this change.

Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
A user has reported that when viewing a post the users online in the extra info are showing 0, any one else get this ?


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Sponsored Links
Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
what I mean is this variable is staying at '0'


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
I have split the query back into two to get it to work:

Code
<br />// Find out how many are browsing this forum<br />   $query = "<br />      SELECT O_Type,O_Board,COUNT(*)<br />      FROM   {$config['tbprefix']}Online<br />      WHERE  O_Board = '$Board'<br />      GROUP BY O_Type<br />   ";<br />   $sth = $dbh -> do_query($query);<br />   $a = "0";<br />   $r = "0";<br />   while (list($Type,$Extra,$onlinecount) = $dbh -> fetch_array($sth)) {<br />      ${$Type} = $onlinecount;<br />   }<br /><br />// Start of Online Users hack.<br />// Find out how many are browsing this forum and check who are online.<br />   $Outdated = $html -> get_date() - 1800;<br />   $queryOnline = "<br />      SELECT O_Uid,O_Type,O_Extra<br />      FROM   {$config['tbprefix']}Online<br />      WHERE  O_Last > $Outdated<br />      ORDER BY O_Last DESC<br />   ";<br />   $sth = $dbh -> do_query($queryOnline);<br /><br />   while (list($ol_usernum,$Type,$Extra) = $dbh -> fetch_array($sth)) {<br />      // Check if the user is browsing this board and update the counters accordingly<br />      // Add this user to the list of online users if they are logged in.<br />      if ( $ol_usernum ) {<br />        $OnlineUsers[] = $ol_usernum;<br />      }}<br />


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Actually that is not necessary, the reason it didn't work properly is because the info about which board they are visiting has been changed in 6.4 which wasn't taken into consideration when the mod was updated. Try this:

Code
#<br /># Find this:<br />#<br /><br />// Find out how many are browsing this forum<br />   $query = "<br />      SELECT O_Type,O_Board,COUNT(*)<br />      FROM   {$config['tbprefix']}Online<br />      WHERE  O_Board = '$Board'<br />      GROUP BY O_Type<br />   ";<br />   $sth = $dbh -> do_query($query);<br />   $a = "0";<br />   $r = "0";<br />   while (list($Type,$Extra,$onlinecount) = $dbh -> fetch_array($sth)) {<br />      ${$Type} = $onlinecount;<br />   }<br /><br />#<br /># Change to:<br />#<br /><br />// Start of Online Users hack.<br />// Find out how many are browsing this forum and check who are online.<br />   $Outdated = $html -> get_date() - 600;<br />   $queryOnline = "<br />      SELECT O_Uid,O_Type,O_Board<br />      FROM   {$config['tbprefix']}Online<br />      WHERE  O_Last > $Outdated<br />      ORDER BY O_Last DESC<br />   ";<br />   $sth = $dbh -> do_query($queryOnline);<br />   $a = 0;<br />   $r = 0;<br />   $OnlineUsers = Array();<br />   while (list($ol_usernum,$Type,$VisitingBoard) = $dbh -> fetch_array($sth)) {<br />      // Check if the user is browsing this board and update the counters accordingly<br />      if ( $VisitingBoard == $Board ) {<br />         ${$Type}++;<br />      }<br />      // Add this user to the list of online users if they are logged in.<br />      if ( $ol_usernum ) {<br />         $OnlineUsers[] = $ol_usernum;<br />      }<br />   }<br />// End of Online Users hack.


Now, I haven't tried this, but I think it should work. =]

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I believe you need to keep the quotes in $a="0"; and $r="0";

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
As I use those as integers (for each user online I increase the number by one) they shouldn't have quotes. It won't really matter though, unless they are checked with === at some point later in the script and I don't see why that would be necessary.

But of course I can be wrong. =]

Joined: Sep 2001
Posts: 129
Member
Member
Offline
Joined: Sep 2001
Posts: 129
Gardener you can have 10 points for that one, cheers


Regards
Clint

Running on WIN2003 Web Server.

Paranoid people get followed too!
Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
Will this work for 6.5? It seems like all the mods are breaking for 6.5, requiring them to be rewritten. What about this one?

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]donJulio said:
Will this work for 6.5? It seems like all the mods are breaking for 6.5, requiring them to be rewritten. What about this one? [/]

This is definitely a great hack that should be implemented in the upcoming version.

I would also like to know if this will work with v6.5.1.1. Anyone had success with this yet?

Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I have it working with 6.5.1.1

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]donJulio said:
I have it working with 6.5.1.1 [/]

Thanks for confirming....did you have to change any of the code to implement this hack into 6.5.1.1 that I should know about before I get started?

Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I don't recall having to change any of the code exactly, but it was a little more work figuring out where to put the code in the .php files because I think the snippets they tell you to look for and then paste the new stuff under had changed a little bit, so the Copy + Find didn't work for me. The code added by the mod doesn't need to be changed.

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Thanks....yea, through what you gave me....I just worked through it and it's up and running.

Thanks again for the reply,
Gonzo

Joined: Feb 2005
Posts: 7
Lurker
Lurker
Offline
Joined: Feb 2005
Posts: 7
It's working for me too (6.5.1)...

Can someone modify the code to allow admins and mods to see the online status. When the users has set the status in hois profiel to NO (Do you want to be visible on the "Who's Online" screen?), than also admins and mods are showing the OFFLINE icon or status...

It would be fine to have a separate status for "invisible" users (to make another icon for this > online but invisible)...


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
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
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
WebGuy 2
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 20221218)