Hide Who's Online

Started by KGIII, February 28, 2007, 09:21:36 PM

Previous topic - Next topic

KGIII

Link to Mod

If you don't want guests or spiders to see the actual information about who is online (they can still see how many people, just not their names) to give additional privacy to the forum members then this would be the mod you are looking for. People who are logged in still get to see who is online and the information shows up and works fine for them, it just doesn't work for guests or spiders.

Some screenshots if they are required:

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Skipdawg

Very good idea!  ;) Grabing this now.  ;D
Skipdawg's Community

Powered by SMF 1.1.3

KGIII

It is so simple, really all my mods are, that you can generally pretty easily port it to another theme. 'Snot difficult or anything but I had one person ask and then saw a few other posts asking similar things so, it became a modification and went through the process of approval and here it is.

(I add the last bit 'cause, well, just so you know - I too have to go through the approval process to get stuff released. I don't and am not complaining about it and I might if that wasn't true. But in this case I had to actually make changes to the mod first prior to approval 'cause it had spaces in the ID tag.)

Anyhow, it wasn't my idea. Just my doing. I can see it being handy for people who ask their members to use real names but want to give them some semblance of privacy.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Skipdawg

Looks like this will not work if you have "Users Online Today Mod" installed. But a good idea.
Skipdawg's Community

Powered by SMF 1.1.3

KGIII

I do not have that installed but if you really want to install it you can probably get it figured out fairly easily. If you would like I can look at the code from that mod and see what changes it makes and then figure it out for you though you would have to do it manually. (I figure with 924 posts editing a single file manually isn't going to scare you much.) ;)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Joseph7

I installed it on my SMF test board which only has the Dilber MC Theme installed (other than that it is 100% stock) and it gives me this error,
QuoteError in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

QuoteInstall Actions
Installations actions for "Hide Who's Online":
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./Themes/default/BoardIndex.template.php    Test failed

KGIII

What version of SMF are you using? Did you rename the theme to default maybe? Those two things are the only two things I can think of that might impact this. You can look at the mod itself and be pretty confident making the changes on your own if you want to as well. It is just a tiny mod that someone wanted so I built it and it seems to have become popular I suppose.  

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

SacmaliK

thanks Very good work!  

My Mods
Veoh Bbc Tag:here
Topic get Keywords:here
...

Poe

Got it working in the SMFone theme by manually adding the line.  Thanks!

http://www.opentalkforum.net/forums [nofollow]

KGIII

Not a problem Poe, it is the world's simplest mod I suspect. :)

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Joseph7

Quote from: KGIII on March 06, 2007, 02:59:30 AM
What version of SMF are you using? Did you rename the theme to default maybe? Those two things are the only two things I can think of that might impact this. You can look at the mod itself and be pretty confident making the changes on your own if you want to as well. It is just a tiny mod that someone wanted so I built it and it seems to have become popular I suppose. 
I am using 1.1.2. Looking at the error again I think I need to rename the Dilber MC theme or maybe change the folder name to, "default"?

KGIII

Nah. You should easily be able to install it manually if you'd like.

This is it:

<file name="$themedir/BoardIndex.template.php">
<operation>
<search position="replace"><![CDATA[// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))]]></search>
<add><![CDATA[// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']) && $context['user']['is_logged'])
]]></add>
</operation>


Yup. That simple really. Basically you look to find where - in your theme's BoardIndex.template.php - they are calling the user's online information and change it so that it only shows it for people who are logged in. This is done simply by adding:


&& $context['user']['is_logged']

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Joseph7

I guess I am an idiot. I tried adding the code you posted in my BoardIndex file and the boards just stopped working. I couldn't get the boards back up until I deleted the code entirely. This seems to be a really great mod too. :(

KGIII

If you have a copy of your BoardIndex.template.php I, or someone else, will try to tuck the code in there for you.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

veldfire

I've got it added but as stated it doesn't seem to work with the Users Online Today mod ?
// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']) && $context['user']['is_logged'])
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

if (!empty($context['spiders']))
{
if ($modSettings['ob_googlebot_display_own_list'])
echo '
<br />
', $txt['ob_googlebot_spiders_last_active'], ':<br />';
else
{
if (empty($context['users_online']))
echo '
', $txt[140], ':<br />';
else
echo ', ';
}

echo implode(', ', $context['spiders']);
}

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';

// Users online today

echo '
<tr>
<td class="titlebg" colspan="2">', $txt['uot_users_online_today'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt['uot_users_online_today'], '" border="0" />
</td>
<td class="windowbg2" width="100%">';

echo '
<div class="smalltext">';

  echo $txt['uot_total'], ': <b>', $context['num_users_online_today'], '</b>';

  echo ' (', $txt['uot_visible'], ': ', ($context['num_users_online_today'] - $context['num_hidden_users_online_today']), ', ', $txt['uot_hidden'], ': ', $context['num_hidden_users_online_today'], ')';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online_today']))
echo '<br />', implode(', ', $context['list_users_online_today']);

echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';

KGIII

You could try adding -

if $context['user']['is_logged'] ahead of the echo statement where it echo's the users online today.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

veldfire


KGIII

Just prior to where it echo's the code for it - you can hide it probably. Just change it to read the above. I haven't tried it with this mod and the likes. If you are willing to wait until (MAYBE) tomorrow - kick me a PM if I haven't done so - I will poke at it but really I only work with the default and don't really know the mod inside and out that you speak of. It shouldn't be TOO tough though.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

xtremecruiser

I like this mod.
How hard to add it so it just shows the numbers for the members and the names are either collapsed or with a click of "names" or something it expands out the list ?

KGIII

I don't imagine it would be too hard, I haven't ever tried it. Do you have an example of some collapsing code? If so then that would be easier. Using the SMF system to do so would be quite a pain in the butt I believe. At least it would be a pain for me - that would be above my current skillset level I believe.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Advertisement: