diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index 22de35990b..39e1bb8c3f 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -38,150 +38,6 @@ if (!$auth->acl_get('a_attach')) trigger_error($user->lang['NO_ADMIN']); } -function size_select($select_name, $size_compare) -{ - global $user; - - $size_types_text = array($user->lang['BYTES'], $user->lang['KB'], $user->lang['MB']); - $size_types = array('b', 'kb', 'mb'); - - $select_field = ''; - - return ($select_field); -} - -function test_upload(&$error, &$error_msg, $upload_dir, $ftp_path, $ftp_upload_allowed, $create_directory = false) -{ - global $user; - - $error = FALSE; - - // Does the target directory exist, is it a directory and writeable. (only test if ftp upload is disabled) - if (!$ftp_upload_allowed) - { - if ($create_directory) - { - if (!@file_exists($upload_dir)) - { - @mkdir($upload_dir, 0755); - @chmod($upload_dir, 0777); - } - } - - if (!@file_exists($upload_dir)) - { - $error = TRUE; - $error_msg = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $new['upload_dir']) . '
'; - } - - if (!$error && !is_dir($upload_dir)) - { - $error = TRUE; - $error_msg = sprintf($user->lang['DIRECTORY_IS_NOT_A_DIR'], $new['upload_dir']) . '
'; - } - - if (!$error) - { - if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) - { - $error = TRUE; - $error_msg = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $new['upload_dir']) . '
'; - } - else - { - @fclose($fp); - @unlink($upload_dir . '/0_000000.000'); - } - } - } - else - { - // Check FTP Settings - $server = ( empty($new['ftp_server']) ) ? 'localhost' : $new['ftp_server']; - $conn_id = @ftp_connect($server); - - if (!$conn_id) - { - $error = TRUE; - $error_msg = sprintf($user->lang['FTP_ERROR_CONNECT'], $server) . '
'; - } - - $login_result = @ftp_login($conn_id, $new['ftp_user'], $new['ftp_pass']); - - if (!$login_result && !$error) - { - $error = TRUE; - $error_msg = sprintf($user->lang['FTP_ERROR_LOGIN'], $new['ftp_user']) . '
'; - } - - if (!@ftp_pasv($conn_id, intval($new['ftp_pasv_mode']))) - { - $error = TRUE; - $error_msg = $user->lang['FTP_ERROR_PASV_MODE']; - } - - if (!$error) - { - // Check Upload - $tmpfname = @tempnam('/tmp', 't0000'); - @unlink($tmpfname); // unlink for safety on php4.0.3+ - $fp = @fopen($tmpfname, 'w'); - @fwrite($fp, 'test'); - @fclose($fp); - - if ($create_directory) - { - $result = @ftp_chdir($conn_id, $ftp_path); - - if (!$result) - { - @ftp_mkdir($conn_id, $ftp_path); - } - } - - $result = @ftp_chdir($conn_id, $ftp_path); - - if (!$result) - { - $error = TRUE; - $error_msg = sprintf($user->lang['FTP_ERROR_PATH'], $ftp_path) . '
'; - } - else - { - $res = @ftp_put($conn_id, 't0000', $tmpfname, FTP_ASCII); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($user->lang['FTP_ERROR_UPLOAD'], $ftp_path) . '
'; - } - else - { - $res = @ftp_delete($conn_id, 't0000'); - - if (!$res) - { - $error = TRUE; - $error_msg = sprintf($user->lang['FTP_ERROR_DELETE'], $ftp_path) . '
'; - } - } - } - - @ftp_quit($conn_id); - @unlink($tmpfname); - } - } -} - $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; $config_sizes = array('max_filesize' => 'size', 'attachment_quota' => 'quota_size', 'max_filesize_pm' => 'pm_size'); @@ -263,11 +119,11 @@ while ($row = $db->sql_fetchrow($result)) } } -if ($submit && $mode == 'manage') +if ($submit && ($mode == 'manage' || $mode == 'cats')) { add_log('admin', 'LOG_SETTING_CONFIG'); $notify = TRUE; - $notify_msg = $user->lang['Config_updated']; + $notify_msg = $user->lang['ATTACH_CONFIG_UPDATED']; } // Adjust the Upload Directory @@ -292,6 +148,10 @@ switch ($mode) case 'manage': $l_title = 'ATTACHMENT_CONFIG'; break; + + case 'cats': + $l_title = 'MANAGE_CATEGORIES'; + break; } // Temporary Language Variables @@ -546,6 +406,255 @@ if ($mode == 'manage') 0 + ORDER BY cat_id"; + $result = $db->sql_query($sql); + + $s_assigned_groups = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $s_assigned_groups[$row['cat_id']][] = $row['group_name']; + } + + $display_inlined_yes = ($new['img_display_inlined']) ? 'checked="checked"' : ''; + $display_inlined_no = (!$new['img_display_inlined']) ? 'checked="checked"' : ''; + + $create_thumbnail_yes = ($new['img_create_thumbnail']) ? 'checked="checked"' : ''; + $create_thumbnail_no = (!$new['img_create_thumbnail']) ? 'checked="checked"' : ''; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lang['SETTINGS_CAT_IMAGES']; ?>
lang['ASSIGNED_GROUP']; ?>: lang['NONE']); ?>
lang['DISPLAY_INLINED']; ?>:
lang['DISPLAY_INLINED_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['CREATE_THUMBNAIL']; ?>:
lang['CREATE_THUMBNAIL_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?>
lang['MIN_THUMB_FILESIZE']; ?>:
lang['MIN_THUMB_FILESIZE_EXPLAIN']; ?>
lang['BYTES']; ?>
lang['IMAGICK_PATH']; ?>:
lang['IMAGICK_PATH_EXPLAIN']; ?>
lang['MAX_IMAGE_SIZE']; ?>:
lang['MAX_IMAGE_SIZE_EXPLAIN']; ?>
x
lang['IMAGE_LINK_SIZE']; ?>:
lang['IMAGE_LINK_SIZE_EXPLAIN']; ?>
x
    
+ +
+ +lang['BYTES'], $user->lang['KB'], $user->lang['MB']); + $size_types = array('b', 'kb', 'mb'); + + $select_field = ''; + + return ($select_field); +} + +// Test Settings +function test_upload(&$error, &$error_msg, $upload_dir, $ftp_path, $ftp_upload_allowed, $create_directory = false) +{ + global $user; + + $error = FALSE; + + // Does the target directory exist, is it a directory and writeable. (only test if ftp upload is disabled) + if (!$ftp_upload_allowed) + { + if ($create_directory) + { + if (!@file_exists($upload_dir)) + { + @mkdir($upload_dir, 0755); + @chmod($upload_dir, 0777); + } + } + + if (!@file_exists($upload_dir)) + { + $error = TRUE; + $error_msg = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $new['upload_dir']) . '
'; + } + + if (!$error && !is_dir($upload_dir)) + { + $error = TRUE; + $error_msg = sprintf($user->lang['DIRECTORY_IS_NOT_A_DIR'], $new['upload_dir']) . '
'; + } + + if (!$error) + { + if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) + { + $error = TRUE; + $error_msg = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $new['upload_dir']) . '
'; + } + else + { + @fclose($fp); + @unlink($upload_dir . '/0_000000.000'); + } + } + } + else + { + // Check FTP Settings + $server = ( empty($new['ftp_server']) ) ? 'localhost' : $new['ftp_server']; + $conn_id = @ftp_connect($server); + + if (!$conn_id) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_CONNECT'], $server) . '
'; + } + + $login_result = @ftp_login($conn_id, $new['ftp_user'], $new['ftp_pass']); + + if (!$login_result && !$error) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_LOGIN'], $new['ftp_user']) . '
'; + } + + if (!@ftp_pasv($conn_id, intval($new['ftp_pasv_mode']))) + { + $error = TRUE; + $error_msg = $user->lang['FTP_ERROR_PASV_MODE']; + } + + if (!$error) + { + // Check Upload + $tmpfname = @tempnam('/tmp', 't0000'); + @unlink($tmpfname); // unlink for safety on php4.0.3+ + $fp = @fopen($tmpfname, 'w'); + @fwrite($fp, 'test'); + @fclose($fp); + + if ($create_directory) + { + $result = @ftp_chdir($conn_id, $ftp_path); + + if (!$result) + { + @ftp_mkdir($conn_id, $ftp_path); + } + } + + $result = @ftp_chdir($conn_id, $ftp_path); + + if (!$result) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_PATH'], $ftp_path) . '
'; + } + else + { + $res = @ftp_put($conn_id, 't0000', $tmpfname, FTP_ASCII); + + if (!$res) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_UPLOAD'], $ftp_path) . '
'; + } + else + { + $res = @ftp_delete($conn_id, 't0000'); + + if (!$res) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_DELETE'], $ftp_path) . '
'; + } + } + } + + @ftp_quit($conn_id); + @unlink($tmpfname); + } + } +} + +// Get supported Image types +function get_supported_image_types() +{ + $types = array(); + + if (@extension_loaded('gd')) + { + if (@function_exists('imagegif')) + { + $types[] = '1'; + } + if (@function_exists('imagejpeg')) + { + $types[] = '2'; + } + if (@function_exists('imagepng')) + { + $types[] = '3'; + } + } + + return ($types); +} + ?> \ No newline at end of file diff --git a/phpBB/common.php b/phpBB/common.php index 413968087a..5e5a5378c0 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -112,9 +112,11 @@ define('PHYSICAL_LINK', 2); // Categories - Attachments define('NONE_CAT', 0); -define('IMAGE_CAT', 1); -define('STREAM_CAT', 2); -//define('SWF_CAT', 3); +define('IMAGE_CAT', 1); // Inline Images +define('WM_CAT', 2); // Windows Media Files - Streaming +define('RM_CAT', 3); // Real Media Files - Streaming +define('THUMB_CAT', 4); // Not used within the database, only while displaying posts +//define('SWF_CAT', 5); // Replaced by [flash] ? or an additional possibility ? // BBCode UID length define('BBCODE_UID_LEN', 5); diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 631942f4bd..542ae39435 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -373,7 +373,7 @@ class Template $template_php = str_replace(' ?> 'in', 'EVT_CREATED' => 'The event has been successfully created.', + 'ATTACHMENTS' => 'Attachments', + 'ATTACH_CONFIG_UPDATED' => 'Attachment configuration updated successfully', + 'ATTACHMENT_CONFIG' => 'Attachment Configuration', 'ATTACH_MANAGE_URL' => 'Configuration', 'ATTACH_CATS_URL' => 'Special Categories', @@ -926,6 +929,25 @@ $lang = array_merge($lang, array( 'FTP_ERROR_UPLOAD' => 'Could not upload files to ftp directory: \'%s\'. Please check your FTP Settings.', 'FTP_ERROR_DELETE' => 'Could not delete files in ftp directory: \'%s\'. Please check your FTP Settings.', + 'MANAGE_CATEGORIES' => 'Manage Special Categories', + 'MANAGE_CATEGORIES_EXPLAIN' => 'Here you can configure the Special Categories. You can set up Special Parameters and Conditions for the Special Categories assigned to one or more Extension Groups.', + 'SETTINGS_CAT_IMAGES' => 'Settings for Special Category: Images', + 'ASSIGNED_GROUP' => 'Assigned Group', + 'DISPLAY_INLINED' => 'Display Images Inlined', + 'DISPLAY_INLINED_EXPLAIN' => 'Choose whether to display images directly within the post (yes) or to display images as a link ?', + 'CREATE_THUMBNAIL' => 'Create Thumbnail', + 'CREATE_THUMBNAIL_EXPLAIN' => 'Always create a Thumbnail. This feature overrides nearly all Settings within this Special Category, except of the Maximum Image Dimensions. With this Feature a Thumbnail will be displayed within the post, the User can click it to open the real Image.
Please Note that this feature requires Imagick to be installed, if it\'s not installed or if Safe-Mode is enabled the GD-Extension of PHP will be used. If the Image-Type is not supported by PHP, this Feature will be not used.', + 'MIN_THUMB_FILESIZE' => 'Minimum Thumbnail Filesize', + 'MIN_THUMB_FILESIZE_EXPLAIN' => 'If an Image is smaller than this defined Filesize no Thumbnail will be created, because it\'s small enough.', + 'IMAGICK_PATH' => 'Imagick Program (Complete Path)', + 'IMAGICK_PATH_EXPLAIN' => 'Enter the Path to the convert program of imagick, normally /usr/bin/convert (on windows: c:/imagemagick/convert.exe).', + 'SEARCH_IMAGICK' => 'Search Imagick', + 'MAX_IMAGE_SIZE' => 'Maximum Image Dimensions', + 'MAX_IMAGE_SIZE_EXPLAIN' => 'Here you can define the maximum allowed Image Dimension to be attached (Width x Height in pixels).
If it is set to 0x0, this feature is disabled. With some Images this Feature will not work due to limitations in PHP.', + 'IMAGE_LINK_SIZE' => 'Image Link Dimensions', + 'IMAGE_LINK_SIZE_EXPLAIN' => 'If this defined Dimension of an Image is reached, the Image will be displayed as a Link, rather than displaying it inlined,
if Inline View is enabled (Width x Height in pixels).
If it is set to 0x0, this feature is disabled. With some Images this Feature will not work due to limitations in PHP.', + + 'WELCOME_INSTALL' => 'Welcome to phpBB 2 Installation', 'INITIAL_CONFIG' => 'Basic Configuration', 'DB_CONFIG' => 'Database Configuration', diff --git a/phpBB/templates/subSilver/viewtopic_attach_body.html b/phpBB/templates/subSilver/viewtopic_attach_body.html index c94d378f5c..b1fa754d56 100644 --- a/phpBB/templates/subSilver/viewtopic_attach_body.html +++ b/phpBB/templates/subSilver/viewtopic_attach_body.html @@ -4,7 +4,7 @@ [{postrow.attachment.L_DENIED}]

- + {postrow.attachment.COMMENT}
@@ -19,6 +19,40 @@
{postrow.attachment.DOWNLOAD_NAME} - {postrow.attachment.L_DOWNLOADED_VIEWED} {postrow.attachment.L_DOWNLOAD_COUNT}

+ + {postrow.attachment.COMMENT}
+ + + + + + + + + +
+ + + + + + + +
{postrow.attachment.DOWNLOAD_NAME} - {postrow.attachment.L_DOWNLOADED_VIEWED} {postrow.attachment.L_DOWNLOAD_COUNT}

{postrow.attachment.COMMENT}
{postrow.attachment.DOWNLOAD_NAME}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9d9068b72d..0e64b3314a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1102,8 +1102,7 @@ foreach ($rowset as $key => $row) $comment = stripslashes(trim(nl2br($attachment['comment']))); $denied = false; - - // Admin is allowed to view forbidden Attachments + if ((!in_array($attachment['extension'], $extensions['_allowed_']))) { $denied = true; @@ -1116,165 +1115,161 @@ foreach ($rowset as $key => $row) if (!$denied) { - // define category - $image = FALSE; - $stream = FALSE; -// $swf = FALSE; - $thumbnail = FALSE; - $link = FALSE; - $l_downloaded_viewed = ''; $download_link = ''; $additional_array = array(); - switch (intval($extensions[$attachment['extension']]['display_cat'])) + $display_cat = intval($extensions[$attachment['extension']]['display_cat']); + + if ($display_cat == IMAGE_CAT) { - case STREAM_CAT: - $stream = TRUE; - break; -/* - case SWF_CAT: - $swf = TRUE; - break; -*/ - case IMAGE_CAT: + if ($attachment['thumbnail']) + { + $display_cat = THUMB_CAT; + } + else + { + $display_cat = NONE_CAT; + if (intval($config['img_display_inlined'])) { if ( (intval($config['img_link_width']) != 0) || (intval($config['img_link_height']) != 0) ) { list($width, $height) = image_getdimension($filename); - $image = (($width == 0) && ($height == 0)) ? true : ((($width <= intval($config['img_link_width'])) && ($height <= intval($config['img_link_height']))) ? true : false); + $display_cat = (($width == 0) && ($height == 0)) ? IMAGE_CAT : ((($width <= intval($config['img_link_width'])) && ($height <= intval($config['img_link_height']))) ? IMAGE_CAT : NONE_CAT); } } else { - $image = TRUE; + $display_cat = IMAGE_CAT; } - - if ($attachment['thumbnail']) + } + } + + switch ($display_cat) + { + case IMAGE_CAT: + // Images + // NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the + // Section between BEGIN and END with (Without the // of course): + // $img_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; + // + // BEGIN + if (!empty($config['ftp_upload']) && trim($config['upload_dir']) == '') { - $thumbnail = TRUE; - $image = FALSE; + $img_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; + } + else + { + $img_source = $filename; + $update_count[] = $attachment['attach_id']; + } + // END + + $l_downloaded_viewed = $user->lang['VIEWED']; + $download_link = $img_source; + break; + + case THUMB_CAT: + // Images, but display Thumbnail + // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the + // Section between BEGIN and END with (Without the // of course): + // $thumb_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'] . '&thumb=1'; + // + // BEGIN + if (!empty($config['allow_ftp_upload']) && trim($config['upload_dir']) == '') + { + $thumb_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'] . '&thumb=1'; + } + else + { + $thumb_source = $thumbnail_filename; + } + // END + + $l_downloaded_viewed = $user->lang['VIEWED']; + $download_link = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; + + $additional_array = array( + 'IMG_THUMB_SRC' => $thumb_source + ); + break; + + case WM_CAT: + // Windows Media Streams + $l_downloaded_viewed = $user->lang['VIEWED']; + $download_link = $filename; + + // Viewed/Heared File ... update the download count (download.php is not called here) + if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) + { + $update_count[] = $attachment['attach_id']; } break; - } - - // && !$swf - if (!$image && !$stream && !$thumbnail) - { - $link = TRUE; - } + case RM_CAT: + // Real Media Streams + $l_downloaded_viewed = $user->lang['VIEWED']; + $download_link = $filename; - if ($image) - { - // Images - // NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the - // Section between BEGIN and END with (Without the // of course): - // $img_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; - // - // BEGIN - if (!empty($config['ftp_upload']) && trim($config['upload_dir']) == '') - { - $img_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; - } - else - { - $img_source = $filename; - $update_count[] = $attachment['attach_id']; - } - // END + $additional_array = array( + 'FORUM_URL' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'] + ); - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $img_source; - } - - if ($thumbnail) - { - // Images, but display Thumbnail - // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the - // Section between BEGIN and END with (Without the // of course): - // $thumb_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'] . '&thumb=1'; - // - // BEGIN - if (!empty($config['allow_ftp_upload']) && trim($config['upload_dir']) == '') - { - $thumb_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'] . '&thumb=1'; - } - else - { - $thumb_source = $thumbnail_filename; - } - // END - - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; - - $additional_array = array( - 'IMG_THUMB_SRC' => $thumb_source - ); - } - - if ($stream) - { - // Streams - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $filename; -// $download_link = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; - - // Viewed/Heared File ... update the download count (download.php is not called here) - if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) - { - $update_count[] = $attachment['attach_id']; - } - } + // Viewed/Heared File ... update the download count (download.php is not called here) + if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) + { + $update_count[] = $attachment['attach_id']; + } + break; /* - if ($swf) - { - // Macromedia Flash Files - list($width, $height) = swf_getdimension($filename); + case SWF_CAT: + // Macromedia Flash Files + list($width, $height) = swf_getdimension($filename); - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $filename; + $l_downloaded_viewed = $user->lang['VIEWED']; + $download_link = $filename; - $additional_array = array( - 'WIDTH' => $width, - 'HEIGHT' => $height - ); + $additional_array = array( + 'WIDTH' => $width, + 'HEIGHT' => $height + ); - // Viewed/Heared File ... update the download count (download.php is not called here) - $update_count[] = $attachment['attach_id']; - } + // Viewed/Heared File ... update the download count (download.php is not called here) + if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) + { + $update_count[] = $attachment['attach_id']; + } + break; */ - if ($link) - { - $l_downloaded_viewed = $user->lang['DOWNLOADED']; - $download_link = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; + default: + $l_downloaded_viewed = $user->lang['DOWNLOADED']; + $download_link = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id']; + break; } - - if ($image || $thumbnail || $stream || $link) - { - $template_array = array_merge($additional_array, array( -// 'IS_FLASH' => ($swf) ? true : false, - 'IS_STREAM' => ($stream) ? true : false, - 'IS_THUMBNAIL' => ($thumbnail) ? true : false, - 'IS_IMAGE' => ($image) ? true : false, - 'DOWNLOAD_NAME' => $display_name, - 'FILESIZE' => $filesize, - 'SIZE_VAR' => $size_lang, - 'COMMENT' => $comment, - 'U_DOWNLOAD_LINK' => $download_link, + $template_array = array_merge($additional_array, array( +// 'IS_FLASH' => ($display_cat == SWF_CAT) ? true : false, + 'IS_WM_STREAM' => ($display_cat == WM_CAT) ? true : false, + 'IS_RM_STREAM' => ($display_cat == RM_CAT) ? true : false, + 'IS_THUMBNAIL' => ($display_cat == THUMB_CAT) ? true : false, + 'IS_IMAGE' => ($display_cat == IMAGE_CAT) ? true : false, + 'DOWNLOAD_NAME' => $display_name, + 'FILESIZE' => $filesize, + 'SIZE_VAR' => $size_lang, + 'COMMENT' => $comment, - 'UPLOAD_IMG' => $upload_image, + 'U_DOWNLOAD_LINK' => $download_link, - 'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed, - 'L_DOWNLOAD_COUNT' => sprintf($user->lang['DOWNLOAD_NUMBER'], $attachment['download_count'])) - ); + 'UPLOAD_IMG' => $upload_image, + + 'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed, + 'L_DOWNLOAD_COUNT' => sprintf($user->lang['DOWNLOAD_NUMBER'], $attachment['download_count'])) + ); - $template->assign_block_vars('postrow.attachment', $template_array); - } + $template->assign_block_vars('postrow.attachment', $template_array); } } }