diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_profile.php | 14 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_reasons.php | 26 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 98 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 4 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 40 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 8 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 2 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 2 | ||||
-rwxr-xr-x | phpBB/includes/mcp/mcp_reports.php | 2 | ||||
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 4 | ||||
-rwxr-xr-x | phpBB/includes/search/fulltext_native.php | 52 | ||||
-rwxr-xr-x | phpBB/includes/search/search.php | 12 | ||||
-rw-r--r-- | phpBB/includes/session.php | 8 | ||||
-rw-r--r-- | phpBB/includes/template.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 2 |
21 files changed, 156 insertions, 156 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index d8d9aadeec..adf3abddfb 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1064,7 +1064,7 @@ class acp_forums } unset($table_ary); - $table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, MODERATOR_TABLE); + $table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, MODERATOR_CACHE_TABLE); foreach ($table_ary as $table) { @@ -1338,7 +1338,7 @@ class acp_forums // Delete everything else and thank MySQL for offering multi-table deletion $tables_ary = array( - SEARCH_MATCH_TABLE => 'post_id', + SEARCH_WORDMATCH_TABLE => 'post_id', REPORTS_TABLE => 'post_id', WARNINGS_TABLE => 'post_id', BOOKMARKS_TABLE => 'topic_id', @@ -1368,7 +1368,7 @@ class acp_forums // Delete everything else and curse your DB for not offering multi-table deletion $tables_ary = array( 'post_id' => array( - SEARCH_MATCH_TABLE, + SEARCH_WORDMATCH_TABLE, REPORTS_TABLE, WARNINGS_TABLE, ), @@ -1418,7 +1418,7 @@ class acp_forums break; } - $table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE); + $table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE); foreach ($table_ary as $table) { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 4822e9158d..d3f49e92a6 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -105,7 +105,7 @@ class acp_profile $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id"); - $db->sql_query('ALTER TABLE ' . PROFILE_DATA_TABLE . " DROP $field_ident"); + $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP $field_ident"); $order = 0; @@ -993,7 +993,7 @@ class acp_profile case 'mysqli': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_DATA_TABLE . " ADD $field_ident "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident "; switch ($field_type) { case FIELD_STRING: @@ -1028,7 +1028,7 @@ class acp_profile case 'sqlite': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_DATA_TABLE . " ADD $field_ident "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident "; switch ($field_type) { @@ -1065,7 +1065,7 @@ class acp_profile case 'mssql_odbc': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE [' . PROFILE_DATA_TABLE . "] ADD $field_ident "; + $sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD $field_ident "; switch ($field_type) { @@ -1098,7 +1098,7 @@ class acp_profile case 'postgres': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_DATA_TABLE . " ADD COLUMN $field_ident "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN $field_ident "; switch ($field_type) { @@ -1134,7 +1134,7 @@ class acp_profile case 'firebird': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_DATA_TABLE . " ADD $field_ident "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident "; switch ($field_type) { @@ -1167,7 +1167,7 @@ class acp_profile case 'oracle': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_DATA_TABLE . " ADD $field_ident "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident "; switch ($field_type) { case FIELD_STRING: diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 0867158eff..450f2d5332 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -56,7 +56,7 @@ class acp_reasons if ($action == 'edit') { $sql = 'SELECT reason_title - FROM ' . REASONS_TABLE . " + FROM ' . REPORTS_REASONS_TABLE . " WHERE reason_id = $reason_id"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -76,7 +76,7 @@ class acp_reasons if ($check_double) { $sql = 'SELECT reason_id - FROM ' . REASONS_TABLE . " + FROM ' . REPORTS_REASONS_TABLE . " WHERE LOWER(reason_title) = '" . strtolower($reason_row['reason_title']) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -95,7 +95,7 @@ class acp_reasons { // Get new order... $sql = 'SELECT MAX(reason_order) as max_reason_order - FROM ' . REASONS_TABLE; + FROM ' . REPORTS_REASONS_TABLE; $result = $db->sql_query($sql); $max_order = (int) $db->sql_fetchfield('max_reason_order'); $db->sql_freeresult($result); @@ -106,7 +106,7 @@ class acp_reasons 'reason_order' => $max_order + 1 ); - $db->sql_query('INSERT INTO ' . REASONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $db->sql_query('INSERT INTO ' . REPORTS_REASONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $log = 'ADDED'; } @@ -117,7 +117,7 @@ class acp_reasons 'reason_description' => (string) $reason_row['reason_description'], ); - $db->sql_query('UPDATE ' . REASONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + $db->sql_query('UPDATE ' . REPORTS_REASONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE reason_id = ' . $reason_id); $log = 'UPDATED'; @@ -130,7 +130,7 @@ class acp_reasons else if ($reason_id) { $sql = 'SELECT * - FROM ' . REASONS_TABLE . ' + FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id; $result = $db->sql_query($sql); $reason_row = $db->sql_fetchrow($result); @@ -173,7 +173,7 @@ class acp_reasons case 'delete': $sql = 'SELECT * - FROM ' . REASONS_TABLE . ' + FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id; $result = $db->sql_query($sql); $reason_row = $db->sql_fetchrow($result); @@ -193,7 +193,7 @@ class acp_reasons if (confirm_box(true)) { $sql = 'SELECT reason_id - FROM ' . REASONS_TABLE . " + FROM ' . REPORTS_REASONS_TABLE . " WHERE reason_title = 'other'"; $result = $db->sql_query($sql); $other_reason_id = (int) $db->sql_fetchfield('reason_id'); @@ -205,7 +205,7 @@ class acp_reasons WHERE reason_id = $reason_id"; $db->sql_query($sql); - $db->sql_query('DELETE FROM ' . REASONS_TABLE . ' WHERE reason_id = ' . $reason_id); + $db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id); add_log('admin', 'LOG_REASON_REMOVED', $reason_row['reason_title']); trigger_error($user->lang['REASON_REMOVED'] . adm_back_link($this->u_action)); @@ -228,7 +228,7 @@ class acp_reasons $order = request_var('order', 0); $order_total = $order * 2 + (($action == 'move_up') ? -1 : 1); - $sql = 'UPDATE ' . REASONS_TABLE . ' + $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . ' SET reason_order = ' . $order_total . ' - reason_order WHERE reason_order IN (' . $order . ', ' . (($action == 'move_up') ? $order - 1 : $order + 1) . ')'; $db->sql_query($sql); @@ -238,7 +238,7 @@ class acp_reasons // By default, check that order is valid and fix it if necessary $sql = 'SELECT reason_id, reason_order - FROM ' . REASONS_TABLE . ' + FROM ' . REPORTS_REASONS_TABLE . ' ORDER BY reason_order'; $result = $db->sql_query($sql); @@ -251,7 +251,7 @@ class acp_reasons if ($row['reason_order'] != $order) { - $sql = 'UPDATE ' . REASONS_TABLE . " + $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . " SET reason_order = $order WHERE reason_id = {$row['reason_id']}"; $db->sql_query($sql); @@ -280,7 +280,7 @@ class acp_reasons $db->sql_freeresult($result); $sql = 'SELECT * - FROM ' . REASONS_TABLE . ' + FROM ' . REPORTS_REASONS_TABLE . ' ORDER BY reason_order ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 548cb743d8..6b57442cfe 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -194,7 +194,7 @@ pagination_sep = \'{PAGINATION_SEP}\' case 'refresh': $sql = 'SELECT * - FROM ' . STYLES_TPL_TABLE . " + FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $style_id"; $result = $db->sql_query($sql); $template_row = $db->sql_fetchrow($result); @@ -215,7 +215,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $filelist = array('' => array()); $sql = 'SELECT template_filename, template_mtime - FROM ' . STYLES_TPLDATA_TABLE . " + FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = $style_id"; $result = $db->sql_query($sql); @@ -271,7 +271,7 @@ pagination_sep = \'{PAGINATION_SEP}\' case 'refresh': $sql = 'SELECT * - FROM ' . STYLES_CSS_TABLE . " + FROM ' . STYLES_THEME_TABLE . " WHERE theme_id = $style_id"; $result = $db->sql_query($sql); $theme_row = $db->sql_fetchrow($result); @@ -297,11 +297,11 @@ pagination_sep = \'{PAGINATION_SEP}\' 'theme_data' => $this->db_theme_data($theme_row) ); - $sql = 'UPDATE ' . STYLES_CSS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE theme_id = $style_id"; $db->sql_query($sql); - $cache->destroy('sql', STYLES_CSS_TABLE); + $cache->destroy('sql', STYLES_THEME_TABLE); trigger_error($user->lang['THEME_REFRESHED'] . adm_back_link($this->u_action)); } @@ -356,15 +356,15 @@ pagination_sep = \'{PAGINATION_SEP}\' break; case 'template': - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; break; case 'theme': - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; break; case 'imageset': - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; break; } @@ -495,7 +495,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // Retrieve some information about the template $sql = 'SELECT template_storedb, template_path, template_name - FROM ' . STYLES_TPL_TABLE . " + FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); @@ -529,7 +529,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // If it's not stored in the db yet, then update the template setting and store all template files in the db if (!$template_info['template_storedb']) { - $sql = 'UPDATE ' . STYLES_TPL_TABLE . ' + $sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . ' SET template_storedb = 1 WHERE template_id = ' . $template_id; $db->sql_query($sql); @@ -542,7 +542,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } // Update the template_data table entry for this template file - $sql = 'UPDATE ' . STYLES_TPLDATA_TABLE . " + $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . " SET template_data = '" . $db->sql_escape($template_data) . "', template_mtime = " . time() . " WHERE template_id = $template_id AND template_filename = '" . $db->sql_escape($template_file) . "'"; @@ -577,7 +577,7 @@ pagination_sep = \'{PAGINATION_SEP}\' else { $sql = 'SELECT * - FROM ' . STYLES_TPLDATA_TABLE . " + FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); @@ -694,7 +694,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $submit = isset($_POST['submit']) ? true : false; $sql = 'SELECT * - FROM ' . STYLES_TPL_TABLE . " + FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); @@ -764,7 +764,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if ($template_row['template_storedb']) { $sql = 'SELECT template_filename, template_mtime - FROM ' . STYLES_TPLDATA_TABLE . " + FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); @@ -831,7 +831,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // Retrieve some information about the theme $sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data - FROM ' . STYLES_CSS_TABLE . " + FROM ' . STYLES_THEME_TABLE . " WHERE theme_id = $theme_id"; $result = $db->sql_query($sql); @@ -1187,12 +1187,12 @@ pagination_sep = \'{PAGINATION_SEP}\' 'theme_storedb' => 1, 'theme_data' => $this->db_theme_data($theme_info, $stylesheet), ); - $sql = 'UPDATE ' . STYLES_CSS_TABLE . ' + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE theme_id = ' . $theme_id; $db->sql_query($sql); - $cache->destroy('sql', STYLES_CSS_TABLE); + $cache->destroy('sql', STYLES_THEME_TABLE); // notify the user if the template was not stored in the db before his modification if (!$theme_info['theme_storedb']) @@ -1202,7 +1202,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } } - $cache->destroy('sql', STYLES_CSS_TABLE); + $cache->destroy('sql', STYLES_THEME_TABLE); add_log('admin', ($add_custom) ? 'LOG_THEME_EDIT_ADD' : 'LOG_THEME_EDIT', $theme_info['theme_name'], ($add_custom) ? $custom_class : $edit_class); trigger_error($message . adm_back_link($this->u_action . "&action=edit&id=$theme_id&css_class=$edit_class&showcss=$show_css&text_rows=$text_rows")); @@ -1242,7 +1242,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { $sql_select = ($imgname) ? ", $imgname" : ''; $sql = "SELECT imageset_path, imageset_name, imageset_copyright$sql_select - FROM " . STYLES_IMAGE_TABLE . " + FROM " . STYLES_IMAGESET_TABLE . " WHERE imageset_id = $imageset_id"; $result = $db->sql_query($sql); @@ -1297,12 +1297,12 @@ pagination_sep = \'{PAGINATION_SEP}\' $imgpath = preg_replace('/^([^\/]+\/)/', '{LANG}/', $imgpath) . $imgheight . $imgwidth; - $sql = 'UPDATE ' . STYLES_IMAGE_TABLE . " + $sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . " SET $imgname = '" . $db->sql_escape($imgpath) . "' WHERE imageset_id = $imageset_id"; $db->sql_query($sql); - $cache->destroy('sql', STYLES_IMAGE_TABLE); + $cache->destroy('sql', STYLES_IMAGESET_TABLE); add_log('admin', 'LOG_IMAGESET_EDIT', $imageset_name); @@ -1416,17 +1416,17 @@ pagination_sep = \'{PAGINATION_SEP}\' break; case 'template': - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; $sql_select = 'template_name, template_path, template_storedb'; break; case 'theme': - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; $sql_select = 'theme_name, theme_path, theme_storedb'; break; case 'imageset': - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; $sql_select = 'imageset_name, imageset_path'; break; } @@ -1568,7 +1568,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $sql_select .= ($inc_template) ? ', t.*' : ', t.template_name'; $sql_select .= ($inc_theme) ? ', c.*' : ', c.theme_name'; $sql_select .= ($inc_imageset) ? ', i.*' : ', i.imageset_name'; - $sql_from = STYLES_TABLE . ' s, ' . STYLES_TPL_TABLE . ' t, ' . STYLES_CSS_TABLE . ' c, ' . STYLES_IMAGE_TABLE . ' i'; + $sql_from = STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i'; $sql_where = "s.style_id = $style_id AND t.template_id = s.template_id AND c.theme_id = s.theme_id AND i.imageset_id = s.imageset_id"; $l_prefix = 'STYLE'; @@ -1578,7 +1578,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $name = 'template_name'; $sql_select = '*'; - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; $sql_where = "template_id = $style_id"; $l_prefix = 'TEMPLATE'; @@ -1588,7 +1588,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $name = 'theme_name'; $sql_select = '*'; - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; $sql_where = "theme_id = $style_id"; $l_prefix = 'THEME'; @@ -1598,7 +1598,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $name = 'imageset_name'; $sql_select = '*'; - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; $sql_where = "imageset_id = $style_id"; $l_prefix = 'IMAGESET'; @@ -1671,7 +1671,7 @@ pagination_sep = \'{PAGINATION_SEP}\' else { $sql = 'SELECT template_filename, template_data - FROM ' . STYLES_TPLDATA_TABLE . " + FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = {$style_row['template_id']}"; $result = $db->sql_query($sql); @@ -1880,7 +1880,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $l_type = strtoupper($mode); $error = array(); - $element_ary = array('template' => STYLES_TPL_TABLE, 'theme' => STYLES_CSS_TABLE, 'imageset' => STYLES_IMAGE_TABLE); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE); switch ($mode) { @@ -1889,15 +1889,15 @@ pagination_sep = \'{PAGINATION_SEP}\' break; case 'template': - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; break; case 'theme': - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; break; case 'imageset': - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; break; } @@ -2037,7 +2037,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$store_db && !$safe_mode && is_writeable("{$phpbb_root_path}styles/{$style_row['template_path']}/template")) { $sql = 'SELECT * - FROM ' . STYLES_TPLDATA_TABLE . " + FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = $style_id"; $result = $db->sql_query($sql); @@ -2056,7 +2056,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$store_db) { - $sql = 'DELETE FROM ' . STYLES_TPLDATA_TABLE . " + $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . " WHERE template_id = $style_id"; $db->sql_query($sql); } @@ -2263,11 +2263,11 @@ pagination_sep = \'{PAGINATION_SEP}\' if ($mode == 'insert') { - $sql = 'INSERT INTO ' . STYLES_TPLDATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); } else { - $sql = 'UPDATE ' . STYLES_TPLDATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE template_id = $style_id AND template_filename = '" . $db->sql_escape("$pathfile$file") . "'"; } @@ -2310,7 +2310,7 @@ pagination_sep = \'{PAGINATION_SEP}\' /** * Destroys cached versions of template files * - * @param array $template_row contains the template's row in the STYLES_TPL_TABLE database table + * @param array $template_row contains the template's row in the STYLES_TEMPLATE_TABLE database table * @param mixed $file_ary is optional and may contain an array of template file names which should be refreshed in the cache. * The file names should be the original template file names and not the cache file names. */ @@ -2356,7 +2356,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $error = $installcfg = $style_row = array(); $root_path = $cfg_file = ''; - $element_ary = array('template' => STYLES_TPL_TABLE, 'theme' => STYLES_CSS_TABLE, 'imageset' => STYLES_IMAGE_TABLE); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE); $install_path = request_var('path', ''); $update = (isset($_POST['update'])) ? true : false; @@ -2501,7 +2501,7 @@ pagination_sep = \'{PAGINATION_SEP}\' global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template; $l_type = strtoupper($mode); - $element_ary = array('template' => STYLES_TPL_TABLE, 'theme' => STYLES_CSS_TABLE, 'imageset' => STYLES_IMAGE_TABLE); + $element_ary = array('template' => STYLES_TEMPLATE_TABLE, 'theme' => STYLES_THEME_TABLE, 'imageset' => STYLES_IMAGESET_TABLE); $error = array(); $style_row = array( @@ -2529,17 +2529,17 @@ pagination_sep = \'{PAGINATION_SEP}\' case 'template': $sql_select = 'template_id'; - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; break; case 'theme': $sql_select = 'theme_id'; - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; break; case 'imageset': $sql_select = 'imageset_id'; - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; break; } @@ -2657,15 +2657,15 @@ pagination_sep = \'{PAGINATION_SEP}\' switch ($element) { case 'template': - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; break; case 'theme': - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; break; case 'imageset': - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; break; } @@ -2813,15 +2813,15 @@ pagination_sep = \'{PAGINATION_SEP}\' switch ($mode) { case 'template': - $sql_from = STYLES_TPL_TABLE; + $sql_from = STYLES_TEMPLATE_TABLE; break; case 'theme': - $sql_from = STYLES_CSS_TABLE; + $sql_from = STYLES_THEME_TABLE; break; case 'imageset': - $sql_from = STYLES_IMAGE_TABLE; + $sql_from = STYLES_IMAGESET_TABLE; break; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 8621f30324..ea8e20a210 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -925,7 +925,7 @@ class acp_users // Update Custom Fields if (sizeof($cp_data)) { - $sql = 'UPDATE ' . PROFILE_DATA_TABLE . ' + $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $cp_data) . " WHERE user_id = $user_id"; $db->sql_query($sql); @@ -936,7 +936,7 @@ class acp_users $db->return_on_error = true; - $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); $db->sql_query($sql); $db->return_on_error = false; diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 75b3c9ef02..8aa1f9117b 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -133,11 +133,11 @@ define('FIELD_DATE', 6); // Table names -define('ACL_GROUPS_TABLE', $table_prefix . 'auth_groups'); -define('ACL_OPTIONS_TABLE', $table_prefix . 'auth_options'); -define('ACL_ROLES_TABLE', $table_prefix . 'auth_roles'); -define('ACL_ROLES_DATA_TABLE', $table_prefix . 'auth_roles_data'); -define('ACL_USERS_TABLE', $table_prefix . 'auth_users'); +define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups'); +define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options'); +define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles'); +define('ACL_ROLES_DATA_TABLE', $table_prefix . 'acl_roles_data'); +define('ACL_USERS_TABLE', $table_prefix . 'acl_users'); define('ATTACHMENTS_TABLE', $table_prefix . 'attachments'); define('BANLIST_TABLE', $table_prefix . 'banlist'); define('BBCODES_TABLE', $table_prefix . 'bbcodes'); @@ -148,21 +148,21 @@ define('CONFIG_TABLE', $table_prefix . 'config'); define('CONFIRM_TABLE', $table_prefix . 'confirm'); define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields'); define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang'); -define('PROFILE_DATA_TABLE', $table_prefix . 'profile_fields_data'); +define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data'); define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang'); define('DISALLOW_TABLE', $table_prefix . 'disallow'); define('DRAFTS_TABLE', $table_prefix . 'drafts'); define('EXTENSIONS_TABLE', $table_prefix . 'extensions'); define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups'); define('FORUMS_TABLE', $table_prefix . 'forums'); -define('FORUMS_ACCESS_TABLE', $table_prefix . 'forum_access'); -define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_marking'); +define('FORUMS_ACCESS_TABLE', $table_prefix . 'forums_access'); +define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_track'); define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch'); define('GROUPS_TABLE', $table_prefix . 'groups'); define('ICONS_TABLE', $table_prefix . 'icons'); define('LANG_TABLE', $table_prefix . 'lang'); define('LOG_TABLE', $table_prefix . 'log'); -define('MODERATOR_TABLE', $table_prefix . 'moderator_cache'); +define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache'); define('MODULES_TABLE', $table_prefix . 'modules'); define('POSTS_TABLE', $table_prefix . 'posts'); define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs'); @@ -172,30 +172,30 @@ define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules'); define('RANKS_TABLE', $table_prefix . 'ranks'); define('RATINGS_TABLE', $table_prefix . 'ratings'); define('REPORTS_TABLE', $table_prefix . 'reports'); -define('REASONS_TABLE', $table_prefix . 'reports_reasons'); -define('SEARCH_TABLE', $table_prefix . 'search_results'); -define('SEARCH_WORD_TABLE', $table_prefix . 'search_wordlist'); -define('SEARCH_MATCH_TABLE', $table_prefix . 'search_wordmatch'); +define('REPORTS_REASONS_TABLE', $table_prefix . 'reports_reasons'); +define('SEARCH_RESULTS_TABLE', $table_prefix . 'search_results'); +define('SEARCH_WORDLIST_TABLE', $table_prefix . 'search_wordlist'); +define('SEARCH_WORDMATCH_TABLE', $table_prefix . 'search_wordmatch'); define('SESSIONS_TABLE', $table_prefix . 'sessions'); define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys'); define('SITELIST_TABLE', $table_prefix . 'sitelist'); define('SMILIES_TABLE', $table_prefix . 'smilies'); define('STYLES_TABLE', $table_prefix . 'styles'); -define('STYLES_TPL_TABLE', $table_prefix . 'styles_template'); -define('STYLES_TPLDATA_TABLE', $table_prefix . 'styles_template_data'); -define('STYLES_CSS_TABLE', $table_prefix . 'styles_theme'); -define('STYLES_IMAGE_TABLE', $table_prefix . 'styles_imageset'); +define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template'); +define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data'); +define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme'); +define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset'); define('TOPICS_TABLE', $table_prefix . 'topics'); define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted'); define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch'); -define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_marking'); +define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track'); define('USER_GROUP_TABLE', $table_prefix . 'user_group'); define('USERS_TABLE', $table_prefix . 'users'); define('USERS_NOTES_TABLE', $table_prefix . 'users_notes'); define('WARNINGS_TABLE', $table_prefix . 'warnings'); define('WORDS_TABLE', $table_prefix . 'words'); -define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_results'); -define('POLL_VOTES_TABLE', $table_prefix . 'poll_voters'); +define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options'); +define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes'); define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 053449c528..af1f486ac4 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1873,10 +1873,10 @@ function cache_moderators() global $db, $cache, $auth, $phpbb_root_path, $phpEx; // Remove cached sql results - $cache->destroy('sql', MODERATOR_TABLE); + $cache->destroy('sql', MODERATOR_CACHE_TABLE); // Clear table - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_TABLE); + $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_CACHE_TABLE); // We add moderators who have forum moderator permissions without an explicit ACL_NO setting $hold_ary = $ug_id_ary = $sql_ary = array(); @@ -2018,13 +2018,13 @@ function cache_moderators() case 'mysql': case 'mysql4': case 'mysqli': - $db->sql_query('INSERT INTO ' . MODERATOR_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); + $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); break; default: foreach ($sql_ary as $ary) { - $db->sql_query('INSERT INTO ' . MODERATOR_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); } break; } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index b0d1b03809..32a6f5e8fc 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -571,7 +571,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) } $sql = 'SELECT * - FROM ' . MODERATOR_TABLE . " + FROM ' . MODERATOR_CACHE_TABLE . " WHERE display_on_index = 1 $forum_sql"; $result = $db->sql_query($sql, 3600); @@ -900,7 +900,7 @@ function display_reasons($reason_id = 0) global $db, $user, $template; $sql = 'SELECT * - FROM ' . REASONS_TABLE . ' + FROM ' . REPORTS_REASONS_TABLE . ' ORDER BY reason_order ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index f6ba08dbb4..8fed0968aa 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -351,7 +351,7 @@ class custom_profile } $sql = 'SELECT * - FROM ' . PROFILE_DATA_TABLE . ' + FROM ' . PROFILE_FIELDS_DATA_TABLE . ' WHERE user_id IN (' . implode(', ', array_map('intval', $user_id)) . ')'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 4c3fbcb956..e82f5af537 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -73,10 +73,10 @@ function user_update_name($old_name, $new_name) global $config, $db, $cache; $update_ary = array( - FORUMS_TABLE => array('forum_last_poster_name'), - MODERATOR_TABLE => array('username'), - POSTS_TABLE => array('post_username'), - TOPICS_TABLE => array('topic_first_poster_name', 'topic_last_poster_name'), + FORUMS_TABLE => array('forum_last_poster_name'), + MODERATOR_CACHE_TABLE => array('username'), + POSTS_TABLE => array('post_username'), + TOPICS_TABLE => array('topic_first_poster_name', 'topic_last_poster_name'), ); foreach ($update_ary as $table => $field_ary) diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index b9e4f083c7..cf2fca1c64 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -127,11 +127,11 @@ function mcp_front_view($id, $mode, $action) 'SELECT' => 'r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name', 'FROM' => array( - REPORTS_TABLE => 'r', - REASONS_TABLE => 'rr', - TOPICS_TABLE => 't', - USERS_TABLE => 'u', - POSTS_TABLE => 'p' + REPORTS_TABLE => 'r', + REPORTS_REASONS_TABLE => 'rr', + TOPICS_TABLE => 't', + USERS_TABLE => 'u', + POSTS_TABLE => 'p' ), diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 9110695180..f8f7b9a16b 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -159,7 +159,7 @@ function mcp_post_details($id, $mode, $action) if ($auth->acl_get('m_', $post_info['forum_id'])) { $sql = 'SELECT r.*, re.*, u.user_id, u.username - FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REASONS_TABLE . " re + FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re WHERE r.post_id = $post_id AND r.reason_id = re.reason_id AND u.user_id = r.user_id diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index f1a9b19acf..f2d82715bc 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -578,7 +578,7 @@ function disapprove_post($post_id_list, $mode) if ($reason_id) { $sql = 'SELECT reason_title, reason_description - FROM ' . REASONS_TABLE . " + FROM ' . REPORTS_REASONS_TABLE . " WHERE reason_id = $reason_id"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index a6725e887e..41526254f0 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -71,7 +71,7 @@ class mcp_reports $post_info = $post_info[$post_id]; $sql = 'SELECT r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username - FROM ' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr, ' . USERS_TABLE . " u + FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . " u WHERE r.post_id = $post_id AND rr.reason_id = r.reason_id AND r.user_id = u.user_id"; diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index bd619a9ffe..ae674e1af7 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -648,7 +648,7 @@ class fulltext_mysql extends search_backend $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_text)'); } - $db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE); + $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); return false; } @@ -681,7 +681,7 @@ class fulltext_mysql extends search_backend $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_text'); } - $db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE); + $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); return false; } diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index cdeb1d6c0e..d871910198 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -132,7 +132,7 @@ class fulltext_native extends search_backend { // identify common words and ignore them $sql = 'SELECT word_text - FROM ' . SEARCH_WORD_TABLE . " + FROM ' . SEARCH_WORDLIST_TABLE . " WHERE word_text IN ($in_words) AND word_common = 1"; $result = $db->sql_query($sql); @@ -388,7 +388,7 @@ class fulltext_native extends search_backend if (strstr($word, '%')) { $sql = "SELECT $sql_select - FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_MATCH_TABLE . ' m, ' . SEARCH_WORD_TABLE . " w + FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . " w WHERE w.word_text LIKE $word AND m.word_id = w.word_id AND w.word_common <> 1 @@ -432,7 +432,7 @@ class fulltext_native extends search_backend if ($sql_in) { $sql = "SELECT $sql_select, COUNT(DISTINCT m.word_id) as matches, " . $sort_by_sql[$sort_key] . " - FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_MATCH_TABLE . ' m, ' . SEARCH_WORD_TABLE . " w + FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . " w WHERE w.word_text IN ($sql_in) AND m.word_id = w.word_id AND w.word_common <> 1 @@ -493,7 +493,7 @@ class fulltext_native extends search_backend $sql_where = ($sql_in) ? $sql_where . (($sql_where) ? ' OR ' : '') . 'w.word_text IN (' . $sql_in . ')' : $sql_where; $sql = "SELECT $sql_select - FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_MATCH_TABLE . ' m, ' . SEARCH_WORD_TABLE . " w + FROM $sql_from$sql_sort_table" . POSTS_TABLE . ' p, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . " w WHERE ($sql_where) AND m.word_id = w.word_id AND w.word_common <> 1 @@ -540,7 +540,7 @@ class fulltext_native extends search_backend $sql_where = ($sql_in) ? $sql_where . (($sql_where) ? ' OR ' : '') . 'w.word_text IN (' . $sql_in . ')' : $sql_where; $sql = "SELECT $sql_select - FROM $sql_from" . POSTS_TABLE . ' p, ' . SEARCH_MATCH_TABLE . ' m, ' . SEARCH_WORD_TABLE . " w + FROM $sql_from" . POSTS_TABLE . ' p, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . " w WHERE ($sql_where) AND m.word_id = w.word_id AND w.word_common <> 1 @@ -769,7 +769,7 @@ class fulltext_native extends search_backend $words['del']['title'] = array(); $sql = 'SELECT w.word_id, w.word_text, m.title_match - FROM ' . SEARCH_WORD_TABLE . ' w, ' . SEARCH_MATCH_TABLE . " m + FROM ' . SEARCH_WORDLIST_TABLE . ' w, ' . SEARCH_WORDMATCH_TABLE . " m WHERE m.post_id = $post_id AND w.word_id = m.word_id"; $result = $db->sql_query($sql); @@ -806,7 +806,7 @@ class fulltext_native extends search_backend if (sizeof($unique_add_words)) { $sql = 'SELECT word_id, word_text - FROM ' . SEARCH_WORD_TABLE . ' + FROM ' . SEARCH_WORDLIST_TABLE . ' WHERE word_text IN (' . implode(', ', preg_replace('#^(.*)$#', '\'$1\'', $unique_add_words)) . ')'; $result = $db->sql_query($sql); @@ -824,7 +824,7 @@ class fulltext_native extends search_backend switch (SQL_LAYER) { case 'mysql': - $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) + $sql = 'INSERT INTO ' . SEARCH_WORDLIST_TABLE . ' (word_text) VALUES ' . implode(', ', preg_replace('#^(.*)$#', '(\'$1\')', $new_words)); $db->sql_query($sql); break; @@ -837,14 +837,14 @@ class fulltext_native extends search_backend // make sure the longest word comes first, so nothing will be truncated usort($new_words, array(&$this, 'strlencmp')); - $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) ' . implode(' UNION ALL ', preg_replace('#^(.*)$#', "SELECT '\$1'", $new_words)); + $sql = 'INSERT INTO ' . SEARCH_WORDLIST_TABLE . ' (word_text) ' . implode(' UNION ALL ', preg_replace('#^(.*)$#', "SELECT '\$1'", $new_words)); $db->sql_query($sql); break; default: foreach ($new_words as $word) { - $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . " (word_text) + $sql = 'INSERT INTO ' . SEARCH_WORDLIST_TABLE . " (word_text) VALUES ('$word')"; $db->sql_query($sql); } @@ -866,7 +866,7 @@ class fulltext_native extends search_backend $sql_in[] = $cur_words[$word_in][$word]; } - $sql = 'DELETE FROM ' . SEARCH_MATCH_TABLE . ' + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' WHERE word_id IN (' . implode(', ', $sql_in) . ') AND post_id = ' . intval($post_id) . " AND title_match = $title_match"; @@ -881,9 +881,9 @@ class fulltext_native extends search_backend if (sizeof($word_ary)) { - $sql = 'INSERT INTO ' . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match) + $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . " (post_id, word_id, title_match) SELECT $post_id, word_id, $title_match - FROM " . SEARCH_WORD_TABLE . ' + FROM " . SEARCH_WORDLIST_TABLE . ' WHERE word_text IN (' . implode(', ', preg_replace('#^(.*)$#', '\'$1\'', $word_ary)) . ')'; $db->sql_query($sql); } @@ -920,11 +920,11 @@ class fulltext_native extends search_backend { global $db; - $sql = 'DELETE FROM ' . SEARCH_MATCH_TABLE . ' + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . ' WHERE post_id IN (' . implode(', ', $post_ids) . ')'; $db->sql_query($sql); - // SEARCH_WORD_TABLE will be updated by tidy() + // SEARCH_WORDLIST_TABLE will be updated by tidy() $this->destroy_cache(array(), $author_ids); } @@ -951,7 +951,7 @@ class fulltext_native extends search_backend if ($config['num_posts'] >= 100) { $sql = 'SELECT word_id - FROM ' . SEARCH_MATCH_TABLE . ' + FROM ' . SEARCH_WORDMATCH_TABLE . ' GROUP BY word_id HAVING COUNT(word_id) > ' . floor($config['num_posts'] * 0.6); $result = $db->sql_query($sql); @@ -969,12 +969,12 @@ class fulltext_native extends search_backend $sql_in = implode(', ', $sql_in); - $sql = 'UPDATE ' . SEARCH_WORD_TABLE . " + $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . " SET word_common = 1 WHERE word_id IN ($sql_in)"; $db->sql_query($sql); - $sql = 'DELETE FROM ' . SEARCH_MATCH_TABLE . " + $sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . " WHERE word_id IN ($sql_in)"; $db->sql_query($sql); unset($sql_in); @@ -984,8 +984,8 @@ class fulltext_native extends search_backend // 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) + FROM ' . SEARCH_WORDLIST_TABLE . ' w + LEFT JOIN ' . SEARCH_WORDMATCH_TABLE . ' m ON (w.word_id = m.word_id) WHERE w.word_common = 0 AND m.word_id IS NULL GROUP BY w.word_id'; $result = $db->sql_query($sql); @@ -1001,7 +1001,7 @@ class fulltext_native extends search_backend $destroy_cache_words = array_merge($destroy_cache_words, $sql_in); - $sql = 'DELETE FROM ' . SEARCH_WORD_TABLE . ' + $sql = 'DELETE FROM ' . SEARCH_WORDLIST_TABLE . ' WHERE word_id IN (' . implode(', ', $sql_in) . ')'; $db->sql_query($sql); unset($sql_in); @@ -1021,9 +1021,9 @@ class fulltext_native extends search_backend { global $db; - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORD_TABLE); - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_MATCH_TABLE); - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_TABLE); + $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDLIST_TABLE); + $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDMATCH_TABLE); + $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_RESULTS_TABLE); } /** @@ -1061,13 +1061,13 @@ class fulltext_native extends search_backend global $db; $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORD_TABLE; + FROM ' . SEARCH_WORDLIST_TABLE; $result = $db->sql_query($sql); $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); $db->sql_freeresult($result); $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_MATCH_TABLE; + FROM ' . SEARCH_WORDMATCH_TABLE; $result = $db->sql_query($sql); $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); $db->sql_freeresult($result); diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index fc9cf2bf02..3cbb5be62a 100755 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -178,7 +178,7 @@ class search_backend if (!empty($keywords) || sizeof($author_ary)) { $sql = 'SELECT search_time - FROM ' . SEARCH_TABLE . ' + FROM ' . SEARCH_RESULTS_TABLE . ' WHERE search_key = \'' . $db->sql_escape($search_key) . '\''; $result = $db->sql_query($sql); @@ -191,7 +191,7 @@ class search_backend 'search_authors' => ' ' . implode(' ', $author_ary) . ' ' ); - $sql = 'INSERT INTO ' . SEARCH_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $sql = 'INSERT INTO ' . SEARCH_RESULTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); } $db->sql_freeresult($result); @@ -251,7 +251,7 @@ class search_backend } $cache->put('_search_results_' . $search_key, $store, $config['search_store_results']); - $sql = 'UPDATE ' . SEARCH_TABLE . ' + $sql = 'UPDATE ' . SEARCH_RESULTS_TABLE . ' SET search_time = ' . time() . ' WHERE search_key = \'' . $db->sql_escape($search_key) . '\''; $db->sql_query($sql); @@ -279,7 +279,7 @@ class search_backend } $sql = 'SELECT search_key - FROM ' . SEARCH_TABLE . " + FROM ' . SEARCH_RESULTS_TABLE . " WHERE search_keywords LIKE '%*%' $sql_where"; $result = $db->sql_query($sql); @@ -300,7 +300,7 @@ class search_backend } $sql = 'SELECT search_key - FROM ' . SEARCH_TABLE . " + FROM ' . SEARCH_RESULTS_TABLE . " WHERE $sql_where"; $result = $db->sql_query($sql); @@ -312,7 +312,7 @@ class search_backend } $sql = 'DELETE - FROM ' . SEARCH_TABLE . ' + FROM ' . SEARCH_RESULTS_TABLE . ' WHERE search_time < ' . (time() - $config['search_store_results']); $db->sql_query($sql); } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 939fd94ae2..f35279fda0 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -985,7 +985,7 @@ class user extends session } $sql = 'SELECT s.style_id, t.*, c.*, i.* - FROM ' . STYLES_TABLE . ' s, ' . STYLES_TPL_TABLE . ' t, ' . STYLES_CSS_TABLE . ' c, ' . STYLES_IMAGE_TABLE . " i + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i WHERE s.style_id = $style AND t.template_id = s.template_id AND c.theme_id = s.theme_id @@ -1004,7 +1004,7 @@ class user extends session $db->sql_query($sql); $sql = 'SELECT s.style_id, t.*, c.*, i.* - FROM ' . STYLES_TABLE . ' s, ' . STYLES_TPL_TABLE . ' t, ' . STYLES_CSS_TABLE . ' c, ' . STYLES_IMAGE_TABLE . " i + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i WHERE s.style_id = $style AND t.template_id = s.template_id AND c.theme_id = s.theme_id @@ -1051,7 +1051,7 @@ class user extends session 'theme_storedb' => 1 ); - $db->sql_query('UPDATE ' . STYLES_CSS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + $db->sql_query('UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE theme_id = ' . $this->theme['theme_id']); unset($sql_ary); @@ -1238,7 +1238,7 @@ class user extends session return; } - $sql = 'SELECT * FROM ' . PROFILE_DATA_TABLE . " + $sql = 'SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query_limit($sql, 1); diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 0a6fb5598d..f5feb11a68 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -219,7 +219,7 @@ class template if (isset($user->theme['template_storedb']) && $user->theme['template_storedb']) { - $sql = 'SELECT * FROM ' . STYLES_TPLDATA_TABLE . ' + $sql = 'SELECT * FROM ' . STYLES_TEMPLATE_DATA_TABLE . ' WHERE template_id = ' . $user->theme['template_id'] . " AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "' OR template_included LIKE '%" . $db->sql_escape($this->filename[$handle]) . ":%')"; diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 1087d2f575..8488f30968 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -313,7 +313,7 @@ class ucp_profile // Update Custom Fields if (sizeof($cp_data)) { - $sql = 'UPDATE ' . PROFILE_DATA_TABLE . ' + $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $cp_data) . ' WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); @@ -324,7 +324,7 @@ class ucp_profile $db->return_on_error = true; - $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); $db->sql_query($sql); $db->return_on_error = false; diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 99eed58884..92b70ca507 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -294,7 +294,7 @@ class ucp_register if (sizeof($cp_data)) { $cp_data['user_id'] = (int) $user_id; - $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); $db->sql_query($sql); } |