Page 1 of 1

[Release] Add Online-Status to Team for B3P2.0.0

Posted: 21. September 2012 14:38
by Kirk
This will add the online status to the team block.
Durch diese Anleitung wird der Online Status im Team-Block angezeigt.


Version: 1.0.1

Screenshot:
Image

Tested with Board3 Portal 2.0.0
Getestet mit Board3 Portal 2.0.0


Normal Team block / Normaler Team Block

Instructions for normal team block:
[+] Install Instructions
Open: root/portal/modules/portal_leaders.php
Find:

Code: Select all

    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: Select all

    // 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: Select all

        'USER_ID'            => $row['user_id'], 
After add:

Code: Select all

        'USER_ONLINE'        => $user_online, 
Open: root/styles/prosilver/template/portal/modules/leaders_side.html
Find:

Code: Select all

      <span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span><br style="clear:both" />
Replace with:

Code: Select all

      <span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span><!-- 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Find:

Code: Select all

      <span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span><br style="clear:both" />
Replace with:

Code: Select all

      <span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Upload the following 2 files to root/styles/prosilver/theme/images/portal
Image
Image
Anleitung für normalen Team Block:
[+] Installations Anleitung
Öffne: root/portal/modules/portal_leaders.php
Finde:

Code: Select all

    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']);
    } 
Danach einfügen:

Code: Select all

    // 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: Select all

        'USER_ID'            => $row['user_id'], 
Danach einfügen:

Code: Select all

        'USER_ONLINE'        => $user_online, 
Öffne: root/styles/prosilver/template/portal/modules/leaders_side.html
Finde:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span><br style="clear:both" />
Ersetzen mit:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span><!-- 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Finde:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span><br style="clear:both" />
Ersetzen mit:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Lade diese 2 Bilder in root/styles/prosilver/theme/images/portal hoch.
Image
Image

Extended Team block / Erweiterter Team Block

Instructions for extended team block:
[+] Install Instructions
Open root/portal/modules/leaders.php
Find:

Code: Select all

        $groups[$row['group_id']]['group_users'][] = array(
            'user_id'        => $row['user_id'],
            'username'        => $row['username'],
            'user_colour'    => $row['user_colour'],
        ); 
Before add:

Code: Select all

        // 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: Select all

'user_id'        => $row['user_id'], 
After add:

Code: Select all

            'user_online'    => $user_online, 
Find:

Code: Select all

                    'USER_ID'            => $group_user['user_id'], 
After add:

Code: Select all

                    'USER_ONLINE'        => $group_user['user_online'], 

Open: root/styles/prosilver/template/portal/modules/leaders_ext_side.html
Find:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><br style="clear:both" />
Replace with:

Code: Select all

      <span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Upload the following 2 files to root/styles/prosilver/theme/images/portal (if the do not already exist)
Image
Image
Anleitung für Erweiterten Team-Block:
[+] Installations Anleitung
Öffne: root/portal/modules/portal_leaders.php
Finde:

Code: Select all

        $groups[$row['group_id']]['group_users'][] = array(
            'user_id'        => $row['user_id'],
            'username'        => $row['username'],
            'user_colour'    => $row['user_colour'],
        ); 
Davor einfügen:

Code: Select all

        // 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: Select all

'user_id'        => $row['user_id'], 
Danach einfügen:

Code: Select all

            'user_online'    => $user_online, 
Finde:

Code: Select all

                    'USER_ID'            => $group_user['user_id'], 
Danach einfügen:

Code: Select all

                    'USER_ONLINE'        => $group_user['user_online'], 
Öffne: root/styles/prosilver/template/portal/modules/leaders_ext_side.html
Finde:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> padding-top:2px;"><strong>{group.member.USERNAME_FULL}</strong></span><br style="clear:both" />
Ersetzen mit:

Code: Select all

		<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->float:right; padding-right:5px;<!-- ELSE -->float:left; padding-left:5px;<!-- ENDIF --> 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_OFFLINE}" style="float: right;" /><!-- ENDIF --><br style="clear:both" />
Lade diese 2 Bilder in root/styles/prosilver/theme/images/portal hoch.(falls nicht schon vorhanden)
Image
Image

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 24. September 2012 17:41
by Shorty1968
Hallo ich habe die änderungen gemacht und die Grafiken sind auch im richtigen ordner Trozdem wird sie nicht angezeigt,woran kann das liegen?
Image
Grafiken liegen im Ordner styles/prosilver/theme/images/portal
Board und Browser Cache sind geleert.

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 24. September 2012 18:07
by cpg
Moin,

sicherlich müssen die Grafiken auch noch in den von Dir verwendeten Style.
Was sagt ein Rechtsklick auf die fehlende Grafik?

Gruß
CPG

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 24. September 2012 18:15
by Shorty1968
hi das wusste ich und sind sie auch,ein rechtsklick sagt das die Datein da sind wo sie sein sollen. ;)

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 24. September 2012 19:18
by cpg
Moin,

na, dann müsste es auch funktionieren.

Meine Grafiken sind in

http://www.mein-forum.de/phpBB3/styles/ ... -on-16.png

... und es klappt tadellos.

Gruß
CPG

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 24. September 2012 20:12
by Shorty1968
Ah jetzt habe ich es vielen dank,das Problem war das wenn man hier die Grafiken speichert laten sie red_on_16.png im Template Codes heisen sie aber red-on-16.png,der unterschied ist das _ anstelle von dem -,aber denoch vielen dank eventuell wäre es mir ohne dich nie aufgefallen. ;)

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 25. September 2012 17:33
by Kirk
Da hatte ich einen Schreibfehler drin hab ihn berichtigt.
Danke für den Hinweis Shorty :)

Re: [Release] Add Online-Status to Team for B3P2.0.0

Posted: 27. September 2012 15:59
by Heinrich-XIV
Schöne Sache. :)

Falls ich mal irgendwann wieder Lust dazu bekomme, ein Forum online zu stellen, werde ich das auf jeden Fall mit einbauen.


Gruß

Heinrich