TinyPortal

Development => Resources => Topic started by: pvcblue on May 19, 2007, 01:07:04 AM

Title: Is there a way to do this?
Post by: pvcblue on May 19, 2007, 01:07:04 AM
I was wondering, in the Info Center where it shows Users Online if there was a way to seperate the regular users from the admins and mods, besides by color? Say put the Admins and Mods on one line and the regular users on the next?

Wasn't sure where this went exactly.  ::)
Title: Re: Is there a way to do this?
Post by: G6Cad on May 19, 2007, 03:41:24 AM
I think that is more of SMF question as the online members, staff members are made by them, TP more or less just fetch whats in the SMF codes allready.
Title: Re: Is there a way to do this?
Post by: pvcblue on May 19, 2007, 03:42:36 AM
I think that is more of SMF question as the online members, staff members are made by them, TP more or less just fetch whats in the SMF codes allready.

Oh sorry - I thought since the Info Center is titled "Tiny Portal Info Center" I would ask here. OOPS  :o
Title: Re: Is there a way to do this?
Post by: pvcblue on May 19, 2007, 03:47:57 AM
Well I posted over there, we all know how long it can take an answer - if you get one- to take, but when and if I get one I will post it here for anyone who also wanted to know.  ;)
Title: Re: Is there a way to do this?
Post by: G6Cad on May 19, 2007, 03:56:40 AM
I know it's confusing with blocks and whats in them :) Been there a lot of times my self  :2funny:

Title: Re: Is there a way to do this?
Post by: knat on May 19, 2007, 08:25:13 AM
I think that is more of SMF question as the online members, staff members are made by them, TP more or less just fetch whats in the SMF codes allready.

Oh sorry - I thought since the Info Center is titled "Tiny Portal Info Center" I would ask here. OOPS  :o

If your forum is named Funny Faces then it will be Funny Faces Info Center :D

Anyway i bumped you topic over at smf because i want this also on my site ;)
Title: Re: Is there a way to do this?
Post by: IchBin on May 19, 2007, 09:50:27 PM
Certainly not an easy task. All the onlines users are put into an array $context['list_users_online'] which only holds a list of links for user profiles. I don't think it can be done straight out of the box, but with some modification I don't see why not. I'll take a look when I get a chance.
Title: Re: Is there a way to do this?
Post by: pvcblue on May 20, 2007, 03:11:19 AM
ANSWER FROM SMF -


Lol, at first I thought it wasn't, but it looks like it is possible. :)

In Sorces/BoardIndex.php find:
Code: [Select]


$context['list_users_online'] = array();


and above it add:

Code: [Select]


$context['list_mods_online'] = array();


then find this:

Code: [Select]

$context['list_users_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;


And replace it with:

Code: [Select]

if($context['users_online'][$row['logTime'] . $row['memberName']]['group'] == 1 || $context['users_online'][$row['logTime'] . $row['memberName']]['group'] == 2)
$context['list_mods_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
else
$context['list_users_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;


This is assuming that your moderartors are group 2 (first line)

Now find this:

Code: [Select]

krsort($context['users_online']);


and above it add:
Code: [Select]

ksort($context['list_mods_online']);


Finally, in BoardIndex.template.php of the default theme and/or the theme your using find:

Code: [Select]

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


and replace it with:

Code: [Select]

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_mods_online']), count($context['list_mods_online']) > 0 ? '<br />' : '', implode(', ', $context['list_users_online']);



thanks to Kays at SMF
Title: Re: Is there a way to do this?
Post by: pvcblue on May 20, 2007, 03:18:44 AM
I haven't treid this yet, as I am at work, but will give it a test run later when I am at home and let you guys know what happens. Hopefully it won't kill my forum LOL!!!

 :laugh:
Title: Re: Is there a way to do this?
Post by: knat on May 20, 2007, 10:04:37 AM
Ok so this will only make the mods stand out of the crowd ?

I wanted to use this for a particular membergroup can that be done ??


Ok just saw the replies on SMF.. i can use this.. great stuff  :D