diff options
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_jabber.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_logs.php | 169 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 4 | ||||
-rw-r--r-- | phpBB/includes/db/mysql4.php | 5 | ||||
-rw-r--r-- | phpBB/includes/db/mysqli.php | 3 | ||||
-rw-r--r-- | phpBB/includes/db/postgres.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 41 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_module.php | 5 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 4 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 10 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 26 | ||||
-rw-r--r-- | phpBB/install/install.php | 6 | ||||
-rw-r--r-- | phpBB/language/en/acp/common.php | 34 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 1 | ||||
-rw-r--r-- | phpBB/mcp.php | 4 | ||||
-rw-r--r-- | phpBB/memberlist.php | 4 | ||||
-rw-r--r-- | phpBB/search.php | 8 | ||||
-rwxr-xr-x | phpBB/ucp.php | 4 | ||||
-rw-r--r-- | phpBB/viewforum.php | 9 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 26 |
23 files changed, 296 insertions, 79 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 25161d05f0..e14053fe34 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1406,7 +1406,7 @@ class acp_attachments_info { return array( 'filename' => 'acp_attachments', - 'title' => 'Attachments', + 'title' => 'ACP_ATTACHMENTS', 'version' => '1.0.0', 'modes' => array( 'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach'), diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 9e8fb8feae..9ddd925557 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -25,6 +25,7 @@ class acp_bbcodes $bbcode_id = request_var('bbcode', 0); $this->tpl_name = 'acp_bbcodes'; + $this->page_title = 'ACP_BBCODES'; $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode"; diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index bfbcec9001..89490349a9 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -170,7 +170,7 @@ class acp_jabber_info { return array( 'filename' => 'acp_jabber', - 'title' => 'Jabber', + 'title' => 'ACP_JABBER_SETTINGS', 'version' => '1.0.0', 'modes' => array( 'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_server'), diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php new file mode 100644 index 0000000000..197ada5cfc --- /dev/null +++ b/phpBB/includes/acp/acp_logs.php @@ -0,0 +1,169 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package acp +*/ +class acp_logs +{ + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('mcp'); + + // Set up general vars + $action = request_var('action', ''); + $forum_id = request_var('f', 0); + $start = request_var('start', 0); + $deletemark = (isset($_POST['delmarked'])) ? true : false; + $deleteall = (isset($_POST['delall'])) ? true : false; + $marked = request_var('mark', array(0)); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('sd', 'd'); + + $this->tpl_name = 'acp_logs'; + $this->log_type = constant('LOG_' . strtoupper($mode)); + + $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode"; + + // Delete entries if requested and able + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + $where_sql = ''; + if ($deletemark && $marked) + { + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')'; + unset($sql_in); + } + + if ($where_sql) + { + $sql = 'DELETE FROM ' . LOG_TABLE . " + WHERE log_type = {$this->log_type} + $where_sql"; + $db->sql_query($sql); + + add_log('admin', 'LOG_' . strtoupper($mode) . '_CLEAR'); + } + } + + // Sorting + $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); + $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); + $sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; + gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); + + // Define where and sort sql for use in displaying logs + $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; + $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + + $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; + $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN']; + + $this->page_title = $l_title; + + // Define forum list if we're looking @ mod logs + if ($mode == 'mod') + { + $forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id); + + $template->assign_vars(array( + 'S_SHOW_FORUMS' => true, + 'S_FORUM_BOX' => $forum_box) + ); + } + + // Grab log data + $log_data = array(); + $log_count = 0; + view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort); + + $template->assign_vars(array( + 'L_TITLE' => $l_title, + 'L_EXPLAIN' => $l_title_explain, + 'U_ACTION' => $u_action, + + 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true), + + 'S_LIMIT_DAYS' => $s_limit_days, + 'S_SORT_KEY' => $s_sort_key, + 'S_SORT_DIR' => $s_sort_dir, + 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), + + ) + ); + + foreach ($log_data as $row) + { + $data = array(); + + foreach (array('viewtopic', 'viewlogs', 'viewforum') as $check) + { + if (isset($row[$check]) && $row[$check]) + { + $data[] = '<a href="' . $row[$check] . '">' . $user->lang['LOGVIEW_' . strtoupper($check)] . '</a>'; + } + } + + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username'], + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'DATA' => (sizeof($data)) ? implode(' | ', $data) : '', + 'ID' => $row['id'], + ) + ); + } + } +} + +/** +* @package module_install +*/ +class acp_logs_info +{ + function module() + { + return array( + 'filename' => 'acp_logs', + 'title' => 'ACP_LOGGING', + 'version' => '1.0.0', + 'modes' => array( + 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_'), + 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_'), + 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_'), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 86a7c8467f..2b1c522f50 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -716,8 +716,8 @@ class acp_modules $rows = array(); $sql = 'SELECT m2.* - FROM (' . MODULES_TABLE . ' m1 - LEFT JOIN ' . MODULES_TABLE . " m2 ON $condition) + FROM ' . MODULES_TABLE . ' m1 + LEFT JOIN ' . MODULES_TABLE . " m2 ON ($condition) WHERE m1.module_class = '" . $db->sql_escape($this->module_class) . "' AND m2.module_class = '" . $db->sql_escape($this->module_class) . "' AND m1.module_id = $module_id diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php index ce56efc664..3df2c0ad0d 100644 --- a/phpBB/includes/db/mysql4.php +++ b/phpBB/includes/db/mysql4.php @@ -20,7 +20,10 @@ if (!defined('SQL_LAYER')) /** * @package dbal * MySQL4 Database Abstraction Layer -* Minimum Requirement is 4.0+ (4.1+ compatible) +* Compatible with: +* MySQL 4.0+ +* MySQL 4.1+ +* MySQL 5.0+ */ class dbal_mysql4 extends dbal { diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 5bd4b124db..82ee6ecf21 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -20,7 +20,8 @@ if (!defined('SQL_LAYER')) /** * @package dbal * MySQLi Database Abstraction Layer -* Minimum Requirement is MySQL 4.1+ and the mysqli-extension +* mysqli-extension has to be compiled with: +* MySQL 4.1+ or MySQL 5.0+ */ class dbal_mysqli extends dbal { diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 72590d6330..f371202578 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -120,6 +120,11 @@ class dbal_postgres extends dbal { global $cache; + if (strpos($query, 'SELECT') === 0 && strpos($query, 'FROM (') !== false) + { + $query = preg_replace('#FROM \((.+)\) #', 'FROM \1 ', $query); + } + // EXPLAIN only in extra debug mode if (defined('DEBUG_EXTRA')) { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a4fe26bccd..48de517083 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -201,7 +201,7 @@ function size_select($select_name, $size_compare) /** * Obtain authed forums list */ -function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = FALSE, $no_cache = FALSE) +function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false, $no_cache = false) { global $db, $auth; static $forum_rows; @@ -242,7 +242,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = /** * Get forum branch */ -function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = TRUE) +function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = true) { global $db; @@ -263,8 +263,8 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl $rows = array(); $sql = 'SELECT f2.* - FROM (' . FORUMS_TABLE . ' f1 - LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition) + FROM ' . FORUMS_TABLE . ' f1 + LEFT JOIN ' . FORUMS_TABLE . " f2 ON ($condition) WHERE f1.forum_id = $forum_id ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC'); $result = $db->sql_query($sql); @@ -431,7 +431,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) /** * Remove topic(s) */ -function delete_topics($where_type, $where_ids, $auto_sync = TRUE) +function delete_topics($where_type, $where_ids, $auto_sync = true) { global $db; $forum_ids = $topic_ids = array(); @@ -502,7 +502,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE) /** * Remove post(s) */ -function delete_posts($where_type, $where_ids, $auto_sync = TRUE) +function delete_posts($where_type, $where_ids, $auto_sync = true) { global $db; @@ -567,7 +567,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) * ids => (post_ids, topic_ids, attach_ids, user_ids) * resync => set this to false if you are deleting posts or topics... */ -function delete_attachments($mode, $ids, $resync = TRUE) +function delete_attachments($mode, $ids, $resync = true) { global $db, $config; @@ -758,7 +758,7 @@ function delete_attachments($mode, $ids, $resync = TRUE) /** * Remove topic shadows */ -function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE) +function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) { $where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', $forum_id) . ')' : (($forum_id) ? "AND t.forum_id = $forum_id" : ''); @@ -799,7 +799,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE) if ($auto_sync) { $where_type = ($forum_id) ? 'forum_id' : ''; - sync('forum', $where_type, $forum_id, TRUE); + sync('forum', $where_type, $forum_id, true); } } @@ -831,7 +831,7 @@ function phpbb_unlink($filename, $mode = 'file') * - post_attachement Same as post_reported, thanks to a quick Search/Replace * - topic_attachement Same as topic_reported, thanks to a quick Search/Replace */ -function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, $sync_extra = FALSE) +function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $sync_extra = false) { global $db; @@ -839,7 +839,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, { $where_ids = array_unique($where_ids); } - elseif ($where_type != 'range') + else if ($where_type != 'range') { $where_ids = ($where_ids) ? array($where_ids) : array(); } @@ -851,7 +851,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, $where_sql = ''; $where_sql_and = 'WHERE'; } - elseif ($where_type == 'range') + else if ($where_type == 'range') { // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)"; @@ -1346,14 +1346,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, // Now we delete empty topics and orphan posts if (sizeof($delete_posts)) { - delete_posts('topic_id', array_keys($delete_posts), FALSE); + delete_posts('topic_id', array_keys($delete_posts), false); unset($delete_posts); } if (!sizeof($topic_data)) { // If we get there, topic ids were invalid or topics did not contain any posts - delete_topics($where_type, $where_ids, TRUE); + delete_topics($where_type, $where_ids, true); return; } if (sizeof($delete_topics)) @@ -1365,7 +1365,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, $delete_topic_ids[] = $topic_id; } - delete_topics('topic_id', $delete_topic_ids, FALSE); + delete_topics('topic_id', $delete_topic_ids, false); unset($delete_topics, $delete_topic_ids); } @@ -1472,11 +1472,11 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, unset($topic_data); // if some topics have been resync'ed then resync parent forums - // except when we're only syncing a range, we don't want to sync forums during - // batch processing. + // except when we're only syncing a range, we don't want to sync forums during + // batch processing. if ($resync_parents && sizeof($resync_forums) && $where_type != 'range') { - sync('forum', 'forum_id', $resync_forums, TRUE); + sync('forum', 'forum_id', $resync_forums, true); } break; } @@ -1636,9 +1636,8 @@ function split_sql_file($sql, $delimiter) // we don't actually care about the matches preg gives us. $matches = array(); - // this is faster than calling count($oktens) every time thru the loop. - $token_count = sizeof($tokens); - for ($i = 0; $i < $token_count; $i++) + // this is faster than calling sizeof($oktens) every time thru the loop. + for ($i = 0, $token_count = sizeof($tokens); $i < $token_count; $i++) { // Don't wanna add an empty string as the last thing in the array. if ($i != $token_count - 1) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index c887c28aef..adb838f371 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -48,7 +48,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($config['load_db_track'] && $user->data['is_registered']) { - $sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; + $sql_from = FORUMS_TABLE . ' f 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 '; } else diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 9841a6f15b..ba43943406 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -358,6 +358,11 @@ class p_master { global $user; + if (!isset($this->module->page_title)) + { + return ''; + } + return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title; } diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 2aafb49180..8659c0b2f1 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -118,8 +118,8 @@ function mcp_front_view($id, $mode, $action, $url) if ($total) { $sql = 'SELECT r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name - FROM ' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr,' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u - LEFT JOIN ' . FORUMS_TABLE . ' f ON f.forum_id = p.forum_id + FROM (' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr,' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u) + LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = p.forum_id) WHERE r.post_id = p.post_id AND r.reason_id = rr.reason_id AND p.topic_id = t.topic_id diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 71cff5ce0c..1aad064c07 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -103,7 +103,7 @@ class bbcode_firstpass extends bbcode 'attachment'=> array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")), 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")), 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")), - 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#ie' => "\$this->validate_url('\$2', '\$3')")), + 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")), 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), @@ -419,7 +419,7 @@ class bbcode_firstpass extends bbcode $out .= array_pop($list_end_tags) . ']'; $tok = '['; } - elseif (preg_match('#list(=?(?:[0-9]|[a-z]|))#i', $buffer, $m)) + else if (preg_match('#list(=?(?:[0-9]|[a-z]|))#i', $buffer, $m)) { // sub-list, add a closing tag if (!$m[1] || preg_match('/^(disc|square|circle)$/i', $m[1])) @@ -505,7 +505,7 @@ class bbcode_firstpass extends bbcode $tok = '['; $buffer = ''; } - elseif (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m)) + else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m)) { $this->parsed_items['quote']++; @@ -565,7 +565,7 @@ class bbcode_firstpass extends bbcode $tok = '['; $buffer = ''; } - elseif (preg_match('#^quote="(.*?)#is', $buffer, $m)) + else if (preg_match('#^quote="(.*?)#is', $buffer, $m)) { // the buffer holds an invalid opening tag $buffer .= ']'; @@ -1508,7 +1508,7 @@ class fulltext_search // Remove words with no matches ... this is a potentially nasty query $sql = 'SELECT w.word_id FROM ' . SEARCH_WORD_TABLE . ' w - LEFT JOIN ' . SEARCH_MATCH_TABLE . ' m ON w.word_id = m.word_id + LEFT JOIN ' . SEARCH_MATCH_TABLE . ' m ON (w.word_id = m.word_id) WHERE w.word_common = 0 AND m.word_id IS NULL GROUP BY m.word_id'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index eb52c5f485..30bf123078 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -294,20 +294,21 @@ class ucp_main if ($config['load_db_lastread']) { - $sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))'; + $sql_join = ' 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 '; } else { - $sql_from = FORUMS_TABLE . ' f '; + $sql_join = ''; $lastread_select = ''; $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); } $sql = "SELECT f.*$lastread_select - FROM $sql_from, " . FORUMS_WATCH_TABLE . ' fw - WHERE fw.user_id = ' . $user->data['user_id'] . ' + FROM (" . FORUMS_TABLE . ' f, ' . FORUMS_WATCH_TABLE . " fw) + $sql_join + WHERE fw.user_id = " . $user->data['user_id'] . ' AND f.forum_id = fw.forum_id ORDER BY left_id'; $result = $db->sql_query($sql); @@ -390,30 +391,29 @@ class ucp_main ); } - $sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : ''; + $sql_join = ($config['load_db_lastread']) ? ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : ''; $sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : ''; - - $sql_from = TOPICS_TABLE . ' t'; $sql_t_select = ''; if ($config['load_db_track']) { - $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id + $sql_join .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id'] . ')'; $sql_t_select .= ', tp.topic_posted'; } if ($config['load_db_lastread']) { - $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id + $sql_join .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')'; $sql_t_select .= ', tt.mark_time'; } $sql = "SELECT t.* $sql_f_select $sql_t_select - FROM $sql_from $sql_f_tracking, " . TOPICS_WATCH_TABLE . ' tw - WHERE tw.user_id = ' . $user->data['user_id'] . ' + FROM (" . TOPICS_TABLE . ' t, ' . TOPICS_WATCH_TABLE . " tw + $sql_join + WHERE tw.user_id = " . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id ORDER BY t.topic_last_post_time DESC'; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); @@ -590,8 +590,8 @@ class ucp_main // But since bookmarks are sensible to the user, they should not be deleted without notice. $sql = 'SELECT b.order_id, b.topic_id as b_topic_id, t.*, f.forum_name FROM ' . BOOKMARKS_TABLE . ' b - LEFT JOIN ' . TOPICS_TABLE . ' t ON b.topic_id = t.topic_id - LEFT JOIN ' . FORUMS_TABLE . ' f ON t.forum_id = f.forum_id + LEFT JOIN ' . TOPICS_TABLE . ' t ON (b.topic_id = t.topic_id) + LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id) WHERE b.user_id = ' . $user->data['user_id'] . ' ORDER BY b.order_id ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/install/install.php b/phpBB/install/install.php index 5d1496036a..f6be615775 100644 --- a/phpBB/install/install.php +++ b/phpBB/install/install.php @@ -94,14 +94,14 @@ $available_dbms = array( 'COMMENTS' => 'remove_remarks' ), 'mysqli' => array( - 'LABEL' => 'MySQL 4.1.x (MySQLi)', + 'LABEL' => 'MySQL 4.1.x/5.x (MySQLi)', 'SCHEMA' => 'mysql', - 'MODULE' => 'mysqli', + 'MODULE' => 'mysqli', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks' ), 'mysql4' => array( - 'LABEL' => 'MySQL 4', + 'LABEL' => 'MySQL 4.x/5.x', 'SCHEMA' => 'mysql', 'MODULE' => 'mysql', 'DELIM' => ';', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 8b6699ad91..60990b4760 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -30,6 +30,7 @@ if (empty($lang) || !is_array($lang)) // Common $lang += array( + 'ACP_ADMIN_LOGS' => 'Admin Log', 'ACP_ATTACHMENTS' => 'Attachments', 'ACP_ATTACHMENT_SETTINGS' => 'Attachment Settings', 'ACP_AUTH_SETTINGS' => 'Authentication', @@ -40,20 +41,32 @@ $lang += array( 'ACP_BOARD_SETTINGS' => 'Board Settings', 'ACP_BOTS' => 'Spiders/Robots', 'ACP_CAT_GENERAL' => 'General', + 'ACP_CAT_MAINTANENCE' => 'Maintanence', + 'ACP_CAT_POSTING' => 'Posting', + 'ACP_CAT_SYSTEM' => 'System', + 'ACP_CAT_USERGROUP' => 'Users and Groups', + 'ACP_CLIENT_COMMUNICATION' => 'Client Communication', 'ACP_COOKIE_SETTINGS' => 'Cookie Settings', + 'ACP_CRITICAL_LOGS' => 'Error Log', 'ACP_EMAIL_SETTINGS' => 'Email Settings', 'ACP_EXTENSION_GROUPS' => 'Manage Extension Groups', + 'ACP_FORUM_LOGS' => 'Forum Logs', + 'ACP_GENERAL_CONFIGURATION' => 'General Configuration', 'ACP_ICONS' => 'Topic Icons', 'ACP_ICONS_SMILIES' => 'Topic Icons/Smilies', + 'ACP_INDEX' => 'Admin index', 'ACP_JABBER_SETTINGS' => 'Jabber Settings', 'ACP_LOAD_SETTINGS' => 'Load Settings', + 'ACP_LOGGING' => 'Logging', 'ACP_MAIN' => 'Admin index', 'ACP_MANAGE_EXTENSIONS' => 'Manage Extensions', + 'ACP_MESSAGES' => 'Messages', 'ACP_MESSAGE_SETTINGS' => 'Message Settings', 'ACP_MODULE_MANAGEMENT' => 'Module Management', + 'ACP_MOD_LOGS' => 'Moderator Log', 'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments', 'ACP_PHP_INFO' => 'PHP Information', - 'ACP_POSTING' => 'Posting', + 'ACP_SERVER_CONFIGURATION' => 'Server Configuration', 'ACP_SERVER_SETTINGS' => 'Server Settings', 'ACP_SMILIES' => 'Smilies', 'ACP_WORDS' => 'Word Censoring', @@ -112,6 +125,22 @@ $lang += array( 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by support or other Team Member on the support forums.', ); +// Logs +$lang += array( + 'ACP_ADMIN_LOGS_EXPLAIN' => 'This lists all the actions carried out by board administrators. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ACP_CRITICAL_LOGS_EXPLAIN' => 'This lists the actions carried out by the board itself. These log provides you with information you are able to use for solving specific problems, for example non-delivery of emails. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ACP_MOD_LOGS_EXPLAIN' => 'This lists the actions carried out by board moderators, select a forum from the drop down list. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.', + 'ALL_ENTRIES' => 'All entries', + + 'DISPLAY_LOG' => 'Display entries from previous', + + 'NO_ENTRIES' => 'No log entries for this period', + + 'SORT_IP' => 'IP address', + 'SORT_DATE' => 'Date', + 'SORT_ACTION' => 'Log action', +); + // Index page $lang += array( 'ADMIN_INTRO' => 'Thank you for choosing phpBB as your forum solution. This screen will give you a quick overview of all the various statistics of your board. The links on the left hand side of this screen allow you to control every aspect of your forum experience. Each page will have instructions on how to use the tools.', @@ -216,6 +245,9 @@ $lang += array( 'LOG_WORD_DELETE' => '<b>Deleted word censor</b><br />» %s', 'LOG_WORD_EDIT' => '<b>Edited word censor</b><br />» %s', + 'LOG_ADMIN_CLEAR' => '<b>Cleared admin log</b>', + 'LOG_MOD_CLEAR' => '<b>Cleared moderator log</b>', + 'LOG_CRITICAL_CLEAR' => '<b>Cleared error log</b>', ); ?>
\ No newline at end of file diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 61d38afc85..a165eeae78 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -181,6 +181,7 @@ $lang += array( 'JOINED' => 'Joined', 'JUMP_PAGE' => 'Enter the page number you wish to goto', 'JUMP_TO' => 'Jump to', + 'JUMP_TO_PAGE' => 'Click to jump to page...', 'KB' => 'KB', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 6476b98e9a..06ccc6d58e 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -272,8 +272,8 @@ function get_post_data($post_ids, $acl_list = false) $rowset = array(); $sql = 'SELECT p.*, u.*, t.*, f.* - FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . TOPICS_TABLE . ' t - LEFT JOIN ' . FORUMS_TABLE . ' f ON f.forum_id = p.forum_id + FROM (' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . TOPICS_TABLE . ' t) + LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = p.forum_id) WHERE p.post_id IN (' . implode(', ', $post_ids) . ') AND u.user_id = p.poster_id AND t.topic_id = p.topic_id'; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 253907f070..8949145126 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -102,7 +102,7 @@ switch ($mode) $db->sql_freeresult($result); $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id - FROM ' . USERS_TABLE . ' u, ' . GROUPS_TABLE . ' g + FROM (' . USERS_TABLE . ' u, ' . GROUPS_TABLE . ' g) LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id AND ug.user_id = ' . $user->data['user_id'] . ') WHERE u.user_id IN (' . implode(', ', $admin_id_ary + $mod_id_ary) . ') AND u.group_id = g.group_id @@ -294,7 +294,7 @@ switch ($mode) $group_options .= '<option value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } - // We left join on the session table to see if the user is currently online + // $sql = 'SELECT username, user_id, user_type, user_colour, user_permissions, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_occ, user_interests, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_avatar, user_avatar_width, user_avatar_height, user_avatar_type, user_lastvisit FROM ' . USERS_TABLE . " WHERE user_id = $user_id diff --git a/phpBB/search.php b/phpBB/search.php index 75ca8b57d3..0e5437b27c 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -82,9 +82,9 @@ if ($keywords || $author || $search_id || $search_session_id) // Which forums can we view? $sql_where = (sizeof($search_forum) && !$search_child) ? 'WHERE f.forum_id IN (' . implode(', ', $search_forum) . ')' : ''; $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id - FROM (' . FORUMS_TABLE . ' f + FROM ' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id - AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')) + AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "') $sql_where ORDER BY f.left_id"; $result = $db->sql_query($sql); @@ -583,9 +583,9 @@ if ($keywords || $author || $search_id || $search_session_id) // Search forum $s_forums = ''; $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, fa.user_id - FROM (' . FORUMS_TABLE . ' f + FROM ' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id - AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')) + AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "') ORDER BY f.left_id ASC"; $result = $db->sql_query($sql); diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 61679d5076..73d976f3b1 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -144,8 +144,8 @@ if (!$user->data['is_registered']) $update_time = $config['load_online_time'] * 60; $sql = 'SELECT DISTINCT u.user_id, u.username, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline - FROM ((' . ZEBRA_TABLE . ' z - LEFT JOIN ' . SESSIONS_TABLE . ' s ON s.session_user_id = z.zebra_id), ' . USERS_TABLE . ' u) + FROM (' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u) + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = z.zebra_id) WHERE z.user_id = ' . $user->data['user_id'] . ' AND z.friend = 1 AND u.user_id = z.zebra_id diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index ff1c789900..134ad988bd 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -36,27 +36,28 @@ if (!$forum_id) trigger_error('NO_FORUM'); } +$sql_from = FORUMS_TABLE . ' f'; + // Grab appropriate forum data if ($config['load_db_lastread'] && $user->data['is_registered']) { - $sql_lastread = 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' + $sql_from .= ' 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'; } else { - $sql_lastread = $lastread_select = ''; + $lastread_select = ''; $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); } if ($user->data['is_registered']) { - $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_from .= ' LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ')'; $lastread_select .= ', fw.notify_status'; } else { - $sql_from = FORUMS_TABLE . ' f'; } $sql = "SELECT f.* $lastread_select diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index f9b0b04ebe..28b85846fb 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -72,7 +72,7 @@ if ($view && !$post_id) $topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0; $sql = 'SELECT p.post_id, p.topic_id, p.forum_id - FROM (' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t) + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t WHERE t.topic_id = $topic_id AND p.topic_id = t.topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . " @@ -146,6 +146,7 @@ if ($view && !$post_id) // also allows for direct linking to a post (and the calculation of which // page the post is on and the correct display of viewtopic) $join_sql_table = ''; +$select_sql = 't.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags, f.forum_rules_bbcode_uid, f.forum_rules_bbcode_bitfield'; if (!$post_id) { @@ -163,7 +164,7 @@ else } } $extra_fields = (!$post_id) ? '' : ', COUNT(p2.post_id) AS prev_posts'; -$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style, f.forum_password ORDER BY p.post_id ASC'; +$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, ' . $select_sql . ' ORDER BY p.post_id ASC'; if ($user->data['is_registered']) { @@ -189,19 +190,18 @@ if ($user->data['is_registered']) } } -$join_sql_table .= (!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2 '; - // Join to forum table on topic forum_id unless topic forum_id is zero // whereupon we join on the forum_id passed as a parameter ... this // is done so navigation, forum name, etc. remain consistent with where // user clicked to view a global topic -$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags, f.forum_rules_bbcode_uid, f.forum_rules_bbcode_bitfield' . $extra_fields . ' - FROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t' . $join_sql_table . " +$sql = "SELECT $select_sql $extra_fields + FROM (" . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t' . ((!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2') . ') ' . + $join_sql_table . " WHERE $join_sql AND (f.forum_id = t.forum_id " . ((!$forum_id) ? '' : 'OR (t.topic_type = ' . POST_GLOBAL . " AND f.forum_id = $forum_id)") . " ) - $order_sql"; + $order_sql"; $result = $db->sql_query($sql); if (!($topic_data = $db->sql_fetchrow($result))) @@ -757,8 +757,8 @@ if (!sizeof($post_list)) $max_post_time = 0; $sql = 'SELECT u.username, u.user_id, u.user_colour, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_jabber, u.user_regdate, u.user_msnm, u.user_allow_viewemail, u.user_allow_viewonline, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.friend, z.foe, p.* - FROM (' . POSTS_TABLE . ' p - LEFT JOIN ' . ZEBRA_TABLE . ' z ON (z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id)), ' . USERS_TABLE . ' u + FROM (' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u) + LEFT JOIN ' . ZEBRA_TABLE . ' z ON (z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id) WHERE p.post_id IN (' . implode(', ', $post_list) . ') AND u.user_id = p.poster_id'; $result = $db->sql_query($sql); @@ -1131,7 +1131,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']); $user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig'])); - $user_cache[$poster_id]['sig_parsed'] = TRUE; + $user_cache[$poster_id]['sig_parsed'] = true; } // Parse the message and subject @@ -1302,9 +1302,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POST_ID' => $row['post_id'], - 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? TRUE : FALSE, - 'S_POST_UNAPPROVED' => ($row['post_approved']) ? FALSE : TRUE, - 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? TRUE : FALSE, + 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], 'S_FRIEND' => ($row['friend']) ? true : false, 'S_UNREAD_POST' => $post_unread, |