Seite 1 von 1

(Erledigt)Wer ist in welchem Forum aktiv Mod

Verfasst: 17.03.2006 23:23
von Red-Benz
Ich habe den
Wer ist in welchem Forum aktiv MOD vers 1.2.0 von Acid eingebaut.

Funktioniert.........aaaber nun mein Problem.

Das Timing passt nicht.

wenn ich mich in ein Forum einklicke bin ich als User in der Liste wenn ich das Forum wieder verlasse und die Seite aktualisiere bin ich immer noch als im Forum anwesend angezeigt, betrete ich nun das nächste Forum erscheine ich in dem Feld nicht ( erst nach ca. 90 sek )nach Seitenaktualisierung.

Was muss ich machen damit es Real angezeigt wird ??

irgend ein TimeCode spielt da nicht mit, aber wo ??

Hier das Forum http://www.tuning-crew-nord.de

Verfasst: 18.03.2006 00:01
von Red-Benz
Hier mal der verwendete Code
#-----[ ÖFFNEN ]------------------------------------------
#
# index.php
#
#-----[ FINDE ]------------------------------------------
#
while( $row = $db->sql_fetchrow($result) )
{
$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
}
$db->sql_freeresult($result);

#
#-----[ DARUNTER EINFÜGEN ]------------------------------------------
#
$sql_active = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip, f.forum_id
FROM ". USERS_TABLE ." u, ". SESSIONS_TABLE ." s, ". FORUMS_TABLE ." f
WHERE u.user_id = s.session_user_id AND s.session_time >= ". (time() - 300) ." AND s.session_page = f.forum_id
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result_active = $db->sql_query($sql_active)) )
{
message_die(GENERAL_ERROR, 'could not obtain user/online information.', '', __LINE__, __FILE__, $sql_active);
}

$userlist_ary = array();
$userlist_visible = array();
$prev_userid = 0;
$prev_userip = $prev_sessionip = '';
while( $active = $db->sql_fetchrow($result_active) )
{
if( $active['session_logged_in'] )
{
if( $active['user_id'] != $prev_userid )
{
if( file_exists(@phpbb_realpath($phpbb_root_path .'includes/functions_color_groups.'.$phpEx)) )
{
include_once($phpbb_root_path .'includes/functions_color_groups.'.$phpEx);
$active['username'] = color_group_colorize_name($active['user_id']);
}
else
{

if( file_exists(@phpbb_realpath($phpbb_root_path .'includes/functions_jr_admin.'.$phpEx)) )
{
include_once($phpbb_root_path .'includes/functions_jr_admin.' . $phpEx);
$jr_admin_userdata = jr_admin_get_user_info($active['user_id']);
}

$style_color = '';
if( $active['user_level'] == ADMIN )
{
$active['username'] = '<b>'. $active['username'] .'</b>';
$style_color = 'style="color:#'. $theme['fontcolor3'] .'"';
}
else if( $active['user_id'] == $jr_admin_userdata['user_id'] || $active['user_level'] == LESS_ADMIN )
{
$active['username'] = '<b>'. $active['username'] .'</b>';
$style_color = 'style="color:#FF0000"';
}
else if( $active['user_level'] == MOD )
{
$active['username'] = '<b>'. $active['username'] .'</b>';
$style_color = 'style="color:#'. $theme['fontcolor2'] .'"';
}
}

if( $active['user_allow_viewonline'] )
{
$onlinerow[$active['forum_id']][] = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL ."=". $active['user_id']) .'" '. $style_color .'>'. $active['username'] .'</a>';
$logged_visible_active[$active['forum_id']][]++;
}
else
{
$onlinerow[$active['forum_id']][] = ( $active['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) ? '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL ."=". $active['user_id']) .'" '. $style_color .'><i>'. $active['username'] .'</i></a>' : '';
$logged_hidden_active[$active['forum_id']][]++;
}
}
$prev_userid = $active['user_id'];
}
else
{
if( $active['session_ip'] != $prev_sessionip )
{
$guestrow[$active['forum_id']][] = '';
$guests_active[$active['forum_id']][]++;
}
}
$prev_sessionip = $active['session_ip'];
}
$db->sql_freeresult($result_active);

#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('catrow.forumrow', array(
'ROW_COLOR' => '#' . $row_color,

#
#-----[ REPLACE WITH ]------------------------------------------
#
if( count($onlinerow[$forum_id]) > '0' )
{
$users_total_guests = count($guests_active[$forum_id]);
$l_guests_total = ( $users_total_guests != '0' ) ? (( $users_total_guests == '1' ) ? $lang['Forum_one_guest_active'] : $lang['Forum_more_guests_active']) : '';
}
else
{
$users_total_guests = '&nbsp;';
$l_guests_total = '';
}

if( count($onlinerow[$forum_id]) > '0' )
{
$users_total = count($onlinerow[$forum_id]);
$users_total_hidden = count($logged_hidden_active[$forum_id]);
$users_active = implode(', ', $onlinerow[$forum_id]);

$l_active_total = ( $users_total == '1' ) ? $lang['Forum_one_active'] : $lang['Forum_more_active'];
$l_hidden_total = ( ($users_total_hidden != '0' ) ? ( $userdata['user_level'] == ADMIN ) ? '' : (( $users_total_hidden == '1' ) ? $lang['Forum_one_hidden_active'] : $lang['Forum_more_hidden_active']) : '');
}
else
{
$users_total = '&nbsp;';
$users_total_hidden = '&nbsp;';
$users_active = '&nbsp;';

$l_active_total = $lang['Forum_no_active'];
$l_hidden_total = '';
}

$template->assign_block_vars('catrow.forumrow', array(
'ACTIVE' => $users_active,
'ACTIVE_TOTAL' => sprintf($l_active_total, ($users_total+$users_total_guests)),
'ACTIVE_INFO' => sprintf($l_hidden_total, $users_total_hidden).sprintf($l_guests_total, $users_total_guests),


#
#-----[ ÖFFNEN ]------------------------------------------
#
# language/lang_german/lang_main.php
#
#-----[ FINDE ]------------------------------------------
#
$lang['Moderators'] = 'Moderatoren';

#
#-----[ DARUNTER EINFÜGEN ]------------------------------------------
#
// wenn man keine "0 users" anzeigen will, muss man die Auskommentierung (//) der
// folgenden Zeile entfernen und die Slashes vor die darauffolgende Zeile einfügen
// $lang['Forum_no_active'] = '';
$lang['Forum_no_active'] = '<b>0</b> User aktiv'; // <-- diese
$lang['Forum_one_active'] = '<b>%d</b> User aktiv: ';
$lang['Forum_more_active'] = '<b>%d</b> User aktiv: ';
$lang['Forum_one_hidden_active'] = '<b>%d</b> versteckter';
$lang['Forum_more_hidden_active'] = '<b>%d</b> versteckte';
$lang['Forum_one_guest_active'] = '<b>%d</b> Gast';
$lang['Forum_more_guests_active'] = '<b>%d</b> Gäste';


#
#-----[ ÖFFNEN ]------------------------------------------
#
# templates/xxx/index_body.tpl
#
#-----[ FINDE ]------------------------------------------
#
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>

#
#-----[ MIT FOLGENDEM ERSETZEN ]------------------------------------------
# falls man ein anderes Template als subSilver benutzt und/oder den obigen Code nicht
# finden kann, muss man nach nur einem Teil von diesem suchen

</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span><br />
<span class="gensmall">{catrow.forumrow.ACTIVE_TOTAL} {catrow.forumrow.ACTIVE} {catrow.forumrow.ACTIVE_INFO}</span></td>

Verfasst: 18.03.2006 19:50
von Red-Benz
Hallo !

Keiner ne Idee ??

Gruß

Red Benz