News:

Wondering if this will always be free?  See why free is better.

Main Menu

List Of Users In Topic or Board

Started by dougiefresh, January 05, 2015, 07:13:45 PM

Previous topic - Next topic

dougiefresh

Link to Mod



LIST OF USERS IN FORUM/TOPIC/BOARD v3.1
By Dougiefresh -> Link to Mod



Introduction
This mod modifies the Message Index and Post Display templates so that list of users in the board or topic is moved from above the topic list or start of the post to just above the Quick Reply box, and adds phpBB-like styling to the list.  It also alters the Board Index so that the list of users online is controlled by permission.

Admin Settings
There is a new admin page at Admin -> Features and Options -> Who's Online.  It takes the Enable Who's Online list and User online time threshold options from General tab and places them under the Who's Online.

There is a new option in v2.0 that removes the membergroup coloring that the user belongs to from the users online list.

There are 3 new permisions that allow membergroups to be able to view the users online list for:
o the Board Index (/index.php)
o the Message Index (index.php?board=x)
o the Post Display (index.php?t=x)

There are new options in v3.0 that allows you to move the "Who's Online" box to the top or bottom of the screen, as well as a section controlling whether the "Who's Online" section shows nothing, only numbers, or members for all installed themes.

Compatibility Notes
This mod was tested on SMF 2.0.15, but should work on SMF 2.1 RC2, as well as SMF 2.0 and up.  SMF 2.1 RC1 and before, as well as SMF 1.x, will not be supported.

Translations
o Dutch: @rjen
o Spanish: d3vcho!
o Spanish Latin: Rock Lee

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2019, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Hj Ahmad Rasyid Hj Ismail


dougiefresh

Uploaded v1.1 - January 16th, 2015
o License change to Simplified BSD.  No functionality change.

shazoo!



dougiefresh

Uploaded v1.2 - April 6th, 2015
o Updated for SMF 2.1 Beta 1

Xer0n_

I would suggest the option to remove member group colors, considering I have a light background with bright membergroup names.

Thanks, and nice mod!

dougiefresh

Quote from: Xer0n_ on January 08, 2016, 05:30:06 AM
I would suggest the option to remove member group colors, considering I have a light background with bright membergroup names.
Let me see what I can do.

d3vcho

Translation for Spanish_es and Spanish_es-utf8

8)
"Greeting Death as an old friend, they departed this life as equals"

dougiefresh

Uploaded v2.0 - January 17th, 2016
o Linked displaying all member lists to the "Enable Who's Online" checkbox.
o Added new permission to deny/allow showing member list on board index.
o Added Who's Online under Features and Options to deal with permissions and options.
o Added option to remove the membergroup color code from the members' username.
o Restored option from Themes/{theme}/Settings.template.php that was commented out.
o Added UTF8 and regular Spanish translation to the mod.




@d3vcho: Thank you for the Spanish translation!  However, version 2.0 adds some more strings to translate.  Could you translate them, then attach the spanish language files again?  Thanks!

Quote from: Xer0n_ on January 08, 2016, 05:30:06 AM
I would suggest the option to remove member group colors, considering I have a light background with bright membergroup names.
Your request has been granted!  Thanks for the suggestion!

samimikawi

hello ,

i install the package and i make a check on the browsing in the permission settings but nothing showing in the topics . any idea ?

thanks & Best Regards

dougiefresh

Under Admin => Configuration => Themes and Layouts => Theme Settings, look for Show who is viewing the board index and posts and change that option to Show member names.

samimikawi

after a long search find it working now thanks
really appreciate it

d3vcho

Got 2.0 translated finally. I haven't had a chance lately  8)
"Greeting Death as an old friend, they departed this life as equals"

dougiefresh

Uploaded v2.1 - January 30th, 2016
o Updated Spanish language translation, courtsey of d3vcho.




@d3vcho:  Thank you for the translation!  It's been included in this update!

villasg

Hello my friend .
I want ask you if need to uninstall the previous v1.2 and install this v2.0 , or just install v2

dougiefresh

Most of my mods are not upgradable via Package Manager, so you will need to uninstall version 1.2 before you can install version 2.1

villasg


dougiefresh

Uploaded v2.2 - July 7th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 1 and 2.

SaidJan

Please add other times other than 15 minutes. Like 1 or 4 or 7 days, or always.
Thanks

dougiefresh

Quote from: SaidJan on July 07, 2017, 02:24:32 PM
Please add other times other than 15 minutes. Like 1 or 4 or 7 days, or always.
The options Enable who's online list and User online time threshold have been moved to Admin => Configuration => Features and Options => Who's Online.  Days are expressed in minutes, using a formula like d*60*24 (where d is the number of days).  For example, 1 day would be expressed as 1440 minutes, 7 days would be expressed as 10080 minutes.

Regarding your request, I will see what I can do about changing the UI to allow units of time to be changed to hours, days, and weeks....

SaidJan

Quote from: dougiefresh on July 07, 2017, 03:10:43 PM
Quote from: SaidJan on July 07, 2017, 02:24:32 PM
Please add other times other than 15 minutes. Like 1 or 4 or 7 days, or always.
The options Enable who's online list and User online time threshold have been moved to Admin => Configuration => Features and Options => Who's Online.  Days are expressed in minutes, using a formula like d*60*24 (where d is the number of days).  For example, 1 day would be expressed as 1440 minutes, 7 days would be expressed as 10080 minutes.

Regarding your request, I will see what I can do about changing the UI to allow units of time to be changed to hours, days, and weeks....

I changed it to 50 and 10080, but in the topic it's showing in the last 15 minutes.

dougiefresh

Quote from: SaidJan on July 07, 2017, 03:24:58 PM
Quote from: dougiefresh on July 07, 2017, 03:10:43 PM
Quote from: SaidJan on July 07, 2017, 02:24:32 PM
Please add other times other than 15 minutes. Like 1 or 4 or 7 days, or always.
The options Enable who's online list and User online time threshold have been moved to Admin => Configuration => Features and Options => Who's Online.  Days are expressed in minutes, using a formula like d*60*24 (where d is the number of days).  For example, 1 day would be expressed as 1440 minutes, 7 days would be expressed as 10080 minutes.

Regarding your request, I will see what I can do about changing the UI to allow units of time to be changed to hours, days, and weeks....

I changed it to 50 and 10080, but in the topic it's showing in the last 15 minutes.
Hmmm.... I'll take a look and see what I can figure out....

SaidJan

Just figured out that the minutes is for main index's online members, and not for the topics or boards.
Just to let you know.

dougiefresh

Quote from: SaidJan on July 07, 2017, 04:00:57 PM
Just figured out that the minutes is for main index's online members, and not for the topics or boards.
Just to let you know.
Actually, the minutes thing DOES NOT apply to the topics and boards.  Rather, the list of users in both topics and boards is gathered via the sessions information stored in the database, and is only for the topic/board in question.  Sessions over one day old are deleted by the forum scheduled task code....  I don't think this is something that I can easily change with any accuracy....

aegersz

i often want to see the Guest's IP address (admin only, of course) but that field, unlike the member, is not a link.

not a big deal but i thought it could be useful.

love this mod !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Ronald_1938



dougiefresh has a mod : http://custom.simplemachines.org/mods/index.php?mod=4015

It shows a member viewing topic for 15 minutes, is it possible to change this to show member viewing topic, say for 24 hrs, or maybe longer.

Appreciate any help here.

Ron..

-Rock Lee-

Quote from: Oldcrow on March 01, 2018, 10:26:07 AM


dougiefresh has a mod : http://custom.simplemachines.org/mods/index.php?mod=4015

It shows a member viewing topic for 15 minutes, is it possible to change this to show member viewing topic, say for 24 hrs, or maybe longer.

Appreciate any help here.

Ron..

Looking at the modification I think it takes the general time it has in the forum by modifying this value it should show the last 24 hours...


Regards!


Although it is already the Spanish translation, the Latin translation has variations 8).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Ronald_1938

Quote from: Rock Lee on March 01, 2018, 10:54:42 AM
Quote from: Oldcrow on March 01, 2018, 10:26:07 AM


dougiefresh has a mod : http://custom.simplemachines.org/mods/index.php?mod=4015

It shows a member viewing topic for 15 minutes, is it possible to change this to show member viewing topic, say for 24 hrs, or maybe longer.

Appreciate any help here.

Ron..

Looking at the modification I think it takes the general time it has in the forum by modifying this value it should show the last 24 hours...


Regards!


Although it is already the Spanish translation, the Latin translation has variations 8) .


Regards!

I made some changes, but I think it's only for Who's Online, time, not who is viewing topic time..

dougiefresh

@aegersz:  Where would you like to see the IP address?

@OldCrow: I'm working on updating the mod to correctly show who is "currently" browsing the topic/board, not who is browsing within the last 15 minutes.  I'll also try to fix the strings for the settings, as they can be a little misleading....

@Rock Lee and @d3vcho: Can you translate these strings?  Thanks in advance!!

$txt['users_browsing_topic'] = 'Users currently browsing this topic';
$txt['users_browsing_board'] = 'Users currently browsing this board';


@Everybody:  I need someone to take over maintenance of the Dutch translations.  If you can, please attach your copy of the translated files!  Thanks in advance!

aegersz

@dougiefresh: thank you for entertaining this thought but i think that my request is not worth following up as I can get that information from elsewhere.

it just seemed a good idea at the time but i don't think that anyone would really benefit from it so i won't waste your limited energy.

but, as always, thank you for the service, mod king
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

-Rock Lee-

With pleasure they are here @dougiefresh

$txt['users_browsing_topic'] = 'Usuarios que actualmente navegan por este tema';
$txt['users_browsing_board'] = 'Usuarios que actualmente navegan en este foro';


It goes both utf8 and normal have no accent...


Regards!

ADD: I only took it off for 15 minutes, I also translated it as you requested.
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Ronald_1938

Quote from: dougiefresh on March 01, 2018, 12:39:50 PM
@aegersz:  Where would you like to see the IP address?

@OldCrow: I'm working on updating the mod to correctly show who is "currently" browsing the topic/board, not who is browsing within the last 15 minutes.  I'll also try to fix the strings for the settings, as they can be a little misleading....

@Rock Lee and @d3vcho: Can you translate these strings?  Thanks in advance!!

$txt['users_browsing_topic'] = 'Users currently browsing this topic';
$txt['users_browsing_board'] = 'Users currently browsing this board';


@Everybody:  I need someone to take over maintenance of the Dutch translations.  If you can, please attach your copy of the translated files!  Thanks in advance!

Thanks dougiefesh, I'll wait for your update. By the way I just registered on your forum, but doesn't seem to be active..

aegersz

dougie's site is very much alive but i think he has to approve you or something first.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Ronald_1938

Quote from: aegersz on March 01, 2018, 05:40:46 PM
dougie's site is very much alive but i think he has to approve you or something first.

No problem getting in, just didn't see anyone online..

dougiefresh

Yeah, it's pretty much dead.  Thinking about converting it to more of a static web site than a forum....  Not sure I should even do that....

Ronald_1938

Quote from: dougiefresh on March 01, 2018, 07:25:20 PM
Yeah, it's pretty much dead.  Thinking about converting it to more of a static web site than a forum....  Not sure I should even do that....

Get some posters, maybe it'll take of..

dougiefresh

I've almost got the next version worked out.  It's a definite rewrite, from top to bottom.  Just lacking part of SMF 2.1 Beta 3 support...

Ronald_1938

Quote from: dougiefresh on March 02, 2018, 02:18:42 PM
I've almost got the next version worked out.  It's a definite rewrite, from top to bottom.  Just lacking part of SMF 2.1 Beta 3 support...

Great news. Thanks for the quick work..Any idea when you'll have it completed..

dougiefresh

Hopefully, tonight after I get home from work.

@rjen

Quote from: dougiefresh on March 01, 2018, 12:39:50 PM

@Everybody:  I need someone to take over maintenance of the Dutch translations.  If you can, please attach your copy of the translated files!  Thanks in advance!

Here you go...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Ronald_1938

Quote from: dougiefresh on March 02, 2018, 04:08:38 PM
Hopefully, tonight after I get home from work.

I'll sit by the phone waiting for your call.. Yea I'll wait until you post the fianl one..

Thanks..

dougiefresh

@rjen, @Rock Lee, and @d3vcho:  Can y'all translate the following strings into your respective languages?

$txt['who_view_sub'] = '<div class="smalltext">NOTE: Affects Board Index only!</div>';
$txt['who_themes'] = 'Theme Settings';
$txt['who_placement_top'] = 'Put <strong>Who\'s Online</strong> at top of screen?';

Thanks a bunch!  Once I get these language strings, I'll update the new version!

@rjen

Quote from: dougiefresh on March 02, 2018, 11:03:15 PM
@rjen, @Rock Lee, and @d3vcho:  Can y'all translate the following strings into your respective languages?

$txt['who_view_sub'] = '<div class="smalltext">NOTE: Affects Board Index only!</div>';
$txt['who_themes'] = 'Theme Settings';
$txt['who_placement_top'] = 'Put <strong>Who\'s Online</strong> at top of screen?';

Thanks a bunch!  Once I get these language strings, I'll update the new version!

Dutch:

$txt['who_view_sub'] = '<div class="smalltext">LET OP: Dit geldt alleen voor de Board Index!</div>';
$txt['who_themes'] = 'Thema Instellingen';
$txt['who_placement_top'] = 'Toon <strong>Wie is online</strong> aan de bovenzijde?';
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

-Rock Lee-

Quote from: dougiefresh on March 02, 2018, 11:03:15 PM
@rjen, @Rock Lee, and @d3vcho:  Can y'all translate the following strings into your respective languages?

$txt['who_view_sub'] = '<div class="smalltext">NOTE: Affects Board Index only!</div>';
$txt['who_themes'] = 'Theme Settings';
$txt['who_placement_top'] = 'Put <strong>Who\'s Online</strong> at top of screen?';

Thanks a bunch!  Once I get these language strings, I'll update the new version!

It will be a pleasure, I leave both versions of the Latin...

Spanish_Latin-utf8:

$txt['who_view_sub'] = '<div class="smalltext">NOTA: ¡Solo afecta el índice del foro!</div>';
$txt['who_themes'] = 'Ajustes de tema';
$txt['who_placement_top'] = '¿Poner <strong>quien está en línea</strong> en la parte superior de la pantalla?';


and

Spanish_Latin:

$txt['who_view_sub'] = '<div class="smalltext">NOTA: &iexcl;Solo afecta el &iacute;ndice del foro!</div>';
$txt['who_themes'] = 'Ajustes de tema';
$txt['who_placement_top'] = '&iquest;Poner <strong>quien est&aacute; en l&iacute;nea</strong> en la parte superior de la pantalla?';



Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

dougiefresh

Uploaded v3.0 - March 3rd, 2018
o Rewrote mod so that most functions are done with hooks.
o Added ability to change "view who's online" theme setting on mod settings page.
o Added ability to change whether the "who's online" block is on top or bottom.
o All language files converted to PHP language files, for ease of translation.
o Added Spanish Latin translation, courtsey of Rock Lee.
o Updated Dutch translation, courtsey of @rjen.




@Rock Lee and @rjen:  Thank you for the translations!  They have been included in this version!

@Everybody:  Hopefully, this version will work on most themes for SMF 2.0, as well as SMF 2.1....  It's been tested against SMF 2.0's Curve and Core theme, as well as SMF 2.1 Beta 3's default theme.  On SMF 2.0.x Core-based themes and SMF 2.1 default-based theme, modifications will probably be necessary in order to make this mod work.  If this mod cannot find either the "Who's Online" stuff in the mod, or cannot find the destination area, then the "Who's Online" stuff will not be moved.

Ronald_1938

Thanks dougiefresh, got the update notice. Downloaded and installed new version, working good.. I appreciate your help with this.

Ron.

dougiefresh

@OldCrow:  Please redownload and reinstall.  There was a tiny bug that was fixed, relating to the top/bottom option.

Ronald_1938

Quote from: dougiefresh on March 03, 2018, 11:21:43 AM
@OldCrow:  Please redownload and reinstall.  There was a tiny bug that was fixed, relating to the top/bottom option.

OK thanks dougiefesh. Done removed and reinstalled, seems to be OK.

Ron.

dougiefresh

Uploaded v3.1 - October 22nd, 2018
o No functionality change.
o Updated documentation to point to new website.

Ronald_1938

Quote from: dougiefresh on October 22, 2018, 09:18:39 PM
Uploaded v3.1 - October 22nd, 2018
o No functionality change.
o Updated documentation to point to new website.

Thanks Douggie

dougiefresh

Uploaded v3.2 - May 22nd, 2018
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 RC1 and below.

Hatshepsut

For SMF 2.1, is it possible to add "Who's online" setting to change default view from "Members only" to "Everyone"?

Arantor

It's funny, it was changed in 2.1 precisely because people complained. There's no config item for it, but I don't recall it being a big change. If I get time, I'll dig it out today.
Holder of controversial views, all of which my own.


Deaks

dougie, not sure if its just the forum im working on or if its a known bug but getting undefined index error on the 2.1 version from

function LUTB_Buffer($buffer)
{
global $context, $txt, $modSettings, $forum_version, $topic;

$pattern = '#<(p|div|tr|td)([^\>]*?)(class=\"([^\>\"]*?)|id=\")(whos_viewing|whoisviewing)([^\>^\"]*?)\"([^\>]*?)>(<td([^\>]*?)>)?(.*?)</(p|div|td|tr)>#is';
if (preg_match($pattern, $buffer, $matches))
{
// Construct the new "Who's Online" HTML fragment:
$smf20 = substr($forum_version, 0, 7) == "SMF 2.0";
$replace = $matches[0];
$fragment = (($is_top = !empty($modSettings['who_placement_top'])) ? '<br />' : '') .
'<div class="cat_bar"><h3 class="catbg">' . $context['LUTB'] . ':</h3></div>' .
'<div class="information">' . $matches[10] . '</div>';

// Where, oh, where to insert the new fragment?
if (!$is_top)
$find = $smf20 ? '(moderationbuttons|topic_icons)' : '(description_board|msg' . $context['first_message'] . ')';
else
$find = $smf20 ? '(messageindex|forumposts)' : (empty($topic) ? 'navigate_section' : 'whoisviewing_bottom');

// If found, remove old fragment and place new fragment after found text:
$pattern = '#(<(a|p|div|tr)([^\>]*)(class=\"([^\>\"]*?)' . $find . '([^\>\"]*?)\"|id=\"' . $find . '")([^\>]*)\>)#is';
if (preg_match($pattern, $buffer, $matches))
$buffer = str_replace($matches[0], $fragment . $matches[0], str_replace($replace, '', $buffer));
}
return $buffer;
}


error states in undefined index on first_message

any idea?

EDIT: error generates when you go into any topic.

cheers
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: