[REL] Add Online-Status to Team Block

Alles zu Board3 Portal Add-Ons gehört hier rein

[REL] Add Online-Status to Team Block

Beitragvon Marc » Mo 5. Apr 2010, 11:36

This will add the online status to the team block. Durch dies Anleitung wird der Online Status im Team-Block angezeigt.

Version: 1.0.0

Screenshot:
screenshot.png


Tested with Board3 Portal 1.0.4 & 1.0.5. Getestet mit Board3 Portal 1.0.4 & 1.0.5

Normal Team block / Normaler Team Block

Instructions for normal team block:
[+] Install Instructions
Open portal/block/leaders.php
Find:
Code: Alles auswählen
    if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
    {
        $group_name = $user->lang['GROUP_UNDISCLOSED'];
        $u_group = '';
    }
    else
    
{
        $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
        $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
    }   


After add:
Code: Alles auswählen
    // Generate online information for user
    $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
        FROM '
 . SESSIONS_TABLE . '
        WHERE '
 . $db->sql_in_set('session_user_id', $row['user_id']) . '
        GROUP BY session_user_id'
;
    $result2 = $db->sql_query($sql);

    $update_time = $config['load_online_time'] * 60;
    $user_online = false;
    while ($row2 = $db->sql_fetchrow($result2))
    {
        $user_online = (time() - $update_time < $row2['online_time'] && (($row2['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
    }
    $db->sql_freeresult($result2);   


Find:
Code: Alles auswählen
        'USER_ID'            => $row['user_id'],   


After add:
Code: Alles auswählen
        'USER_ONLINE'        => $user_online,   



Open styles/prosilver/template/portal/block/leaders.html
Find:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span>


Inline: After add:
Code: Alles auswählen
<!-- IF admin.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF -->


Find:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span>


Replace with:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span><!-- IF mod.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF -->


Upload the following 2 files to styles/prosilver/theme/images/portal:
green-on-16.png

red-on-16.png


Anleitung für normalen Team Block:
[+] Installations Anleitung
Öffne portal/block/leaders.php
Finde:
Code: Alles auswählen
    if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
    {
        $group_name = $user->lang['GROUP_UNDISCLOSED'];
        $u_group = '';
    }
    else
    
{
        $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
        $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
    }   


Danach einfügen:
Code: Alles auswählen
    // Generate online information for user
    $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
        FROM '
 . SESSIONS_TABLE . '
        WHERE '
 . $db->sql_in_set('session_user_id', $row['user_id']) . '
        GROUP BY session_user_id'
;
    $result2 = $db->sql_query($sql);

    $update_time = $config['load_online_time'] * 60;
    $user_online = false;
    while ($row2 = $db->sql_fetchrow($result2))
    {
        $user_online = (time() - $update_time < $row2['online_time'] && (($row2['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
    }
    $db->sql_freeresult($result2);   


Finde:
Code: Alles auswählen
        'USER_ID'            => $row['user_id'],   


Danach einfügen:
Code: Alles auswählen
        'USER_ONLINE'        => $user_online,   



Öffne styles/prosilver/template/portal/block/leaders.html
Finde:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span>


In der Zeile direkt danach einfügen:
Code: Alles auswählen
<!-- IF admin.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF -->


Finde:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span>


Ersetze mit:
Code: Alles auswählen
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span><!-- IF mod.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF -->


Jetzt noch die folgenden 2 Dateien in styles/prosilver/theme/images/portal hochladen:
green-on-16.png

red-on-16.png


Extended Team block / Erweiterter Team Block

Instructions for extended team block:
[+] Install Instructions
Open portal/block/leaders_ext.php
Find:
Code: Alles auswählen
        $groups[$row['group_id']]['group_users'][] = array(
            'user_id'        => $row['user_id'],
            'username'        => $row['username'],
            'user_colour'    => $row['user_colour'],
        );   


Before add:
Code: Alles auswählen
        // Generate online information for user
        $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
            FROM '
 . SESSIONS_TABLE . '
            WHERE '
 . $db->sql_in_set('session_user_id', $row['user_id']) . '
            GROUP BY session_user_id'
;
        $result2 = $db->sql_query($sql);

        $update_time = $config['load_online_time'] * 60;
        $user_online = false;
        while ($row2 = $db->sql_fetchrow($result2))
        {
            $user_online = (time() - $update_time < $row2['online_time'] && (($row2['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
        }
        $db->sql_freeresult($result2);   


Find:
Code: Alles auswählen
'user_id'        => $row['user_id'],   


After add:
Code: Alles auswählen
            'user_online'    => $user_online,   


Find:
Code: Alles auswählen
                    'USER_ID'            => $group_user['user_id'],   


After add:
Code: Alles auswählen
                    'USER_ONLINE'        => $group_user['user_online'],   



Open styles/prosilver/template/portal/block/leaders_ext.html
Find:
Code: Alles auswählen
      <span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><br style="clear:both" />


Replace with:
Code: Alles auswählen
      <span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><!-- IF group.member.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />


Upload the following 2 files to styles/prosilver/theme/images/portal hochladen (if the do not already exist):
green-on-16.png

red-on-16.png


Anleitung für Erweiterten Team-Block:
[+] Installations Anleitung
Öffne portal/block/leaders_ext.php
Finde:
Code: Alles auswählen
        $groups[$row['group_id']]['group_users'][] = array(
            'user_id'        => $row['user_id'],
            'username'        => $row['username'],
            'user_colour'    => $row['user_colour'],
        );  


Davor einfügen:
Code: Alles auswählen
        // Generate online information for user
        $sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
            FROM '
 . SESSIONS_TABLE . '
            WHERE '
 . $db->sql_in_set('session_user_id', $row['user_id']) . '
            GROUP BY session_user_id'
;
        $result2 = $db->sql_query($sql);

        $update_time = $config['load_online_time'] * 60;
        $user_online = false;
        while ($row2 = $db->sql_fetchrow($result2))
        {
            $user_online = (time() - $update_time < $row2['online_time'] && (($row2['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
        }
        $db->sql_freeresult($result2);  


Finde:
Code: Alles auswählen
'user_id'        => $row['user_id'],  


Danach einfügen:
Code: Alles auswählen
            'user_online'    => $user_online,  


Finde:
Code: Alles auswählen
                    'USER_ID'            => $group_user['user_id'],  


Danach einfügen:
Code: Alles auswählen
                    'USER_ONLINE'        => $group_user['user_online'],  



Öffne styles/prosilver/template/portal/block/leaders_ext.html
Finde:
Code: Alles auswählen
      <span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><br style="clear:both" />


Ersetze durch:
Code: Alles auswählen
      <span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><!-- IF group.member.USER_ONLINE eq 'true' --><img src="{T_THEME_PATH}/images/portal/green-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ELSE --><img src="{T_THEME_PATH}/images/portal/red-on-16.png" width="16" height="16" alt="{L_ONLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />


Jetzt noch die folgenden 2 Dateien in styles/prosilver/theme/images/portal hochladen (falls nicht schon vorhanden):
green-on-16.png

red-on-16.png


Note: The png-leds will not have a transparent background in IE6. If you want it to look correct in IE6, look for GIF led-icons.
Hinweis: Die PNG-LEDs haben im IE6 keinen transparenten Hintergrund. Falls du willst, dass es im IE6 auch gut aussieht, suche LED-Icons im GIF-Format.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Bild
Benutzeravatar
Marc
Administrator
Administrator
 
Beiträge: 566
Bilder: 10
Registriert: Di 2. Sep 2008, 23:48
Wohnort: Munich

Zurück zu Board3 Portal Add-Ons

Wer ist online?

Mitglieder in diesem Forum: CommonCrawl [Bot] und 0 Gäste

x