aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-03-10 20:30:26 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-03-10 20:30:26 +0000
commit7487bfce48dd90ea370c8a40e67a75b814f2eb37 (patch)
tree0896d08ec9993dc920de00ebdcaf9c59eb0792fa
parentc235dced700cd0223ac36880a25ff25110d8d6f4 (diff)
downloadforums-7487bfce48dd90ea370c8a40e67a75b814f2eb37.tar
forums-7487bfce48dd90ea370c8a40e67a75b814f2eb37.tar.gz
forums-7487bfce48dd90ea370c8a40e67a75b814f2eb37.tar.bz2
forums-7487bfce48dd90ea370c8a40e67a75b814f2eb37.tar.xz
forums-7487bfce48dd90ea370c8a40e67a75b814f2eb37.zip
- check for array [lang]
- admin_forums delete routine updated - added extension groups per forum git-svn-id: file:///svn/phpbb/trunk@4861 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/admin_attachments.php86
-rw-r--r--phpBB/adm/admin_forums.php62
-rw-r--r--phpBB/download.php2
-rw-r--r--phpBB/includes/functions.php4
-rw-r--r--phpBB/includes/functions_display.php21
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/message_parser.php6
-rw-r--r--phpBB/install/schemas/mysql_schema.sql1
-rw-r--r--phpBB/language/en/admin.php6
-rw-r--r--phpBB/language/en/common.php4
-rw-r--r--phpBB/language/en/gcp.php2
-rw-r--r--phpBB/language/en/mcp.php2
-rw-r--r--phpBB/language/en/memberlist.php2
-rw-r--r--phpBB/language/en/posting.php2
-rw-r--r--phpBB/language/en/search.php2
-rw-r--r--phpBB/language/en/ucp.php2
-rw-r--r--phpBB/language/en/viewforum.php2
-rw-r--r--phpBB/language/en/viewtopic.php2
-rw-r--r--phpBB/posting.php2
-rw-r--r--phpBB/viewtopic.php2
20 files changed, 162 insertions, 54 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php
index 420e91434f..a3b5b64e7e 100644
--- a/phpBB/adm/admin_attachments.php
+++ b/phpBB/adm/admin_attachments.php
@@ -104,6 +104,7 @@ if ($mode == 'attach')
if ($submit)
{
+/*
// Update Extension Group Filesizes
if ($config_name == 'max_filesize')
{
@@ -119,7 +120,7 @@ if ($mode == 'attach')
$db->sql_query($sql);
}
}
-
+*/
set_config($config_name, $new[$config_name]);
if (in_array($config_name, array('max_filesize', 'attachment_quota', 'max_filesize_pm')))
@@ -300,6 +301,8 @@ if ($submit && $mode == 'ext_groups')
// Ok, build the update/insert array
$upload_icon = request_var('upload_icon', 'no_image');
$size_select = request_var('size_select', 'b');
+ $forum_select = request_var('forum_select', false);
+ $allowed_forums = isset($_REQUEST['allowed_forums']) ? array_map('intval', array_values($_REQUEST['allowed_forums'])) : array();
$max_filesize = request_var('max_filesize', 0);
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
@@ -308,13 +311,19 @@ if ($submit && $mode == 'ext_groups')
$max_filesize = 0;
}
+ if (!sizeof($allowed_forums))
+ {
+ $forum_select = false;
+ }
+
$group_ary = array(
'group_name' => $group_name,
'cat_id' => request_var('special_category', NONE_CAT),
'allow_group' => (isset($_REQUEST['allow_group'])) ? 1 : 0,
'download_mode' => request_var('download_mode', INLINE_LINK),
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
- 'max_filesize' => $max_filesize
+ 'max_filesize' => $max_filesize,
+ 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : ''
);
$sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ';
@@ -784,6 +793,8 @@ if ($mode == 'ext_groups')
extract($db->sql_fetchrow($result));
$db->sql_freeresult($result);
+ $forum_ids = (!$allowed_forums) ? array() : unserialize(trim($allowed_forums));
+
case 'add':
if ($action == 'add')
@@ -794,6 +805,7 @@ if ($mode == 'ext_groups')
$download_mode = 1;
$upload_icon = '';
$max_filesize = 0;
+ $forum_ids = array();
}
$extensions = array();
@@ -960,6 +972,70 @@ if ($mode == 'ext_groups')
</select></td>
</tr>
<tr>
+ <td class="row1" valign="top"><b><?php echo $user->lang['ALLOWED_FORUMS']; ?></b>:<br /><span class="gensmall"><?php echo $user->lang['ALLOWED_FORUMS_EXPLAIN']; ?></span></td>
+ <td class="row2"><input type="radio" name="forum_select" value="0"<?php echo (!sizeof($forum_ids)) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo $user->lang['ALLOW_ALL_FORUMS']; ?>&nbsp;&nbsp;<input type="radio" name="forum_select" value="1"<?php echo (sizeof($forum_ids)) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo $user->lang['ALLOW_SELECTED_FORUMS']; ?><br /><br />
+ <select name="allowed_forums[]" multiple="true" size="8">
+<?php
+
+ $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
+ FROM ' . FORUMS_TABLE . '
+ ORDER BY left_id ASC';
+ $result = $db->sql_query($sql);
+
+ $right = $cat_right = $padding_inc = 0;
+ $padding = $forum_list = $holding = '';
+ $padding_store = array('0' => '');
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']))
+ {
+ // Non-postable forum with no subforums, don't display
+ continue;
+ }
+
+ if (!$auth->acl_get('f_list', $row['forum_id']))
+ {
+ // if the user does not have permissions to list this forum skip
+ continue;
+ }
+
+ if ($row['left_id'] < $right)
+ {
+ $padding .= '&nbsp; &nbsp;';
+ $padding_store[$row['parent_id']] = $padding;
+ }
+ else if ($row['left_id'] > $right + 1)
+ {
+ $padding = $padding_store[$row['parent_id']];
+ }
+
+ $right = $row['right_id'];
+
+ $selected = (in_array($row['forum_id'], $forum_ids)) ? ' selected="selected"' : '';
+
+ if ($row['left_id'] > $cat_right)
+ {
+ $holding = '';
+ }
+
+ if ($row['right_id'] - $row['left_id'] > 1)
+ {
+ $cat_right = max($cat_right, $row['right_id']);
+
+ $holding .= '<option value="' . $row['forum_id'] . '"' . (($row['forum_type'] == FORUM_POST) ? ' class="blue"' : '') . $selected . '>' . $padding . $row['forum_name'] . '</option>';
+ }
+ else
+ {
+ echo $holding . '<option value="' . $row['forum_id'] . '"' . (($row['forum_type'] == FORUM_POST) ? ' class="blue"' : '') . $selected . '>' . $padding . $row['forum_name'] . '</option>';
+ $holding = '';
+ }
+ }
+ $db->sql_freeresult($result);
+ unset($padding_store);
+?>
+ </select></td>
+ </tr>
+ <tr>
<td class="cat" colspan="2" align="right"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" />&nbsp;&nbsp;<input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="btnlite" /></td>
</tr>
</table>
@@ -1335,7 +1411,7 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
$message_parser->filename_data['filecomment'] = '';
$message_parser->filename_data['filename'] = $upload_dir . '/' . $filename;
- $filedata = upload_attachment($filename, true, $upload_dir . '/' . $filename);
+ $filedata = upload_attachment($forum_id, $filename, true, $upload_dir . '/' . $filename);
if ($filedata['post_attach'] && !sizeof($filedata['error']))
{
@@ -1644,11 +1720,13 @@ function rewrite_extensions()
{
$extension = $row['extension'];
- $extensions['_allowed_'][] = $extension;
$extensions[$extension]['display_cat'] = (int) $row['cat_id'];
$extensions[$extension]['download_mode']= (int) $row['download_mode'];
$extensions[$extension]['upload_icon'] = (string) $row['upload_icon'];
$extensions[$extension]['max_filesize'] = (int) $row['max_filesize'];
+
+ // Store allowed extensions forum wise
+ $extensions['_allowed_'][$extension] = (!$row['allowed_forums']) ? 0 : unserialize(trim($row['allowed_forums']));
}
$db->sql_freeresult($result);
diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php
index 42438cfb1a..19cab76e6b 100644
--- a/phpBB/adm/admin_forums.php
+++ b/phpBB/adm/admin_forums.php
@@ -1134,7 +1134,7 @@ function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = '
if ($action_posts == 'delete')
{
$log_action_posts = 'POSTS';
- $errors += delete_forum_content($forum_id);
+ $errors = array_merge($errors, delete_forum_content($forum_id));
}
elseif ($action_posts == 'move')
{
@@ -1160,7 +1160,7 @@ function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = '
$posts_to_name = $row['forum_name'];
unset($row);
- $errors += move_forum_content($forum_id, $subforums_to_id);
+ $errors = array_merge($errors, move_forum_content($forum_id, $subforums_to_id));
}
}
}
@@ -1180,7 +1180,7 @@ function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = '
foreach ($rows as $row)
{
$forum_ids[] = $row['forum_id'];
- $errors += delete_forum_content($row['forum_id']);
+ $errors = array_merge($errors, delete_forum_content($row['forum_id']));
}
if (count($errors))
@@ -1265,6 +1265,27 @@ function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = '
WHERE left_id > $right_id";
$db->sql_query($sql);
+ if (!is_array($forum_ids))
+ {
+ $forum_ids = array($forum_id);
+ }
+
+ // Delete forum ids from extension groups table
+ $sql = 'SELECT group_id, allowed_forums
+ FROM ' . EXTENSION_GROUPS_TABLE . "
+ WHERE allowed_forums <> ''";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $allowed_forums = unserialize(trim($row['allowed_forums']));
+ $allowed_forums = array_diff($allowed_forums, $forum_ids);
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "
+ SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'
+ WHERE group_id = {$row['group_id']}";
+ $db->sql_query($sql);
+ }
+
$log_action = implode('_', array($log_action_posts, $log_action_forums));
switch ($log_action)
@@ -1311,11 +1332,10 @@ function delete_forum_content($forum_id)
// Use delete_attachments('topic', $ids, false) here...
// Select then delete all attachments
- $sql = 'SELECT d.physical_filename, d.thumbnail
- FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_DESC_TABLE . ' d, ' . ATTACHMENTS_TABLE . " a
+ $sql = 'SELECT a.physical_filename, a.thumbnail
+ FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a
WHERE p.forum_id = $forum_id
- AND a.post_id = p.post_id
- AND d.attach_id = a.attach_id";
+ AND a.post_id = p.post_id";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1340,10 +1360,10 @@ function delete_forum_content($forum_id)
POLL_VOTES_TABLE => 'pv.post_id'
);
- $sql = 'DELETE QUICK FROM ' . POSTS_TABLE . ', ' . ATTACHMENTS_DESC_TABLE;
- $sql_using = "\nUSING " . POSTS_TABLE . ' p, ' . ATTACHMENTS_DESC_TABLE . ' d';
- $sql_where = "\nWHERE p.forum_id = $forum_id\nAND d.attach_id = a.attach_id";
- $sql_optimise = 'OPTIMIZE TABLE . ' . POSTS_TABLE . ', ' . ATTACHMENTS_DESC_TABLE;
+ $sql = 'DELETE QUICK FROM ' . POSTS_TABLE;
+ $sql_using = "\nUSING " . POSTS_TABLE . ' p';
+ $sql_where = "\nWHERE p.forum_id = $forum_id\n";
+ $sql_optimise = 'OPTIMIZE TABLE . ' . POSTS_TABLE;
foreach ($tables_ary as $table => $field)
{
@@ -1368,11 +1388,10 @@ function delete_forum_content($forum_id)
default:
// Select then delete all attachments
- $sql = 'SELECT d.attach_id, d.physical_filename, d.thumbnail
- FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . ' a, ' . ATTACHMENTS_DESC_TABLE . " d
+ $sql = 'SELECT a.attach_id, a.physical_filename, a.thumbnail
+ FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a
WHERE p.forum_id = $forum_id
- AND a.post_id = p.post_id
- AND d.attach_id = a.attach_id";
+ AND a.post_id = p.post_id";
$result = $db->sql_query($sql);
$attach_ids = array();
@@ -1391,10 +1410,7 @@ function delete_forum_content($forum_id)
if (count($attach_ids))
{
$attach_id_list = implode(',', array_unique($attach_ids));
-
$db->sql_query('DELETE FROM ' . ATTACHMENTS_TABLE . " WHERE attach_id IN ($attach_id_list)");
- $db->sql_query('DELETE FROM ' . ATTACHMENTS_DESC_TABLE . " WHERE attach_id IN ($attach_id_list)");
-
unset($attach_ids, $attach_id_list);
}
@@ -1404,13 +1420,13 @@ function delete_forum_content($forum_id)
SEARCH_MATCH_TABLE,
RATINGS_TABLE,
REPORTS_TABLE,
- POLL_OPTIONS_TABLE,
- POLL_VOTES_TABLE
),
'topic_id' => array(
TOPICS_WATCH_TABLE,
- TOPICS_TRACK_TABLE
+ TOPICS_TRACK_TABLE,
+ POLL_OPTIONS_TABLE,
+ POLL_VOTES_TABLE
)
);
@@ -1446,7 +1462,7 @@ function delete_forum_content($forum_id)
}
unset($ids, $id_list);
- $table_ary = array('phpbb_forum_access', POSTS_TABLE, TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE);
+ $table_ary = array('phpbb_forum_access', TOPICS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, ACL_GROUPS_TABLE, ACL_USERS_TABLE, MODERATOR_TABLE, LOG_TABLE);
foreach ($table_ary as $table)
{
$db->sql_query("DELETE FROM $table WHERE forum_id = $forum_id");
@@ -1456,7 +1472,7 @@ function delete_forum_content($forum_id)
switch (SQL_LAYER)
{
case 'mysql':
- $sql = 'OPTIMIZE TABLE ' . POSTS_TABLE . ', ' . ATTACHMENTS_TABLE . ', ' . ATTACHMENTS_DESC_TABLE . ', ' . implode(', ', $tables_ary['post_id']) . ', ' . implode(', ', $tables_ary['topic_id']) . ', ' . implode(', ', $table_ary);
+ $sql = 'OPTIMIZE TABLE ' . POSTS_TABLE . ', ' . ATTACHMENTS_TABLE . ', ' . implode(', ', $tables_ary['post_id']) . ', ' . implode(', ', $tables_ary['topic_id']) . ', ' . implode(', ', $table_ary);
$db->sql_query($sql);
break;
diff --git a/phpBB/download.php b/phpBB/download.php
index 7d441d166a..9d61032d15 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -73,7 +73,7 @@ $extensions = array();
obtain_attach_extensions($extensions);
// disallowed ?
-if (!in_array($attachment['extension'], $extensions['_allowed_']))
+if ((is_array($extensions['_allowed_'][$attachment['extension']]) && !in_array($row['forum_id'], $extensions['_allowed_'][$attachment['extension']])) || !isset($extensions['_allowed_'][$attachment['extension']]))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c31969aef4..fcb073a074 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -883,11 +883,13 @@ function obtain_attach_extensions(&$extensions)
{
$extension = strtolower(trim($row['extension']));
- $extensions['_allowed_'][] = $extension;
$extensions[$extension]['display_cat'] = (int) $row['cat_id'];
$extensions[$extension]['download_mode'] = (int) $row['download_mode'];
$extensions[$extension]['upload_icon'] = trim($row['upload_icon']);
$extensions[$extension]['max_filesize'] = (int) $row['max_filesize'];
+
+ // Store allowed extensions forum wise
+ $extensions['_allowed_'][$extension] = (!$row['allowed_forums']) ? 0 : unserialize(trim($row['allowed_forums']));
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index dc86e48ec9..2ba13d6939 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -331,7 +331,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
}
// Display Attachments
-function display_attachments($blockname, $attachment_data, &$update_count, $force_physical = false, $return = false)
+function display_attachments($forum_id, $blockname, $attachment_data, &$update_count, $force_physical = false, $return = false)
{
global $extensions, $template, $cache, $attachment_tpl;
global $config, $user, $phpbb_root_path, $phpEx, $SID;
@@ -409,11 +409,11 @@ function display_attachments($blockname, $attachment_data, &$update_count, $forc
$display_name = $attachment['real_filename'];
$comment = str_replace("\n", '<br />', censor_text($attachment['comment']));
- $denied = FALSE;
+ $denied = false;
- if (!in_array($attachment['extension'], $extensions['_allowed_']))
+ if ((is_array($extensions['_allowed_'][$attachment['extension']]) && !in_array($forum_id, $extensions['_allowed_'][$attachment['extension']])) || !isset($extensions['_allowed_'][$attachment['extension']]))
{
- $denied = TRUE;
+ $denied = true;
$template_array['VAR'] = array('{L_DENIED}');
$template_array['VAL'] = array(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
@@ -423,9 +423,16 @@ function display_attachments($blockname, $attachment_data, &$update_count, $forc
// Replace {L_*} lang strings
$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);
- $template->assign_block_vars($blockname, array(
- 'SHOW_ATTACHMENT' => $tpl)
- );
+ if (!$return)
+ {
+ $template->assign_block_vars($blockname, array(
+ 'DISPLAY_ATTACHMENT' => $tpl)
+ );
+ }
+ else
+ {
+ $return_tpl[] = $tpl;
+ }
}
if (!$denied)
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 23bcbd25d4..4c5a3d4c69 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -162,7 +162,7 @@ function update_last_post_information($type, $id)
}
// Upload Attachment - filedata is generated here
-function upload_attachment($filename, $local = false, $local_storage = '')
+function upload_attachment($forum_id, $filename, $local = false, $local_storage = '')
{
global $auth, $user, $config, $db;
@@ -188,7 +188,7 @@ function upload_attachment($filename, $local = false, $local_storage = '')
obtain_attach_extensions($extensions);
// Check Extension
- if (!in_array($filedata['extension'], $extensions['_allowed_']))
+ if ((is_array($extensions['_allowed_'][$filedata['extension']]) && !in_array($forum_id, $extensions['_allowed_'][$filedata['extension']])) || !isset($extensions['_allowed_'][$filedata['extension']]))
{
$filedata['error'][] = sprintf($user->lang['DISALLOWED_EXTENSION'], $filedata['extension']);
$filedata['post_attach'] = false;
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 33a3c5ac30..b1f272eefa 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -706,7 +706,7 @@ class parse_message
// Parse Attachments
function parse_attachments($mode, $post_id, $submit, $preview, $refresh)
{
- global $config, $auth, $user;
+ global $config, $auth, $user, $forum_id;
global $_FILES, $_POST;
$error = array();
@@ -723,7 +723,7 @@ class parse_message
{
if ($num_attachments < $config['max_attachments'] || $auth->acl_gets('m_', 'a_'))
{
- $filedata = upload_attachment($this->filename_data['filename']);
+ $filedata = upload_attachment($forum_id, $this->filename_data['filename']);
$error = $filedata['error'];
@@ -807,7 +807,7 @@ class parse_message
{
if ($num_attachments < $config['max_attachments'] || $auth->acl_gets('m_', 'a_'))
{
- $filedata = upload_attachment($this->filename_data['filename']);
+ $filedata = upload_attachment($forum_id, $this->filename_data['filename']);
$error = array_merge($error, $filedata['error']);
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index 294ff178f1..980d1263c2 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -171,6 +171,7 @@ CREATE TABLE phpbb_extension_groups (
download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
upload_icon varchar(100) DEFAULT '' NOT NULL,
max_filesize int(20) DEFAULT '0' NOT NULL,
+ allowed_forums text NOT NULL,
PRIMARY KEY (group_id)
);
diff --git a/phpBB/language/en/admin.php b/phpBB/language/en/admin.php
index 04da22fe58..6871b738c4 100644
--- a/phpBB/language/en/admin.php
+++ b/phpBB/language/en/admin.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
@@ -1757,6 +1757,10 @@ $lang += array(
'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension Group successfully updated',
'EXTENSION_GROUP_EXIST' => 'The Extension Group %s already exist',
'EXTENSION_GROUP_DELETED' => 'Extension Group successfully deleted',
+ 'ALLOWED_FORUMS' => 'Allowed Forums',
+ 'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the following forums',
+ 'ALLOW_ALL_FORUMS' => 'Allow All Forums',
+ 'ALLOW_SELECTED_FORUMS' => 'Only Forums selected below',
'CAT_IMAGES' => 'Images',
'CAT_WM_FILES' => 'Win Media Streams',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 880e6976c4..a2483ec7a3 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
@@ -89,7 +89,7 @@ $lang += array(
'EMAIL' => 'Email',
'EMAIL_ADDRESS' => 'Email address',
'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.',
- 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <b>%s</b> has been deactivated and can no longer be displayed.',
+ 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <b>%s</b> has been deactivated and can no longer be displayed',
'FAQ' => 'FAQ',
'FILENAME' => 'Filename',
diff --git a/phpBB/language/en/gcp.php b/phpBB/language/en/gcp.php
index a1c2849dcc..f5ff081f5c 100644
--- a/phpBB/language/en/gcp.php
+++ b/phpBB/language/en/gcp.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index 67f1747717..b694d1b39e 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index 5260ff38ef..c531c5e539 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index ecfaa4eba9..1d673cf4f6 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index 8af62635d3..34052cc0d4 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 7152458419..8925bfc5ab 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index 8587e39ced..26eb392ebf 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index 6729edf1e6..3262803206 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -12,7 +12,7 @@
// -------------------------------------------------------------
// DO NOT CHANGE
-if (empty($lang))
+if (empty($lang) || !is_array($lang))
{
$lang = array();
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index bf7ba6e293..9752e3a768 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -826,7 +826,7 @@ if (!sizeof($error) && $preview)
$extensions = $update_count = array();
$template->assign_var('S_HAS_ATTACHMENTS', true);
- display_attachments('attachment', $message_parser->attachment_data, $update_count, true);
+ display_attachments($forum_id, 'attachment', $message_parser->attachment_data, $update_count, true);
}
}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 48f9152e4a..cef6bd1a7e 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1179,7 +1179,7 @@ for ($i = 0; $i < count($post_list); ++$i)
if (sizeof($attachments[$row['post_id']]))
{
$tpl = &$attachments[$row['post_id']];
- $tpl = display_attachments(NULL, $tpl, $update_count, false, true);
+ $tpl = display_attachments($forum_id, NULL, $tpl, $update_count, false, true);
$tpl_size = sizeof($tpl);
$unset_tpl = array();