diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 45b3035606..4f102112c2 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -154,8 +154,9 @@ $dbms_type_map = array( // A list of types being unsigned for better reference in some db's $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); +$supported_dbms = array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite'); -foreach (array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite') as $dbms) +foreach ($supported_dbms as $dbms) { $fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt'); @@ -619,7 +620,7 @@ function get_schema_struct() 'topic_id' => array('UINT', 0), 'in_message' => array('BOOL', 0), 'poster_id' => array('UINT', 0), - 'pysical_filename' => array('VCHAR', ''), + 'physical_filename' => array('VCHAR', ''), 'real_filename' => array('VCHAR', ''), 'download_count' => array('UINT', 0), 'attach_comment' => array('TEXT', ''), @@ -845,6 +846,7 @@ function get_schema_struct() 'forum_name' => array('STEXT', ''), 'forum_desc' => array('TEXT', ''), 'forum_desc_bitfield' => array('UINT:11', 0), + 'forum_desc_options' => array('UINT:11', 0), 'forum_desc_uid' => array('VCHAR:5', ''), 'forum_link' => array('VCHAR', ''), 'forum_password' => array('VCHAR:40', ''), @@ -853,6 +855,7 @@ function get_schema_struct() 'forum_rules' => array('TEXT', ''), 'forum_rules_link' => array('VCHAR', ''), 'forum_rules_bitfield' => array('UINT:11', 0), + 'forum_rules_options' => array('UINT:11', 0), 'forum_rules_uid' => array('VCHAR:5', ''), 'forum_topics_per_page' => array('TINT:4', 0), 'forum_type' => array('TINT:4', 0), @@ -919,6 +922,7 @@ function get_schema_struct() 'group_name' => array('VCHAR_CI', ''), 'group_desc' => array('TEXT', ''), 'group_desc_bitfield' => array('UINT:11', 0), + 'group_desc_options' => array('UINT:11', 0), 'group_desc_uid' => array('VCHAR:5', ''), 'group_display' => array('BOOL', 0), 'group_avatar' => array('VCHAR', ''), @@ -953,7 +957,7 @@ function get_schema_struct() $schema_data['phpbb_lang'] = array( 'COLUMNS' => array( 'lang_id' => array('TINT:4', NULL, 'auto_increment'), - 'lang_iso' => array('VCHAR:5', ''), + 'lang_iso' => array('VCHAR:30', ''), 'lang_dir' => array('VCHAR:30', ''), 'lang_english_name' => array('VCHAR:100', ''), 'lang_local_name' => array('VCHAR:255', ''), @@ -1149,7 +1153,7 @@ function get_schema_struct() 'rule_user_id' => array('UINT', 0), 'rule_group_id' => array('UINT', 0), 'rule_action' => array('UINT', 0), - 'rule_folder_id' => array('UINT', 0), + 'rule_folder_id' => array('INT:4', 0), ), 'PRIMARY_KEY' => 'rule_id', ); @@ -1165,7 +1169,7 @@ function get_schema_struct() 'pm_replied' => array('BOOL', 0), 'pm_marked' => array('BOOL', 0), 'pm_forwarded' => array('BOOL', 0), - 'folder_id' => array('UINT', 0), + 'folder_id' => array('INT:4', 0), ), 'KEYS' => array( 'msg_id' => array('INDEX', 'msg_id'), diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index f69f42d393..cafa65354f 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -177,8 +177,8 @@ function view_folder($id, $mode, $folder_id, $folder) { $row = &$folder_info['rowset'][$message_id]; - $folder_img = ($row['unread']) ? 'folder_new' : 'folder'; - $folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; + $folder_img = ($row['pm_unread']) ? 'folder_new' : 'folder'; + $folder_alt = ($row['pm_unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; // Generate all URIs ... $message_author = '' . $row['username'] . ''; @@ -188,7 +188,7 @@ function view_folder($id, $mode, $folder_id, $folder) $row_indicator = ''; foreach ($color_rows as $var) { - if (($var != 'friend' && $var != 'foe' && $row[$var]) + if (($var != 'friend' && $var != 'foe' && $row['pm_' . $var]) || (($var == 'friend' || $var == 'foe') && isset(${$var}[$row['author_id']]) && ${$var}[$row['author_id']])) { @@ -213,10 +213,10 @@ function view_folder($id, $mode, $folder_id, $folder) 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', 'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', - 'S_PM_DELETED' => ($row['deleted']) ? true : false, + 'S_PM_DELETED' => ($row['pm_deleted']) ? true : false, - 'U_VIEW_PM' => ($row['deleted']) ? '' : $view_message_url, - 'U_REMOVE_PM' => ($row['deleted']) ? $remove_message_url : '', + 'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url, + 'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '', 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '') ); } diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index aa2a27b07d..8e1b580571 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -23,7 +23,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) $author_id = (int) $message_row['author_id']; // Not able to view message, it was deleted by the sender - if ($message_row['deleted']) + if ($message_row['pm_deleted']) { trigger_error('NO_AUTH_READ_REMOVED_MESSAGE'); } diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 0c8d0af6e1..be7c161a9c 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -11,7 +11,7 @@ CREATE TABLE phpbb_attachments ( topic_id INTEGER DEFAULT 0 NOT NULL, in_message INTEGER DEFAULT 0 NOT NULL, poster_id INTEGER DEFAULT 0 NOT NULL, - pysical_filename VARCHAR(255) DEFAULT '' NOT NULL, + physical_filename VARCHAR(255) DEFAULT '' NOT NULL, real_filename VARCHAR(255) DEFAULT '' NOT NULL, download_count INTEGER DEFAULT 0 NOT NULL, attach_comment BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, @@ -472,7 +472,7 @@ END;; # Table: 'phpbb_lang' CREATE TABLE phpbb_lang ( lang_id INTEGER NOT NULL, - lang_iso VARCHAR(5) DEFAULT '' NOT NULL, + lang_iso VARCHAR(30) DEFAULT '' NOT NULL, lang_dir VARCHAR(30) DEFAULT '' NOT NULL, lang_english_name VARCHAR(100) DEFAULT '' NOT NULL, lang_local_name VARCHAR(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 01dc57fcf6..67699a3d80 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -15,7 +15,7 @@ CREATE TABLE [phpbb_attachments] ( [topic_id] [int] DEFAULT (0) NOT NULL , [in_message] [int] DEFAULT (0) NOT NULL , [poster_id] [int] DEFAULT (0) NOT NULL , - [pysical_filename] [varchar] (255) DEFAULT ('') NOT NULL , + [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL , [real_filename] [varchar] (255) DEFAULT ('') NOT NULL , [download_count] [int] DEFAULT (0) NOT NULL , [attach_comment] [varchar] (8000) DEFAULT ('') NOT NULL , @@ -509,7 +509,7 @@ GO /* Table: 'phpbb_lang' */ CREATE TABLE [phpbb_lang] ( [lang_id] [int] IDENTITY (1, 1) NOT NULL , - [lang_iso] [varchar] (5) DEFAULT ('') NOT NULL , + [lang_iso] [varchar] (30) DEFAULT ('') NOT NULL , [lang_dir] [varchar] (30) DEFAULT ('') NOT NULL , [lang_english_name] [varchar] (100) DEFAULT ('') NOT NULL , [lang_local_name] [varchar] (255) DEFAULT ('') NOT NULL , diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 0cd3bd1c92..e1d39e7c97 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -11,7 +11,7 @@ CREATE TABLE phpbb_attachments ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - pysical_filename varchar(255) DEFAULT '' NOT NULL, + physical_filename varchar(255) DEFAULT '' NOT NULL, real_filename varchar(255) DEFAULT '' NOT NULL, download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, attach_comment text DEFAULT '' NOT NULL, @@ -322,7 +322,7 @@ CREATE TABLE phpbb_icons ( # Table: 'phpbb_lang' CREATE TABLE phpbb_lang ( lang_id tinyint(4) NOT NULL auto_increment, - lang_iso varchar(5) DEFAULT '' NOT NULL, + lang_iso varchar(30) DEFAULT '' NOT NULL, lang_dir varchar(30) DEFAULT '' NOT NULL, lang_english_name varchar(100) DEFAULT '' NOT NULL, lang_local_name varchar(255) DEFAULT '' NOT NULL, @@ -500,7 +500,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - rule_folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_folder_id int(4) DEFAULT '0' NOT NULL, PRIMARY KEY (rule_id) ); @@ -516,7 +516,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + folder_id int(4) DEFAULT '0' NOT NULL, KEY msg_id (msg_id), KEY user_folder_id (user_id, folder_id) ); diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 2fdd4ed96d..2e6331ac40 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -49,7 +49,7 @@ CREATE TABLE phpbb_attachments ( topic_id number(8) DEFAULT '0' NOT NULL, in_message number(1) DEFAULT '0' NOT NULL, poster_id number(8) DEFAULT '0' NOT NULL, - pysical_filename varchar2(255) DEFAULT '' NOT NULL, + physical_filename varchar2(255) DEFAULT '' NOT NULL, real_filename varchar2(255) DEFAULT '' NOT NULL, download_count number(8) DEFAULT '0' NOT NULL, attach_comment clob DEFAULT '' NOT NULL, @@ -598,7 +598,7 @@ END; /* Table: 'phpbb_lang' */ CREATE TABLE phpbb_lang ( lang_id number(4) NOT NULL, - lang_iso varchar2(5) DEFAULT '' NOT NULL, + lang_iso varchar2(30) DEFAULT '' NOT NULL, lang_dir varchar2(30) DEFAULT '' NOT NULL, lang_english_name varchar2(100) DEFAULT '' NOT NULL, lang_local_name varchar2(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index b91142d6a2..8ccf2a6468 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -85,7 +85,7 @@ CREATE TABLE phpbb_attachments ( topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0), poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0), - pysical_filename varchar(255) DEFAULT '' NOT NULL, + physical_filename varchar(255) DEFAULT '' NOT NULL, real_filename varchar(255) DEFAULT '' NOT NULL, download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0), attach_comment varchar(8000) DEFAULT '' NOT NULL, @@ -417,7 +417,7 @@ CREATE SEQUENCE phpbb_lang_seq; CREATE TABLE phpbb_lang ( lang_id INT2 DEFAULT nextval('phpbb_lang_seq'), - lang_iso varchar(5) DEFAULT '' NOT NULL, + lang_iso varchar(30) DEFAULT '' NOT NULL, lang_dir varchar(30) DEFAULT '' NOT NULL, lang_english_name varchar(100) DEFAULT '' NOT NULL, lang_local_name varchar(255) DEFAULT '' NOT NULL, @@ -607,7 +607,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0), rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0), rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0), - rule_folder_id INT4 DEFAULT '0' NOT NULL CHECK (rule_folder_id >= 0), + rule_folder_id INT4 DEFAULT '0' NOT NULL, PRIMARY KEY (rule_id) ); @@ -623,7 +623,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0), pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0), pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0), - folder_id INT4 DEFAULT '0' NOT NULL CHECK (folder_id >= 0) + folder_id INT4 DEFAULT '0' NOT NULL ); CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index a2b2202337..6b39fe7c15 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -13,7 +13,7 @@ CREATE TABLE phpbb_attachments ( topic_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0', in_message tinyint(1) UNSIGNED NOT NULL DEFAULT '0', poster_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0', - pysical_filename varchar(255) NOT NULL DEFAULT '', + physical_filename varchar(255) NOT NULL DEFAULT '', real_filename varchar(255) NOT NULL DEFAULT '', download_count mediumint(8) UNSIGNED NOT NULL DEFAULT '0', attach_comment text(65535) NOT NULL DEFAULT '', @@ -306,7 +306,7 @@ CREATE TABLE phpbb_icons ( # Table: 'phpbb_lang' CREATE TABLE phpbb_lang ( lang_id INTEGER PRIMARY KEY NOT NULL , - lang_iso varchar(5) NOT NULL DEFAULT '', + lang_iso varchar(30) NOT NULL DEFAULT '', lang_dir varchar(30) NOT NULL DEFAULT '', lang_english_name varchar(100) NOT NULL DEFAULT '', lang_local_name varchar(255) NOT NULL DEFAULT '', @@ -478,7 +478,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0', rule_group_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0', rule_action mediumint(8) UNSIGNED NOT NULL DEFAULT '0', - rule_folder_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0' + rule_folder_id int(4) NOT NULL DEFAULT '0' ); @@ -493,7 +493,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied tinyint(1) UNSIGNED NOT NULL DEFAULT '0', pm_marked tinyint(1) UNSIGNED NOT NULL DEFAULT '0', pm_forwarded tinyint(1) UNSIGNED NOT NULL DEFAULT '0', - folder_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0' + folder_id int(4) NOT NULL DEFAULT '0' ); CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); diff --git a/phpBB/posting.php b/phpBB/posting.php index 3b8d007dbf..164fedb262 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -131,14 +131,14 @@ $result = $db->sql_query($sql); $post_data = $db->sql_fetchrow($result); $db->sql_freeresult($result); -$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']); - if ($mode == 'popup') { upload_popup($post_data['forum_style']); exit; } +$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']); + // Use post_row values in favor of submitted ones... $forum_id = (!empty($post_data['forum_id'])) ? (int) $post_data['forum_id'] : (int) $forum_id; $topic_id = (!empty($post_data['topic_id'])) ? (int) $post_data['topic_id'] : (int) $topic_id; @@ -1236,7 +1236,7 @@ function upload_popup($forum_style = 0) ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting'); - page_header('PROGRESS_BAR'); + page_header($user->lang['PROGRESS_BAR']); $template->set_filenames(array( 'popup' => 'posting_progress_bar.html') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 31f90eff24..19a73a83f3 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -989,6 +989,10 @@ while ($row = $db->sql_fetchrow($result)) 'avatar' => '', 'age' => '', + 'rank_title' => '', + 'rank_image' => '', + 'rank_image_src' => '', + 'online' => false, 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"), 'www' => $row['user_website'], @@ -1039,12 +1043,6 @@ while ($row = $db->sql_fetchrow($result)) } } } - else - { - $user_cache[$poster_id]['rank_title'] = ''; - $user_cache[$poster_id]['rank_image'] = ''; - $user_cache[$poster_id]['rank_image_src'] = ''; - } } if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))