diff options
-rw-r--r-- | phpBB/adm/admin_attachments.php | 551 | ||||
-rw-r--r-- | phpBB/common.php | 2 | ||||
-rw-r--r-- | phpBB/config.php | 16 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_basic.sql | 1 | ||||
-rw-r--r-- | phpBB/language/en/lang_admin.php | 51 | ||||
-rw-r--r-- | phpBB/posting.php | 2 | ||||
-rw-r--r-- | phpBB/templates/subSilver/index_body.html | 2 | ||||
-rw-r--r-- | phpBB/templates/subSilver/posting_body.html | 11 |
8 files changed, 630 insertions, 6 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php new file mode 100644 index 0000000000..22de35990b --- /dev/null +++ b/phpBB/adm/admin_attachments.php @@ -0,0 +1,551 @@ +<?php +/*************************************************************************** + * admin_attachments.php + * ------------------- + * begin : Sunday, Apr 20, 2003 + * copyright : (C) 2003 The phpBB Group + * email : support@phpbb.com + * + * $Id$ + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +if (!empty($setmodules)) +{ + $filename = basename(__FILE__); + $module['POST']['ATTACHMENTS'] = ($auth->acl_get('a_attach')) ? $filename . $SID . '&mode=manage' : ''; + + return; +} + +define('IN_PHPBB', 1); +// Include files +$phpbb_root_path = '../'; +require($phpbb_root_path . 'extension.inc'); +require('pagestart.' . $phpEx); + +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 = '<select name="' . $select_name . '">'; + + for ($i = 0; $i < count($size_types_text); $i++) + { + $selected = ($size_compare == $size_types[$i]) ? ' selected="selected"' : ''; + + $select_field .= '<option value="' . $size_types[$i] . '"' . $selected . '>' . $size_types_text[$i] . '</option>'; + } + + $select_field .= '</select>'; + + 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']) . '<br />'; + } + + if (!$error && !is_dir($upload_dir)) + { + $error = TRUE; + $error_msg = sprintf($user->lang['DIRECTORY_IS_NOT_A_DIR'], $new['upload_dir']) . '<br />'; + } + + if (!$error) + { + if ( !($fp = @fopen($upload_dir . '/0_000000.000', 'w')) ) + { + $error = TRUE; + $error_msg = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $new['upload_dir']) . '<br />'; + } + 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) . '<br />'; + } + + $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']) . '<br />'; + } + + 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) . '<br />'; + } + else + { + $res = @ftp_put($conn_id, 't0000', $tmpfname, FTP_ASCII); + + if (!$res) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_UPLOAD'], $ftp_path) . '<br />'; + } + else + { + $res = @ftp_delete($conn_id, 't0000'); + + if (!$res) + { + $error = TRUE; + $error_msg = sprintf($user->lang['FTP_ERROR_DELETE'], $ftp_path) . '<br />'; + } + } + } + + @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'); + +foreach ($config_sizes as $cfg_key => $var) +{ + $$var = (isset($_REQUEST[$var])) ? htmlspecialchars($_REQUEST[$var]) : ''; +} + +$submit = (isset($_POST['submit'])) ? TRUE : FALSE; +$search_imagick = (isset($_POST['search_imagick'])) ? TRUE : FALSE; + +$error = $notify = false; +$error_msg = $notify_msg = ''; + +// Pull all config data +$sql = "SELECT * + FROM " . CONFIG_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + $config_name = $row['config_name']; + $config_value = $row['config_value']; + + $default_config[$config_name] = $config_value; + $new[$config_name] = (isset($_POST[$config_name])) ? $_POST[$config_name] : $default_config[$config_name]; + + foreach ($config_sizes as $cfg_key => $var) + { + if (empty($$var) && !$submit && $config_name == $cfg_key) + { + $$var = (intval($default_config[$config_name]) >= 1048576) ? 'mb' : ((intval($default_config[$config_name]) >= 1024) ? 'kb' : 'b'); + } + + if (!$submit && $config_name == $cfg_key) + { + if ($new[$config_name] >= 1048576) + { + $new[$config_name] = round($new[$config_name] / 1048576 * 100) / 100; + } + else if($new[$config_name] >= 1024) + { + $new[$config_name] = round($new[$config_name] / 1024 * 100) / 100; + } + } + + if ($submit && $mode == 'manage' && $config_name == $cfg_key) + { + $old = $new[$config_name]; + $new[$config_name] = ($$var == 'kb') ? round($new[$config_name] * 1024) : (($$var == 'mb') ? round($new[$config_name] * 1048576) : $new[$config_name]); + } + } + + if ($submit && $mode == 'manage') + { + // Update Extension Group Filesizes + if ($config_name == 'max_filesize') + { + $old_size = intval($default_config[$config_name]); + $new_size = intval($new[$config_name]); + + if ($old_size != $new_size) + { + // See, if we have a similar value of old_size in Extension Groups. If so, update these values. + $sql = "UPDATE " . EXTENSION_GROUPS_TABLE . " + SET max_filesize = " . $new_size . " + WHERE max_filesize = " . $old_size; + $db->sql_query($sql); + } + } + + set_config($config_name, stripslashes($new[$config_name])); + + if (in_array($config_name, array('max_filesize', 'attachment_quota', 'max_filesize_pm'))) + { + $new[$config_name] = $old; + } + } +} + +if ($submit && $mode == 'manage') +{ + add_log('admin', 'LOG_SETTING_CONFIG'); + $notify = TRUE; + $notify_msg = $user->lang['Config_updated']; +} + +// Adjust the Upload Directory +if (!$new['allow_ftp_upload']) +{ + if ( ($new['upload_dir'][0] == '/') || ( ($new['upload_dir'][0] != '/') && ($new['upload_dir'][1] == ':') ) ) + { + $upload_dir = $new['upload_dir']; + } + else + { + $upload_dir = $phpbb_root_path . $new['upload_dir']; + } +} +else +{ + $upload_dir = $new['download_path']; +} + +switch ($mode) +{ + case 'manage': + $l_title = 'ATTACHMENT_CONFIG'; + break; +} + +// Temporary Language Variables + +page_header($user->lang[$l_title]); + +// Search Imagick +if ($search_imagick) +{ + $imagick = ''; + + if (eregi('convert', $imagick)) + { + continue; + } + else if ($imagick != 'none') + { + if (!eregi('WIN', PHP_OS)) + { + $retval = @exec('whereis convert'); + $paths = explode(' ', $retval); + + if (is_array($paths)) + { + foreach($paths as $path) + { + if (basename($path) == 'convert') + { + $imagick = $path; + } + } + } + } + else if (eregi('WIN', PHP_OS)) + { + $path = 'c:/imagemagick/convert.exe'; + + if (@file_exists($path)) + { + $imagick = $path; + } + } + } + + $new['img_imagick'] = (@file_exists(trim($imagick))) ? trim($imagick) : ''; +} + +// Check Settings +if ($submit && $mode == 'manage') +{ + $upload_dir = ( ($new['upload_dir'][0] == '/') || ($new['upload_dir'][0] != '/' && $new['upload_dir'][1] == ':') ) ? $new['upload_dir'] : $phpbb_root_path . $new['upload_dir']; + + test_upload($error, $error_msg, $upload_dir, $new['ftp_path'], $new['allow_ftp_upload'], false); +} + + +if ($submit && $mode == 'cats') +{ + $upload_dir = ( ($new['upload_dir'][0] == '/') || ($new['upload_dir'][0] != '/' && $new['upload_dir'][1] == ':') ) ? $new['upload_dir'] . '/thumbs' : $phpbb_root_path . $new['upload_dir'] . '/thumbs'; + test_upload($error, $error_msg, $upload_dir, $new['ftp_path'] . '/thumbs', $new['allow_ftp_upload'], true); +} + +?> + +<h1><?php echo $user->lang[$l_title]; ?></h1> + +<p><?php echo $user->lang[$l_title . '_EXPLAIN']; ?></p> + +<?php +if ($error) +{ +?> + +<h2 style="color:red"><?php echo $user->lang['WARNING']; ?></h2> + +<p><?php echo $error_msg; ?></p> + +<?php +} +else if ($notify) +{ +?> + +<h2 style="color:green"><?php echo $user->lang['NOTIFY']; ?></h2> + +<p><?php echo $notify_msg; ?></p> + +<?php +} + +$modes = array('manage', 'cats', 'extensions'); + +$select_size_mode = size_select('size', $size); +$select_quota_size_mode = size_select('quota_size', $quota_size); +$select_pm_size_mode = size_select('pm_size', $pm_size); + +?> +<form action="admin_attachments.<?php echo $phpEx . $SID . "&mode=$mode"; ?>" method="post"> + <table cellspacing="1" cellpadding="0" border="0" align="center" width="100%"> + <tr> + <td align="right"> +<?php + for ($i = 0; $i < count($modes); $i++) + { + if ($i != 0) + { + ?> | <?php + } + + if ($mode != $modes[$i]) + { + ?><a href="admin_attachments.<?php echo $phpEx . $SID . '&mode=' . $modes[$i]; ?>"><?php + } + + echo $user->lang['ATTACH_' . strtoupper($modes[$i]) . '_URL']; + + if ($mode != $modes[$i]) + { + ?></a><?php + } + } +?> </td> + </tr> + </table> +<?php + +if ($mode == 'manage') +{ + + $yes_no_switches = array('disable_mod', 'allow_pm_attach', 'allow_ftp_upload', 'display_order', 'ftp_pasv_mode'); + + for ($i = 0; $i < count($yes_no_switches); $i++) + { + eval("\$" . $yes_no_switches[$i] . "_yes = ( \$new['" . $yes_no_switches[$i] . "']) ? 'checked=\"checked\"' : '';"); + eval("\$" . $yes_no_switches[$i] . "_no = ( !\$new['" . $yes_no_switches[$i] . "']) ? 'checked=\"checked\"' : '';"); + } + +?> + <table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th align="center" colspan="2"><?php echo $user->lang['ATTACHMENT_SETTINGS']; ?></th> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['UPLOAD_DIR']; ?>:<br /><span class="gensmall"><?php echo $user->lang['UPLOAD_DIR_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="25" maxlength="100" name="upload_dir" class="post" value="<?php echo $new['upload_dir'] ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['DISPLAY_ORDER']; ?>:<br /><span class="gensmall"><?php echo $user->lang['DISPLAY_ORDER_EXPLAIN']; ?></span></td> + <td class="row2"> + <table border=0 cellpadding=0 cellspacing=0> + <tr> + <td><input type="radio" name="display_order" value="0" <?php echo $display_order_no; ?> /> <?php echo $user->lang['DESCENDING']; ?></td> + </tr> + <tr> + <td><input type="radio" name="display_order" value="1" <?php echo $display_order_yes; ?> /> <?php echo $user->lang['ASCENDING']; ?></td> + </tr> + </table></td> + </tr> + <tr> + <td class="spacer" colspan="2" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['ATTACH_MAX_FILESIZE']; ?>:<br /><span class="gensmall"><?php echo $user->lang['ATTACH_MAX_FILESIZE_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="8" maxlength="15" name="max_filesize" class="post" value="<?php echo $new['max_filesize']; ?>" /> <?php echo $select_size_mode; ?></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['ATTACH_QUOTA']; ?>:<br /><span class="gensmall"><?php echo $user->lang['ATTACH_QUOTA_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="8" maxlength="15" name="attachment_quota" class="post" value="<?php echo $new['attachment_quota']; ?>" /> <?php echo $select_quota_size_mode; ?></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['ATTACH_MAX_PM_FILESIZE']; ?>:<br /><span class="gensmall"><?php echo $user->lang['ATTACH_MAX_PM_FILESIZE_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="8" maxlength="15" name="max_filesize_pm" class="post" value="<?php echo $new['max_filesize_pm']; ?>" /> <?php echo $select_pm_size_mode; ?></td> + </tr> + <tr> + <td class="spacer" colspan="2" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['MAX_ATTACHMENTS'] ?>:<br /><span class="gensmall"><?php echo $user->lang['MAX_ATTACHMENTS_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="3" maxlength="3" name="max_attachments" class="post" value="<?php echo $new['max_attachments']; ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['MAX_ATTACHMENTS_PM'] ?>:<br /><span class="gensmall"><?php echo $user->lang['MAX_ATTACHMENTS_PM_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="3" maxlength="3" name="max_attachments_pm" class="post" value="<?php echo $new['max_attachments_pm']; ?>" /></td> + </tr> + <tr> + <td class="spacer" colspan="2" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['PM_ATTACH']; ?>:<br /><span class="gensmall"><?php echo $user->lang['PM_ATTACH_EXPLAIN']; ?></span></td> + <td class="row2"><input type="radio" name="allow_pm_attach" value="1" <?php echo $allow_pm_attach_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_pm_attach" value="0" <?php echo $allow_pm_attach_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> +<?php + if (!function_exists('ftp_connect')) + { +?> + + <input type="hidden" name="allow_ftp_upload" value="0" /> + <tr> + <td class="spacer" colspan="2" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row1" colspan="2" align="center"><span class="gen"><?php echo $user->lang['NO_FTP_EXTENSIONS_INSTALLED']; ?></span></td> + </tr> + +<?php + } + else + { +?> + + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_UPLOAD']; ?>:<br /><span class="gensmall"><?php echo $user->lang['FTP_UPLOAD_EXPLAIN']; ?></span></td> + <td class="row2"><input type="radio" name="allow_ftp_upload" value="1" <?php echo $allow_ftp_upload_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_ftp_upload" value="0" <?php echo $allow_ftp_upload_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="spacer" colspan="2" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_SERVER']; ?>:<br /><span class="gensmall"><?php echo $user->lang['FTP_SERVER_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="20" maxlength="100" name="ftp_server" class="post" value="<?php echo $new['ftp_server']; ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['ATTACH_FTP_PATH']; ?>:<br /><span class="gensmall"><?php echo $user->lang['ATTACH_FTP_PATH_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="20" maxlength="100" name="ftp_path" class="post" value="<?php echo $new['ftp_path']; ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_DOWNLOAD_PATH']; ?>:<br /><span class="gensmall"><?php echo $user->lang['FTP_DOWNLOAD_PATH_EXPLAIN']; ?></span></td> + <td class="row2"><input type="text" size="20" maxlength="100" name="download_path" class="post" value="<?php echo $new['download_path']; ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_PASSIVE_MODE']; ?>:<br /><span class="gensmall"><?php echo $user->lang['FTP_PASSIVE_MODE_EXPLAIN']; ?></span></td> + <td class="row2"><input type="radio" name="ftp_pasv_mode" value="1" <?php echo $ftp_pasv_mode_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="ftp_pasv_mode" value="0" <?php echo $ftp_pasv_mode_no; ?> /> <?php echo $user->lang['NO']; ?></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_USER']; ?>:</td> + <td class="row2"><input type="text" size="20" maxlength="100" name="ftp_user" class="post" value="<?php echo $new['ftp_user']; ?>" /></td> + </tr> + <tr> + <td class="row1" width="50%"><?php echo $user->lang['FTP_PASS']; ?>:</td> + <td class="row2"><input type="password" size="10" maxlength="20" name="ftp_pass" class="post" value="<?php echo $new['ftp_path']; ?>" /></td> + </tr> +<?php + } +?> + <tr> + <td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td> + </tr> +</table></form> + +<br clear="all" /> + +<?php +} + +page_footer(); + +?>
\ No newline at end of file diff --git a/phpBB/common.php b/phpBB/common.php index f4d4969ffa..413968087a 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -138,7 +138,7 @@ define('FORUMS_WATCH_TABLE', $table_prefix.'forums_watch'); define('GROUPS_TABLE', $table_prefix.'groups'); define('GROUPS_MODERATOR_TABLE', $table_prefix.'groups_moderator'); define('ICONS_TABLE', $table_prefix.'icons'); -define('LASTREAD_TABLE', $table_prefix.'lastread'); +define('TOPICS_TRACK_TABLE', $table_prefix.'topics_marking'); define('LOG_ADMIN_TABLE', $table_prefix.'log_admin'); define('LOG_MOD_TABLE', $table_prefix.'log_moderator'); define('MODERATOR_TABLE', $table_prefix.'moderator_cache'); diff --git a/phpBB/config.php b/phpBB/config.php index e69de29bb2..d665f36559 100644 --- a/phpBB/config.php +++ b/phpBB/config.php @@ -0,0 +1,16 @@ +<?php +// phpBB 2.x auto-generated config file +// Do not change anything in this file! +$dbms = 'mysql'; +$dbhost = 'localhost'; +$dbport = ''; +$dbname = 'phpbb'; +$dbuser = 'root'; +$dbpasswd = 'rootdb'; + +$table_prefix = 'phpbb_'; +$acm_type = 'file'; +$load_extensions = ''; + +define('PHPBB_INSTALLED', true); +?>
\ No newline at end of file diff --git a/phpBB/install/schemas/mysql_basic.sql b/phpBB/install/schemas/mysql_basic.sql index 4ddd73565a..a81b28cc84 100644 --- a/phpBB/install/schemas/mysql_basic.sql +++ b/phpBB/install/schemas/mysql_basic.sql @@ -92,6 +92,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('lastread', '432000'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_ftp_upload', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_filesize', '262144'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('attachment_quota', '52428800'); diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 5b1aefe714..afe39d5fd9 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -261,6 +261,7 @@ $lang = array_merge($lang, array( 'EMPTY' => 'Empty', 'WARNING' => 'Warning', 'WARNING_EXPLAIN' => 'You have altered settings for one or alternative views. Be sure to verify these settings before updating', + 'NOTIFY' => 'Notification', 'SELECTED_USER' => 'Selected User', 'SELECTED_USERS' => 'Selected Users', 'SELECTED_GROUP' => 'Selected Group', @@ -874,6 +875,56 @@ $lang = array_merge($lang, array( 'EVT_IN' => 'in', 'EVT_CREATED' => 'The event has been successfully created.', + 'ATTACHMENT_CONFIG' => 'Attachment Configuration', + 'ATTACH_MANAGE_URL' => 'Configuration', + 'ATTACH_CATS_URL' => 'Special Categories', + 'ATTACH_EXTENSIONS_URL' => 'Extensions', + 'ATTACHMENT_SETTINGS' => 'Attachment Settings', + 'ATTACHMENT_CONFIG_EXPLAIN' => 'Here you can configure the Main Settings for Attachments and the associated Special Categories.', + + 'UPLOAD_DIR' => 'Upload Directory', + 'UPLOAD_DIR_EXPLAIN' => 'Enter the relative path from your phpBB2 installation to the Attachments upload directory. For example, enter \'files\' if your phpBB2 Installation is located at http://www.yourdomain.com/phpBB2 and the Upload Directory is located at http://www.yourdomain.com/phpBB2/files.', + 'DISPLAY_ORDER' => 'Attachment Display Order', + 'DISPLAY_ORDER_EXPLAIN' => 'Here you can choose whether to display the Attachments in Posts/PMs in Descending Filetime Order (Newest Attachment First) or Ascending Filetime Order (Oldest Attachment First).', + + 'ATTACH_MAX_FILESIZE' => 'Filesize', + 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum filesize for Attachments. A value of 0 means \'unlimited\'. The real upload limit is restricted by your Server Configuration. For example, if your php Configuration only allows a maximum of 2 MB uploads, this cannot be overwritten by this Setting.', + 'ATTACH_QUOTA' => 'Attachment Quota', + 'ATTACH_QUOTA_EXPLAIN' => 'Maximum Disk Space ALL Attachments can hold on your Webspace. A value of 0 means \'unlimited\'.', + 'ATTACH_MAX_PM_FILESIZE' => 'Maximum Filesize in Private Messages Folder', + 'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum Disk Space Attachments can use up in each User\'s Private Message box. A value of 0 means \'unlimited\'.', + + 'MAX_ATTACHMENTS' => 'Maximum Number of Attachments', + 'MAX_ATTACHMENTS_EXPLAIN' => 'The maximum number of attachments allowed in one post.', + 'MAX_ATTACHMENTS_PM' => 'Maximum number of Attachments in one Private Message', + 'MAX_ATTACHMENTS_PM_EXPLAIN' => 'Define the maximum number of attachments the user is allowed to include in a private message.', + + 'PM_ATTACH' => 'Allow Attachments in Private Messages', + 'PM_ATTACH_EXPLAIN' => 'Allow/Disallow attaching files to Private Messages.', + 'FTP_UPLOAD' => 'Enable FTP Upload', + 'FTP_UPLOAD_EXPLAIN' => 'Enable/Disable the FTP Upload option. If you set it to yes, you have to define the Attachment FTP Settings and the Upload Directory is no longer used.', + + 'FTP_SERVER' => 'FTP Upload Server', + 'FTP_SERVER_EXPLAIN' => 'Here you can enter the IP-Address or FTP-Hostname of the Server used for your uploaded files. If you leave this field empty, the Server on which your phpBB2 Board is installed will be used. Please note that it is not allowed to add ftp:// or something else to the address, just plain ftp.foo.com or, which is a lot faster, the plain IP Address.', + + 'ATTACH_FTP_PATH' => 'FTP Path to your upload directory', + 'ATTACH_FTP_PATH_EXPLAIN' => 'The Directory where your Attachments will be stored. This Directory doesn\'t have to be chmodded. Please don\'t enter your IP or FTP-Address here, this input field is only for the FTP Path.<br />For example: /home/web/uploads', + 'FTP_DOWNLOAD_PATH' => 'Download Link to FTP Path', + 'FTP_DOWNLOAD_PATH_EXPLAIN' => 'Enter the URL to your FTP Path, where your Attachments are stored.<br />If you are using a Remote FTP Server, please enter the complete url, for example http://www.mystorage.com/phpBB2/upload.<br />If you are using your Local Host to store your Files, you are able to enter the url path relative to your phpBB2 Directory, for example \'upload\'.<br />A trailing slash will be removed. Leave this field empty, if the FTP Path is not accessible from the Internet. With this field empty you are unable to use the physical download method.', + 'FTP_PASSIVE_MODE' => 'Enable FTP Passive Mode', + 'FTP_PASSIVE_MODE_EXPLAIN' => 'The PASV command requests that the remote server open a port for the data connection and return the address of that port. The remote server listens on that port and the client connects to it.', + + 'NO_FTP_EXTENSIONS_INSTALLED' => 'You are not able to use the FTP Upload Methods, because FTP Extensions are not compiled into your PHP Installation.', + 'DIRECTORY_DOES_NOT_EXIST' => 'The Directory \'%s\' does not exist or couldn\'t be found.', + 'DIRECTORY_IS_NOT_A_DIR' => 'Please check if \'%s\' is a directory.', + 'DIRECTORY_NOT_WRITEABLE' => 'Directory \'%s\' is not writeable. You\'ll have to create the upload path and chmod it to 777 (or change the owner to you httpd-servers owner) to upload files.<br />If you have only plain ftp-access change the \'Attribute\' of the directory to rwxrwxrwx.', + + 'FTP_ERROR_CONNECT' => 'Could not connect to FTP Server: \'%s\'. Please check your FTP-Settings.', + 'FTP_ERROR_LOGIN' => 'Could not login to FTP Server. The Username \'%s\' or the Password is wrong. Please check your FTP-Settings.', + 'FTP_ERROR_PASV_MODE' => 'Unable to enable/disable FTP Passive Mode', + 'FTP_ERROR_PATH' => 'Could not access ftp directory: \'%s\'. Please check your FTP Settings.', + '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.', 'WELCOME_INSTALL' => 'Welcome to phpBB 2 Installation', 'INITIAL_CONFIG' => 'Basic Configuration', diff --git a/phpBB/posting.php b/phpBB/posting.php index a472cb3f55..d74963cc07 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -701,6 +701,7 @@ if (($submit) || ($preview) || ($refresh)) // Validate username if (($username != '' && $user->data['user_id'] == ANONYMOUS) || ($mode == 'edit' && $post_username != '')) { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $userdata = new userdata(); $username = strip_tags(htmlspecialchars($username)); if (($result = $userdata->validate_username($username)) != false) @@ -1210,6 +1211,7 @@ function topic_review($topic_id, $is_inline_review = false) FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id + AND p.post_approved = 1 ORDER BY p.post_time DESC"; $result = $db->sql_query_limit($sql, $config['posts_per_page']); diff --git a/phpBB/templates/subSilver/index_body.html b/phpBB/templates/subSilver/index_body.html index f4ab35de3e..24dbf7514b 100644 --- a/phpBB/templates/subSilver/index_body.html +++ b/phpBB/templates/subSilver/index_body.html @@ -35,7 +35,7 @@ </table><span class="gensmall"><!-- IF forumrow.MODERATORS --><b>{forumrow.L_MODERATOR_STR}:</b> {forumrow.MODERATORS}<br /><!-- ENDIF --><!-- IF forumrow.SUBFORUMS --><br /><b>{forumrow.L_SUBFORUM_STR}</b> {forumrow.SUBFORUMS}<!-- ENDIF --></span></td> <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.TOPICS}</span></td> <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{forumrow.POSTS}</span></td> - <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST}</span></td> + <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{forumrow.LAST_POST_TIME}<br /><!-- IF forumrow.U_LAST_POSTER --><a href="{forumrow.U_LAST_POSTER}">{forumrow.LAST_POSTER}</a><!-- ELSE -->{forumrow.LAST_POSTER}<!-- ENDIF --><a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_IMG}</a></span></td> </tr> <!-- ENDIF --> <!-- BEGINELSE --> diff --git a/phpBB/templates/subSilver/posting_body.html b/phpBB/templates/subSilver/posting_body.html index f02c68a92a..46069753bd 100644 --- a/phpBB/templates/subSilver/posting_body.html +++ b/phpBB/templates/subSilver/posting_body.html @@ -53,16 +53,19 @@ function checkForm() <th height="28" align="center">{L_POST_REVIEW}</th> </tr> <tr> - <td> </td> + <td class="row1"> </td> </tr> <tr> - <td class="gen" align="center">{L_POST_REVIEW_EXPLAIN}</td> + <td class="row1" align="center"><span class="gen">{L_POST_REVIEW_EXPLAIN}</span></td> </tr> <tr> - <td> </td> + <td class="row1"> </td> </tr> <tr> - <td class="row1"> + <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <tr> + <td class="row2"> <table class="tablebg" width="100%" cellpadding="2" cellspacing="1" border="0"> <tr> |