From 4d1def879aef2b97a2dfe65c13f2c3c8e6b53aff Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 11 May 2003 16:21:35 +0000 Subject: a few updates, added #539865 and #694413. git-svn-id: file:///svn/phpbb/trunk@4005 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_attachments.php | 237 ++++++++++++++++++++++++++++++++++++++-- phpBB/adm/admin_board.php | 6 + 2 files changed, 232 insertions(+), 11 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index db5181504f..667a40ee2e 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -127,7 +127,7 @@ if ($submit && ($mode == 'manage' || $mode == 'cats')) } // Adjust the Upload Directory -if (!$new['allow_ftp_upload']) +if (!$new['use_ftp_upload']) { if ( ($new['upload_dir'][0] == '/') || ( ($new['upload_dir'][0] != '/') && ($new['upload_dir'][1] == ':') ) ) { @@ -153,6 +153,10 @@ switch ($mode) $l_title = 'MANAGE_CATEGORIES'; break; + case 'extensions': + $l_title = 'MANAGE_EXTENSIONS'; + break; + case 'ext_groups': $l_title = 'EXTENSION_GROUPS_TITLE'; } @@ -207,14 +211,126 @@ 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); + test_upload($error, $error_msg, $upload_dir, $new['ftp_path'], $new['use_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); + test_upload($error, $error_msg, $upload_dir, $new['ftp_path'] . '/thumbs', $new['use_ftp_upload'], true); +} + +if ($submit && $mode == 'extensions') +{ + // Change Extensions ? + $extension_change_list = ( isset($_POST['extension_change_list']) ) ? $_POST['extension_change_list'] : array(); + $extension_explain_list = ( isset($_POST['extension_explain_list']) ) ? $_POST['extension_explain_list'] : array(); + $group_select_list = ( isset($_POST['group_select']) ) ? $_POST['group_select'] : array(); + + // Generate correct Change List + $extensions = array(); + + for ($i = 0; $i < count($extension_change_list); $i++) + { + $extensions[$extension_change_list[$i]]['comment'] = stripslashes(htmlspecialchars($extension_explain_list[$i])); + $extensions[$extension_change_list[$i]]['group_id'] = intval($group_select_list[$i]); + } + + $sql = 'SELECT * + FROM ' . EXTENSIONS_TABLE . ' + ORDER BY extension_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ( ($row['comment'] != $extensions[$row['extension_id']]['comment']) || (intval($row['group_id']) != intval($extensions[$row['extension_id']]['group_id'])) ) + { + $sql = "UPDATE " . EXTENSIONS_TABLE . " + SET comment = '" . $extensions[$row['extension_id']]['comment'] . "', group_id = " . $extensions[$row['extension_id']]['group_id'] . " + WHERE extension_id = " . $row['extension_id']; + $db->sql_query($sql); + } + } + $db->sql_freeresult($result); + + // Delete Extension ? + $extension_id_list = ( isset($_POST['extension_id_list']) ) ? $_POST['extension_id_list'] : array(); + + $extension_id_sql = implode(', ', $extension_id_list); + + if ($extension_id_sql != '') + { + $sql = 'DELETE + FROM ' . EXTENSIONS_TABLE . ' + WHERE extension_id IN (' . $extension_id_sql . ')'; + $db->sql_query($sql); + } + + // Add Extension ? + $add_extension = ( isset($_POST['add_extension']) ) ? trim(strip_tags($_POST['add_extension'])) : ''; + $add_extension_explain = ( isset($_POST['add_extension_explain']) ) ? trim(strip_tags($_POST['add_extension_explain'])) : ''; + $add_extension_group = ( isset($_POST['add_group_select']) ) ? intval($_POST['add_group_select']) : ''; + $add = ( isset($_POST['add_extension_check']) ) ? TRUE : FALSE; + + if ($add_extension != '' && $add) + { + if (!$error) + { + // check extension + $sql = "SELECT extension + FROM " . EXTENSIONS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (strtolower(trim($row['extension'])) == strtolower(trim($add_extension))) + { + $error = TRUE; + if( isset($error_msg) ) + { + $error_msg .= '
'; + } + $error_msg .= sprintf($user->lang['EXTENSION_EXIST'], strtolower(trim($add_extension))); + } + } + $db->sql_freeresult($result); + + // Extension Forbidden ? + if (!$error) + { + $sql = "SELECT extension + FROM " . FORBIDDEN_EXTENSIONS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (strtolower(trim($row['extension'])) == strtolower(trim($add_extension))) + { + $error = TRUE; + if( isset($error_msg) ) + { + $error_msg .= '
'; + } + $error_msg .= sprintf($user->lang['CANNOT_ADD_FORBIDDEN_EXTENSION'], strtolower(trim($add_extension))); + } + } + } + + if (!$error) + { + $sql = "INSERT INTO " . EXTENSIONS_TABLE . " (group_id, extension, comment) + VALUES (" . $add_extension_group . ", '" . strtolower(trim($add_extension)) . "', '" . trim($add_extension_explain) . "')"; + $db->sql_query($sql); + } + } + } + + if (!$error) + { + $notify = true; + $notify_msg = $user->lang['EXTENSIONS_UPDATED']; + } } if ($submit && $mode == 'ext_groups') @@ -409,7 +525,7 @@ $select_pm_size_mode = size_select('pm_size', $pm_size); ?>
" method="post"> - +
@@ -382,6 +384,10 @@ switch ($mode) + + + + -- cgit v1.2.1
   - +
@@ -507,7 +623,7 @@ if ($mode == 'manage') { ?> - + @@ -523,7 +639,7 @@ if ($mode == 'manage') - + @@ -584,7 +700,7 @@ if ($mode == 'cats') $create_thumbnail_no = (!$new['img_create_thumbnail']) ? 'checked="checked"' : ''; ?> -
lang['ATTACHMENT_SETTINGS']; ?>
lang['FTP_UPLOAD']; ?>:
lang['FTP_UPLOAD_EXPLAIN']; ?>
/> lang['YES']; ?>   /> lang['NO']; ?> /> lang['YES']; ?>   /> lang['NO']; ?>
+
@@ -703,7 +819,7 @@ if ($mode == 'ext_groups') //--> -
lang['SETTINGS_CAT_IMAGES']; ?>
+
@@ -838,6 +954,64 @@ if ($mode == 'ext_groups')
lang['EXTENSION_GROUPS_TITLE']; ?>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { +?> + + + + + + + + + + + +
lang['MANAGE_EXTENSIONS']; ?>
 lang['COMMENT']; ?>  lang['EXTENSION']; ?>  lang['EXTENSION_GROUP']; ?>  lang['ADD_EXTENSION']; ?> 
 lang['COMMENT']; ?>  lang['EXTENSION']; ?>  lang['EXTENSION_GROUP']; ?>  lang['DELETE']; ?> 
  
+ @@ -1043,8 +1217,49 @@ function category_select($select_name, $group_id = -1) return($group_select); } -// Build select for download modes +// Extension group select +function group_select($select_name, $default_group = -1) +{ + global $db, $user; + + $group_select = ''; + + return $group_select; +} + +// Build select for download modes function download_select($select_name, $group_id = -1) { global $db, $user; diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index 4a2ba30d10..75eb9e9d6b 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -332,6 +332,8 @@ switch ($mode) $prune_yes = ($new['prune_enable']) ? 'checked="checked"' : ''; $prune_no = (!$new['prune_enable']) ? 'checked="checked"' : ''; + $display_last_edited_yes = ($new['display_last_edited']) ? 'checked="checked"' : ''; + $display_last_edited_no = (!$new['display_last_edited']) ? 'checked="checked"' : ''; ?>
lang['SITE_NAME']; ?>: lang['EDIT_TIME']; ?>:
lang['EDIT_TIME_EXPLAIN']; ?>
lang['DISPLAY_LAST_EDITED']; ?>:
lang['DISPLAY_LAST_EDITED_EXPLAIN']; ?>
/>lang['YES']; ?>    />lang['NO']; ?>
lang['FLOOD_INTERVAL']; ?>:
lang['FLOOD_INTERVAL_EXPLAIN']; ?>