mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 20:08:55 +00:00
changed extension group administration (more user friendly)
git-svn-id: file:///svn/phpbb/trunk@4858 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
fbb9f40cc7
commit
91811b8289
4 changed files with 485 additions and 324 deletions
|
@ -244,141 +244,116 @@ if ($submit && $mode == 'extensions')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($submit && $mode == 'ext_groups')
|
if ($submit && $mode == 'ext_groups')
|
||||||
{
|
{
|
||||||
// Change Extension Groups ?
|
$action = request_var('action', '');
|
||||||
$group_change_list = (isset($_POST['group_change_list'])) ? array_map('intval', $_POST['group_change_list']) : array();
|
$group_id = request_var('g', 0);
|
||||||
$extension_group_list = request_var('extension_group_list', '');
|
|
||||||
$group_allowed_list = (isset($_POST['allowed_list'])) ? array_flip(array_map('intval', $_POST['allowed_list'])) : array();
|
|
||||||
$download_mode_list = (isset($_POST['download_mode_list'])) ? array_map('intval', $_POST['download_mode_list']) : array();
|
|
||||||
$category_list = (isset($_POST['category_list'])) ? array_map('intval', $_POST['category_list']) : array();
|
|
||||||
$upload_icon_list = request_var('upload_icon_list', '');
|
|
||||||
$filesize_list = (isset($_POST['max_filesize_list'])) ? array_map('intval', $_POST['max_filesize_list']) : array();
|
|
||||||
$size_select_list = request_var('size_select_list', 'b');
|
|
||||||
|
|
||||||
foreach ($group_change_list as $group_id => $var)
|
if ($action != 'add' && $action != 'edit')
|
||||||
{
|
{
|
||||||
$filesize_list[$group_id] = ($size_select_list[$group_id] == 'kb') ? round($filesize_list[$group_id] * 1024) : (($size_select_list[$group_id] == 'mb') ? round($filesize_list[$group_id] * 1048576) : $filesize_list[$group_id]);
|
trigger_error('WRONG_MODE');
|
||||||
|
}
|
||||||
|
|
||||||
$group_sql = array(
|
if (!$group_id && $action == 'edit')
|
||||||
'group_name' => $extension_group_list[$group_id],
|
{
|
||||||
'cat_id' => $category_list[$group_id],
|
trigger_error('NO_EXT_GROUP_SPECIFIED');
|
||||||
'allow_group' => (isset($group_allowed_list[$group_id])) ? 1 : 0,
|
}
|
||||||
'download_mode' => $download_mode_list[$group_id],
|
|
||||||
'upload_icon' => ($upload_icon_list[$group_id] == 'no_image') ? '' : $upload_icon_list[$group_id],
|
if ($group_id)
|
||||||
'max_filesize' => $filesize_list[$group_id]
|
{
|
||||||
|
$sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$ext_row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ext_row = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$group_name = request_var('group_name', '');
|
||||||
|
$new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : '');
|
||||||
|
|
||||||
|
if (!$group_name)
|
||||||
|
{
|
||||||
|
$error[] = $user->lang['NO_EXT_GROUP_NAME'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check New Group Name
|
||||||
|
if ($new_group_name)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT group_id
|
||||||
|
FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
WHERE LOWER(group_name) = '" . strtolower($new_group_name) . "'";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
if ($db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $new_group_name);
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sizeof($error))
|
||||||
|
{
|
||||||
|
// Ok, build the update/insert array
|
||||||
|
$upload_icon = request_var('upload_icon', 'no_image');
|
||||||
|
$size_select = request_var('size_select', 'b');
|
||||||
|
$max_filesize = request_var('max_filesize', 0);
|
||||||
|
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
|
||||||
|
|
||||||
|
if ($max_filesize == $config['max_filesize'])
|
||||||
|
{
|
||||||
|
$max_filesize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$group_ary = array(
|
||||||
|
'group_name' => $group_name,
|
||||||
|
'cat_id' => request_var('special_category', NONE_CAT),
|
||||||
|
'allow_group' => (isset($_REQUEST['allow_group'])) ? 1 : 0,
|
||||||
|
'download_mode' => request_var('download_mode', INLINE_LINK),
|
||||||
|
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
|
||||||
|
'max_filesize' => $max_filesize
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
|
$sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ';
|
||||||
SET ' . $db->sql_build_array('UPDATE', $group_sql) . "
|
$sql .= $db->sql_build_array((($action == 'add') ? 'INSERT' : 'UPDATE'), $group_ary);
|
||||||
|
$sql .= ($action == 'edit') ? " WHERE group_id = $group_id" : '';
|
||||||
|
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($action == 'add')
|
||||||
|
{
|
||||||
|
$group_id = $db->sql_nextid();
|
||||||
|
}
|
||||||
|
|
||||||
|
add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
$extension_list = isset($_REQUEST['extensions']) ? array_map('intval', array_values($_REQUEST['extensions'])) : array();
|
||||||
|
|
||||||
|
if ($action == 'edit' && sizeof($extension_list))
|
||||||
|
{
|
||||||
|
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
|
||||||
|
SET group_id = 0
|
||||||
WHERE group_id = $group_id";
|
WHERE group_id = $group_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete Extension Groups
|
if (sizeof($extension_list))
|
||||||
$group_delete_list = (isset($_POST['group_delete_list'])) ? array_keys(array_map('intval', $_POST['group_delete_list'])) : array();
|
|
||||||
|
|
||||||
if (sizeof($group_delete_list))
|
|
||||||
{
|
{
|
||||||
$sql = 'SELECT group_name
|
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
|
||||||
FROM ' . EXTENSION_GROUPS_TABLE . '
|
SET group_id = $group_id
|
||||||
WHERE group_id IN (' . implode(', ', $group_delete_list) . ')';
|
WHERE extension_id IN (" . implode(', ', $extension_list) . ")";
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$l_group_list = array();
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$l_group_list[] = $row['group_name'];
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = 'DELETE
|
|
||||||
FROM ' . EXTENSION_GROUPS_TABLE . '
|
|
||||||
WHERE group_id IN (' . implode(', ', $group_delete_list) . ')';
|
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Set corresponding Extensions to a pending Group
|
|
||||||
$sql ='"UPDATE ' . EXTENSIONS_TABLE . '
|
|
||||||
SET group_id = 0
|
|
||||||
WHERE group_id IN (' . implode(', ', $group_delete_list) . ')';
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', implode(', ', $l_group_list));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Extensions Group ?
|
rewrite_extensions();
|
||||||
$extension_group = request_var('add_extension_group', '');
|
|
||||||
$download_mode = request_var('add_download_mode', INLINE_LINK);
|
|
||||||
$cat_id = request_var('add_category', 0);
|
|
||||||
$upload_icon = request_var('add_upload_icon', '');
|
|
||||||
$filesize = request_var('add_max_filesize', 0);
|
|
||||||
$size_select = request_var('add_size_select', 'b');
|
|
||||||
$is_allowed = (isset($_POST['add_allowed'])) ? true : false;
|
|
||||||
$add = (isset($_POST['add_extension_group_check'])) ? true : false;
|
|
||||||
|
|
||||||
if ($extension_group != '' && $add)
|
|
||||||
{
|
|
||||||
// check Extension Group
|
|
||||||
$sql = 'SELECT group_name
|
|
||||||
FROM ' . EXTENSION_GROUPS_TABLE . "
|
|
||||||
WHERE group_name = '" . $db->sql_escape($extension_group) . "'";
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if ($row['group_name'] == $extension_group)
|
|
||||||
{
|
|
||||||
$error[] = sprintf($user->lang['EXTENSION_GROUP_EXIST'], $extension_group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if (!sizeof($error))
|
if (!sizeof($error))
|
||||||
{
|
{
|
||||||
$filesize = ($size_select == 'kb') ? round($filesize * 1024) : (($size_select == 'mb') ? round($filesize * 1048576) : $filesize);
|
$notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)];
|
||||||
|
|
||||||
$group_sql = array(
|
|
||||||
'group_name' => $extension_group,
|
|
||||||
'cat_id' => $cat_id,
|
|
||||||
'allow_group' => $is_allowed,
|
|
||||||
'download_mode' => $download_mode,
|
|
||||||
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
|
|
||||||
'max_filesize' => $filesize
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' .
|
|
||||||
$db->sql_build_array('INSERT', $group_sql);
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
add_log('admin', 'LOG_ATTACH_EXTGROUP_ADD', $extension_group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = 'SELECT e.extension, g.*
|
|
||||||
FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g
|
|
||||||
WHERE e.group_id = g.group_id
|
|
||||||
AND g.allow_group = 1';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$extensions = array();
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$extension = $row['extension'];
|
|
||||||
|
|
||||||
$extensions['_allowed_'][] = $extension;
|
|
||||||
$extensions[$extension]['display_cat'] = (int) $row['cat_id'];
|
|
||||||
$extensions[$extension]['download_mode']= (int) $row['download_mode'];
|
|
||||||
$extensions[$extension]['upload_icon'] = (string) $row['upload_icon'];
|
|
||||||
$extensions[$extension]['max_filesize'] = (int) $row['max_filesize'];
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$cache->destroy('extensions');
|
|
||||||
$cache->put('extensions', $extensions);
|
|
||||||
|
|
||||||
if (!sizeof($error))
|
|
||||||
{
|
|
||||||
$notify[] = $user->lang['EXTENSION_GROUPS_UPDATED'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,8 +620,6 @@ if ($mode == 'attach')
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
// Secure Download Options - Same procedure as with banning
|
// Secure Download Options - Same procedure as with banning
|
||||||
if ($new['secure_downloads'])
|
|
||||||
{
|
|
||||||
$allow_deny = ($new['secure_allow_deny']) ? 'ALLOWED' : 'DISALLOWED';
|
$allow_deny = ($new['secure_allow_deny']) ? 'ALLOWED' : 'DISALLOWED';
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
|
@ -666,7 +639,21 @@ if ($mode == 'attach')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if (!$new['secure_downloads'])
|
||||||
|
{
|
||||||
?>
|
?>
|
||||||
|
<br />
|
||||||
|
<table cellspacing="1" cellpadding="4" border="0" align="center" width="99%">
|
||||||
|
<tr>
|
||||||
|
<td class="row3" align="center"><?php echo $user->lang['SECURE_DOWNLOAD_NOTICE']; ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center" width="99%">
|
<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center" width="99%">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -716,7 +703,6 @@ if ($mode == 'attach')
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
|
@ -725,6 +711,100 @@ if ($mode == 'attach')
|
||||||
// Extension Groups
|
// Extension Groups
|
||||||
if ($mode == 'ext_groups')
|
if ($mode == 'ext_groups')
|
||||||
{
|
{
|
||||||
|
$cat_lang = array(
|
||||||
|
NONE_CAT => $user->lang['NONE'],
|
||||||
|
IMAGE_CAT => $user->lang['CAT_IMAGES'],
|
||||||
|
WM_CAT => $user->lang['CAT_WM_FILES'],
|
||||||
|
RM_CAT => $user->lang['CAT_RM_FILES']
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$action = request_var('action', 'show');
|
||||||
|
$group_id = request_var('g', 0);
|
||||||
|
$action = (isset($_REQUEST['add'])) ? 'add' : $action;
|
||||||
|
$action = (($action == 'add' || $action == 'edit') && $submit && !sizeof($error)) ? 'show' : $action;
|
||||||
|
|
||||||
|
if (isset($_REQUEST['select_mode']))
|
||||||
|
{
|
||||||
|
$action = 'show';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'delete')
|
||||||
|
{
|
||||||
|
$confirm = (isset($_POST['confirm'])) ? true : false;
|
||||||
|
$cancel = (isset($_POST['cancel'])) ? true : false;
|
||||||
|
|
||||||
|
if (!$cancel && !$confirm)
|
||||||
|
{
|
||||||
|
adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']);
|
||||||
|
}
|
||||||
|
else if ($confirm && !$cancel)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT group_name
|
||||||
|
FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$group_name = $db->sql_fetchfield('group_name', 0, $result);
|
||||||
|
|
||||||
|
$sql = 'DELETE
|
||||||
|
FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
// Set corresponding Extensions to a pending Group
|
||||||
|
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
|
||||||
|
SET group_id = 0
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name);
|
||||||
|
|
||||||
|
rewrite_extensions();
|
||||||
|
|
||||||
|
trigger_error('EXTENSION_GROUP_DELETED');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'show';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($action)
|
||||||
|
{
|
||||||
|
case 'edit':
|
||||||
|
|
||||||
|
if (!$group_id)
|
||||||
|
{
|
||||||
|
trigger_error('NO_EXTENSION_GROUP');
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
extract($db->sql_fetchrow($result));
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
case 'add':
|
||||||
|
|
||||||
|
if ($action == 'add')
|
||||||
|
{
|
||||||
|
$group_name = request_var('group_name', '');
|
||||||
|
$cat_id = 0;
|
||||||
|
$allow_group = 1;
|
||||||
|
$download_mode = 1;
|
||||||
|
$upload_icon = '';
|
||||||
|
$max_filesize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$extensions = array();
|
||||||
|
|
||||||
|
$sql = 'SELECT * FROM ' . EXTENSIONS_TABLE . "
|
||||||
|
WHERE group_id = $group_id OR group_id = 0
|
||||||
|
ORDER BY extension";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$extensions = $db->sql_fetchrowset($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$img_path = $config['upload_icons_path'];
|
$img_path = $config['upload_icons_path'];
|
||||||
|
|
||||||
$imglist = filelist($phpbb_root_path . $img_path);
|
$imglist = filelist($phpbb_root_path . $img_path);
|
||||||
|
@ -737,185 +817,231 @@ if ($mode == 'ext_groups')
|
||||||
$filename_list .= '<option value="' . $img . '">' . htmlspecialchars($img) . '</option>';
|
$filename_list .= '<option value="' . $img . '">' . htmlspecialchars($img) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$size = request_var('size', 0);
|
if ($max_filesize == 0)
|
||||||
|
|
||||||
if (!$size && !$submit)
|
|
||||||
{
|
{
|
||||||
$max_add_filesize = intval($config['max_filesize']);
|
$max_filesize = (int) $config['max_filesize'];
|
||||||
$size = ($max_add_filesize >= 1048576) ? 'mb' : (($max_add_filesize >= 1024) ? 'kb' : 'b');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$max_add_filesize = ($max_add_filesize >= 1048576) ? round($max_add_filesize / 1048576 * 100) / 100 : (($max_add_filesize >= 1024) ? round($max_add_filesize / 1024 * 100) / 100 : $max_add_filesize);
|
$size_format = ($max_filesize >= 1048576) ? 'mb' : (($max_filesize >= 1024) ? 'kb' : 'b');
|
||||||
|
|
||||||
$viewgroup = request_var('g', 0);
|
$max_filesize = ($max_filesize >= 1048576) ? round($max_filesize / 1048576 * 100) / 100 : (($max_filesize >= 1024) ? round($max_filesize / 1024 * 100) / 100 : $max_filesize);
|
||||||
?>
|
|
||||||
|
|
||||||
<script language="javascript" type="text/javascript" defer="defer">
|
$s_allowed = ($allow_group == 1) ? 'checked="checked"' : '';
|
||||||
<!--
|
|
||||||
|
|
||||||
function update_add_image(newimage)
|
|
||||||
{
|
|
||||||
if (newimage == 'no_image')
|
|
||||||
{
|
|
||||||
document.add_image.src = '<?php echo $phpbb_root_path ?>images/spacer.gif';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
document.add_image.src = "<?php echo $phpbb_root_path . $img_path ?>/" + newimage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_image(newimage, index)
|
|
||||||
{
|
|
||||||
if (newimage == 'no_image')
|
|
||||||
{
|
|
||||||
eval('document.image_' + index + '.src = "<?php echo $phpbb_root_path ?>images/spacer.gif";');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eval('document.image_' + index + '.src = "<?php echo $phpbb_root_path . $img_path ?>/" + newimage;');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-->
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center" width="99%">
|
|
||||||
<tr>
|
|
||||||
<th> <?php echo $user->lang['EXTENSION_GROUP']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['SPECIAL_CATEGORY']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['ALLOWED']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['DOWNLOAD_MODE']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['UPLOAD_ICON']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['MAX_EXTGROUP_FILESIZE']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['ADD']; ?> </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1" align="center" valign="middle">
|
|
||||||
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
|
|
||||||
<tr>
|
|
||||||
<td class="row1" align="center" valign="middle" width="10%" wrap="nowrap"> </td>
|
|
||||||
<td class="row1" align="left" valign="middle"><input type="text" size="20" maxlength="100" name="add_extension_group" class="post" value="<?php echo ((isset($submit)) ? $extension_group : '') ?>" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td class="row1" align="center" valign="middle"><?php echo category_select('add_category'); ?></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><input type="checkbox" name="add_allowed" /></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><?php echo download_select('add_download_mode'); ?></td>
|
|
||||||
<td class="row1" align="center" valign="middle">
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="center"><select name="add_upload_icon" onChange="update_add_image(this.options[selectedIndex].value);"><option value="no_image" selected="selected"><?php echo $user->lang['NO_IMAGE']; ?></option><?php echo $filename_list ?></select></td>
|
|
||||||
<td width="50" align="center" valign="middle"> <img src="<?php echo $phpbb_root_path . 'images/spacer.gif' ?>" name="add_image" border="0" alt="" title="" /> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td class="row1" align="center" valign="middle"><input type="text" size="3" maxlength="15" name="add_max_filesize" class="post" value="<?php echo $max_add_filesize; ?>" /> <?php echo size_select('add_size_select', $size); ?></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><input type="checkbox" name="add_extension_group_check" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr align="right">
|
|
||||||
<td class="cat" colspan="7"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th> <?php echo $user->lang['EXTENSION_GROUP']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['SPECIAL_CATEGORY']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['ALLOWED']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['DOWNLOAD_MODE']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['UPLOAD_ICON']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['MAX_EXTGROUP_FILESIZE']; ?> </th>
|
|
||||||
<th> <?php echo $user->lang['DELETE']; ?> </th>
|
|
||||||
</tr>
|
|
||||||
<?
|
|
||||||
|
|
||||||
$sql = 'SELECT *
|
|
||||||
FROM ' . EXTENSION_GROUPS_TABLE;
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
// Format the filesize
|
|
||||||
if ($row['max_filesize'] == 0)
|
|
||||||
{
|
|
||||||
$row['max_filesize'] = (int) $config['max_filesize'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$size_format = ($row['max_filesize'] >= 1048576) ? 'mb' : (($row['max_filesize'] >= 1024) ? 'kb' : 'b');
|
|
||||||
|
|
||||||
$row['max_filesize'] = ($row['max_filesize'] >= 1048576) ? round($row['max_filesize'] / 1048576 * 100) / 100 : (($row['max_filesize'] >= 1024) ? round($row['max_filesize'] / 1024 * 100) / 100 : $row['max_filesize']);
|
|
||||||
|
|
||||||
$s_allowed = ($row['allow_group'] == 1) ? 'checked="checked"' : '';
|
|
||||||
$edit_img = ($row['upload_icon'] != '') ? $row['upload_icon'] : '';
|
|
||||||
|
|
||||||
$filename_list = '';
|
$filename_list = '';
|
||||||
$no_image_select = false;
|
$no_image_select = false;
|
||||||
foreach ($imglist as $key => $img)
|
foreach ($imglist as $key => $img)
|
||||||
{
|
{
|
||||||
if ($edit_img == '')
|
if (!$upload_icon)
|
||||||
{
|
{
|
||||||
$no_image_select = true;
|
$no_image_select = true;
|
||||||
$selected = '';
|
$selected = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$selected = ($edit_img == $img) ? ' selected="selected"' : '';
|
$selected = ($upload_icon == $img) ? ' selected="selected"' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . htmlspecialchars($img) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show Edit Screen
|
||||||
?>
|
?>
|
||||||
|
<script language="javascript" type="text/javascript" defer="defer">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
function update_image(newimage)
|
||||||
|
{
|
||||||
|
if (newimage == 'no_image')
|
||||||
|
{
|
||||||
|
document.image.src = "<?php echo $phpbb_root_path; ?>images/spacer.gif";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.image.src = "<?php echo $phpbb_root_path . $img_path; ?>/" + newimage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_extensions(elem)
|
||||||
|
{
|
||||||
|
var str = '';
|
||||||
|
|
||||||
|
for (i = 0; i < elem.length; i++)
|
||||||
|
{
|
||||||
|
var element = elem.options[i];
|
||||||
|
if (element.selected)
|
||||||
|
{
|
||||||
|
if (str)
|
||||||
|
{
|
||||||
|
str = str + ', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
str = str + element.innerHTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.all)
|
||||||
|
{
|
||||||
|
document.all.ext.innerText = str;
|
||||||
|
}
|
||||||
|
else if (document.getElementById('ext').textContent)
|
||||||
|
{
|
||||||
|
document.getElementById('ext').textContent = str;
|
||||||
|
}
|
||||||
|
else if (document.getElementById('ext').firstChild.nodeValue)
|
||||||
|
{
|
||||||
|
document.getElementById('ext').firstChild.nodeValue = str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="hidden" name="action" value="<?php echo $action; ?>" />
|
||||||
|
<input type="hidden" name="g" value="<?php echo $group_id; ?>" />
|
||||||
|
|
||||||
|
<table class="bg" width="99%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<input type="hidden" name="group_change_list[<?php echo $row['group_id']; ?>]" value="1" />
|
<th colspan="2"><?php echo $user->lang[strtoupper($action) . '_EXTENSION_GROUP']; ?></th>
|
||||||
<td class="row1" align="center" valign="middle">
|
</tr>
|
||||||
<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="center" valign="middle" width="10%" wrap="nowrap"><b><a href="<?php echo (($viewgroup == $row['group_id']) ? "admin_attachments.$phpEx$SID&mode=ext_groups" : "admin_attachments.$phpEx$SID&mode=ext_groups&g=" . $row['group_id']); ?>" class="gen"><?php echo (($viewgroup == $row['group_id']) ? '-' : '+'); ?></a></span></b></td>
|
<td class="row1" width="35%"><b><?php echo $user->lang['GROUP_NAME']; ?></b>:</td>
|
||||||
<td class="row1" align="left" valign="middle"><input type="text" size="20" maxlength="100" name="extension_group_list[<?php echo $row['group_id']; ?>]" class="post" value="<?php echo $row['group_name']; ?>" /></td>
|
<td class="row2"><input type="text" size="20" maxlength="100" name="group_name" class="post" value="<?php echo $group_name; ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="35%"><b><?php echo $user->lang['SPECIAL_CATEGORY']; ?></b>:</td>
|
||||||
|
<td class="row2"><?php echo category_select('special_category', $group_id); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="35%"><b><?php echo $user->lang['ALLOWED']; ?></b>:</td>
|
||||||
|
<td class="row2"><input type="checkbox" name="allow_group" value="<?php echo $group_id; ?>" <?php echo $s_allowed; ?> /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="35%"><b><?php echo $user->lang['DOWNLOAD_MODE']; ?></b>:</td>
|
||||||
|
<td class="row2"><?php echo download_select('download_mode', $group_id); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="35%"><b><?php echo $user->lang['UPLOAD_ICON']; ?></b>:</td>
|
||||||
|
<td class="row2" align="left">
|
||||||
|
<table border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td align="center"><select name="upload_icon" onChange="update_image(this.options[selectedIndex].value);"><option value="no_image"<?php echo (($no_image_select) ? ' selected="selected"' : ''); ?>><?php echo $user->lang['NO_IMAGE']; ?></option><?php echo $filename_list ?></select></td>
|
||||||
|
<td width="50" align="center" valign="middle"> <img src="<?php echo (($no_image_select) ? $phpbb_root_path . 'images/spacer.gif' : $phpbb_root_path . $img_path . '/' . $upload_icon) ?>" name="image" border="0" alt="" title="" /> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td class="row2" align="center" valign="middle"><?php echo category_select('category_list[' . $row['group_id'] . ']', $row['group_id']); ?></td>
|
|
||||||
<td class="row1" align="center" valign="middle"><input type="checkbox" name="allowed_list[<?php echo $row['group_id']; ?>]" value="<?php echo $row['group_id']; ?>" <?php echo $s_allowed; ?> /></td>
|
|
||||||
<td class="row2" align="center" valign="middle"><?php echo download_select('download_mode_list[' . $row['group_id'] . ']', $row['group_id']); ?></td>
|
|
||||||
<td class="row1" align="center" valign="middle">
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
||||||
<tr>
|
|
||||||
<td align="center"><select name="upload_icon_list[<?php echo $row['group_id']; ?>]" onChange="update_image(this.options[selectedIndex].value, <?php echo $row['group_id']; ?>);"><option value="no_image"<?php echo (($no_image_select) ? ' selected="selected"' : ''); ?>><?php echo $user->lang['NO_IMAGE']; ?></option><?php echo $filename_list ?></select></td>
|
|
||||||
<td width="50" align="center" valign="middle"> <img src="<?php echo (($no_image_select) ? $phpbb_root_path . 'images/spacer.gif' : $phpbb_root_path . $img_path . '/' . $edit_img) ?>" name="image_<?php echo $row['group_id']; ?>" border="0" alt="" title="" /> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
<tr>
|
||||||
|
<td class="row1" width="35%"><b><?php echo $user->lang['MAX_EXTGROUP_FILESIZE']; ?></b>:</td>
|
||||||
|
<td class="row2"><input type="text" size="3" maxlength="15" name="max_filesize" class="post" value="<?php echo $max_filesize; ?>" /> <?php echo size_select('size_select', $size_format); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="35%" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td colspan="2"><b><?php echo $user->lang['ASSIGNED_EXTENSIONS']; ?></b>:</td></tr>
|
||||||
|
<tr><td class="row1" width="20"> » </td>
|
||||||
|
<td class="row1"><div id="ext" style="margin:0px; width:200px"> <?php
|
||||||
|
$i = 0;
|
||||||
|
foreach ($extensions as $num => $row)
|
||||||
|
{
|
||||||
|
if ($row['group_id'] == $group_id && $group_id)
|
||||||
|
{
|
||||||
|
echo ($i) ? ', ' . $row['extension'] : $row['extension'];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?></div></td></tr></table>
|
||||||
</td>
|
</td>
|
||||||
<td class="row2" align="center" valign="middle"><input type="text" size="3" maxlength="15" name="max_filesize_list[<?php echo $row['group_id']; ?>]" class="post" value="<?php echo $row['max_filesize']; ?>" /> <?php echo size_select('size_select_list[' . $row['group_id'] . ']', $size_format); ?></td>
|
<td class="row2"><select name="extensions[]" onChange="show_extensions(this);" multiple="true" size="8" style="width:100px">
|
||||||
<td class="row2" align="center" valign="middle"><input type="checkbox" name="group_delete_list[<?php echo $row['group_id']; ?>]" value="1" /></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
<?php
|
||||||
|
foreach ($extensions as $row)
|
||||||
if ($viewgroup && $viewgroup == $row['group_id'])
|
|
||||||
{
|
{
|
||||||
$sql = 'SELECT extension
|
echo '<option' . ((!$row['group_id']) ? ' class="blue"' : '') . ' value="' . $row['extension_id'] . '"' . (($row['group_id'] == $group_id && $group_id) ? ' selected="selected"' : '') . '>' . $row['extension'] . '</option>';
|
||||||
FROM ' . EXTENSIONS_TABLE . "
|
|
||||||
WHERE group_id = $viewgroup";
|
|
||||||
$e_result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$assigned_extensions = array();
|
|
||||||
while ($e_row = $db->sql_fetchrow($e_result))
|
|
||||||
{
|
|
||||||
$assigned_extensions[] = strtoupper($e_row['extension']);
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($e_result);
|
|
||||||
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="row2" colspan="7"> <?php echo $user->lang['ASSIGNED_EXTENSIONS'] . ' » ' . ((sizeof($assigned_extensions)) ? implode(', ', $assigned_extensions) : $user->lang['NONE']); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="7" align="right"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="btnlite" /></td>
|
<td class="cat" colspan="2" align="right"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="btnlite" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?
|
<?php
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'deactivate':
|
||||||
|
case 'activate':
|
||||||
|
|
||||||
|
if (!$group_id)
|
||||||
|
{
|
||||||
|
trigger_error('NO_EXTENSION_GROUP');
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
|
||||||
|
SET allow_group = ' . (($action == 'activate') ? '1' : '0') . "
|
||||||
|
WHERE group_id = $group_id";
|
||||||
|
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
rewrite_extensions();
|
||||||
|
|
||||||
|
case 'show':
|
||||||
|
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . EXTENSION_GROUPS_TABLE . '
|
||||||
|
ORDER BY allow_group DESC, group_name';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table class="bg" width="99%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<th width="60%"><?php echo $user->lang['EXTENSION_GROUP']; ?></th>
|
||||||
|
<th nowrap="nowrap"><?php echo $user->lang['SPECIAL_CATEGORY']; ?></th>
|
||||||
|
<th colspan="3"><?php echo $user->lang['OPTIONS']; ?></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$row_class = 'row2';
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||||
|
|
||||||
|
if ($row['allow_group'] == 0 && $act_deact == 'deactivate')
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="spacer" colspan="5" height="1"><img src="../images/spacer.gif" alt="" width="1" height="1" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$act_deact = ($row['allow_group']) ? 'deactivate' : 'activate';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="<?php echo $row_class; ?>"><a href="admin_attachments.<?php echo "$phpEx$SID&mode=$mode&action=edit&g={$row['group_id']}"; ?>"><?php echo $row['group_name']; ?></a></td>
|
||||||
|
<td class="<?php echo $row_class; ?>"><b><?php echo $cat_lang[$row['cat_id']]; ?></b></td>
|
||||||
|
<td class="<?php echo $row_class; ?>"><a href="admin_attachments.<?php echo "$phpEx$SID&mode=$mode&action=$act_deact&g={$row['group_id']}"; ?>"><?php echo $user->lang[strtoupper($act_deact)]; ?></a></td>
|
||||||
|
<td class="<?php echo $row_class; ?>"><a href="admin_attachments.<?php echo "$phpEx$SID&mode=$mode&action=edit&g={$row['group_id']}"; ?>"><?php echo $user->lang['EDIT']; ?></a></td>
|
||||||
|
<td class="<?php echo $row_class; ?>"><a href="admin_attachments.<?php echo "$phpEx$SID&mode=$mode&action=delete&g={$row['group_id']}"; ?>"><?php echo $user->lang['DELETE']; ?></a></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<td class="cat" colspan="5" align="right"><?php echo $user->lang['CREATE_GROUP']; ?>: <input class="post" type="text" name="group_name" maxlength="30" /> <input class="btnmain" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /></td>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,7 +1072,7 @@ if ($mode == 'extensions')
|
||||||
<?php
|
<?php
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . EXTENSIONS_TABLE . '
|
FROM ' . EXTENSIONS_TABLE . '
|
||||||
ORDER BY group_id';
|
ORDER BY group_id, extension';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -1161,7 +1287,7 @@ function group_select($select_name, $default_group = '-1')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build select for download modes
|
// Build select for download modes
|
||||||
function download_select($select_name, $group_id = FALSE)
|
function download_select($select_name, $group_id = false)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
|
@ -1470,7 +1596,7 @@ function perform_site_list()
|
||||||
add_log('admin', $log_entry, $ip_list_log);
|
add_log('admin', $log_entry, $ip_list_log);
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCESSFUL']);
|
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
|
||||||
}
|
}
|
||||||
else if (isset($_POST['unsecuresubmit']))
|
else if (isset($_POST['unsecuresubmit']))
|
||||||
{
|
{
|
||||||
|
@ -1498,8 +1624,36 @@ function perform_site_list()
|
||||||
add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
|
add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCESSFUL']);
|
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-Write extensions cache file
|
||||||
|
function rewrite_extensions()
|
||||||
|
{
|
||||||
|
global $db, $cache;
|
||||||
|
|
||||||
|
$sql = 'SELECT e.extension, g.*
|
||||||
|
FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g
|
||||||
|
WHERE e.group_id = g.group_id
|
||||||
|
AND g.allow_group = 1';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$extensions = array();
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$extension = $row['extension'];
|
||||||
|
|
||||||
|
$extensions['_allowed_'][] = $extension;
|
||||||
|
$extensions[$extension]['display_cat'] = (int) $row['cat_id'];
|
||||||
|
$extensions[$extension]['download_mode']= (int) $row['download_mode'];
|
||||||
|
$extensions[$extension]['upload_icon'] = (string) $row['upload_icon'];
|
||||||
|
$extensions[$extension]['max_filesize'] = (int) $row['max_filesize'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$cache->destroy('extensions');
|
||||||
|
$cache->put('extensions', $extensions);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -167,7 +167,8 @@ $lang += array(
|
||||||
'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />» %s',
|
'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />» %s',
|
||||||
'LOG_ATTACH_EXT_DEL' => '<b>Removed attachment extension</b><br />» %s',
|
'LOG_ATTACH_EXT_DEL' => '<b>Removed attachment extension</b><br />» %s',
|
||||||
'LOG_ATTACH_EXT_UPDATE' => '<b>Updated attachment extension</b><br />» %s',
|
'LOG_ATTACH_EXT_UPDATE' => '<b>Updated attachment extension</b><br />» %s',
|
||||||
'LOG_ATTACH_EXTGROUP_ADD' => '<b>Added or edited extension group</b><br />» %s',
|
'LOG_ATTACH_EXTGROUP_ADD' => '<b>Added extension group</b><br />» %s',
|
||||||
|
'LOG_ATTACH_EXTGROUP_EDIT' => '<b>Edited extension group</b><br />» %s',
|
||||||
'LOG_ATTACH_EXTGROUP_DEL' => '<b>Removed extension group</b><br />» %s',
|
'LOG_ATTACH_EXTGROUP_DEL' => '<b>Removed extension group</b><br />» %s',
|
||||||
'LOG_ATTACH_FILEUPLOAD' => '<b>Orphan File uploaded to Post Number %1$d - %2$s</b>',
|
'LOG_ATTACH_FILEUPLOAD' => '<b>Orphan File uploaded to Post Number %1$d - %2$s</b>',
|
||||||
'LOG_ATTACH_ORPHAN_DEL' => '<b>Orphan Files deleted</b><br />» %s',
|
'LOG_ATTACH_ORPHAN_DEL' => '<b>Orphan Files deleted</b><br />» %s',
|
||||||
|
@ -1704,7 +1705,7 @@ $lang += array(
|
||||||
'UPLOAD_DIR' => 'Upload Directory',
|
'UPLOAD_DIR' => 'Upload Directory',
|
||||||
'UPLOAD_DIR_EXPLAIN' => 'Storage Path for Attachments.',
|
'UPLOAD_DIR_EXPLAIN' => 'Storage Path for Attachments.',
|
||||||
'DISPLAY_ORDER' => 'Attachment Display Order',
|
'DISPLAY_ORDER' => 'Attachment Display Order',
|
||||||
'DISPLAY_ORDER_EXPLAIN' => 'Display attachments ordering by time.',
|
'DISPLAY_ORDER_EXPLAIN' => 'Display attachments ordered by time.',
|
||||||
'ATTACH_MAX_FILESIZE' => 'Maximum filesize',
|
'ATTACH_MAX_FILESIZE' => 'Maximum filesize',
|
||||||
'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, 0 is unlimited.',
|
'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, 0 is unlimited.',
|
||||||
'ATTACH_QUOTA' => 'Total attachment quota',
|
'ATTACH_QUOTA' => 'Total attachment quota',
|
||||||
|
@ -1741,14 +1742,21 @@ $lang += array(
|
||||||
|
|
||||||
'EXTENSION_GROUPS_TITLE' => 'Manage Extension Groups',
|
'EXTENSION_GROUPS_TITLE' => 'Manage Extension Groups',
|
||||||
'EXTENSION_GROUPS_TITLE_EXPLAIN' => 'Here you can add, delete and modify your Extension Groups, you can disable Extension Groups, assign a special Category to them, change the download mechanism and you can define an Upload Icon which will be displayed in front of an Attachment belonging to the Group.',
|
'EXTENSION_GROUPS_TITLE_EXPLAIN' => 'Here you can add, delete and modify your Extension Groups, you can disable Extension Groups, assign a special Category to them, change the download mechanism and you can define an Upload Icon which will be displayed in front of an Attachment belonging to the Group.',
|
||||||
'EXTENSION_GROUPS' => 'Extension groups',
|
'EXTENSION_GROUPS' => 'Extension Groups',
|
||||||
'EXTENSION_GROUP' => 'Extension group',
|
'EXTENSION_GROUP' => 'Extension Group',
|
||||||
'SPECIAL_CATEGORY' => 'Special category',
|
'SPECIAL_CATEGORY' => 'Special Category',
|
||||||
'DOWNLOAD_MODE' => 'Download mode',
|
'DOWNLOAD_MODE' => 'Download Mode',
|
||||||
'UPLOAD_ICON' => 'Upload icon',
|
'UPLOAD_ICON' => 'Upload Icon',
|
||||||
'MAX_EXTGROUP_FILESIZE' => 'Maximum filesize',
|
'MAX_EXTGROUP_FILESIZE' => 'Maximum Filesize',
|
||||||
'ADD_EXTGROUP' => 'Add extension group',
|
|
||||||
'ASSIGNED_EXTENSIONS' => 'Assigned Extensions',
|
'ASSIGNED_EXTENSIONS' => 'Assigned Extensions',
|
||||||
|
'ADD_EXTENSION_GROUP' => 'Add Extension Group',
|
||||||
|
'EDIT_EXTENSION_GROUP' => 'Edit Extension Group',
|
||||||
|
'NO_EXT_GROUP_SPECIFIED' => 'No Extension Group specified',
|
||||||
|
'NO_EXT_GROUP_NAME' => 'No Group Name entered',
|
||||||
|
'SUCCESS_EXTENSION_GROUP_ADD' => 'Extension Group successfully added',
|
||||||
|
'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension Group successfully updated',
|
||||||
|
'EXTENSION_GROUP_EXIST' => 'The Extension Group %s already exist',
|
||||||
|
'EXTENSION_GROUP_DELETED' => 'Extension Group successfully deleted',
|
||||||
|
|
||||||
'CAT_IMAGES' => 'Images',
|
'CAT_IMAGES' => 'Images',
|
||||||
'CAT_WM_FILES' => 'Win Media Streams',
|
'CAT_WM_FILES' => 'Win Media Streams',
|
||||||
|
@ -1756,8 +1764,6 @@ $lang += array(
|
||||||
'MODE_INLINE' => 'Inline',
|
'MODE_INLINE' => 'Inline',
|
||||||
'MODE_PHYSICAL' => 'Physical',
|
'MODE_PHYSICAL' => 'Physical',
|
||||||
'NO_IMAGE' => 'No Image',
|
'NO_IMAGE' => 'No Image',
|
||||||
'EXTENSION_GROUPS_UPDATED' => 'Extension Groups updated successfully',
|
|
||||||
'EXTENSION_GROUP_EXIST' => 'The Extension Group %s already exist',
|
|
||||||
|
|
||||||
'MANAGE_EXTENSIONS' => 'Manage Extensions',
|
'MANAGE_EXTENSIONS' => 'Manage Extensions',
|
||||||
'MANAGE_EXTENSIONS_EXPLAIN' => 'Here you can manage your allowed extensions. To activate your Extensions, please refer to the extension groups management panel. We strongly recommend not to allow scripting extensions (such as php, php3, php4, phtml, pl, cgi, asp, aspx...)',
|
'MANAGE_EXTENSIONS_EXPLAIN' => 'Here you can manage your allowed extensions. To activate your Extensions, please refer to the extension groups management panel. We strongly recommend not to allow scripting extensions (such as php, php3, php4, phtml, pl, cgi, asp, aspx...)',
|
||||||
|
@ -1795,8 +1801,8 @@ $lang += array(
|
||||||
'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a blue background.',
|
'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a blue background.',
|
||||||
'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/Hostname.',
|
'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/Hostname.',
|
||||||
'NO_IPS_DEFINED' => 'No IPs or Hostnames defined',
|
'NO_IPS_DEFINED' => 'No IPs or Hostnames defined',
|
||||||
|
'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully',
|
||||||
'SECURE_DOWNLOAD_UPDATE_SUCESSFUL' => 'The IP list has been updated successfully'
|
'SECURE_DOWNLOAD_NOTICE' => 'Secure Downloads are not enabled. The settings below will be applied after enabling secure downloads.'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Installation
|
// Installation
|
||||||
|
|
|
@ -45,6 +45,7 @@ $lang += array(
|
||||||
|
|
||||||
'ACP' => 'Administration Control Panel',
|
'ACP' => 'Administration Control Panel',
|
||||||
'ACTIVE_ERROR' => 'You have specified an inactive username. Please activate your account and try again. If you continue to have problems please contact a board administrator.',
|
'ACTIVE_ERROR' => 'You have specified an inactive username. Please activate your account and try again. If you continue to have problems please contact a board administrator.',
|
||||||
|
'ALLOWED' => 'Allowed',
|
||||||
'ALL_POSTS' => 'All Posts',
|
'ALL_POSTS' => 'All Posts',
|
||||||
'ALL_TIMES' => 'All times are %s %s',
|
'ALL_TIMES' => 'All times are %s %s',
|
||||||
'ALL_TOPICS' => 'All Topics',
|
'ALL_TOPICS' => 'All Topics',
|
||||||
|
@ -451,7 +452,6 @@ $lang += array(
|
||||||
|
|
||||||
// Pool of unused or currently not assignable language variables
|
// Pool of unused or currently not assignable language variables
|
||||||
$unused = array(
|
$unused = array(
|
||||||
'ALLOWED' => 'Allowed',
|
|
||||||
'ALREADY_VOTED' => 'You have already voted in this poll and may not change your selection.',
|
'ALREADY_VOTED' => 'You have already voted in this poll and may not change your selection.',
|
||||||
'AM' => 'AM',
|
'AM' => 'AM',
|
||||||
'AVATAR' => 'Avatar',
|
'AVATAR' => 'Avatar',
|
||||||
|
|
|
@ -100,6 +100,7 @@ function insert_text(text) {
|
||||||
|
|
||||||
function attach_inline() {
|
function attach_inline() {
|
||||||
insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]');
|
insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]');
|
||||||
|
document.forms[form_name].elements[text_name].focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addquote(post_id, username) {
|
function addquote(post_id, username) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue