Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=706)
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:
Very good idea! ;) Grabing this now. ;D
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.
Looks like this will not work if you have "Users Online Today Mod" installed. But a good idea.
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.) ;)
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
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.
thanks Very good work!
Got it working in the SMFone theme by manually adding the line. Thanks!
http://www.opentalkforum.net/forums
Not a problem Poe, it is the world's simplest mod I suspect. :)
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"?
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']
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. :(
If you have a copy of your BoardIndex.template.php I, or someone else, will try to tuck the code in there for you.
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>';
You could try adding -
if $context['user']['is_logged'] ahead of the echo statement where it echo's the users online today.
Not sure I understand ?
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.
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 ?
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.
Quote from: KGIII on March 17, 2007, 09:49:27 PM
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.
I will look for some code for the collapse and post it, thanks
When you have a couple hundred users online it fills up the page
You could change the variable so that it only appeared for admins or the likes if you wanted? Where it says 'is_logged' would be 'is_admin' instead. Though, then again, that doesn't do too much good if they WANT to see the information so, yeah, I could understand expaning that and contracting it. I am not home (I won't be until tomorrow night) but I will also take a look when I am home and not stuck on a laptop.
I would everyone to just see just the numbers like how your mod does, and then if they clicked on the numbers its would show the names too ( to those that would be allowed access )
That would be pretty neat - if you can find some code to play with then I will certainly TRY to do it though that isn't really what this mod was meant to do but, what the heck, it would make an interesting addition to it. I am not sure if I can get it to work just exactly the way you are wanting it to work but, what the heck, I will certainly give it a shot.
Quote from: KGIII on March 18, 2007, 03:12:10 AM
That would be pretty neat - if you can find some code to play with then I will certainly TRY to do it though that isn't really what this mod was meant to do but, what the heck, it would make an interesting addition to it. I am not sure if I can get it to work just exactly the way you are wanting it to work but, what the heck, I will certainly give it a shot.
I am still looking for a how to "collapse"
Thanks
Collapsing or changing it would be something other than what this mod does. This just removes it for folks who aren't logged in.
Quote from: KGIII on March 12, 2007, 06:46:09 PM
You could try adding -
if $context['user']['is_logged'] ahead of the echo statement where it echo's the users online today.
Sent you a PM about this as you asked but never received a response ?
Nope, I don't respond to uninvited PMs though did you try this? I will not have time tonight but if you want I will go around and install a clean forum, install that mod, see what that mod does, and then see how to modify that mod to make it work with this one if you would like? In most cases it is just a matter of making sure that the user is logged if there is information for them to keep hidden from unlogged in users.
Yes, I am willing to wait. Thanks.
Incidentally, if you'll take a moment and read the bit below taking notice of the
highlighted bit you will see your invitation so my PM was not "uninvited".
Quote from: KGIII on March 12, 2007, 11:26:17 PM
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.
Ah - well you shoulda kicked me harder. :P (Sorry - I see so many posts I didn't notice or remember.) I read a LOT of posts and get a billion PMs daily (many of which have nothing in them about where they came from) so please, accept my humble appologies. Give me a few moments and I will check.
Quote from: KGIII on April 09, 2007, 05:43:42 PM
Ah - well you shoulda kicked me harder. :P (Sorry - I see so many posts I didn't notice or remember.) I read a LOT of posts and get a billion PMs daily (many of which have nothing in them about where they came from) so please, accept my humble appologies. Give me a few moments and I will check.
LMAO, I can just imagine. I just didn't want you thinking I was PM'ing you uninvited as I know how that goes as I was part of the coding team of iB way back when and I went through much of the same as you describe and vowed never to do that to anyone else !
TIA,
Veldfire
Here ya go:
Find:
// Users online today
Change to:
// Users online today
if ($context['user']['is_logged'])
That should do it - in the future if I take too long yell and say why, when, how, etc... I get a PILE of uninvited PMs.
Thanks ! Had to move it around to another bit but I got the idea.
Not a problem, glad you got it sorted. It basically says, if, in context, the settings confirm that the user is logged in then echo the results and, in this case, send those results to the browser. It was easier than doing a check to see if the user was a guest and then commenting out the code.
Quote from: KGIII on March 17, 2007, 09:49:27 PM
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.
Maybe this will help, thanks
http://www.simplemachines.org/community/index.php?topic=124294.0
That's not so much help really - I am not seeing HOW to make it collapse. (That section, by default, isn't collapsable.)