invisible admin

Started by Jade Elizabeth, October 19, 2007, 07:20:39 PM

Previous topic - Next topic

Jade Elizabeth

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?

and for 1.1.4 can you hide the "online" from profiles and beside posts too?


imagine it, the invisible admin who logs in daily...but no one sees them
MWAHAHAHAHAAAAAAA!!

okay im done. i need it to work with the users online today, and umm the who template thingie with google bots and the like too

i only want admin to be hidden, if admin choses to hide oneself in the profile settings :D

thankyou :D
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

wicked1

Quoteand for 1.1.4 can you hide the "online" from profiles and beside posts too?
from profiles? you mean the last active part? If so, I'd also like to know how to keep that hidden from everyone except Admin.

Completely invisible, super-stealth mode lol

Jade Elizabeth

i got johnyB to do it, and he made it and it works perfectly. ill direct him to this thread so he can attach it :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Bulakbol

#4
I know there's similar topic in Coding Discussion but I'll post it here anyway.

In default/BoardIndex.template.php, find and comment out.


// 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 ')';
}


On top of the above codes, replace


', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];


with


', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', ($context['num_users_online'] - $context['num_users_hidden']), ' ', ($context['num_users_online'] - $context['num_users_hidden']) == 1 ? $txt['user'] : $txt['users'];


if google or spider bot mod is installed, look for.


', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];


and replace with


', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . ($context['num_users_online'] - $context['num_users_hidden']), ' ', ($context['num_users_online'] - $context['num_users_hidden']) == 1 ? $txt['user'] : $txt['users'];


If you choose "Show Member names" in  "Admin > Current Theme > Show who is viewing the board index and posts", then, in Display.template.php find


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'] . ')');


replace with


echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' ');


and in MessageIndex.template.php look for


echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');


and replace with


echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' ');


and in Profile.template.php, look for


</tr><tr>
                                        <td><b>', $txt['lastLoggedIn'], ': </b></td>
                                        <td>', $context['member']['last_login'], '</td>
                                </tr>';


and replace with


</tr>';
// If the person looking is allowed to see IP. show the member's last login
if (($context['can_see_ip']) || $context['user']['is_owner'])
echo '
<tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';


Edited.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Jade Elizabeth

:D

awesome.
i think someone here should be promoted ;)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

wicked1

thats great :) thanks for the help!
i havent tried out all of it but i just tried the profile.template.php part and it gave me this error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/Profile.template.php on line 162
153: <b>', $modSettings['karmaLabel'], ' </b>
154: </td><td>
155: +', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '
156: </td>
157: </tr>';
158: echo '
159: <tr>
160: <td><b>', $txt[233], ': </b></td>
161: <td>', $context['member']['registered'], '</td>
162: // If the person looking is allowed to see IP. show the member's last login
163: if (($context['can_see_ip']) || $context['user']['is_owner'])
164: echo '
165: <tr>
166: <td><b>', $txt['lastLoggedIn'], ': </b></td>

i tried it 3 different times to make sure I put it in right, but I'm guessing I messed it up lol

Bulakbol

I'm sorry, I made a bobo. I forgot to include the </tr>; Here's the right one.

Profile.template.php


</tr>';
// If the person looking is allowed to see IP. show the member's last login
if (($context['can_see_ip']) || $context['user']['is_owner'])
echo '
<tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

chrishicks

this is great. I did the above on my test board and it works except for one little thing. it doesn't have anything to do this exactly but I also use the Users Logged in Today Mod and it still shows hidden members. is there a way to remove the hidden status from that section?

Bulakbol

If they are not allowed to see hidden members, they can't see hidden members in the "Users Logged In Today" mod too.  Try using another account other than admin and see for yourself.   
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

chrishicks

is that a permissions thing having them not being allowed to see hidden members? I don't see anything related to hidden members other than the option in features and options about allowing members to be hidden.

wicked1

thank you so much johnyb, i just now got around to retrying it after the correction, and it works great.

spiros

One small problem, I used this code and I see

88 Guests, 3 Users0 Buddies

[No space between users and 0]

Jade Elizabeth

Quote from: spiros on February 01, 2008, 06:12:07 PM
One small problem, I used this code and I see

88 Guests, 3 Users0 Buddies

[No space between users and 0]

Dude!! I totally had that problem!!!
http://www.simplemachines.org/community/index.php?topic=19243.msg1307054#msg1307054
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

spiros

Thanks! Problem fixed, someone should update the above code though!!!

falguni1

can we have it as a package for people who are afraid of doing manual edits.

Jade Elizabeth

Quote from: falguni1 on February 02, 2008, 03:26:14 AM
can we have it as a package for people who are afraid of doing manual edits.

Dont be afraid, it's simple and if you mess up just re-upload your backup of it before you edited :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

spiros

Here is another little problem of these modifications:

88 Guests, 9 Users ()

Jade Elizabeth

Quote from: spiros on February 03, 2008, 12:07:41 PM
Here is another little problem of these modifications:

88 Guests, 9 Users ()

I dunno, did you do the code on the other page correctly?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: