Greetings! Today I present a plugin created for MyBB software that was inspired by this thread: https://hackforums.net/showthread.php?tid=5363460
Essentially this plugin will allow you to easily view if a member is online while you are browsing forums (forumdisplay.php).
![[Image: 4K73lne.png]](https://i.imgur.com/4K73lne.png)
The green circle is the default online color and the gray circle is the default offline color. I have opted not to include the "away" status.
Installation
Installation is very simple.
inc/plugins/tr_online_status.php and activate the plugin (Thread Results Online Status) in the plugin manager.
Only one template edit is made.
template name: forumdisplay_thread
before: {$thread['profilelink']}
after: {$thread['online_status']}{$thread['profilelink']}
The function uses two hooks and NO additional queries are made. The first hook alters the $ratingadd variable to include u.lastvisit, u.lastactive, u.invisible to be grabbed when querying for the list of forum threads. The second hook processes the online status of the user and displays either online or offline icon.
To change the color of the online/offline icons, simply change the color values for these two variables in the plugin code:
The current colors are designed for a dark theme.
SOURCE CODE (pastebin embed):
Spoiler (Click to View)
Enjoy!
Essentially this plugin will allow you to easily view if a member is online while you are browsing forums (forumdisplay.php).
![[Image: 4K73lne.png]](https://i.imgur.com/4K73lne.png)
The green circle is the default online color and the gray circle is the default offline color. I have opted not to include the "away" status.
Installation
Installation is very simple.
- Create the file: inc/plugins/tr_online_status.php
- Be sure to create the file in the plugins directory!
- Fill the newly created file with the following code (pastebin embed):
Spoiler (Click to View)
- Active the plugin via the plugin manager in AdminCP.
inc/plugins/tr_online_status.php and activate the plugin (Thread Results Online Status) in the plugin manager.
Only one template edit is made.
template name: forumdisplay_thread
before: {$thread['profilelink']}
after: {$thread['online_status']}{$thread['profilelink']}
The function uses two hooks and NO additional queries are made. The first hook alters the $ratingadd variable to include u.lastvisit, u.lastactive, u.invisible to be grabbed when querying for the list of forum threads. The second hook processes the online status of the user and displays either online or offline icon.
To change the color of the online/offline icons, simply change the color values for these two variables in the plugin code:
Code
$online_color = "#32CD32";
$offline_color = "#666666";The current colors are designed for a dark theme.
SOURCE CODE (pastebin embed):
Spoiler (Click to View)
Enjoy!
![[Image: DE93-ABEA-2-E28-4-F9-D-9-BB6-312-B3328937-E.png]](https://i.ibb.co/BcJWkqN/DE93-ABEA-2-E28-4-F9-D-9-BB6-312-B3328937-E.png)




![[Image: j2RMNCH.gif]](https://i.imgur.com/j2RMNCH.gif)