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.
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
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 />
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. =]
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.
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.
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)...
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.