News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Hiding Admin completely

Started by rhizome, May 27, 2005, 06:06:33 AM

Previous topic - Next topic

andrewsimon

Quote from: Gregory on December 20, 2005, 10:31:08 AM

In the template directory /BoardIndex.template.php find
// "Users online" - in order of activity.
and above it add
    //Count any hidden users as guests.
   $context['num_guests'] = $context['num_guests'] + $context['num_users_hidden'];
   $context['num_users_online'] = $context['num_users_online'] - $context['num_users_hidden'];
   $context['num_users_hidden'] = 0;


Brings up a template parse error for me. Am I forgetting something?

spiros

One remaining problem is that at the actual topic page, if an admin is viewing it, you still get (+1 Hidden).

spiros

Anybody know a way to hide this too?

greyknight17

Do you mind having one more user showing but showing NONE hidden? It will still count the user in the total users online though ;)

Open up Themes/default/BoardIndex.template.php:

Find:
// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{
echo ' (';

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

// How about hidden users?
if (!empty($context['num_users_hidden']))
echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];

echo ')';
}


Replace with:

// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

}

Bigguy

Does that code work with no problems ???

greyknight17

Quote from: Bigguy on June 20, 2007, 10:50:47 PM
Does that code work with no problems ???
LOL. I want to know the same thing ;)  I see several files that mention this but didn't touch base on those because they didn't help much. I tested it out with one of my test users hidden and browsed around and refreshed the page a few times. Just did a quick check in the error log only to see if there were problems. Nothing in there :)

Bigguy

Maybe this should be packaged for those who want it.

greyknight17

Who wants to volunteer to do this? Doesn't sound complicated, but I don't have the time to learn how to create it.

EDIT: What the heck...I'll give it a shot anyway if anything. Just the hidden users or admin also? Just hope I won't screw anything up if I do manage to get the Package up ;)

Bigguy

If you need any help you can PM me if you want. ;) I have done a couple packages.

greyknight17

No problem Bigguy :D

Looks like I have to do this tomorrow after work though. Lots of reading up on how to do this, but won't mind doing it. Learn something new every day ;)

Bigguy

Yep, and making a package is a great way to learn. :)

spiros

#31
Hooray! Finally, something that works and does not only provide for the index page!

Thank you very much.

spiros

#32
I just double checked it, and it still appears to display +1 hidden. When I first access the page, the hidden user is displayed as guest, but when I browse another page and return to that one (or go one level back, i.e. to board level) then then +1 hidden is displayed.

Just to clarify, I made the modification in the Display.template.php of my theme (babylon) and not the default theme (no such code was found in the default theme, the only relevant code is the code below)



// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
// Or show the actual people viewing the topic?
else
echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>';
}


weightman

#33
I tried this out and it removes the +1 hidden but leaves the parenthesis that used to surround it. Any way to remove that?


Woops. My error. Works great on 1.13.

Thanks

Jade Elizabeth

#34
Quote from: greyknight17 on June 20, 2007, 10:40:25 PM
Do you mind having one more user showing but showing NONE hidden? It will still count the user in the total users online though ;)

Open up Themes/default/BoardIndex.template.php:

Find:
// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{
echo ' (';

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

// How about hidden users?
if (!empty($context['num_users_hidden']))
echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];

echo ')';
}


Replace with:

// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

}


this is perfect...is there any way to exclude them from the online users count too?

and for 1.1.4 can you hide the "online" from profiles and beside posts too?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

yes no?

cant we eliminate all traces of online activity for admin?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

greyknight17

Alundra I would post a new topic on this as it's a separate question. There are ways to remove it ;)

spiros

I am a bit confused with different code in 1.1.4, how can one hide hidden in this case:

   <td class="windowbg" width="20" valign="middle" align="center">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">';

if ($context['show_who'])
echo '
<a href="', $scripturl, '?action=who">';

echo $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
{
echo ' (';

// Show the number of buddies online?
if ($context['show_buddies'])
echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

// How about hidden users?
if (!empty($context['num_users_hidden']))
echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];

echo ')';
}

if ($context['show_who'])
echo '</a>';

Jade Elizabeth

^ go to my other topic, http://www.simplemachines.org/community/index.php?topic=201301.0 which will give you a 1.1.4 version by JohnyB which I still use on my own forum :D
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: