TinyPortal

Development => Support => Topic started by: snowcrash on May 30, 2005, 11:56:24 AM

Title: Online box & hidden users
Post by: snowcrash on May 30, 2005, 11:56:24 AM
Hi

Ok, I've got to learn php one day...
But for the meantime, got a couple of more questions/requests:

1. I managed with the good help of the smf folks, to hide the 'hidden user' and their name from being displayed on the main board page (ie. the site Admin being totally stealthed). So the online users displays the correct number of users and names, minus the stealthed Admin
Just asking how this can be done for the the On-Line users box on the TP home page

2. For guests viewing the log in page, can only the number of users be displayed, but not their names. But for a logged on user, it does show the names as normal (though minus the hidden admin as 1)

If this is going to be too messy to script for someone, I guess I'll  just have to then completely leave out the on-line user box from displaying on the TP

thanks
rhizome
Title: Re: Online box & hidden users
Post by: Bjørn on May 30, 2005, 01:47:56 PM
If you could share the code, or a thread where its described..I can help with applying it to the code in TPl. Its mainly a slightly modified copy of the SMF equivalent anyway.
Title: Re: Online box & hidden users
Post by: snowcrash on May 30, 2005, 01:58:21 PM
Hi Bloc

For my query 1. it's on this bit of a messy thread
http://www.simplemachines.org/community/index.php?topic=37029.0

Basically, it involved editing the BoardIndex.template.php code below, by taking out all the references to hidden

<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a>
<br>


The second part, [Unknown] corrected the number of users displaying with:

Replace this:

', $context['num_users_online'], '

With:

', $context['num_users_online'] - $context['num_users_hidden'], '


thanks
Title: Re: Online box & hidden users
Post by: snowcrash on June 04, 2005, 09:53:57 PM
Actually, I don't think the above code helps as it refers to the boardindex template, and the TP uses an ssi_ call to display users online

Anyway, I managed to hack the ssi.php file, and get what I wanted  :)

Though, an inelegant solution as not good when smf updates. But not bad for newbie me who knows almost nothing about php, lol
Also, I'm just practising on a test forum at the moment.

Anyway Bloc, you can get back to more serious things

thanks
Title: Re: Online box & hidden users
Post by: Bjørn on June 05, 2005, 08:51:19 PM
Ok. :)