(phpBB2)
, !

## MOD:
##
## :
, 24 ,

##
## : 3
## - /templates/subSilver/index_body.tpl
## - /language/lang_english/lang_main.php
## - /includes/page_header.php

#-----[ ]---------------------------------
#
/templates/_/index_body.tpl
#
#-----[ ]---------------------------------
#
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#
#-----[ ]---------------------------
#
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
#
#-----[ ]---------------------------------
#
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}   [ {L_WHOSONLINE_ADMIN} ]   [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
#
#-----[ ]----------------------------
#
</tr>


<tr>
<td class="row1" align="left"><span class="gensmall">{USERS_OF_THE_DAY_LIST}</span></td>
#
#
#-----[ ]--------------------------------
#
/language/_/lang_main.php
#
#-----[ ]--------------------------------
#
$lang['Registered_users'] = 'Registered Users:';
#
#-----[ ]--------------------------
#
$lang['Day_users'] = '%d registered users visit during the last %d hours:';
$lang['Not_day_users'] = '%d registered users <span style="color:red">DIDN\'T</span> visit during the last %d hours:';
#
#
#-----[ ]--------------------------------
#
/includes/page_header.php
#
#-----[ ]--------------------------------
#
'LOGGED_IN_USER_LIST' => $online_userlist,
#
#-----[ ]---------------------------
#
'USERS_OF_THE_DAY_LIST' => $day_userlist,
#
#-----[ ]--------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//
#
#-----[ ]--------------------------
: Edit below - !
#
//
// Users of the day MOD
//

// ############ Edit below ############
// #
$display_not_day_userlist = 0; // 1
$users_list_delay = 24; // (-
// #
// ############ Edit above ############

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}

$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;

while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
}
else
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;

if ( $display_not_day_userlist )
{
$day_userlist .= '<br />' . $not_day_userlist;
}

//
// End of MOD
//



#
#-----[ // ]----------------------


: http://princeofpersia-bg.info/forum/

.

1. 1


2. 1


/ /
: Martowe
23:42 28-01-2010
#-----[ // ]-------------------

?
1