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/viewforum.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/viewforum.php')
| -rw-r--r-- | phpBB/viewforum.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 1a9a91420b..14cae34d18 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -37,7 +37,7 @@ if (!$forum_id) } // Grab appropriate forum data -if ($user->data['user_id'] == ANONYMOUS) +if (!$user->data['is_registered']) { $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -85,7 +85,7 @@ if (!($forum_data = $db->sql_fetchrow($result))) } $db->sql_freeresult($result); -if ($user->data['user_id'] == ANONYMOUS && $config['load_db_lastread']) +if (!$user->data['is_registered'] && $config['load_db_lastread']) { $forum_data['mark_time'] = 0; } @@ -117,7 +117,7 @@ if ($forum_data['forum_password']) } // Redirect to login upon emailed notification links -if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) +if (isset($_GET['e']) && !$user->data['is_registered']) { login_box('', $user->lang['LOGIN_NOTIFY_FORUM']); } @@ -158,7 +158,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) // Handle marking posts if ($mark_read == 'topics') { - if ($user->data['user_id'] != ANONYMOUS) + if ($user->data['is_registered']) { markread('mark', $forum_id); } @@ -307,11 +307,11 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) break; default: - $sql_from = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['user_id'] != ANONYMOUS) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t '; + $sql_from = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['is_registered']) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t '; } $sql_approved = ($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1'; - $sql_select = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['user_id'] != ANONYMOUS) ? ', tt.mark_type, tt.mark_time' : ''; + $sql_select = (($config['load_db_lastread'] || $config['load_db_track']) && $user->data['is_registered']) ? ', tt.mark_type, tt.mark_time' : ''; if ($forum_data['forum_type'] == FORUM_POST) { @@ -397,7 +397,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) if ($config['load_db_lastread']) { - $mark_time_topic = ($user->data['user_id'] != ANONYMOUS) ? $row['mark_time'] : 0; + $mark_time_topic = ($user->data['is_registered']) ? $row['mark_time'] : 0; } else { @@ -480,7 +480,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) // on all topics (as we do in 2.0.x). It looks for unread or new topics, if it doesn't find // any it updates the forum last read cookie. This requires that the user visit the forum // after reading a topic - if ($forum_data['forum_type'] == FORUM_POST && $user->data['user_id'] != ANONYMOUS && count($topic_list) && $mark_forum_read) + if ($forum_data['forum_type'] == FORUM_POST && $user->data['is_registered'] && sizeof($topic_list) && $mark_forum_read) { markread('mark', $forum_id); } |
