[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:
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:
Extended Team block / Erweiterter Team Block
Instructions for extended team block:
Durch diese Anleitung wird der Online Status im Team-Block angezeigt.
Version: 1.0.1
Screenshot:
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: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'],
Open: root/styles/prosilver/template/portal/modules/leaders_side.htmlCode: Select all
'USER_ONLINE' => $user_online,
Find: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><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>{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" />
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><br style="clear:both" />
Upload the following 2 files to root/styles/prosilver/theme/images/portalCode: 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" />
- [+] Installations Anleitung
- Öffne: root/portal/modules/portal_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'],
Öffne: root/styles/prosilver/template/portal/modules/leaders_side.htmlCode: Select all
'USER_ONLINE' => $user_online,
Finde: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><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>{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" />
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><br style="clear:both" />
Lade diese 2 Bilder in root/styles/prosilver/theme/images/portal hoch.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" />
Extended Team block / Erweiterter Team Block
Instructions for extended team block:
- [+] Install Instructions
- Open root/portal/modules/leaders.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: root/styles/prosilver/template/portal/modules/leaders_ext_side.html
Find: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><br style="clear:both" />
Upload the following 2 files to root/styles/prosilver/theme/images/portal (if the do not already exist)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" />
- [+] Installations Anleitung
- Öffne: root/portal/modules/portal_leaders.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'],
Öffne: root/styles/prosilver/template/portal/modules/leaders_ext_side.htmlCode: Select all
'USER_ONLINE' => $group_user['user_online'],
Finde: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><br style="clear:both" />
Lade diese 2 Bilder in root/styles/prosilver/theme/images/portal hoch.(falls nicht schon vorhanden)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" />