+
+
+
+
+
+
+
@@ -930,8 +993,19 @@ function database_update_info()
),
),
- // No changes from 3.1.0-dev to 3.1.0-A1
- '3.1.0-dev' => array(),
+ // Changes from 3.1.0-dev to 3.1.0-A1
+ '3.1.0-dev' => array(
+ 'add_columns' => array(
+ GROUPS_TABLE => array(
+ 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
+ ),
+ ),
+ 'change_columns' => array(
+ GROUPS_TABLE => array(
+ 'group_legend' => array('UINT', 0),
+ ),
+ ),
+ ),
);
}
@@ -1902,6 +1976,140 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':
set_config('use_system_cron', 0);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 1
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'ADMINISTRATORS'";
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 2
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'GLOBAL_MODERATORS'";
+ _sql($sql, $errored, $error_ary);
+
+ set_config('legend_sort_groupname', '0');
+ set_config('teampage_multiple', '1');
+ set_config('teampage_forums', '1');
+
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_legend = 1
+ ORDER BY group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $next_legend = 1;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . $next_legend . '
+ WHERE group_id = ' . (int) $row['group_id'];
+ _sql($sql, $errored, $error_ary);
+
+ $next_legend++;
+ }
+ $db->sql_freeresult($result);
+ unset($next_legend);
+
+ // Install modules
+ $modules_to_install = array(
+ 'position' => array(
+ 'base' => 'groups',
+ 'class' => 'acp',
+ 'title' => 'ACP_GROUPS_POSITION',
+ 'auth' => 'acl_a_group',
+ 'cat' => 'ACP_GROUPS',
+ ),
+ 'manage' => array(
+ 'base' => 'attachments',
+ 'class' => 'acp',
+ 'title' => 'ACP_MANAGE_ATTACHMENTS',
+ 'auth' => 'acl_a_attach',
+ 'cat' => 'ACP_ATTACHMENTS',
+ ),
+ );
+
+ _add_modules($modules_to_install);
+
+ // Localise Global Announcements
+ $sql = 'SELECT topic_id, topic_approved, (topic_replies + 1) AS topic_posts, topic_last_post_id, topic_last_post_subject, topic_last_post_time, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour
+ FROM ' . TOPICS_TABLE . '
+ WHERE forum_id = 0
+ AND topic_type = ' . POST_GLOBAL;
+ $result = $db->sql_query($sql);
+
+ $global_announcements = $update_lastpost_data = array();
+ $update_lastpost_data['forum_last_post_time'] = 0;
+ $update_forum_data = array(
+ 'forum_posts' => 0,
+ 'forum_topics' => 0,
+ 'forum_topics_real' => 0,
+ );
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $global_announcements[] = (int) $row['topic_id'];
+
+ $update_forum_data['forum_posts'] += (int) $row['topic_posts'];
+ $update_forum_data['forum_topics_real']++;
+ if ($row['topic_approved'])
+ {
+ $update_forum_data['forum_topics']++;
+ }
+
+ if ($update_lastpost_data['forum_last_post_time'] < $row['topic_last_post_time'])
+ {
+ $update_lastpost_data = array(
+ 'forum_last_post_id' => (int) $row['topic_last_post_id'],
+ 'forum_last_post_subject' => $row['topic_last_post_subject'],
+ 'forum_last_post_time' => (int) $row['topic_last_post_time'],
+ 'forum_last_poster_id' => (int) $row['topic_last_poster_id'],
+ 'forum_last_poster_name' => $row['topic_last_poster_name'],
+ 'forum_last_poster_colour' => $row['topic_last_poster_colour'],
+ );
+ }
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($global_announcements))
+ {
+ // Update the post/topic-count for the forum and the last-post if needed
+ $ga_forum_id = request_var('ga_forum_id', 0);
+
+ $sql = 'SELECT forum_last_post_time
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $ga_forum_id;
+ $result = $db->sql_query($sql);
+ $lastpost = (int) $db->sql_fetchfield('forum_last_post_time');
+ $db->sql_freeresult($result);
+
+ $sql_update = 'forum_posts = forum_posts + ' . $update_forum_data['forum_posts'] . ', ';
+ $sql_update .= 'forum_topics_real = forum_topics_real + ' . $update_forum_data['forum_topics_real'] . ', ';
+ $sql_update .= 'forum_topics = forum_topics + ' . $update_forum_data['forum_topics'];
+ if ($lastpost < $update_lastpost_data['forum_last_post_time'])
+ {
+ $sql_update .= ', ' . $db->sql_build_array('UPDATE', $update_lastpost_data);
+ }
+
+ $sql = 'UPDATE ' . FORUMS_TABLE . '
+ SET ' . $sql_update . '
+ WHERE forum_id = ' . $ga_forum_id;
+ _sql($sql, $errored, $error_ary);
+
+ // Update some forum_ids
+ $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
+ foreach ($table_ary as $table)
+ {
+ $sql = "UPDATE $table
+ SET forum_id = $ga_forum_id
+ WHERE " . $db->sql_in_set('topic_id', $global_announcements);
+ _sql($sql, $errored, $error_ary);
+ }
+ unset($table_ary);
+ }
+
+ $no_updates = false;
break;
}
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 01ed223c27..e18ed43778 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1867,7 +1867,7 @@ class install_install extends module
if (!$user_id)
{
- // If we can't insert this user then continue to the next one to avoid inconsistant data
+ // If we can't insert this user then continue to the next one to avoid inconsistent data
$this->p_master->db_error('Unable to insert bot into users table', $db->sql_error_sql, __LINE__, __FILE__, true);
continue;
}
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index ab622e8fde..e16b4ab64c 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -444,7 +444,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INTEGER DEFAULT 0 NOT NULL,
group_message_limit INTEGER DEFAULT 0 NOT NULL,
group_max_recipients INTEGER DEFAULT 0 NOT NULL,
- group_legend INTEGER DEFAULT 1 NOT NULL
+ group_legend INTEGER DEFAULT 0 NOT NULL,
+ group_teampage INTEGER DEFAULT 0 NOT NULL
);;
ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 068373c9a1..a14e246c8f 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -546,7 +546,8 @@ CREATE TABLE [phpbb_groups] (
[group_receive_pm] [int] DEFAULT (0) NOT NULL ,
[group_message_limit] [int] DEFAULT (0) NOT NULL ,
[group_max_recipients] [int] DEFAULT (0) NOT NULL ,
- [group_legend] [int] DEFAULT (1) NOT NULL
+ [group_legend] [int] DEFAULT (0) NOT NULL ,
+ [group_teampage] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 0dd2a579e6..3b79afa942 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -316,7 +316,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name(255))
);
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 071033ae53..a4b34c05db 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -316,7 +316,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (group_id),
KEY group_legend_name (group_legend, group_name)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 811c975d5d..9b516b4a56 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -605,7 +605,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm number(1) DEFAULT '0' NOT NULL,
group_message_limit number(8) DEFAULT '0' NOT NULL,
group_max_recipients number(8) DEFAULT '0' NOT NULL,
- group_legend number(1) DEFAULT '1' NOT NULL,
+ group_legend number(8) DEFAULT '0' NOT NULL,
+ group_teampage number(8) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
)
/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 217ecd3771..1b9c1a75aa 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -459,7 +459,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
- group_legend INT2 DEFAULT '1' NOT NULL CHECK (group_legend >= 0),
+ group_legend INT4 DEFAULT '0' NOT NULL CHECK (group_legend >= 0),
+ group_teampage INT4 DEFAULT '0' NOT NULL CHECK (group_teampage >= 0),
PRIMARY KEY (group_id)
);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 88265d3173..9a29ad7b4d 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -151,6 +151,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('legend_sort_groupname', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0');
@@ -238,6 +239,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', '');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_multiple', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
@@ -520,13 +523,13 @@ INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_reg
INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
# -- Groups
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 1, '', '', '', 0);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5);
-INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 2, 2, '', '', '', 0);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, 1, '', '', '', 0);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, 0, '', '', '', 5);
+INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_teampage, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, 0, '', '', '', 5);
# -- User -> Group
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);
@@ -566,7 +569,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
# No Avatar (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_chgavatar', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group');
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar', 'u_masspm', 'u_masspm_group');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar');
# Full Moderator (m_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%';
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index e83b4342fb..9344a29929 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -308,7 +308,8 @@ CREATE TABLE phpbb_groups (
group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1'
+ group_legend INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_teampage INTEGER UNSIGNED NOT NULL DEFAULT '0'
);
CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index 9ae250a95a..eede2c5d50 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -62,6 +62,7 @@ $lang = array_merge($lang, array(
'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited, attached to a private message.',
'ATTACH_ORPHAN_URL' => 'Orphan attachments',
'ATTACH_POST_ID' => 'Post ID',
+ 'ATTACH_POST_TYPE' => 'Post type',
'ATTACH_QUOTA' => 'Total attachment quota',
'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.',
'ATTACH_TO_POST' => 'Attach file to post',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 25a020d8a2..2a8ed86175 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -100,6 +100,7 @@ $lang = array_merge($lang, array(
'ACP_GROUPS_MANAGE' => 'Manage groups',
'ACP_GROUPS_MANAGEMENT' => 'Group management',
'ACP_GROUPS_PERMISSIONS' => 'Groups’ permissions',
+ 'ACP_GROUPS_POSITION' => 'Manage group positions',
'ACP_ICONS' => 'Topic icons',
'ACP_ICONS_SMILIES' => 'Topic icons/smilies',
@@ -115,6 +116,10 @@ $lang = array_merge($lang, array(
'ACP_LOGGING' => 'Logging',
'ACP_MAIN' => 'ACP index',
+
+ 'ACP_MANAGE_ATTACHMENTS' => 'Manage attachments',
+ 'ACP_MANAGE_ATTACHMENTS_EXPLAIN' => 'Here you can list and delete files attached to posts and private messages.',
+
'ACP_MANAGE_EXTENSIONS' => 'Manage extensions',
'ACP_MANAGE_FORUMS' => 'Manage forums',
'ACP_MANAGE_RANKS' => 'Manage ranks',
@@ -226,12 +231,16 @@ $lang = array_merge($lang, array(
'DOWNLOAD_AS' => 'Download as',
'DOWNLOAD_STORE' => 'Download or store file',
'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your
store/ folder.',
+ 'DOWNLOADS' => 'Downloads',
'EDIT' => 'Edit',
'ENABLE' => 'Enable',
'EXPORT_DOWNLOAD' => 'Download',
'EXPORT_STORE' => 'Store',
+ 'FILES_GONE' => 'Some of the attachments you selected for deletion do not exist. They may have been already deleted. Attachments that did exist were deleted.',
+ 'FILES_STATS_WRONG' => 'Your files statistics are probably inaccurate and need to be resynchronised. Actual values: number of attachments = %1$d, total size of attachments = %2$s.',
+
'GENERAL_OPTIONS' => 'General options',
'GENERAL_SETTINGS' => 'General settings',
'GLOBAL_MASK' => 'Global permission mask',
@@ -257,6 +266,7 @@ $lang = array_merge($lang, array(
'NOTIFY' => 'Notification',
'NO_ADMIN' => 'You are not authorised to administer this board.',
'NO_EMAILS_DEFINED' => 'No valid e-mail addresses found.',
+ 'NO_FILES_TO_DELETE' => 'Attachments you selected for deletion do not exist.',
'NO_PASSWORD_SUPPLIED' => 'You need to enter your password to access the Administration Control Panel.',
'OFF' => 'Off',
@@ -271,6 +281,8 @@ $lang = array_merge($lang, array(
'REMIND' => 'Remind',
'RESYNC' => 'Resynchronise',
+ 'RESYNC_FILES_STATS' => 'Resynchronise files statistics',
+ 'RESYNC_FILES_STATS_EXPLAIN' => 'Recalculates the total number and size of files attached to posts and private messages.',
'RETURN_TO' => 'Return to…',
'SELECT_ANONYMOUS' => 'Select anonymous user',
@@ -283,6 +295,8 @@ $lang = array_merge($lang, array(
'SHOW_ALL_OPERATIONS' => 'Show all operations',
+ 'TOTAL_SIZE' => 'Total size',
+
'UCP' => 'User Control Panel',
'USERNAMES_EXPLAIN' => 'Place each username on a separate line.',
'USER_CONTROL_PANEL' => 'User Control Panel',
@@ -355,6 +369,7 @@ $lang = array_merge($lang, array(
'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?',
'RESET_ONLINE' => 'Reset most users ever online',
'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?',
+ 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise files statistics?',
'RESYNC_POSTCOUNTS' => 'Resynchronise post counts',
'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.',
'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?',
@@ -659,6 +674,7 @@ $lang = array_merge($lang, array(
'LOG_REFERER_INVALID' => '
Referer validation failed »Referer was “
%1$s ”. The request was rejected and the session killed.',
'LOG_RESET_DATE' => '
Board start date reset ',
'LOG_RESET_ONLINE' => '
Most users online reset ',
+ 'LOG_RESYNC_FILES_STATS' => '
Files statistics resynchronised ',
'LOG_RESYNC_POSTCOUNTS' => '
User post counts resynchronised ',
'LOG_RESYNC_POST_MARKING' => '
Dotted topics resynchronised ',
'LOG_RESYNC_STATS' => '
Post, topic and user statistics resynchronised ',
diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php
index b8b299bee9..6ce8ddd59b 100644
--- a/phpBB/language/en/acp/email.php
+++ b/phpBB/language/en/acp/email.php
@@ -52,14 +52,16 @@ $lang = array_merge($lang, array(
'SEND_TO_GROUP' => 'Send to group',
'SEND_TO_USERS' => 'Send to users',
'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.',
-
+
+ 'MAIL_BANNED' => 'Mail banned users',
+ 'MAIL_BANNED_EXPLAIN' => 'When sending a mass e-mail to a group you can select here whether banned users will also receive the e-mail.',
'MAIL_HIGH_PRIORITY' => 'High',
'MAIL_LOW_PRIORITY' => 'Low',
'MAIL_NORMAL_PRIORITY' => 'Normal',
'MAIL_PRIORITY' => 'Mail priority',
'MASS_MESSAGE' => 'Your message',
'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.',
-
+
'NO_EMAIL_MESSAGE' => 'You must enter a message.',
'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.',
));
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index 3b3953ac36..11342bf4f2 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -97,6 +97,8 @@ $lang = array_merge($lang, array(
'GROUP_SETTINGS_SAVE' => 'Group wide settings',
'GROUP_SKIP_AUTH' => 'Exempt group leader from permissions',
'GROUP_SKIP_AUTH_EXPLAIN' => 'If enabled group leader no longer inherit permissions from the group.',
+ 'GROUP_SPECIAL' => 'Pre-defined',
+ 'GROUP_TEAMPAGE' => 'Display group on teampage',
'GROUP_TYPE' => 'Group type',
'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.',
'GROUP_UPDATED' => 'Group preferences updated successfully.',
@@ -105,19 +107,34 @@ $lang = array_merge($lang, array(
'GROUP_USERS_EXIST' => 'The selected users are already members.',
'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.',
+ 'LEGEND_EXPLAIN' => 'These are the groups which are displayed in the group legend:',
+ 'LEGEND_SETTINGS' => 'Legend settings',
+ 'LEGEND_SORT_GROUPNAME' => 'Sort legend by group name',
+ 'LEGEND_SORT_GROUPNAME_EXPLAIN' => 'The order below is ignored when this option is enabled.',
+
+ 'MANAGE_LEGEND' => 'Manage group legend',
+ 'MANAGE_TEAMPAGE' => 'Manage teampage',
'MAKE_DEFAULT_FOR_ALL' => 'Make default group for every member',
'MEMBERS' => 'Members',
'NO_GROUP' => 'No group specified.',
+ 'NO_GROUPS_ADDED' => 'No groups added yet.',
'NO_GROUPS_CREATED' => 'No groups created yet.',
'NO_PERMISSIONS' => 'Do not copy permissions',
'NO_USERS' => 'You haven’t entered any users.',
'NO_USERS_ADDED' => 'No users were added to the group.',
'NO_VALID_USERS' => 'You haven’t entered any users eligible for that action.',
+ 'SELECT_GROUP' => 'Select a group',
'SPECIAL_GROUPS' => 'Pre-defined groups',
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',
+ 'TEAMPAGE_EXPLAIN' => 'These are the groups which are displayed on the teampage:',
+ 'TEAMPAGE_FORUMS' => 'Display moderated forums',
+ 'TEAMPAGE_FORUMS_EXPLAIN' => 'If set to yes, moderators will have a list with all of the forums where they have moderator permissions displayed in their row. This can be very database intensive for big boards.',
+ 'TEAMPAGE_MULTIPLE' => 'Display users in all groups',
+ 'TEAMPAGE_MULTIPLE_EXPLAIN' => 'If set to no, the users will only be displayed in their primary group (If the primary group is not listed, the users will be displayed in their first displayed group).',
+ 'TEAMPAGE_SETTINGS' => 'Teampage settings',
'TOTAL_MEMBERS' => 'Members',
'USERS_APPROVED' => 'Users approved successfully.',
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index b0f1b74faa..16e1aaca66 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -168,8 +168,9 @@ $lang = array_merge($lang, array(
'SMILIES_CONFIG' => 'Smiley configuration',
'SMILIES_DELETED' => 'The smiley has been removed successfully.',
'SMILIES_EDIT' => 'Edit smiley',
- 'SMILIE_NO_CODE' => 'The smilie “%s” was ignored, as there was no code entered.',
- 'SMILIE_NO_EMOTION' => 'The smilie “%s” was ignored, as there was no emotion entered.',
+ 'SMILIE_NO_CODE' => 'The smiley “%s” was ignored, as there was no code entered.',
+ 'SMILIE_NO_EMOTION' => 'The smiley “%s” was ignored, as there was no emotion entered.',
+ 'SMILIE_NO_FILE' => 'The smiley “%s” was ignored, as the file is missing.',
'SMILIES_NONE_EDITED' => 'No smilies were updated.',
'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.',
'SMILIES_EDITED' => 'The smilies have been updated successfully.',
@@ -233,13 +234,13 @@ $lang = array_merge($lang, array(
// Disallow Usernames
$lang = array_merge($lang, array(
- 'ACP_DISALLOW_EXPLAIN' => 'Here you can control usernames which will not be allowed to be used. Disallowed usernames are allowed to contain a wildcard character of *. Please note that you will not be allowed to specify any username that has already been registered, you must first delete that name then disallow it.',
+ 'ACP_DISALLOW_EXPLAIN' => 'Here you can control usernames which will not be allowed to be used. Disallowed usernames are allowed to contain a wildcard character of *.',
'ADD_DISALLOW_EXPLAIN' => 'You can disallow a username using the wildcard character * to match any character.',
'ADD_DISALLOW_TITLE' => 'Add a disallowed username',
'DELETE_DISALLOW_EXPLAIN' => 'You can remove a disallowed username by selecting the username from this list and clicking submit.',
'DELETE_DISALLOW_TITLE' => 'Remove a disallowed username',
- 'DISALLOWED_ALREADY' => 'The name you entered could not be disallowed. It either already exists in the list, exists in the word censor list, or a matching username is present.',
+ 'DISALLOWED_ALREADY' => 'The name you entered is already disallowed.',
'DISALLOWED_DELETED' => 'The disallowed username has been successfully removed.',
'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added.',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index d5311c5820..4a17deb32e 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -190,7 +190,7 @@ $lang = array_merge($lang, array(
'FORM_INVALID' => 'The submitted form was invalid. Try submitting again.',
'FORUM' => 'Forum',
'FORUMS' => 'Forums',
- 'FORUMS_MARKED' => 'All forums have been marked read.',
+ 'FORUMS_MARKED' => 'The selected forums have been marked read.',
'FORUM_CAT' => 'Forum category',
'FORUM_INDEX' => 'Board index',
'FORUM_LINK' => 'Forum link',
@@ -322,6 +322,7 @@ $lang = array_merge($lang, array(
'MARK' => 'Mark',
'MARK_ALL' => 'Mark all',
'MARK_FORUMS_READ' => 'Mark forums read',
+ 'MARK_SUBFORUMS_READ' => 'Mark subforums read',
'MB' => 'MB',
'MIB' => 'MiB',
'MCP' => 'Moderator Control Panel',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 021f5eccb0..bc5a3ab936 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -302,7 +302,7 @@ $lang = array_merge($lang, array(
'PHP_SETTINGS' => 'PHP version and settings',
'PHP_SETTINGS_EXPLAIN' => '
Required - You must be running at least version 4.3.3 of PHP in order to install phpBB. If
safe mode is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
'PHP_URL_FOPEN_SUPPORT' => 'PHP setting
allow_url_fopen is enabled',
- 'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '
Optional - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it. ',
+ 'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '
Optional - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.',
'PHP_VERSION_REQD' => 'PHP version >= 4.3.3',
'POST_ID' => 'Post ID',
'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using
%s as table prefix.',
@@ -323,6 +323,7 @@ $lang = array_merge($lang, array(
'SERVER_CONFIG' => 'Server configuration',
'SEARCH_INDEX_UNCONVERTED' => 'Search index was not converted',
'SEARCH_INDEX_UNCONVERTED_EXPLAIN' => 'Your old search index was not converted. Searching will always yield an empty result. To create a new search index go to the Administration Control Panel, select Maintenance and then choose Search index from the submenu.',
+ 'SELECT_FORUM_GA' => 'In phpBB 3.1 the global announcements are linked to forums. Select a forum for your current global announcements (can be moved later):',
'SOFTWARE' => 'Board software',
'SPECIFY_OPTIONS' => 'Specify conversion options',
'STAGE_ADMINISTRATOR' => 'Administrator details',
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index 401a12d0f9..0029d224cd 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -85,7 +85,7 @@ if ($post_id)
$db->sql_freeresult($result);
$topic_id = (int) $row['topic_id'];
- $forum_id = (int) ($row['forum_id']) ? $row['forum_id'] : $forum_id;
+ $forum_id = (int) $row['forum_id'];
}
else if ($topic_id)
{
@@ -400,12 +400,6 @@ function get_topic_data($topic_ids, $acl_list = false, $read_tracking = false)
while ($row = $db->sql_fetchrow($result))
{
- if (!$row['forum_id'])
- {
- // Global Announcement?
- $row['forum_id'] = request_var('f', 0);
- }
-
$rowset[$row['topic_id']] = $row;
if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
@@ -485,12 +479,6 @@ function get_post_data($post_ids, $acl_list = false, $read_tracking = false)
while ($row = $db->sql_fetchrow($result))
{
- if (!$row['forum_id'])
- {
- // Global Announcement?
- $row['forum_id'] = request_var('f', 0);
- }
-
if ($acl_list && !$auth->acl_gets($acl_list, $row['forum_id']))
{
continue;
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 0b2fd24871..685830c656 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -77,189 +77,196 @@ switch ($mode)
$page_title = $user->lang['THE_TEAM'];
$template_html = 'memberlist_leaders.html';
- $user_ary = $auth->acl_get_list(false, array('a_', 'm_'), false);
+ $sql_ary = array(
+ 'SELECT' => 'g.group_id, g.group_name, g.group_colour, g.group_type, g.group_teampage, ug.user_id as ug_user_id',
- $admin_id_ary = $global_mod_id_ary = $mod_id_ary = $forum_id_ary = array();
- foreach ($user_ary as $forum_id => $forum_ary)
- {
- foreach ($forum_ary as $auth_option => $id_ary)
- {
- if (!$forum_id)
- {
- if ($auth_option == 'a_')
- {
- $admin_id_ary = array_merge($admin_id_ary, $id_ary);
- }
- else
- {
- $global_mod_id_ary = array_merge($global_mod_id_ary, $id_ary);
- }
- continue;
- }
- else
- {
- $mod_id_ary = array_merge($mod_id_ary, $id_ary);
- }
-
- if ($forum_id)
- {
- foreach ($id_ary as $id)
- {
- $forum_id_ary[$id][] = $forum_id;
- }
- }
- }
- }
-
- $admin_id_ary = array_unique($admin_id_ary);
- $global_mod_id_ary = array_unique($global_mod_id_ary);
-
- $mod_id_ary = array_merge($mod_id_ary, $global_mod_id_ary);
- $mod_id_ary = array_unique($mod_id_ary);
-
- // Admin group id...
- $sql = 'SELECT group_id
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = 'ADMINISTRATORS'";
- $result = $db->sql_query($sql);
- $admin_group_id = (int) $db->sql_fetchfield('group_id');
- $db->sql_freeresult($result);
-
- // Get group memberships for the admin id ary...
- $admin_memberships = group_memberships($admin_group_id, $admin_id_ary);
-
- $admin_user_ids = array();
-
- if (!empty($admin_memberships))
- {
- // ok, we only need the user ids...
- foreach ($admin_memberships as $row)
- {
- $admin_user_ids[$row['user_id']] = true;
- }
- }
- unset($admin_memberships);
-
- $sql = 'SELECT forum_id, forum_name
- FROM ' . FORUMS_TABLE;
- $result = $db->sql_query($sql);
-
- $forums = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $forums[$row['forum_id']] = $row['forum_name'];
- }
- $db->sql_freeresult($result);
-
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
-
- 'FROM' => array(
- USERS_TABLE => 'u',
- GROUPS_TABLE => 'g'
- ),
+ 'FROM' => array(GROUPS_TABLE => 'g'),
'LEFT_JOIN' => array(
array(
'FROM' => array(USER_GROUP_TABLE => 'ug'),
- 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id']
- )
+ 'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . (int) $user->data['user_id'],
+ ),
),
- 'WHERE' => $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary)), false, true) . '
- AND u.group_id = g.group_id',
+ 'WHERE' => '',
- 'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
- ));
- $result = $db->sql_query($sql);
+ 'ORDER_BY' => 'g.group_teampage ASC',
+ );
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
+
+ $group_ids = $groups_ary = array();
while ($row = $db->sql_fetchrow($result))
{
- $which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
-
- // We sort out admins not within the 'Administrators' group.
- // Else, we will list those as admin only having the permission to view logs for example.
- if ($which_row == 'admin' && empty($admin_user_ids[$row['user_id']]))
+ if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
{
- // Remove from admin_id_ary, because the user may be a mod instead
- unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
-
- if (!in_array($row['user_id'], $mod_id_ary) && !in_array($row['user_id'], $global_mod_id_ary))
- {
- continue;
- }
- else
- {
- $which_row = 'mod';
- }
+ $row['group_name'] = $user->lang['GROUP_UNDISCLOSED'];
+ $row['u_group'] = '';
+ }
+ else
+ {
+ $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}
- $s_forum_select = '';
- $undisclosed_forum = false;
-
- if (isset($forum_id_ary[$row['user_id']]) && !in_array($row['user_id'], $global_mod_id_ary))
+ if ($row['group_teampage'])
{
- if ($which_row == 'mod' && sizeof(array_diff(array_keys($forums), $forum_id_ary[$row['user_id']])))
+ // Only put groups into the array we want to display.
+ // We are fetching all groups, to ensure we got all data for default groups.
+ $group_ids[] = (int) $row['group_id'];
+ }
+ $groups_ary[(int) $row['group_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ $sql_ary = array(
+ 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id',
+
+ 'FROM' => array(
+ USER_GROUP_TABLE => 'ug',
+ ),
+
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(USERS_TABLE => 'u'),
+ 'ON' => 'ug.user_id = u.user_id AND ug.user_pending = 0',
+ ),
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'ug.group_id = g.group_id',
+ ),
+ ),
+
+ 'WHERE' => $db->sql_in_set('g.group_id', $group_ids, false, true),
+
+ 'ORDER_BY' => 'u.username_clean ASC',
+ );
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
+
+ $user_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $row['forums'] = '';
+ $row['forums_ary'] = array();
+ $user_ary[(int) $row['user_id']] = $row;
+ $user_ids[] = (int) $row['user_id'];
+ $group_users[(int) $row['group_id']][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if ($config['teampage_forums'])
+ {
+ $template->assign_var('S_DISPLAY_MODERATOR_FORUMS', true);
+ // Get all moderators
+ $perm_ary = $auth->acl_get_list(array_unique($user_ids), array('m_'), false);
+
+ foreach ($perm_ary as $forum_id => $forum_ary)
+ {
+ foreach ($forum_ary as $auth_option => $id_ary)
{
- foreach ($forum_id_ary[$row['user_id']] as $forum_id)
+ foreach ($id_ary as $id)
{
- if (isset($forums[$forum_id]))
+ if (!$forum_id)
{
- if ($auth->acl_get('f_list', $forum_id))
- {
- $s_forum_select .= '
' . $forums[$forum_id] . ' ';
- }
- else
- {
- $undisclosed_forum = true;
- }
+ $user_ary[$id]['forums'] = $user->lang['ALL_FORUMS'];
+ }
+ else
+ {
+ $user_ary[$id]['forums_ary'][] = $forum_id;
}
}
}
}
- // If the mod is only moderating non-viewable forums we skip the user. There is no gain in displaying the person then...
- if (!$s_forum_select && $undisclosed_forum)
+ $sql = 'SELECT forum_id, forum_name
+ FROM ' . FORUMS_TABLE;
+ $result = $db->sql_query($sql);
+
+ $forums = array();
+ while ($row = $db->sql_fetchrow($result))
{
-// $s_forum_select = '
' . $user->lang['FORUM_UNDISCLOSED'] . ' ';
- continue;
+ $forums[$row['forum_id']] = $row['forum_name'];
}
+ $db->sql_freeresult($result);
- // The person is moderating several "public" forums, therefore the person should be listed, but not giving the real group name if hidden.
- if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
+ foreach ($user_ary as $user_id => $user_data)
{
- $group_name = $user->lang['GROUP_UNDISCLOSED'];
- $u_group = '';
+ if (!$user_data['forums'])
+ {
+ foreach ($user_data['forums_ary'] as $forum_id)
+ {
+ $user_ary[$user_id]['forums_options'] = true;
+ if (isset($forums[$forum_id]))
+ {
+ if ($auth->acl_get('f_list', $forum_id))
+ {
+ $user_ary[$user_id]['forums'] .= '
' . $forums[$forum_id] . ' ';
+ }
+ }
+ }
+ }
+ }
+ }
+
+ foreach ($groups_ary as $group_id => $group_data)
+ {
+ if ($group_data['group_teampage'])
+ {
+ $template->assign_block_vars('group', array(
+ 'GROUP_NAME' => $group_data['group_name'],
+ 'GROUP_COLOR' => $group_data['group_colour'],
+ 'U_GROUP' => $group_data['u_group'],
+ ));
+ }
+
+ // Display group members.
+ if (!empty($group_users[$group_id]))
+ {
+ foreach ($group_users[$group_id] as $user_id)
+ {
+ if (isset($user_ary[$user_id]))
+ {
+ $row = $user_ary[$user_id];
+ if (!$config['teampage_multiple'] && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['group_teampage'])
+ {
+ // Display users in their primary group, instead of the first group, when it is displayed on the teampage.
+ continue;
+ }
+
+ $rank_title = $rank_img = $rank_img_src = '';
+ get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
+
+ $template->assign_block_vars('group.user', array(
+ 'USER_ID' => $row['user_id'],
+ 'FORUMS' => $row['forums'],
+ 'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false,
+ 'RANK_TITLE' => $rank_title,
+
+ 'GROUP_NAME' => $groups_ary[$row['default_group']]['group_name'],
+ 'GROUP_COLOR' => $groups_ary[$row['default_group']]['group_colour'],
+ 'U_GROUP' => $groups_ary[$row['default_group']]['u_group'],
+
+ 'RANK_IMG' => $rank_img,
+ 'RANK_IMG_SRC' => $rank_img_src,
+
+ 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
+
+ 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
+ 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
+ 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
+ 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
+ ));
+
+ if (!$config['teampage_multiple'])
+ {
+ unset($user_ary[$user_id]);
+ }
+ }
+ }
}
- else
- {
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
- $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
- }
-
- $rank_title = $rank_img = '';
- get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
-
- $template->assign_block_vars($which_row, array(
- 'USER_ID' => $row['user_id'],
- 'FORUMS' => $s_forum_select,
- 'RANK_TITLE' => $rank_title,
- 'GROUP_NAME' => $group_name,
- 'GROUP_COLOR' => $row['group_colour'],
-
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
-
- 'U_GROUP' => $u_group,
- 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
-
- 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
- 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
- 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
- 'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
- ));
}
- $db->sql_freeresult($result);
$template->assign_vars(array(
'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']))
@@ -1069,8 +1076,27 @@ switch ($mode)
$sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';
$sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
$sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
- $sql_where .= (sizeof($joined) > 1 && isset($find_key_match[$joined_select])) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
- $sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1 && isset($find_key_match[$active_select])) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
+
+ if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3)
+ {
+ $joined_time = gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]);
+
+ if ($joined_time !== false)
+ {
+ $sql_where .= " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . $joined_time;
+ }
+ }
+
+ if (isset($find_key_match[$active_select]) && sizeof($active) == 3 && $auth->acl_get('u_viewonline'))
+ {
+ $active_time = gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
+
+ if ($active_time !== false)
+ {
+ $sql_where .= " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . $active_time;
+ }
+ }
+
$sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';
if ($search_group_id)
@@ -1110,7 +1136,7 @@ switch ($mode)
$sql = 'SELECT DISTINCT poster_id
FROM ' . POSTS_TABLE . '
WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips)
- AND forum_id IN (0, " . implode(', ', $ip_forums) . ')';
+ AND " . $db->sql_in_set('forum_id', $ip_forums);
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
@@ -1692,7 +1718,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
'U_EMAIL' => $email,
'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
'U_SHORT_WWW' => (!empty($data['user_website'])) ? ((strlen($data['user_website']) > 55) ? substr($data['user_website'], 0, 39) . ' ... ' . substr($data['user_website'], -10) : $data['user_website']) : '',
- 'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($data['user_icq']) : '',
+ 'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/' . urlencode($data['user_icq']) . '/' : '',
'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $user_id) : '',
'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&.src=pg' : '',
'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $user_id) : '',
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 41559056b9..734e97742c 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -87,9 +87,8 @@ switch ($mode)
$sql = 'SELECT f.*, t.*
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
+ AND f.forum_id = t.forum_id" .
+ (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND t.topic_approved = 1');
break;
case 'quote':
@@ -116,9 +115,8 @@ switch ($mode)
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
- AND (f.forum_id = t.forum_id
- OR f.forum_id = $forum_id)" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
+ AND f.forum_id = t.forum_id" .
+ (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND p.post_approved = 1');
break;
case 'smilies':
@@ -1005,60 +1003,6 @@ if ($submit || $preview || $refresh)
// Store message, sync counters
if (!sizeof($error) && $submit)
{
- // Check if we want to de-globalize the topic... and ask for new forum
- if ($post_data['topic_type'] != POST_GLOBAL)
- {
- $sql = 'SELECT topic_type, forum_id
- FROM ' . TOPICS_TABLE . "
- WHERE topic_id = $topic_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($row && !$row['forum_id'] && $row['topic_type'] == POST_GLOBAL)
- {
- $to_forum_id = request_var('to_forum_id', 0);
-
- if ($to_forum_id)
- {
- $sql = 'SELECT forum_type
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $to_forum_id;
- $result = $db->sql_query($sql);
- $forum_type = (int) $db->sql_fetchfield('forum_type');
- $db->sql_freeresult($result);
-
- if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
- {
- $to_forum_id = 0;
- }
- }
-
- if (!$to_forum_id)
- {
- include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-
- $template->assign_vars(array(
- 'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true, true),
- 'S_UNGLOBALISE' => true)
- );
-
- $submit = false;
- $refresh = true;
- }
- else
- {
- if (!$auth->acl_get('f_post', $to_forum_id))
- {
- // This will only be triggered if the user tried to trick the forum.
- trigger_error('NOT_AUTHORISED');
- }
-
- $forum_id = $to_forum_id;
- }
- }
- }
-
if ($submit)
{
// Lock/Unlock Topic
diff --git a/phpBB/report.php b/phpBB/report.php
index 8e780813ff..a30914392b 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -70,7 +70,7 @@ if ($post_id)
trigger_error('POST_NOT_EXIST');
}
- $forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
+ $forum_id = (int) $report_data['forum_id'];
$topic_id = (int) $report_data['topic_id'];
$sql = 'SELECT *
diff --git a/phpBB/search.php b/phpBB/search.php
index b7cea03057..4b1527b7e7 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -719,11 +719,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
if ($user->data['is_registered'] && $config['load_db_lastread'])
{
- $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
+ $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']));
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
+ $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list']);
if (!$user->data['is_registered'])
{
@@ -832,35 +832,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$result_topic_id = $row['topic_id'];
$topic_title = censor_text($row['topic_title']);
- // we need to select a forum id for this global topic
- if (!$forum_id)
- {
- if (!isset($g_forum_id))
- {
- // Get a list of forums the user cannot read
- $forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));
-
- // Determine first forum the user is able to read (must not be a category)
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE forum_type = ' . FORUM_POST;
-
- if (sizeof($forum_ary))
- {
- $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
- }
-
- $result = $db->sql_query_limit($sql, 1);
- $g_forum_id = (int) $db->sql_fetchfield('forum_id');
- }
- $u_forum_id = $g_forum_id;
- }
- else
- {
- $u_forum_id = $forum_id;
- }
-
- $view_topic_url_params = "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : '');
+ $view_topic_url_params = "f=$forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : '');
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
@@ -898,6 +870,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'PAGINATION' => topic_generate_pagination($replies, $view_topic_url),
'TOPIC_TYPE' => $topic_type,
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
@@ -910,7 +883,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
- 'S_TOPIC_GLOBAL' => (!$forum_id) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index cc5aacff2f..4c0a326f1e 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -70,12 +70,12 @@
-
+
-
+
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index e9ed5d9daf..d6596203e5 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -25,7 +25,7 @@
-
+
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index 7c914a7b68..49d4601dfa 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -34,7 +34,7 @@
-
+
style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;">
[ {L_SELECT_MERGE} ]
{topicrow.TOPIC_TITLE}
diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html
index 29c4cf1b91..88c57eb8c5 100644
--- a/phpBB/styles/prosilver/template/memberlist_im.html
+++ b/phpBB/styles/prosilver/template/memberlist_im.html
@@ -39,7 +39,7 @@
{L_IM_ADD_CONTACT}
{L_IM_SEND_MESSAGE}
- {L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS}
+ {L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS}
diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html
index 090476e365..1a63793bc3 100644
--- a/phpBB/styles/prosilver/template/memberlist_leaders.html
+++ b/phpBB/styles/prosilver/template/memberlist_leaders.html
@@ -4,72 +4,43 @@
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index b95185a6f2..9df648f644 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -37,7 +37,7 @@ function insert_single(user)
}
// ]]>
-
+
{L_FIND_USERNAME}
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index ff14abe370..463ed2b5c1 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -81,8 +81,8 @@
// ]]>
-
-
+
+
@@ -145,7 +145,7 @@
{L_PROFILE}
- ({PRIVATE_MESSAGE_INFO} )
+ ({PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD} )
•
{L_SEARCH_SELF}
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 5d21229611..19d55d1a4a 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -38,7 +38,7 @@
// ]]>
-
+
diff --git a/phpBB/styles/prosilver/template/posting_smilies.html b/phpBB/styles/prosilver/template/posting_smilies.html
index 225721bef6..9f7e25406e 100644
--- a/phpBB/styles/prosilver/template/posting_smilies.html
+++ b/phpBB/styles/prosilver/template/posting_smilies.html
@@ -6,7 +6,7 @@
var text_name = 'message';
// ]]>
-
+
{L_SMILIES}
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 225225e1ca..942d154d44 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -51,15 +51,14 @@
-
+
style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;">
{NEWEST_POST_IMG}
{searchresults.TOPIC_TITLE} {searchresults.ATTACH_ICON_IMG}
{searchresults.UNAPPROVED_IMG}
{REPORTED_IMG}
- {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} » {searchresults.FIRST_POST_TIME}
- {L_IN} {searchresults.FORUM_TITLE} ({L_GLOBAL})
+ {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} » {searchresults.FIRST_POST_TIME} » {L_IN} {searchresults.FORUM_TITLE}
{searchresults.TOPIC_REPLIES}
{searchresults.TOPIC_VIEWS}
@@ -102,12 +101,8 @@
{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}
{searchresults.POST_DATE}
-
- {L_FORUM}: {searchresults.FORUM_TITLE}
- {L_TOPIC}: {searchresults.TOPIC_TITLE}
-
- {L_GLOBAL}: {searchresults.TOPIC_TITLE}
-
+ {L_FORUM}: {searchresults.FORUM_TITLE}
+ {L_TOPIC}: {searchresults.TOPIC_TITLE}
{L_REPLIES}: {searchresults.TOPIC_REPLIES}
{L_VIEWS}: {searchresults.TOPIC_VIEWS}
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 63c223c4bd..f983a8ef8d 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -46,8 +46,8 @@
// ]]>
-
-
+
+
diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html
index 6c2fd8bee0..df9737084e 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_manage.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html
@@ -118,7 +118,7 @@
-
+
diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
index a4da7579c8..50310f3b79 100644
--- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
+++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html
@@ -31,7 +31,7 @@
-
+
style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
{topicrow.UNAPPROVED_IMG}
diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html
index 6c9c46c9cf..68f89edf12 100644
--- a/phpBB/styles/prosilver/template/ucp_main_front.html
+++ b/phpBB/styles/prosilver/template/ucp_main_front.html
@@ -13,7 +13,7 @@
-
+
style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;">
{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html
index 2a970c7e42..2711c9486f 100644
--- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html
+++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html
@@ -22,7 +22,7 @@
-
+
{forumrow.FORUM_NAME} {forumrow.FORUM_DESC}
{L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL}
{LAST_POST_IMG} {forumrow.LAST_POST_TIME}
@@ -51,7 +51,7 @@
-
+
style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
{topicrow.UNAPPROVED_IMG}
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
index ecffe5c49a..d5f1608425 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html
@@ -58,7 +58,7 @@
-
+
style="background-image: url({messagerow.PM_ICON_URL}); background-repeat: no-repeat;">
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 460a58a70b..b9e222bff1 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -28,7 +28,7 @@
@@ -138,12 +138,13 @@
-
+
style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
{topicrow.UNAPPROVED_IMG}
{REPORTED_IMG}
{topicrow.ATTACH_ICON_IMG} {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME}
+ » {L_IN} {topicrow.FORUM_NAME}
{topicrow.REPLIES} {L_REPLIES}
{topicrow.VIEWS} {L_VIEWS}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 3f215def72..c1c0711fb2 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -652,7 +652,7 @@ fieldset.polls dd div {
}
.online {
- background-image: url("{T_IMAGESET_LANG_PATH}/icon_user_online.gif");
+ background-image: url("{IMG_ICON_USER_ONLINE_SRC}");
}
/*
@@ -714,6 +714,59 @@ a.fontsize {
.info-icon, .info-icon a { background-image: url("{IMG_ICON_POST_INFO_SRC}"); }
.warn-icon, .warn-icon a { background-image: url("{IMG_ICON_USER_WARN_SRC}"); } /* Need updated warn icon */
+/* Forum icons & Topic icons */
+.global_read { background-image: url("{IMG_GLOBAL_READ_SRC}"); }
+.global_read_mine { background-image: url("{IMG_GLOBAL_READ_MINE_SRC}"); }
+.global_read_locked { background-image: url("{IMG_GLOBAL_READ_LOCKED_SRC}"); }
+.global_read_locked_mine { background-image: url("{IMG_GLOBAL_READ_LOCKED_MINE_SRC}"); }
+.global_unread { background-image: url("{IMG_GLOBAL_UNREAD_SRC}"); }
+.global_unread_mine { background-image: url("{IMG_GLOBAL_UNREAD_MINE_SRC}"); }
+.global_unread_locked { background-image: url("{IMG_GLOBAL_UNREAD_LOCKED_SRC}"); }
+.global_unread_locked_mine { background-image: url("{IMG_GLOBAL_UNREAD_LOCKED_MINE_SRC}"); }
+
+.announce_read { background-image: url("{IMG_ANNOUNCE_READ_SRC}"); }
+.announce_read_mine { background-image: url("{IMG_ANNOUNCE_READ_MINE_SRC}"); }
+.announce_read_locked { background-image: url("{IMG_ANNOUNCE_READ_LOCKED_SRC}"); }
+.announce_read_locked_mine { background-image: url("{IMG_ANNOUNCE_READ_LOCKED_MINE_SRC}"); }
+.announce_unread { background-image: url("{IMG_ANNOUNCE_UNREAD_SRC}"); }
+.announce_unread_mine { background-image: url("{IMG_ANNOUNCE_UNREAD_MINE_SRC}"); }
+.announce_unread_locked { background-image: url("{IMG_ANNOUNCE_UNREAD_LOCKED_SRC}"); }
+.announce_unread_locked_mine { background-image: url("{IMG_ANNOUNCE_UNREAD_LOCKED_MINE_SRC}"); }
+
+.forum_link { background-image: url("{IMG_FORUM_LINK_SRC}"); }
+.forum_read { background-image: url("{IMG_FORUM_READ_SRC}"); }
+.forum_read_locked { background-image: url("{IMG_FORUM_READ_LOCKED_SRC}"); }
+.forum_read_subforum { background-image: url("{IMG_FORUM_READ_SUBFORUM_SRC}"); }
+.forum_unread { background-image: url("{IMG_FORUM_UNREAD_SRC}"); }
+.forum_unread_locked { background-image: url("{IMG_FORUM_UNREAD_LOCKED_SRC}"); }
+.forum_unread_subforum { background-image: url("{IMG_FORUM_UNREAD_SUBFORUM_SRC}"); }
+
+.sticky_read { background-image: url("{IMG_STICKY_READ_SRC}"); }
+.sticky_read_mine { background-image: url("{IMG_STICKY_READ_MINE_SRC}"); }
+.sticky_read_locked { background-image: url("{IMG_STICKY_READ_LOCKED_SRC}"); }
+.sticky_read_locked_mine { background-image: url("{IMG_STICKY_READ_LOCKED_MINE_SRC}"); }
+.sticky_unread { background-image: url("{IMG_STICKY_UNREAD_SRC}"); }
+.sticky_unread_mine { background-image: url("{IMG_STICKY_UNREAD_MINE_SRC}"); }
+.sticky_unread_locked { background-image: url("{IMG_STICKY_UNREAD_LOCKED_SRC}"); }
+.sticky_unread_locked_mine { background-image: url("{IMG_STICKY_UNREAD_LOCKED_MINE_SRC}"); }
+
+.topic_moved { background-image: url("{IMG_TOPIC_MOVED_SRC}"); }
+.topic_read { background-image: url("{IMG_TOPIC_READ_SRC}"); }
+.topic_read_mine { background-image: url("{IMG_TOPIC_READ_MINE_SRC}"); }
+.topic_read_hot { background-image: url("{IMG_TOPIC_READ_HOT_SRC}"); }
+.topic_read_hot_mine { background-image: url("{IMG_TOPIC_READ_HOT_MINE_SRC}"); }
+.topic_read_locked { background-image: url("{IMG_TOPIC_READ_LOCKED_SRC}"); }
+.topic_read_locked_mine { background-image: url("{IMG_TOPIC_READ_LOCKED_MINE_SRC}"); }
+.topic_unread { background-image: url("{IMG_TOPIC_UNREAD_SRC}"); }
+.topic_unread_mine { background-image: url("{IMG_TOPIC_UNREAD_MINE_SRC}"); }
+.topic_unread_hot { background-image: url("{IMG_TOPIC_UNREAD_HOT_SRC}"); }
+.topic_unread_hot_mine { background-image: url("{IMG_TOPIC_UNREAD_HOT_MINE_SRC}"); }
+.topic_unread_locked { background-image: url("{IMG_TOPIC_UNREAD_LOCKED_SRC}"); }
+.topic_unread_locked_mine { background-image: url("{IMG_TOPIC_UNREAD_LOCKED_MINE_SRC}"); }
+
+.pm_read { background-image: url("{IMG_TOPIC_READ_SRC}"); }
+.pm_unread { background-image: url("{IMG_TOPIC_UNREAD_SRC}"); }
+
/*
--------------------------------------------------------------
Colours and backgrounds for cp.css
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index 833bd4d55f..b5b547b2e6 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -67,12 +67,12 @@
-
+
-
+
diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html
index 7b650dda70..329c323ffa 100644
--- a/phpBB/styles/subsilver2/template/memberlist_im.html
+++ b/phpBB/styles/subsilver2/template/memberlist_im.html
@@ -19,7 +19,7 @@
- {L_IM_ADD_CONTACT} {L_IM_SEND_MESSAGE} {L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS}
+ {L_IM_ADD_CONTACT} {L_IM_SEND_MESSAGE} {L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS}
diff --git a/phpBB/styles/subsilver2/template/memberlist_leaders.html b/phpBB/styles/subsilver2/template/memberlist_leaders.html
index 57f5838e7f..75fff9f98a 100644
--- a/phpBB/styles/subsilver2/template/memberlist_leaders.html
+++ b/phpBB/styles/subsilver2/template/memberlist_leaders.html
@@ -5,57 +5,36 @@
diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
index 621fa87fd4..92b4bd3e39 100644
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ b/phpBB/styles/subsilver2/template/posting_buttons.html
@@ -33,7 +33,7 @@
// ]]>
-
+
diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html
index 06e830845a..691ba239b2 100644
--- a/phpBB/styles/subsilver2/template/posting_smilies.html
+++ b/phpBB/styles/subsilver2/template/posting_smilies.html
@@ -6,7 +6,7 @@
var text_name = 'message';
// ]]>
-
+
diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html
index 823d057f06..282b0f864b 100644
--- a/phpBB/styles/subsilver2/template/search_results.html
+++ b/phpBB/styles/subsilver2/template/search_results.html
@@ -45,11 +45,7 @@
[ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {searchresults.PAGINATION} ]
-
- {L_GLOBAL}
-
- {L_IN} {searchresults.FORUM_TITLE}
-
+ {L_IN} {searchresults.FORUM_TITLE}
{searchresults.TOPIC_AUTHOR_FULL}
{searchresults.TOPIC_REPLIES}
@@ -84,7 +80,7 @@
{searchresults.L_IGNORE_POST}
- {L_FORUM}: {searchresults.FORUM_TITLE} {L_GLOBAL} {L_TOPIC}: {searchresults.TOPIC_TITLE}
+ {L_FORUM}: {searchresults.FORUM_TITLE} {L_TOPIC}: {searchresults.TOPIC_TITLE}
{searchresults.POST_AUTHOR_FULL}
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index 65d8ef51c0..5c20b84541 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -202,6 +202,7 @@
[ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ]
+ {L_IN} {topicrow.FORUM_NAME}
{topicrow.TOPIC_AUTHOR_FULL}
{topicrow.REPLIES}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 2672703042..c53150d89b 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -177,8 +177,7 @@ if ($mark_read == 'topics')
$token = request_var('hash', '');
if (check_link_hash($token, 'global'))
{
- // Add 0 to forums array to mark global announcements correctly
- markread('topics', array($forum_id, 0));
+ markread('topics', array($forum_id));
}
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
@@ -238,9 +237,10 @@ if ($sort_days)
$sql = 'SELECT COUNT(topic_id) AS num_topics
FROM ' . TOPICS_TABLE . "
WHERE forum_id = $forum_id
- AND ((topic_type <> " . POST_GLOBAL . " AND topic_last_post_time >= $min_post_time)
- OR topic_type = " . POST_ANNOUNCE . ")
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
+ AND (topic_last_post_time >= $min_post_time
+ OR topic_type = " . POST_ANNOUNCE . '
+ OR topic_type = ' . POST_GLOBAL . ')
+ ' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
@@ -324,7 +324,7 @@ $template->assign_vars(array(
$icons = $cache->obtain_icons();
// Grab all topic data
-$rowset = $announcement_list = $topic_list = $global_announce_list = array();
+$rowset = $announcement_list = $topic_list = $global_announce_forums = array();
$sql_array = array(
'SELECT' => 't.*',
@@ -359,14 +359,24 @@ if ($user->data['is_registered'])
if ($forum_data['forum_type'] == FORUM_POST)
{
+ // Get global announcement forums
+ $g_forum_ary = $auth->acl_getf('f_read', true);
+ $g_forum_ary = array_unique(array_keys($g_forum_ary));
+
+ $sql_anounce_array['LEFT_JOIN'] = $sql_array['LEFT_JOIN'];
+ $sql_anounce_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TABLE => 'f'), 'ON' => 'f.forum_id = t.forum_id');
+ $sql_anounce_array['SELECT'] = $sql_array['SELECT'] . ', f.forum_name';
+
// Obtain announcements ... removed sort ordering, sort by time in all cases
$sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => $sql_array['SELECT'],
+ 'SELECT' => $sql_anounce_array['SELECT'],
'FROM' => $sql_array['FROM'],
- 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
+ 'LEFT_JOIN' => $sql_anounce_array['LEFT_JOIN'],
- 'WHERE' => 't.forum_id IN (' . $forum_id . ', 0)
- AND t.topic_type IN (' . POST_ANNOUNCE . ', ' . POST_GLOBAL . ')',
+ 'WHERE' => '(t.forum_id = ' . $forum_id . '
+ AND t.topic_type = ' . POST_ANNOUNCE . ') OR
+ (' . $db->sql_in_set('t.forum_id', $g_forum_ary) . '
+ AND t.topic_type = ' . POST_GLOBAL . ')',
'ORDER_BY' => 't.topic_time DESC',
));
@@ -377,18 +387,37 @@ if ($forum_data['forum_type'] == FORUM_POST)
$rowset[$row['topic_id']] = $row;
$announcement_list[] = $row['topic_id'];
- if ($row['topic_type'] == POST_GLOBAL)
+ if ($forum_id != $row['forum_id'])
{
- $global_announce_list[$row['topic_id']] = true;
- }
- else
- {
- $topics_count--;
+ $topics_count++;
+ $global_announce_forums[] = $row['forum_id'];
}
}
$db->sql_freeresult($result);
}
+$forum_tracking_info = array();
+
+if ($user->data['is_registered'])
+{
+ $forum_tracking_info[$forum_id] = $forum_data['mark_time'];
+
+ if (!empty($global_announce_forums) && $config['load_db_lastread'])
+ {
+ $sql = 'SELECT forum_id, mark_time
+ FROM ' . FORUMS_TRACK_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $global_announce_forums) . '
+ AND user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $forum_tracking_info[$row['forum_id']] = $row['mark_time'];
+ }
+ $db->sql_freeresult($result);
+ }
+}
+
// If the user is trying to reach late pages, start searching from the end
$store_reverse = false;
$sql_limit = $config['topics_per_page'];
@@ -546,45 +575,44 @@ if (sizeof($topic_list))
$mark_forum_read = true;
$mark_time_forum = 0;
- // Active topics?
- if ($s_display_active && sizeof($active_forum_ary))
+ // Generate topic forum list...
+ $topic_forum_list = array();
+ foreach ($rowset as $t_id => $row)
{
- // Generate topic forum list...
- $topic_forum_list = array();
- foreach ($rowset as $t_id => $row)
+ if (isset($forum_tracking_info[$row['forum_id']]))
{
- $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0;
- $topic_forum_list[$row['forum_id']]['topics'][] = $t_id;
+ $row['forum_mark_time'] = $forum_tracking_info[$row['forum_id']];
}
- if ($config['load_db_lastread'] && $user->data['is_registered'])
- {
- foreach ($topic_forum_list as $f_id => $topic_row)
- {
- $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), false);
- }
- }
- else if ($config['load_anon_lastread'] || $user->data['is_registered'])
- {
- foreach ($topic_forum_list as $f_id => $topic_row)
- {
- $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], false);
- }
- }
-
- unset($topic_forum_list);
+ $topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread'] && $user->data['is_registered'] && isset($row['forum_mark_time'])) ? $row['forum_mark_time'] : 0;
+ $topic_forum_list[$row['forum_id']]['topics'][] = (int) $t_id;
}
- else
+
+ if ($config['load_db_lastread'] && $user->data['is_registered'])
+ {
+ foreach ($topic_forum_list as $f_id => $topic_row)
+ {
+ $topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']));
+ }
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ foreach ($topic_forum_list as $f_id => $topic_row)
+ {
+ $topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics']);
+ }
+ }
+
+ unset($topic_forum_list);
+
+ if (!$s_display_active)
{
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
- $topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $rowset, array($forum_id => $forum_data['mark_time']), $global_announce_list);
$mark_time_forum = (!empty($forum_data['mark_time'])) ? $forum_data['mark_time'] : $user->data['user_lastmark'];
}
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
{
- $topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, $global_announce_list);
-
if (!$user->data['is_registered'])
{
$user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
@@ -622,16 +650,16 @@ if (sizeof($topic_list))
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
// Generate all the URIs ...
- $view_topic_url_params = 'f=' . $topic_forum_id . '&t=' . $topic_id;
+ $view_topic_url_params = 'f=' . $row['forum_id'] . '&t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : '';
// Send vars to template
$template->assign_block_vars('topicrow', array(
- 'FORUM_ID' => $topic_forum_id,
+ 'FORUM_ID' => $row['forum_id'],
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -649,7 +677,9 @@ if (sizeof($topic_list))
'VIEWS' => $row['topic_views'],
'TOPIC_TITLE' => censor_text($row['topic_title']),
'TOPIC_TYPE' => $topic_type,
+ 'FORUM_NAME' => (isset($row['forum_name'])) ? $row['forum_name'] : $forum_data['forum_name'],
+ 'TOPIC_IMG_STYLE' => $folder_img,
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt],
@@ -659,13 +689,13 @@ if (sizeof($topic_list))
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
- 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $topic_forum_id)) ? true : false,
+ 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
@@ -680,7 +710,8 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $topic_forum_id . '&t=' . $topic_id, true, $user->session_id),
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
+ 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $row['forum_id'] . '&t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index ff4e018d12..74ad7eba0d 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -371,17 +371,18 @@ unset($vars_online);
$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
+$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
- $sql = 'SELECT group_id, group_name, group_colour, group_type
+ $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
FROM ' . GROUPS_TABLE . '
- WHERE group_legend = 1
- ORDER BY group_name ASC';
+ WHERE group_legend = > 0
+ ORDER BY ' . $order_legend . ' ASC';
}
else
{
- $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
+ $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
@@ -389,9 +390,9 @@ else
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
- WHERE g.group_legend = 1
+ WHERE g.group_legend > 0
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
- ORDER BY g.group_name ASC';
+ ORDER BY g.' . $order_legend . ' ASC';
}
$result = $db->sql_query($sql);
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index b8f1b9d3b0..53119e2ae7 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -152,26 +152,12 @@ if ($view && !$post_id)
else
{
$topic_id = $row['topic_id'];
-
- // Check for global announcement correctness?
- if (!$row['forum_id'] && !$forum_id)
- {
- trigger_error('NO_TOPIC');
- }
- else if ($row['forum_id'])
- {
- $forum_id = $row['forum_id'];
- }
+ $forum_id = $row['forum_id'];
}
}
}
- // Check for global announcement correctness?
- if ((!isset($row) || !$row['forum_id']) && !$forum_id)
- {
- trigger_error('NO_TOPIC');
- }
- else if (isset($row) && $row['forum_id'])
+ if (isset($row) && $row['forum_id'])
{
$forum_id = $row['forum_id'];
}
@@ -186,13 +172,6 @@ $sql_array = array(
'FROM' => array(FORUMS_TABLE => 'f'),
);
-// Firebird handles two columns of the same name a little differently, this
-// addresses that by forcing the forum_id to come from the forums table.
-if ($db->sql_layer === 'firebird')
-{
- $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT'];
-}
-
// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
if ($post_id)
{
@@ -247,26 +226,8 @@ else
$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id";
}
-$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
+$sql_array['WHERE'] .= ' AND f.forum_id = t.forum_id';
-if (!$forum_id)
-{
- // If it is a global announcement make sure to set the forum id to a postable forum
- $sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
- AND f.forum_type = ' . FORUM_POST . ')';
-}
-else
-{
- $sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . "
- AND f.forum_id = $forum_id)";
-}
-
-$sql_array['WHERE'] .= ')';
-
-// 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 = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$topic_data = $db->sql_fetchrow($result);
@@ -1157,7 +1118,7 @@ while ($row = $db->sql_fetchrow($result))
if (!empty($row['user_icq']))
{
- $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/webmsg.php?to=' . $row['user_icq'];
+ $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/' . urlencode($row['user_icq']) . '/';
$user_cache[$poster_id]['icq_status_img'] = ' ';
}
else
@@ -1540,13 +1501,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $row['post_id']) : '',
'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
- 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&f=' . $forum_id : '') . '#p' . $row['post_id'],
+ 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
'U_NOTES' => ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '',
'U_WARN' => ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
'POST_ID' => $row['post_id'],
+ 'POST_NUMBER' => $i + $start + 1,
'POSTER_ID' => $poster_id,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
@@ -1615,34 +1577,13 @@ if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($use
}
}
-// Get last post time for all global announcements
-// to keep proper forums tracking
-if ($topic_data['topic_type'] == POST_GLOBAL)
-{
- $sql = 'SELECT topic_last_post_time as forum_last_post_time
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = 0
- ORDER BY topic_last_post_time DESC';
- $result = $db->sql_query_limit($sql, 1);
- $topic_data['forum_last_post_time'] = (int) $db->sql_fetchfield('forum_last_post_time');
- $db->sql_freeresult($result);
-
- $sql = 'SELECT mark_time as forum_mark_time
- FROM ' . FORUMS_TRACK_TABLE . '
- WHERE forum_id = 0
- AND user_id = ' . $user->data['user_id'];
- $result = $db->sql_query($sql);
- $topic_data['forum_mark_time'] = (int) $db->sql_fetchfield('forum_mark_time');
- $db->sql_freeresult($result);
-}
-
// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed.
if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id])
{
- markread('topic', (($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_id, $max_post_time);
+ markread('topic', $forum_id, $topic_id, $max_post_time);
// Update forum info
- $all_marked_read = update_forum_tracking_info((($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
+ $all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
}
else
{
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 8c4f1ed874..b7c3534cde 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -12,6 +12,10 @@ $phpbb_root_path = 'phpBB/';
$phpEx = 'php';
$table_prefix = 'phpbb_';
+if (!defined('E_DEPRECATED'))
+{
+ define('E_DEPRECATED', 8192);
+}
error_reporting(E_ALL & ~E_DEPRECATED);
// If we are on PHP >= 6.0.0 we do not need some code
diff --git a/tests/config/config_test.php b/tests/config/config_test.php
index 73a365c847..9c91d9eb87 100644
--- a/tests/config/config_test.php
+++ b/tests/config/config_test.php
@@ -109,4 +109,12 @@ class phpbb_config_test extends phpbb_test_case
$config->increment('foo', 1);
$this->assertEquals(27, $config['foo']);
}
+
+ public function test_delete()
+ {
+ $config = new phpbb_config(array('foo' => 'bar'));
+
+ $config->delete('foo');
+ $this->assertFalse(isset($config['foo']));
+ }
}
diff --git a/tests/config/db_test.php b/tests/config/db_test.php
index e0d5252f19..e817545a54 100644
--- a/tests/config/db_test.php
+++ b/tests/config/db_test.php
@@ -125,4 +125,42 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->config->increment('foobar', 3);
$this->assertEquals(3, $this->config['foobar']);;
}
+
+ public function test_delete()
+ {
+ $this->assertTrue(isset($this->config['foo']));
+ $this->config->delete('foo');
+ $this->cache->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($this->config['foo']));
+
+ // re-read config and populate cache
+ $cache2 = new phpbb_mock_cache;
+ $config2 = new phpbb_config_db($this->db, $cache2, 'phpbb_config');
+ $cache2->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($config2['foo']));
+ }
+
+ public function test_delete_write_read_not_cacheable()
+ {
+ // bar is dynamic
+ $this->assertTrue(isset($this->config['bar']));
+ $this->config->delete('bar');
+ $this->cache->checkVarUnset($this, 'bar');
+ $this->assertFalse(isset($this->config['bar']));
+
+ $this->config->set('bar', 'new bar', false);
+ $this->assertEquals('new bar', $this->config['bar']);
+ }
+
+ public function test_delete_write_read_cacheable()
+ {
+ // foo is not dynamic
+ $this->assertTrue(isset($this->config['foo']));
+ $this->config->delete('foo');
+ $this->cache->checkVarUnset($this, 'foo');
+ $this->assertFalse(isset($this->config['foo']));
+
+ $this->config->set('foo', 'new foo', true);
+ $this->assertEquals('new foo', $this->config['foo']);
+ }
}
diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php
index 6288a5c641..65d8360fbb 100644
--- a/tests/cron/manager_test.php
+++ b/tests/cron/manager_test.php
@@ -7,18 +7,18 @@
*
*/
-require_once __DIR__ . '/../mock/cache.php';
-require_once __DIR__ . '/task/testmod/dummy_task.php';
-require_once __DIR__ . '/task/testmod/second_dummy_task.php';
-require_once __DIR__ . '/task2/testmod/simple_ready.php';
-require_once __DIR__ . '/task2/testmod/simple_not_runnable.php';
-require_once __DIR__ . '/task2/testmod/simple_should_not_run.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+require_once dirname(__FILE__) . '/task/testmod/dummy_task.php';
+require_once dirname(__FILE__) . '/task/testmod/second_dummy_task.php';
+require_once dirname(__FILE__) . '/task2/testmod/simple_ready.php';
+require_once dirname(__FILE__) . '/task2/testmod/simple_not_runnable.php';
+require_once dirname(__FILE__) . '/task2/testmod/simple_should_not_run.php';
class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
{
public function setUp()
{
- $this->manager = new phpbb_cron_manager(__DIR__ . '/task/', 'php');
+ $this->manager = new phpbb_cron_manager(dirname(__FILE__) . '/task/', 'php');
$this->task_name = 'phpbb_cron_task_testmod_dummy_task';
}
@@ -57,7 +57,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_all_ready_tasks_cached()
{
$cache = new phpbb_mock_cache(array('_cron_tasks' => array($this->task_name)));
- $manager = new phpbb_cron_manager(__DIR__ . '/../../phpBB/', 'php', $cache);
+ $manager = new phpbb_cron_manager(dirname(__FILE__) . '/../../phpBB/', 'php', $cache);
$tasks = $manager->find_all_ready_tasks();
$this->assertEquals(1, sizeof($tasks));
@@ -65,7 +65,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_only_ready_tasks()
{
- $manager = new phpbb_cron_manager(__DIR__ . '/task2/', 'php');
+ $manager = new phpbb_cron_manager(dirname(__FILE__) . '/task2/', 'php');
$tasks = $manager->find_all_ready_tasks();
$task_names = $this->tasks_to_names($tasks);
$this->assertEquals(array('phpbb_cron_task_testmod_simple_ready'), $task_names);
diff --git a/tests/group_positions/fixtures/group_positions.xml b/tests/group_positions/fixtures/group_positions.xml
new file mode 100644
index 0000000000..55b1c2e08d
--- /dev/null
+++ b/tests/group_positions/fixtures/group_positions.xml
@@ -0,0 +1,23 @@
+
+
+
+ group_id
+ group_teampage
+ group_legend
+
+ 1
+ 0
+ 0
+
+
+ 2
+ 1
+ 0
+
+
+ 3
+ 2
+ 1
+
+
+
diff --git a/tests/group_positions/group_positions_test.php b/tests/group_positions/group_positions_test.php
new file mode 100644
index 0000000000..b68f205b37
--- /dev/null
+++ b/tests/group_positions/group_positions_test.php
@@ -0,0 +1,287 @@
+createXMLDataSet(dirname(__FILE__) . '/fixtures/group_positions.xml');
+ }
+
+ public static function get_group_value_data()
+ {
+ return array(
+ array('teampage', 1, 0),
+ array('teampage', 2, 1),
+ array('legend', 1, 0),
+ array('legend', 3, 1),
+ );
+ }
+
+ /**
+ * @dataProvider get_group_value_data
+ */
+ public function test_get_group_value($field, $group_id, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+
+ $test_class = new phpbb_group_positions($db, $field);
+ $this->assertEquals($expected, $test_class->get_group_value($group_id));
+ }
+
+ public static function get_group_count_data()
+ {
+ return array(
+ array('teampage', 2),
+ array('legend', 1),
+ );
+ }
+
+ /**
+ * @dataProvider get_group_count_data
+ */
+ public function test_get_group_count($field, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+
+ $test_class = new phpbb_group_positions($db, $field);
+ $this->assertEquals($expected, $test_class->get_group_count());
+ }
+
+ public static function add_group_data()
+ {
+ return array(
+ array('teampage', 1, array(
+ array('group_id' => 1, 'group_teampage' => 3, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider add_group_data
+ */
+ public function test_add_group($field, $group_id, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+ $test_class = new phpbb_group_positions($db, $field);
+ $test_class->add_group($group_id);
+
+ $result = $db->sql_query('SELECT group_id, group_teampage, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public static function delete_group_data()
+ {
+ return array(
+ array('teampage', 1, false, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, false, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 3, false, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 0, 'group_legend' => 1),
+ )),
+ array('teampage', 1, true, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, true, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 3, true, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider delete_group_data
+ */
+ public function test_delete_group($field, $group_id, $skip_group, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+ $test_class = new phpbb_group_positions($db, $field);
+ $test_class->delete_group($group_id, $skip_group);
+
+ $result = $db->sql_query('SELECT group_id, group_teampage, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public static function move_up_data()
+ {
+ return array(
+ array('teampage', 1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 3, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_up_data
+ */
+ public function test_move_up($field, $group_id, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+ $test_class = new phpbb_group_positions($db, $field);
+ $test_class->move_up($group_id);
+
+ $result = $db->sql_query('SELECT group_id, group_teampage, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public static function move_down_data()
+ {
+ return array(
+ array('teampage', 1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 3, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_down_data
+ */
+ public function test_move_down($field, $group_id, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+ $test_class = new phpbb_group_positions($db, $field);
+ $test_class->move_down($group_id);
+
+ $result = $db->sql_query('SELECT group_id, group_teampage, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+
+ public static function move_data()
+ {
+ return array(
+ array('teampage', 1, 1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 1, -1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 3, 3, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 2, 0, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ array('teampage', 2, -1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 2, -3, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 2, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 1, 'group_legend' => 1),
+ )),
+ array('teampage', 3, -1, array(
+ array('group_id' => 1, 'group_teampage' => 0, 'group_legend' => 0),
+ array('group_id' => 2, 'group_teampage' => 1, 'group_legend' => 0),
+ array('group_id' => 3, 'group_teampage' => 2, 'group_legend' => 1),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider move_data
+ */
+ public function test_move($field, $group_id, $increment, $expected)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+ $test_class = new phpbb_group_positions($db, $field);
+ $test_class->move($group_id, $increment);
+
+ $result = $db->sql_query('SELECT group_id, group_teampage, group_legend
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_id ASC');
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+ }
+}
+
diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php
index 3b2e3ea3b2..ed15423314 100644
--- a/tests/lock/db_test.php
+++ b/tests/lock/db_test.php
@@ -7,7 +7,7 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_lock_db_test extends phpbb_database_test_case
{
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 713f1ca817..d3f9b8ad5a 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -42,9 +42,21 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface
$test->assertFalse(isset($this->data[$var_name]));
}
- public function check(PHPUnit_Framework_Assert $test, $data)
+ public function check(PHPUnit_Framework_Assert $test, $data, $ignore_db_info = true)
{
- $test->assertEquals($data, $this->data);
+ $cache_data = $this->data;
+
+ if ($ignore_db_info)
+ {
+ unset($cache_data['mssqlodbc_version']);
+ unset($cache_data['mssql_version']);
+ unset($cache_data['mysql_version']);
+ unset($cache_data['mysqli_version']);
+ unset($cache_data['pgsql_version']);
+ unset($cache_data['sqlite_version']);
+ }
+
+ $test->assertEquals($data, $cache_data);
}
function load()
diff --git a/tests/regex/password_complexity_test.php b/tests/regex/password_complexity_test.php
new file mode 100644
index 0000000000..21e8d12a0a
--- /dev/null
+++ b/tests/regex/password_complexity_test.php
@@ -0,0 +1,81 @@
+assertFalse(validate_password($password));
+ }
+
+ /**
+ * @dataProvider password_complexity_test_data_negative
+ */
+ public function test_password_complexity_negative($password, $mode)
+ {
+ global $config;
+ $config['pass_complex'] = $mode;
+ $this->assertEquals('INVALID_CHARS', validate_password($password));
+ }
+}
diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php
index 6a0ede0106..7a45ef2fee 100644
--- a/tests/request/request_var_test.php
+++ b/tests/request/request_var_test.php
@@ -12,6 +12,15 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_request_var_test extends phpbb_test_case
{
+ /**
+ * Makes sure request_var has its standard behaviour.
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ request_var(false, false, false, false, false);
+ }
+
/**
* @dataProvider request_variables
*/
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php
new file mode 100644
index 0000000000..19a3822145
--- /dev/null
+++ b/tests/security/hash_test.php
@@ -0,0 +1,21 @@
+assertTrue(phpbb_check_hash('test', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ $this->assertTrue(phpbb_check_hash('test', '$P$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ $this->assertFalse(phpbb_check_hash('foo', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ }
+}
+
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php
index 06b03f5780..6737562a0a 100644
--- a/tests/session/continue_test.php
+++ b/tests/session/continue_test.php
@@ -19,27 +19,30 @@ class phpbb_session_continue_test extends phpbb_database_test_case
static public function session_begin_attempts()
{
- global $_SID;
+ // The session_id field is defined as CHAR(32) in the database schema.
+ // Thus the data we put in session_id fields has to have a length of 32 characters on stricter DBMSes.
+ // Thus we fill those strings up with zeroes until they have a string length of 32.
+
return array(
array(
- 'bar_session', '4', 'user agent', '127.0.0.1',
+ 'bar_session000000000000000000000', '4', 'user agent', '127.0.0.1',
array(
- array('session_id' => 'anon_session', 'session_user_id' => 1),
- array('session_id' => 'bar_session', 'session_user_id' => 4)
+ array('session_id' => 'anon_session00000000000000000000', 'session_user_id' => 1),
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
),
array(),
'If a request comes with a valid session id with matching user agent and IP, no new session should be created.',
),
array(
- 'anon_session', '4', 'user agent', '127.0.0.1',
+ 'anon_session00000000000000000000', '4', 'user agent', '127.0.0.1',
array(
- array('session_id' => 'bar_session', 'session_user_id' => 4),
- array('session_id' => null, 'session_user_id' => 1) // use generated SID
+ array('session_id' => '__new_session_id__', 'session_user_id' => 1), // use generated SID
+ array('session_id' => 'bar_session000000000000000000000', 'session_user_id' => 4),
),
array(
'u' => array('1', null),
'k' => array(null, null),
- 'sid' => array($_SID, null),
+ 'sid' => array('__new_session_id__', null),
),
'If a request comes with a valid session id and IP but different user id and user agent, a new anonymous session is created and the session matching the supplied session id is deleted.',
),
@@ -71,26 +74,48 @@ class phpbb_session_continue_test extends phpbb_database_test_case
$session->session_begin();
$sql = 'SELECT session_id, session_user_id
- FROM phpbb_sessions';
+ FROM phpbb_sessions
+ ORDER BY session_user_id';
- // little tickery to allow using a dataProvider with dynamic expected result
- foreach ($expected_sessions as $i => $s)
- {
- if (is_null($s['session_id']))
- {
- $expected_sessions[$i]['session_id'] = $session->session_id;
- }
- }
+ $expected_sessions = $this->replace_session($expected_sessions, $session->session_id);
+ $expected_cookies = $this->replace_session($expected_cookies, $session->session_id);
$this->assertSqlResultEquals(
$expected_sessions,
$sql,
- 'Check if no new session was created'
+ $message
);
$session->check_cookies($this, $expected_cookies);
$session_factory->check($this);
}
-}
+ /**
+ * Replaces recursively the value __new_session_id__ with the given session
+ * id.
+ *
+ * @param array $array An array of data
+ * @param string $session_id The new session id to use instead of the
+ * placeholder.
+ * @return array The input array with all occurances of __new_session_id__
+ * replaced.
+ */
+ public function replace_session($array, $session_id)
+ {
+ foreach ($array as $key => &$value)
+ {
+ if ($value === '__new_session_id__')
+ {
+ $value = $session_id;
+ }
+
+ if (is_array($value))
+ {
+ $value = $this->replace_session($value, $session_id);
+ }
+ }
+
+ return $array;
+ }
+}
diff --git a/tests/session/fixtures/sessions_full.xml b/tests/session/fixtures/sessions_full.xml
index 4559a08c55..bf6fc65997 100644
--- a/tests/session/fixtures/sessions_full.xml
+++ b/tests/session/fixtures/sessions_full.xml
@@ -22,13 +22,13 @@
session_ip
session_browser
- anon_session
+ anon_session00000000000000000000
1
127.0.0.1
anonymous user agent
- bar_session
+ bar_session000000000000000000000
4
127.0.0.1
user agent
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index a3ba3e581f..62f94f7d32 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -324,8 +324,7 @@ class phpbb_template_template_test extends phpbb_test_case
*/
public function test_template($file, array $vars, array $block_vars, array $destroy, $expected)
{
- global $phpEx;
- $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.' . $phpEx;
+ $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.php';
$this->assertFileNotExists($cache_file);
@@ -375,11 +374,9 @@ class phpbb_template_template_test extends phpbb_test_case
public function test_php()
{
- global $phpEx;
-
$GLOBALS['config']['tpl_allow_php'] = true;
- $cache_file = $this->template->cachepath . 'php.html.' . $phpEx;
+ $cache_file = $this->template->cachepath . 'php.html.php';
$this->assertFileNotExists($cache_file);
@@ -390,21 +387,14 @@ class phpbb_template_template_test extends phpbb_test_case
public function test_includephp()
{
- $this->markTestIncomplete('Include PHP test file paths are broken');
-
$GLOBALS['config']['tpl_allow_php'] = true;
- $cache_file = $this->template->cachepath . 'includephp.html.' . PHP_EXT;
-
- $cwd = getcwd();
- chdir(dirname(__FILE__) . '/templates');
+ $cache_file = $this->template->cachepath . 'includephp.html.php';
$this->run_template('includephp.html', array(), array(), array(), 'testing included php', $cache_file);
$this->template->set_filenames(array('test' => 'includephp.html'));
- $this->assertEquals('testing included php', $this->display('test'), "Testing $file");
-
- chdir($cwd);
+ $this->assertEquals('testing included php', $this->display('test'), "Testing INCLUDEPHP");
$GLOBALS['config']['tpl_allow_php'] = false;
}
@@ -418,17 +408,16 @@ class phpbb_template_template_test extends phpbb_test_case
false,
'insert',
<< 'before'),
- false,
- 'insert',
- << 'after'),
- true,
- 'insert',
- << 'pos #1'),
- 1,
- 'insert',
- << 'before'),
- false,
- 'insert',
- << 'before'),
- false,
- 'insert',
- << 'before'),
- false,
- 'insert',
- <<markTestIncomplete('Alter Block Test is broken');
-
$this->template->set_filenames(array('test' => 'loop_nested.html'));
// @todo Change this
@@ -656,12 +498,11 @@ EOT
$this->template->assign_block_vars('outer', array());
$this->template->assign_block_vars('outer.middle', array());
$this->template->assign_block_vars('outer.middle', array());
- $this->template->assign_block_vars('outer.middle', array());
$this->template->assign_block_vars('outer', array());
$this->template->assign_block_vars('outer.middle', array());
$this->template->assign_block_vars('outer.middle', array());
- $this->assertEquals("outer - 0/3\nmiddle - 0/2\nmiddle - 1/2\nouter - 1/3\nmiddle - 0/3\nmiddle - 1/3\nmiddle - 2/3\nouter - 2/3\nmiddle - 0/2\nmiddle - 1/2", $this->display('test'), 'Ensuring template is built correctly before modification');
+ $this->assertEquals("outer - 0\nmiddle - 0\nmiddle - 1\nouter - 1\nmiddle - 0\nmiddle - 1\nouter - 2\nmiddle - 0\nmiddle - 1", $this->display('test'), 'Ensuring template is built correctly before modification');
$this->template->alter_block_array($alter_block, $vararray, $key, $mode);
$this->assertEquals($expect, $this->display('test'), $description);
diff --git a/tests/template/templates/includephp.html b/tests/template/templates/includephp.html
index 117d4273f0..70ebdac0d0 100644
--- a/tests/template/templates/includephp.html
+++ b/tests/template/templates/includephp.html
@@ -1 +1 @@
-
+
diff --git a/tests/template/templates/loop_nested.html b/tests/template/templates/loop_nested.html
index 571df97b4c..9b251cd453 100644
--- a/tests/template/templates/loop_nested.html
+++ b/tests/template/templates/loop_nested.html
@@ -1,8 +1,8 @@
- {outer.S_BLOCK_NAME} - {outer.S_ROW_NUM}/{outer.S_NUM_ROWS} - {outer.VARIABLE}
+ outer - {outer.S_ROW_COUNT} - {outer.VARIABLE}
- {middle.S_BLOCK_NAME} - {middle.S_ROW_NUM}/{middle.S_NUM_ROWS} - {middle.VARIABLE}
+ middle - {middle.S_ROW_COUNT} - {middle.VARIABLE}
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 6c06857fbc..a7559e2183 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -123,7 +123,7 @@ class phpbb_database_test_connection_manager
try
{
- $this->pdo->exec('DROP DATABASE ' . $config['dbname']);
+ $this->pdo->exec('DROP DATABASE ' . $this->config['dbname']);
}
catch (PDOException $e)
{