[REL] Add Online-Status to Team Block
Posted: Mon 5. Apr 2010, 10:36
by Marc
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:
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:
Instructions for extended team block:
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.
Version: 1.0.0
Screenshot:
- screenshot.png (11.36 KiB) Viewed 23345 times
Normal Team block / Normaler Team Block
Instructions for normal team block:
- [+] Install Instructions
- Open portal/block/leaders.php
Find:After add: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']); }
Find: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);
After add:Code: Select all
'USER_ID' => $row['user_id'],
Code: Select all
'USER_ONLINE' => $user_online,
Open styles/prosilver/template/portal/block/leaders.html
Find:Inline: After add:Code: Select all
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span>
Find:Code: Select all
<!-- 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 -->
Replace with:Code: Select all
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span>
Upload the following 2 files to styles/prosilver/theme/images/portal:Code: Select all
<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 -->
The attachment green-on-16.png is no longer availableThe attachment red-on-16.png is no longer available
- [+] Installations Anleitung
- Öffne portal/block/leaders.php
Finde:Danach einfügen: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']); }
Finde: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);
Danach einfügen:Code: Select all
'USER_ID' => $row['user_id'],
Code: Select all
'USER_ONLINE' => $user_online,
Öffne styles/prosilver/template/portal/block/leaders.html
Finde:In der Zeile direkt danach einfügen:Code: Select all
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{admin.USERNAME_FULL}</strong></span>
Finde:Code: Select all
<!-- 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 -->
Ersetze mit:Code: Select all
<span style="float:left; padding-left:5px; padding-top:2px;"><strong>{mod.USERNAME_FULL}</strong></span>
Jetzt noch die folgenden 2 Dateien in styles/prosilver/theme/images/portal hochladen:Code: Select all
<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 -->
The attachment green-on-16.png is no longer availableThe attachment red-on-16.png is no longer available
Instructions for extended team block:
- [+] Install Instructions
- Open portal/block/leaders_ext.php
Find:Before add:Code: Select all
$groups[$row['group_id']]['group_users'][] = array( 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], );
Find: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);
After add:Code: Select all
'user_id' => $row['user_id'],
Find:Code: Select all
'user_online' => $user_online,
After add:Code: Select all
'USER_ID' => $group_user['user_id'],
Code: Select all
'USER_ONLINE' => $group_user['user_online'],
Open styles/prosilver/template/portal/block/leaders_ext.html
Find:Replace with:Code: Select all
<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" />
Upload the following 2 files to styles/prosilver/theme/images/portal hochladen (if the do not already exist):Code: Select all
<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" />
The attachment green-on-16.png is no longer availableThe attachment red-on-16.png is no longer available
- [+] Installations Anleitung
- Öffne portal/block/leaders_ext.php
Finde:Davor einfügen:Code: Select all
$groups[$row['group_id']]['group_users'][] = array( 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], );
Finde: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);
Danach einfügen:Code: Select all
'user_id' => $row['user_id'],
Finde:Code: Select all
'user_online' => $user_online,
Danach einfügen:Code: Select all
'USER_ID' => $group_user['user_id'],
Code: Select all
'USER_ONLINE' => $group_user['user_online'],
Öffne styles/prosilver/template/portal/block/leaders_ext.html
Finde:Ersetze durch:Code: Select all
<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" />
Jetzt noch die folgenden 2 Dateien in styles/prosilver/theme/images/portal hochladen (falls nicht schon vorhanden):Code: Select all
<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" />
The attachment green-on-16.png is no longer availableThe attachment red-on-16.png is no longer available
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.