diff --git a/phpBB/index.php b/phpBB/index.php index a4c2f57bd6..b7e6bed2ef 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -3,12 +3,12 @@ // // $Id$ // -// FILENAME : index.php +// FILENAME : index.php // STARTED : Sat Feb 13, 2001 // COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// +// LICENCE : GPL vs2.0 [ see /docs/COPYING ] +// // ------------------------------------------------------------- define('IN_PHPBB', true); @@ -36,15 +36,15 @@ $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER' $l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER'; // Grab group details for legend display -$sql = 'SELECT group_name, group_colour, group_type - FROM ' . GROUPS_TABLE . ' +$sql = 'SELECT group_id, group_name, group_colour, group_type + FROM ' . GROUPS_TABLE . ' WHERE group_legend = 1'; $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } $db->sql_freeresult($result); @@ -54,8 +54,8 @@ $birthday_list = ''; if ($config['load_birthdays']) { $now = getdate(); - $sql = 'SELECT user_id, username, user_colour, user_birthday - FROM ' . USERS_TABLE . " + $sql = 'SELECT user_id, username, user_colour, user_birthday + FROM ' . USERS_TABLE . " WHERE user_birthday LIKE '" . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . "%'"; $result = $db->sql_query($sql); @@ -63,7 +63,7 @@ if ($config['load_birthdays']) { $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; $birthday_list .= (($birthday_list != '') ? ', ' : '') . '' . $row['username'] . ''; - + if ($age = (int)substr($row['user_birthday'], -4)) { $birthday_list .= ' (' . ($now['year'] - $age) . ')'; @@ -77,16 +77,16 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "", $newest_user, ''), - 'LEGEND' => $legend, - 'BIRTHDAY_LIST' => $birthday_list, + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "", $newest_user, ''), + 'LEGEND' => $legend, + 'BIRTHDAY_LIST' => $birthday_list, 'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'), 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'), 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'), - 'S_LOGIN_ACTION' => "ucp.$phpEx$SID&mode=login", - 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, + 'S_LOGIN_ACTION' => "ucp.$phpEx$SID&mode=login", + 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, 'U_MARK_FORUMS' => "index.$phpEx$SID&mark=forums") ); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index c0b4121a3e..afafb1d457 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -3,12 +3,12 @@ // // $Id$ // -// FILENAME : viewforum.php +// FILENAME : viewforum.php // STARTED : Sat Feb 13, 2001 // COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ -// LICENCE : GPL vs2.0 [ see /docs/COPYING ] -// +// LICENCE : GPL vs2.0 [ see /docs/COPYING ] +// // ------------------------------------------------------------- define('IN_PHPBB', true); @@ -59,7 +59,7 @@ else default: if ($config['load_db_lastread']) { - $sql_lastread = 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' + $sql_lastread = 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)'; $lastread_select = ', ft.mark_time '; } @@ -78,8 +78,8 @@ else $sql_from = ($sql_lastread) ? '((' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ")) $sql_lastread)" : '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . '))'; - $sql = "SELECT f.*, fw.notify_status $lastread_select - FROM $sql_from + $sql = "SELECT f.*, fw.notify_status $lastread_select + FROM $sql_from WHERE f.forum_id = $forum_id"; } } @@ -96,7 +96,7 @@ if ($user->data['user_id'] == ANONYMOUS && $config['load_db_lastread']) $forum_data['mark_time'] = 0; } -// Is this forum a link? ... User got here either because the +// Is this forum a link? ... User got here either because the // number of clicks is being tracked or they guessed the id if ($forum_data['forum_link']) { @@ -104,7 +104,7 @@ if ($forum_data['forum_link']) if ($forum_data['forum_flags'] & 1) { $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_posts = forum_posts + 1 + SET forum_posts = forum_posts + 1 WHERE forum_id = ' . $forum_id; $db->sql_query($sql); } @@ -125,7 +125,7 @@ if ($forum_data['forum_password']) // Redirect to login upon emailed notification links if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) { - login_box($user->cur_page, '', $user->lang['LOGIN_NOTIFY_FORUM']); + login_box('', $user->lang['LOGIN_NOTIFY_FORUM']); } // Permissions check @@ -136,7 +136,7 @@ if (!$auth->acl_get('f_read', $forum_id)) trigger_error($user->lang['SORRY_AUTH_READ']); } - login_box($user->cur_page, '', $user->lang['LOGIN_VIEWFORUM']); + login_box('', $user->lang['LOGIN_VIEWFORUM']); } // Build navigation links @@ -226,7 +226,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $sql = 'SELECT COUNT(topic_id) AS num_topics FROM ' . TOPICS_TABLE . " WHERE forum_id = $forum_id - AND topic_type <> " . POST_ANNOUNCE . " + AND topic_type <> " . POST_ANNOUNCE . " AND topic_last_post_time >= $min_post_time " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1'); $result = $db->sql_query($sql); @@ -280,20 +280,20 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'], 'S_IS_POSTABLE' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, - 'S_DISPLAY_ACTIVE' => ($forum_data['forum_type'] == FORUM_CAT && $forum_data['forum_flags'] & 16) ? true : false, + 'S_DISPLAY_ACTIVE' => ($forum_data['forum_type'] == FORUM_CAT && $forum_data['forum_flags'] & 16) ? true : false, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, - 'S_TOPIC_ICONS' => ($forum_data['forum_type'] == FORUM_CAT && $forum_data['forum_flags'] & 16) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), + 'S_TOPIC_ICONS' => ($forum_data['forum_type'] == FORUM_CAT && $forum_data['forum_flags'] & 16) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'], 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], 'S_FORUM_ACTION' => "viewforum.$phpEx$SID&f=$forum_id&start=$start", - 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, - 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f[]=$forum_id", + 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, + 'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&f[]=$forum_id", - 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? "mcp.$phpEx?sid=$user->session_id&f=$forum_id&mode=forum_view" : '', - 'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&mode=post&f=$forum_id", - 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id&$u_sort_param&start=$start", + 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? "mcp.$phpEx?sid=$user->session_id&f=$forum_id&mode=forum_view" : '', + 'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&mode=post&f=$forum_id", + 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id&$u_sort_param&start=$start", 'U_MARK_TOPICS' => "viewforum.$phpEx$SID&f=$forum_id&mark=topics") ); @@ -319,8 +319,8 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) if ($forum_data['forum_type'] == FORUM_POST) { // Obtain announcements ... removed sort ordering, sort by time in all cases - $sql = "SELECT t.* $sql_select - FROM $sql_from + $sql = "SELECT t.* $sql_select + FROM $sql_from WHERE t.forum_id IN ($forum_id, 0) AND t.topic_type IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ') ORDER BY t.topic_time DESC'; @@ -361,11 +361,11 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) // $sql_rownum = (SQL_LAYER != 'oracle') ? '' : ', ROWNUM rnum '; $sql_rownum = ''; $sql_where = ($forum_data['forum_type'] == FORUM_POST) ? "= $forum_id" : 'IN (' . implode(', ', $active_forum_ary['forum_id']) . ')'; - $sql = "SELECT t.* $sql_select$sql_rownum + $sql = "SELECT t.* $sql_select$sql_rownum FROM $sql_from WHERE t.forum_id $sql_where - AND t.topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ") - $sql_approved + AND t.topic_type NOT IN (" . POST_ANNOUNCE . ', ' . POST_GLOBAL . ") + $sql_approved $sql_limit_time ORDER BY t.topic_type DESC, $sql_sort_order"; $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); @@ -464,7 +464,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) if ($user->data['user_id'] != ANONYMOUS) { $unread_topic = $new_votes = true; - + if ($mark_time_topic >= $row['topic_last_post_time'] || $mark_time_forum >= $row['topic_last_post_time'] || ($row['topic_last_post_time'] == $row['poll_last_vote'] && $replies)) { $unread_topic = false; @@ -479,7 +479,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) { $unread_topic = $new_votes = false; } - + // $folder_new .= ($new_votes) ? '_vote' : ''; $newest_post_img = ($unread_topic) ? "" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . ' ' : ''; @@ -535,7 +535,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) $topic_author .= ($row['topic_poster'] != ANONYMOUS) ? $row['topic_first_poster_name'] : (($row['topic_first_poster_name'] != '') ? $row['topic_first_poster_name'] : $user->lang['GUEST']); $topic_author .= ($row['topic_poster'] != ANONYMOUS) ? '' : ''; - // This will allow the style designer to output a different header + // This will allow the style designer to output a different header // or even seperate the list of announcements from sticky and normal // topics $s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; @@ -549,7 +549,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], - 'GOTO_PAGE' => $goto_page, + 'GOTO_PAGE' => $goto_page, 'REPLIES' => ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'], 'VIEWS' => $row['topic_views'], 'TOPIC_TITLE' => censor_text($row['topic_title']), @@ -561,9 +561,9 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '' : '', 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', - 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test, - 'S_TOPIC_TYPE' => $row['topic_type'], - 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false, + 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test, + 'S_TOPIC_TYPE' => $row['topic_type'], + 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false, 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', $forum_id)) ? TRUE : FALSE, 'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? TRUE : FALSE, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7072b7794e..b9f61f0afc 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -276,7 +276,7 @@ if (isset($_GET['e'])) if ($user->data['user_id'] == ANONYMOUS) { - login_box($redirect_url . "&p=$post_id&e=$jump_to", '', $user->lang['LOGIN_NOTIFY_TOPIC']); + login_box($redirect_url . "&p=$post_id&e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']); } else if ($jump_to > 0) {