News: September 21st, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.4! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

December 12, 2019, 03:09:14 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189280
  • Total Topics: 20775
  • Online Today: 70
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 57
Total: 57

Author Topic: Is there a way to do this?  (Read 10271 times)

0 Members and 1 Guest are viewing this topic.

pvcblue

  • Guest
Is there a way to do this?
« 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.  ::)

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: Is there a way to do this?
« Reply #1 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.

pvcblue

  • Guest
Re: Is there a way to do this?
« Reply #2 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

pvcblue

  • Guest
Re: Is there a way to do this?
« Reply #3 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.  ;)

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: Is there a way to do this?
« Reply #4 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:


knat

  • Guest
Re: Is there a way to do this?
« Reply #5 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 ;)

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Is there a way to do this?
« Reply #6 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.

pvcblue

  • Guest
Re: Is there a way to do this?
« Reply #7 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

pvcblue

  • Guest
Re: Is there a way to do this?
« Reply #8 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:

knat

  • Guest
Re: Is there a way to do this?
« Reply #9 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
« Last Edit: May 20, 2007, 10:28:30 AM by Tank »