Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: rsw686 on April 02, 2008, 10:15:45 PM

Title: Grouped Who's Online List
Post by: rsw686 on April 02, 2008, 10:15:45 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1148)

This modification will group the members, guests, and spiders on the who's online list. It will also show the browser version for those allowed to view IP addresses.
Title: Re: Grouped Who's Online List
Post by: Eliana Tamerin on April 02, 2008, 11:54:51 PM
So basically just a packaged version of the tip/trick? Or did you make any improvements of your own?
Title: Re: Grouped Who's Online List
Post by: Darkness_ on April 05, 2008, 05:16:49 PM
demo ?
Title: Re: Grouped Who's Online List
Post by: rsw686 on April 06, 2008, 11:34:36 PM
Quote from: Eliana Tamerin on April 02, 2008, 11:54:51 PM
So basically just a packaged version of the tip/trick? Or did you make any improvements of your own?

I wasn't aware of a trick for SMF 2.0.

Quote from: Darkness_ on April 05, 2008, 05:16:49 PM
demo ?

You can view it at my forum http://www.thereptilefile.com/forum/index.php?action=who

Admins can also see the member's IP and browser version.
Title: Re: Grouped Who's Online List
Post by: Apllicmz on April 07, 2008, 04:55:07 AM
thank you she work
fine
i translate portuguese...Pt_PT/pt_BR

<file name="$languagedir/Modifications.portuguese.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['whosonline_members'] = 'Membros';
$txt['whosonline_guests'] = 'Visitantes';
$txt['whosonline_spiders'] = 'Spiders';]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['whosonline_members'] = 'Membros';
$txt['whosonline_guests'] = 'Visitantes';
$txt['whosonline_spiders'] = 'Spiders';]]></add>
</operation>
</file>
Title: Re: Grouped Who's Online List
Post by: Duilio on April 07, 2008, 08:30:50 AM
Does this work for 1.1.4?
Title: Re: Grouped Who's Online List
Post by: Yağız... on April 07, 2008, 08:39:06 AM
You can use this tip for 1.1.4
http://www.simplemachines.org/community/index.php?topic=19243.0
Title: Re: Grouped Who's Online List
Post by: Duilio on April 07, 2008, 08:42:12 AM
Quote from: Yağız on April 07, 2008, 08:39:06 AM
You can use this tip for 1.1.4
http://www.simplemachines.org/community/index.php?topic=19243.0

Thank you a lot!
Title: Re: Grouped Who's Online List
Post by: rubensde on April 07, 2008, 09:31:46 AM
Hi.

I tried to integrate that plugin on my 1.1.4 SMF forum, but i cant add .php files to a theme.
On my default theme there is not who.php file and post.php file. Can I add them any way?

Thanks
Title: Re: Grouped Who's Online List
Post by: edi67 on April 30, 2008, 09:16:01 AM
nice
Title: Re: Grouped Who's Online List
Post by: THE BRA1N on May 07, 2008, 01:38:37 AM
Would it be asking too much to add the extended browser info on hover like this version has..

Quote from: Yağız on April 07, 2008, 08:39:06 AM
You can use this tip for 1.1.4
http://www.simplemachines.org/community/index.php?topic=19243.0
Title: Re: Grouped Who's Online List
Post by: Vampy on July 29, 2008, 07:06:53 AM
Can someone kindly help?

I've looked at the parse page for manual install into 1.1.5 and there are several sections where it says to replace things in the ./Themes/default/Who.template.php file that I do not have.

For example:

Where it says to replace </tr>  <tr class="catbg"> with this </tr>'; $show_by = $context['show_by'] == 'all' ? array('members', 'guests', 'spiders') : array($context['show_by']); foreach($show_by as $show) { $count = 0; echo ' <tr class="catbg">

There are several others. I'd like to install this mod but I need help ... please

Thanks in advance
Title: Re: Grouped Who's Online List
Post by: rsw686 on July 29, 2008, 08:55:36 AM
Vampy this mod is for SMF 2.0 that is why you don't have those sections.
Title: Re: Grouped Who's Online List
Post by: Vampy on July 29, 2008, 09:27:08 AM
 :P I realised that afterwards - I've applied the other one from  http://www.simplemachines.org/community/index.php?topic=19243.0 (http://www.simplemachines.org/community/index.php?topic=19243.0) and that works fine with 1.1.5

This throws up a question though - why is there a parser for 1.1.5 if it can't be applied?
Title: Re: Grouped Who's Online List
Post by: vagrant on October 12, 2008, 07:33:05 PM
tried it on 2.0 bete4
failed step 2

is there an update available or a simple change to make please.
Title: Re: Grouped Who's Online List
Post by: tk2012 on October 18, 2008, 10:46:03 AM
It doesn't say it is compatible with b4.0, but it is working for me.

try replacing it with this line instead:

<td width="30%"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';show=', $context['show_by'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '" rel="nofollow">', $txt['whosonline_' . $show], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>

(Keep in mind that is supposed to be one line the entire way across the page.)

You will have to do the 2nd edit manually yourself.  You won't be able to search for the entire string because the rel="nofollow" code has been added.  The string you want to replace is around line 28 of the file. 

Search for:

<td width="30%">

because there is only one line in the file that contains that and replace the entire line with what I have above and see if that works for you.  Like I said, it is working on my b4.0 forum.


* Someone can reply here if they see that I am incorrect.

Title: Re: Grouped Who's Online List
Post by: carbonize on October 18, 2008, 12:04:04 PM
I used the instructions for 2.4 and it's working fine but I made some modifications as I prefered the old method of having the useragent as title and I also added support for Chrome, Flock and the iPhone. Also added support for the version number of more browsers. I will detail the changes here but I also zipped mine up and uploaded it to http://carbonize.co.uk/Who.zip

', ($show != 'spiders') ? '<br />' : '', '<span class="smalltext">(<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;sa=tracking;area=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>', ($show != 'spiders') ? ', ' . getAgent($member['query']['USER_AGENT']) : '', ')</span>';

I used

', ($show != 'spiders') ? '<br />' : '', '<span class="smalltext">(<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;sa=tracking;area=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>', ($show != 'spiders') ? ', <span title="'. htmlspecialchars($member['query']['USER_AGENT']) . '">' : '', ($show != 'spiders') ? getAgent(htmlspecialchars($member['query']['USER_AGENT'])) : '', '</span>)</span>';

and my array at the end looks like this

$known_agents = array (
// Phones
array ('agent' => 'Nokia'),
array ('agent' => 'Samsung'),
array ('agent' => 'Ericsson'),
array ('agent' => 'Siemens'),
array ('agent' => 'Motorola'),
array ('agent' => 'BlackBerry'),
array ('agent' => 'iPhone'),
// Browsers
array ('agent' => 'Opera', 'version' => '/opera/i'),
array ('agent' => 'Flock', 'version' => '/flock\//i'),
array ('agent' => 'Firefox', 'version' => '/firefox\//i'),
array ('agent' => 'Firebird', 'version' => '/firebird\//i'),
array ('agent' => 'Chrome', 'version' => '/chrome\//i'),
array ('agent' => 'Safari', 'version' => '/safari\//i'),
array ('agent' => 'Google Desktop'),
array ('agent' => 'Netscape', 'version' => '/navigator\//i'),
array ('agent' => 'MyIE2'),
array ('agent' => 'Konqueror'),
array ('agent' => 'Galeon'),
array ('agent' => 'KMeleon', 'version' => '/k-meleon\//i'),
array ('agent' => 'NG/2.0'),
array ('agent' => 'Gecko', 'name' => 'Mozilla'),
array ('agent' => 'MSIE', 'name' => 'IE', 'version' => '/msie/i')
);


Had to put Flock before Firefox as Flock also says Firefox in it's useragent.

Also at the end I just replaced

return $user_agent;
}
?>


with

  $user_agent = (empty($user_agent)) ? 'no useragent' : $user_agent;
return $user_agent;
}
?>


So it displays something for empty useragents.
Title: Re: Grouped Who's Online List
Post by: carbonize on October 18, 2008, 02:58:59 PM
Ok further improved the script (in my eyes anyway) by improving Netscape detection and making it show the full version number. So instead of it saying Firefox 3 it will now say Firefox 3.0.3 and so on. Also fixed issue with the multiple ways Opera shows it's version number.

function getAgent ($user_agent)
{
$known_agents = array (
// Phones
array ('agent' => 'Nokia'),
array ('agent' => 'Samsung'),
array ('agent' => 'Ericsson'),
array ('agent' => 'Siemens'),
array ('agent' => 'Motorola'),
array ('agent' => 'BlackBerry'),
array ('agent' => 'iPhone'),
// Browsers
array ('agent' => 'Opera', 'version' => '/opera/i'),
array ('agent' => 'Flock', 'version' => '/flock\//i'),
array ('agent' => 'Firefox', 'version' => '/firefox\//i'),
array ('agent' => 'Firebird', 'version' => '/firebird\//i'),
array ('agent' => 'Chrome', 'version' => '/chrome\//i'),
array ('agent' => 'Safari', 'version' => '/safari\//i'),
array ('agent' => 'Google Desktop'),
array ('agent' => 'Netscape', 'version' => '/netscape\//i'),
array ('agent' => 'Navigator', 'name'=>'Netscape', 'version' => '/navigator\//i'),
array ('agent' => 'MyIE2'),
array ('agent' => 'Konqueror', 'version' => '/konqueror\//i'),
array ('agent' => 'Galeon', 'version' => '/galeon\//i'),
array ('agent' => 'KMeleon', 'version' => '/k-meleon\//i'),
array ('agent' => 'NG/2.0'),
array ('agent' => 'Gecko', 'name' => 'Mozilla'),
array ('agent' => 'MSIE', 'name' => 'IE', 'version' => '/msie/i')
);

foreach($known_agents as $agent)
if (strpos(strtolower($user_agent), strtolower($agent['agent'])) !== false)
{
$browser = isset($agent['name']) ? $agent['name'] : $agent['agent'];
$version = isset($agent['version']) ? preg_split($agent['version'], $user_agent) : false;

    $version = (strpos($version[1], ';') > 0) ? substr($version[1], 0, strpos($version[1], ';')) : $version[1];
    $version = (strpos($version, ' ') > 0) ? substr($version, 0, strpos($version, ' ')) : $version;
    $version = str_replace('/', '', $version);
return $version ? $browser . ' ' . $version : $browser;
}
  $user_agent = (empty($user_agent)) ? 'no useragent' : $user_agent;
return $user_agent;
}
Title: Re: Grouped Who's Online List
Post by: dwd2000 on November 17, 2008, 01:33:42 AM
Very nice.

I am using SimplePortal Classic 2.0.5. I would like to add the "Who's Online" section to a block (php or html) to display on the portal. (SimplePortal version does not show the spiders) I would be making the block visible to only the admin (me)

Any ideas?
Title: Re: Grouped Who's Online List
Post by: carbonize on November 17, 2008, 07:08:32 AM
Well there is already the abuility to display who is online via the ssi file of SMF. I'm sure it wouldn't be to compicated for someone to copy portions of this code over to the SSI file.
Title: Re: Grouped Who's Online List
Post by: Chit-Chat ChatterBox Boss on May 03, 2009, 04:50:51 PM
I have been watching and I noticed quite a few spiders that come on that are in your addspiders file that still show as guests and not spiders any idea why?
Title: Re: Grouped Who's Online List
Post by: Chit-Chat ChatterBox Boss on May 05, 2009, 10:35:58 AM
Fixed the problem  :D
Title: Re: Grouped Who's Online List
Post by: Sarlat on May 21, 2009, 09:02:25 PM
How ? I have the same problem no spiders in spider list :( they shows in guest list
Title: Re: Grouped Who's Online List
Post by: TheListener on July 06, 2009, 12:37:26 AM
Anyone noticed the mod authors forum is on vbulletin?
Title: Re: Grouped Who's Online List
Post by: C4G-TK on December 23, 2009, 08:06:41 PM
Has anyone updated this for RC2, yet?
Title: Re: Grouped Who's Online List
Post by: bpratt on January 31, 2010, 08:17:42 AM
Just what I was wondering too.

It doesn't like the new Who.template file from 2.0RC2 , and was hoping some update would be out sooner rather than later. :)
Title: Re: Grouped Who's Online List
Post by: Stigmartyr on February 02, 2010, 11:09:18 PM
Yeah what's up with that.. ?  It says compatible with RC2 but really it isn't..
Title: Re: Grouped Who's Online List
Post by: JulesW on February 11, 2010, 08:39:46 AM
Joining the request for update to rc2, or will it be updated as soon as smf2 is final?
Title: Re: Grouped Who's Online List
Post by: carbonize on February 11, 2010, 10:25:07 AM
Hmm I'm already using this with RC2. I think the only thing i had to do was add the text to the modificiations language file.
Title: Re: Grouped Who's Online List
Post by: bpratt on February 11, 2010, 06:19:41 PM
Quote from: carbonize on February 11, 2010, 10:25:07 AM
Hmm I'm already using this with RC2. I think the only thing i had to do was add the text to the modificiations language file.

That's really strange how so many of can not make it work without major changes that we're reluctant to make, yet you've got it to work fine.

Did you actually install it on your running RC2, or did you perhaps have an earlier version of smf2.0 that you installed it on to, and then later on updated to RC2 ?

Personally I went straight from smf 1.1.11 to smf 2.0RC2, and this mod comes up as incompatible to me.
Title: Re: Grouped Who's Online List
Post by: carbonize on February 12, 2010, 05:38:33 AM
Extract the php file from this (http://carbonize.co.uk/Who.template.zip) and put it in Themes/default and then add the following to Theme/default/languages/Modifications.english.php or your chosen language

$txt['whosonline_members'] = 'Members';
$txt['whosonline_guests'] = 'Guests';
$txt['whosonline_spiders'] = 'Spiders';
Title: Re: Grouped Who's Online List
Post by: bpratt on February 12, 2010, 07:12:57 AM
Quote from: carbonize on February 12, 2010, 05:38:33 AM
Extract the php file from this (http://carbonize.co.uk/Who.template.zip) and put it in Themes/default and then add the following to Theme/default/languages/Modifications.english.php or your chosen language

$txt['whosonline_members'] = 'Members';
$txt['whosonline_guests'] = 'Guests';
$txt['whosonline_spiders'] = 'Spiders';

Yep, that made it work.

Thanks for the the file. :)
Title: Re: Grouped Who's Online List
Post by: TurtleKicker on April 07, 2010, 10:43:25 AM
Might we get an official packaged version that's compatible with SMF2 RC3? :)
Title: Re: Grouped Who's Online List
Post by: TheListener on April 07, 2010, 10:45:32 AM
I would suggest a request in the feature requests board with a link to this mod.
Title: Re: Grouped Who's Online List
Post by: Bugo on June 07, 2010, 09:03:52 AM
Perfect work on 2.0 RC2-RC4.
Title: Re: Grouped Who's Online List
Post by: FireDitto on July 10, 2010, 10:48:13 PM
Thanks Bugo, works a charm =D
Title: Re: Grouped Who's Online List
Post by: shakaran on August 20, 2010, 03:00:54 PM
Please, Could you update this mod for SMF 2.0 RC3 officialy?

1.     Executar Modificación     ./Themes/default/Who.template.php     Prueba fallida
      1.    Reemplazar    ./Themes/default/Who.template.php    Prueba fallida
      2.    Reemplazar    ./Themes/default/Who.template.php    Prueba fallida
      3.    Añadir después    ./Themes/default/Who.template.php    Prueba fallida
      4.    Reemplazar    ./Themes/default/Who.template.php    Prueba fallida
      5.    Reemplazar    ./Themes/default/Who.template.php    Prueba fallida
Title: Re: Grouped Who's Online List
Post by: FireDitto on November 04, 2010, 03:58:29 AM
Is anyone able to help with getting this to Install on RC4?

Nvm. The RC3 version went through nicely.
Title: Re: Grouped Who's Online List
Post by: C4G-TK on December 05, 2010, 02:48:47 PM
Quote from: Bugo on June 07, 2010, 09:03:52 AM
Perfect work on 2.0 RC2-RC4.

Yepp and thanks!
I didn't see that you updated the post recently.  Works for me on RC4!
Title: Re: Grouped Who's Online List
Post by: Bugo on December 05, 2010, 03:01:19 PM
U're welcome :)
Title: Re: Grouped Who's Online List
Post by: thesikaleon on February 26, 2011, 04:46:27 PM
Quote from: Bugo on June 07, 2010, 09:03:52 AM
Perfect work on 2.0 RC2-RC4.

What i need to make it work in RC4 ?

just download the mod and install?
Title: Re: Grouped Who's Online List
Post by: C4G-TK on June 18, 2011, 08:50:34 PM
@Bugo

Any chance you can take this mod over?  I just installed your previously attached version on my 2.0 forum (since I keep all my mods from one version to the next) and it works perfectly.  It is a shame that more people can't use this just because the original author hasn't signed on in the past 8 months.  Seems like there should be a time limit that if someone doesn't sign in within 6 months their mods become property of SMF or something, so these mods can stay alive for others.  Anyway, this was more or less me getting on my soapbox and it isn't directed to you.  Just wanted you to know it works fine if the situation ever presents itself.   ;)
Title: Re: Grouped Who's Online List
Post by: Fisch.666 on August 14, 2011, 10:06:11 AM
Hi!

I hope it's ok when i post this for smf 2.0 modified version of this mod. Please test it and let me know if it works for you.
Title: Re: Grouped Who's Online List
Post by: THE BRA1N on November 24, 2011, 06:32:55 AM
Quote from: Fisch.666 on August 14, 2011, 10:06:11 AM
Hi!

I hope it's ok when i post this for smf 2.0 modified version of this mod. Please test it and let me know if it works for you.

Nice job. Works great for me. 2.0.1
Title: Re: Grouped Who's Online List
Post by: Vagrancy on August 02, 2016, 02:47:35 PM
Fisch.666's modification works on 2.0.11, at least for me.

Browser detection is out-dated, however. Replace the getAgent function with this one to make it better:


function getAgent($user_agent)
{
    if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera';
    elseif (strpos($user_agent, 'Edge')) return 'Edge';
    elseif (strpos($user_agent, 'Firefox')) return 'Firefox';
    elseif (strpos($user_agent, 'Vivaldi')) return 'Vivaldi';
    elseif (strpos($user_agent, 'Konqueror')) return 'Konqueror';
    elseif (strpos($user_agent, 'Chrome')) return 'Chrome';
    elseif (strpos($user_agent, 'Safari')) return 'Safari';
    elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer';
   
    return 'Other';
}


Credit to some commenters on the PHP manual (http://php.net/manual/en/function.get-browser.php#119332).
Title: Re: Grouped Who's Online List
Post by: FragaCampos on October 25, 2017, 01:16:32 PM
Hi there.
Since sometime ago, this useful mod stopped showing the name of the spiders in the action=who page. Does anyone knows how to get that back?