+
+
+
+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}]