News:

Wondering if this will always be free?  See why free is better.

Main Menu

Small thing but?

Started by K2, October 14, 2005, 09:27:00 AM

Previous topic - Next topic

K2

If you go here http://www.ozzu.com/index.php and look at the users online section, you will see they have color coded and explained the user groups for easy referencing in brackets [ admin ] [ moderator ]  I think that is a nice feature as I always wonder what the heck the colors mean when I go to other peoples forums.
Disclaimer: Any post that I make infers the phrase IMHO "In my honest opinion" and "Kids, do not try this at home."

Oldiesmann

The information is already there... Just a matter of displaying it :)

Add this someplace in BoardIndex.template.php:

foreach($context['online_groups'] AS $group)
{
    if(!empty($group['color']) && $group['color'] != '')
        echo '[ <span style="color:' . $group['color'] . '">' . $group['name'] . '</span> ] ';
}

xenovanis

Wow, that's a pretty cool and simple modification. Thanks.

Is that for all regular groups? How about showing the primary groups, but not the additional groups?
"Insanity: doing the same thing over and over again and expecting different results."

Oldiesmann

That's for all groups. As long as at least one member in that group is online at the moment, and there's a color set for that group, the group will be displayed. If you don't want additional groups to be displayed, then don't set colors for those groups :)

K2

Another VERY COOL thing I found on that forum http://www.ozzu.com/index.php was in the "Website Reviews" section. If you sign up as a member of that board, click on that section as if you are going to ask for a site review and see what happens. An awesome warning window pops up.

I WANT ONE!

Any hope we can get some guidance on doing something like that on SMF?
Disclaimer: Any post that I make infers the phrase IMHO "In my honest opinion" and "Kids, do not try this at home."

JayBachatero

Nice.  I just added this to my test forum.  It would be nice if this was added as default.  maybe an option to enable it or disable it.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

dtm.exe

Quote from: JayBachatero on October 14, 2005, 08:56:39 PM
Nice.  I just added this to my test forum.  It would be nice if this was added as default.  maybe an option to enable it or disable it.

I agree.

JayBachatero

Oldiesmann can I turn this into a mod with the ability to enable it disable it in the admin panel?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Ivan Minic


JayBachatero

#9
I just finished into making it a mod for 1.1 beta 3 - rc1 :)

http://mods.simplemachines.org/index.php?mod=207
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

1MileCrash

why?

it's not really mod worthy...anybody could paste the code and make it work..
The only thing php can't do is tell you how much milk is left in the fridge.



K2

How about using it on 'this' forum? I would like it. But then again...
Disclaimer: Any post that I make infers the phrase IMHO "In my honest opinion" and "Kids, do not try this at home."

Anakin_holland

I would like this feature to be permanently visible, not just for the groups that are current represented online?

I guess I have to replace the variable "$context['online_groups']", but with what?

Greetz!

Anakin

Khyron

love this option, however i'm having a hell of a time getting it to possition right in the HELIOS template. any ideas? I have no ['Show_who']

if you look at my site you can see it's way off hxxp:www.musclecarculture.com [nonactive]


    // "Users online" - in order of activity.
foreach($context['online_groups'] AS $group)
{
    if(!empty($group['color']) && $group['color'] != '')
        echo '[ <span style="color:' . $group['color'] . '">' . $group['name'] . '</span> ] ';
}
        echo '
        <tr>
                <td class="catbg" colspan="2">', $txt[158], '</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center">
                        <a href="', $scripturl, '?action=who">
                                <img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], '" border="0" /></a>
                </td>
                <td class="windowbg2" width="100%">

                        <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 />

                        <span class="smalltext">';

        // 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']);
        echo '
                                <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
                                <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
                        </span>

                      <hr /><span class="smalltext">
                        Most users online today: '.$modSettings['mostOnlineToday'].' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                        Most users online ever: <b>'.$modSettings['mostOnline'].'</b> ( '.timeformat($modSettings['mostDate']).'  )
                        </span>
                </td>

        </tr>';
        // If they are logged in, but SP1 style information is off... show a personal message bar.

        if ($context['user']['is_logged'] && !$settings['show_sp1_info'])

        {
                echo '
        <tr>

                <td class="catbg" colspan="2">', $txt[159], '</td>
        </tr><tr>
                <td class="windowbg" width="20" valign="middle" align="center">
                        <a href="', $scripturl, '?action=pm">
                                <img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt[159], '" border="0" /></a>
                </td>
                <td class="windowbg2" valign="top">
                        <b><a href="', $scripturl, '?action=pm">', $txt[159], '</a></b>

                        <div class="smalltext">

                                ', $txt[660], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt[471] : $txt[153], '.... ', $txt[661], ' <a href="', $scripturl, '?action=pm">', $txt[662], '</a> ', $txt[663], '
                        </div>
                </td>
        </tr>';
        }


any idea were it goes?

Oldiesmann

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


Replace
        // 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']), '<br />';
                foreach($context['online_groups'] AS $group)
                {
                    if(!empty($group['color']) && $group['color'] != '')
                        echo '[ <span style="color:' . $group['color'] . '">' . $group['name'] . '</span> ] ';
                }
        }

Khyron

worked like a charm. Thank you for your help.

blinddruid

I really like the format that one board I saw has for their online users. 



How can this be done for ver 1.05? 

Thanks.

Ripper1231

I put it in...but what stuff do I edit? Can you make it red on the stuff you must edit?

Advertisement: