diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-10 18:07:12 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-10 18:07:12 +0000 |
commit | 557d09bb72f7e9848b6fc50ed4e2ba651b89e743 (patch) | |
tree | 9db78285f2e35af8f70dfbb240712164b45bcfd2 /phpBB/includes/functions.php | |
parent | c9478353171267a3ebc5d87b43d759d22684b21e (diff) | |
download | forums-557d09bb72f7e9848b6fc50ed4e2ba651b89e743.tar forums-557d09bb72f7e9848b6fc50ed4e2ba651b89e743.tar.gz forums-557d09bb72f7e9848b6fc50ed4e2ba651b89e743.tar.bz2 forums-557d09bb72f7e9848b6fc50ed4e2ba651b89e743.tar.xz forums-557d09bb72f7e9848b6fc50ed4e2ba651b89e743.zip |
- added updated coding guidelines
- introduced is_registered and is_bot flags for correct determinition of guest/registered/bot users
- changed bot code to act on useragent || ip
git-svn-id: file:///svn/phpbb/trunk@5117 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7eacbe91fd..848e97d935 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -110,7 +110,7 @@ function gen_rand_string($num_chars) list($usec, $sec) = explode(' ', microtime()); mt_srand($sec * $usec); - $max_chars = count($chars) - 1; + $max_chars = sizeof($chars) - 1; $rand_str = ''; for ($i = 0; $i < $num_chars; $i++) { @@ -505,7 +505,7 @@ function tz_select($default = '') global $sys_timezone, $user; $tz_select = ''; - foreach ($user->lang['tz'] as $offset => $zone) + foreach ($user->lang['tz']['zones'] as $offset => $zone) { if (is_numeric($offset)) { @@ -631,7 +631,7 @@ function markread($mode, $forum_id = 0, $topic_id = 0, $marktime = false) { global $config, $db, $user; - if ($user->data['user_id'] == ANONYMOUS) + if (!$user->data['is_registered']) { return; } @@ -1804,7 +1804,7 @@ function page_header($page_title = '') $s_privmsg_new = false; // Obtain number of new private messages if user is logged in - if ($user->data['user_id'] != ANONYMOUS) + if ($user->data['is_registered']) { if ($user->data['user_new_privmsg']) { @@ -1842,7 +1842,7 @@ function page_header($page_title = '') // Which timezone? $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])); - + // The following assigns all _common_ variables that may be used at any point // in a template. $template->assign_vars(array( @@ -1889,10 +1889,10 @@ function page_header($page_title = '') 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'], - 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], (($tz >= 0) ? '+' . $tz : $tz), $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], (($tz >= 0) ? '+' . $tz : $tz), ''), - 'S_DISPLAY_ONLINE_LIST' => (!empty($config['load_online'])) ? 1 : 0, - 'S_DISPLAY_SEARCH' => (!empty($config['load_search'])) ? 1 : 0, - 'S_DISPLAY_PM' => (!empty($config['allow_privmsg'])) ? 1 : 0, + 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''), + 'S_DISPLAY_ONLINE_LIST' => ($config['load_online']) ? 1 : 0, + 'S_DISPLAY_SEARCH' => ($config['load_search']) ? 1 : 0, + 'S_DISPLAY_PM' => ($config['allow_privmsg'] && $user->data['is_registered']) ? 1 : 0, 'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0, 'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0, @@ -1957,7 +1957,7 @@ function page_footer() $template->assign_vars(array( 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', - 'U_ACP' => ($auth->acl_get('a_') && $user->data['user_id'] != ANONYMOUS) ? "adm/index.$phpEx?sid=" . $user->data['session_id'] : '') + 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? "adm/index.$phpEx?sid=" . $user->data['session_id'] : '') ); $template->display('body'); |