aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
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 /phpBB/includes/functions_display.php
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
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php21
1 files changed, 14 insertions, 7 deletions
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)