|
From: Bart v. B. <ba...@us...> - 2002-01-25 21:53:09
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv5878/includes
Modified Files:
page_header.php
Log Message:
Implemented Record of online users
Index: page_header.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/page_header.php,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -r1.90 -r1.91
*** page_header.php 2002/01/24 02:59:21 1.90
--- page_header.php 2002/01/25 21:53:05 1.91
***************
*** 162,165 ****
--- 162,207 ----
}
+ //
+ // This block of INSERTs is only here for people that are running RC1 or RC2 of phpBB2.
+ // Can be removed after most of those users have migrated to a version that has inserted
+ // the needed conifg keys.
+ //
+ if(!isset($board_config['record_online_users']) )
+ {
+ $sql = "INSERT INTO ". CONFIG_TABLE ."
+ (config_name, config_value) VALUES ('record_online_users', '".$total_online_users."')";
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't insert config key 'record_online_users'", "", __LINE__, __FILE__, $sql);
+ }
+ $sql = "INSERT INTO ". CONFIG_TABLE ."
+ (config_name, config_value) VALUES ('record_online_date', '".time()."')";
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't insert config key 'record_online_date'", "", __LINE__, __FILE__, $sql);
+ }
+ $board_config['record_online_users'] = $total_online_users;
+ $board_config['record_online_date'] = time();
+ }
+ else if($total_online_users > $board_config['record_online_users'])
+ {
+ $sql = "UPDATE " . CONFIG_TABLE . "
+ SET config_value = '$total_online_users'
+ WHERE config_name = 'record_online_users'";
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't update online user record (nr of users)", "", __LINE__, __FILE__, $sql);
+ }
+ $sql = "UPDATE " . CONFIG_TABLE . "
+ SET config_value = '" . time() . "'
+ WHERE config_name = 'record_online_date'";
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't update online user record (date)", "", __LINE__, __FILE__, $sql);
+ }
+ $board_config['record_online_users'] = $total_online_users;
+ $board_config['record_online_date'] = time();
+ }
+
$online_userlist = $lang['Registered_users'] . " " . $online_userlist;
***************
*** 360,363 ****
--- 402,406 ----
"L_WHOSONLINE_ADMIN" => sprintf($lang['Admin_online_color'], '<span style="color:' . $theme['fontcolor3'] . '">', '</span>'),
"L_WHOSONLINE_MOD" => sprintf($lang['Mod_online_color'], '<span style="color:' . $theme['fontcolor2'] . '">', '</span>'),
+ "L_RECORD_USERS" => sprintf($lang['Record_online_users'], $board_config['record_online_users'], date($lang['DATE_FORMAT'], $board_config['record_online_date']) ),
"U_SEARCH_UNANSWERED" => append_sid("search.".$phpEx."?search_id=unanswered"),
|