require_once updates

git-svn-id: file:///svn/phpbb/trunk@3340 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-01-21 14:15:48 +00:00
parent 75731c034c
commit 8c31649706
8 changed files with 90 additions and 105 deletions

View file

@ -37,7 +37,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
// Get mode // Get mode
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
@ -168,15 +168,15 @@ switch ($mode)
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $user->lang['Allow_local']; ?>: </td> <td class="row1" width="50%"><?php echo $user->lang['Allow_local']; ?>: </td>
<td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_remote']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allow_remote_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Allow_remote']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allow_remote_explain']; ?></span></td>
<td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_upload']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_upload']; ?>: </td>
<td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Max_filesize']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_filesize_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Max_filesize']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_filesize_explain']; ?></span></td>
@ -235,7 +235,7 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Override_style']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Override_style_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Override_style']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Override_style_explain']; ?></span></td>
<td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Default_language']; ?>: </td> <td class="row1"><?php echo $user->lang['Default_language']; ?>: </td>
@ -259,19 +259,19 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_topic_notify']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_topic_notify']; ?>: </td>
<td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_forum_notify']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_forum_notify']; ?>: </td>
<td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_name_change']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_name_change']; ?>: </td>
<td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_HTML']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_HTML']; ?>: </td>
<td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allowed_tags']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allowed_tags_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Allowed_tags']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allowed_tags_explain']; ?></span></td>
@ -279,15 +279,15 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_BBCode']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_BBCode']; ?>: </td>
<td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_smilies']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_smilies']; ?>: </td>
<td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smile_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_smilies" value="0" <?php echo $smile_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smile_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_smilies" value="0" <?php echo $smile_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Allow_sig']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_sig']; ?>: </td>
<td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Max_sig_length']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_sig_length_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Max_sig_length']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_sig_length_explain']; ?></span></td>
@ -327,11 +327,11 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Board_disable']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_disable_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Board_disable']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_disable_explain']; ?></span></td>
<td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $disable_board_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="board_disable" value="0" <?php echo $disable_board_no; ?> /> <?php echo $user->lang['No']; ?><br /><input type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td> <td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $disable_board_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="board_disable" value="0" <?php echo $disable_board_no; ?> /> <?php echo $user->lang['NO']; ?><br /><input type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Enable_prune']; ?>: </td> <td class="row1"><?php echo $user->lang['Enable_prune']; ?>: </td>
<td class="row2"><input type="radio" name="prune_enable" value="1" <?php echo $prune_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" <?php echo $prune_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="prune_enable" value="1" <?php echo $prune_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" <?php echo $prune_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Acct_activation']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Acct_activation_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Acct_activation']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Acct_activation_explain']; ?></span></td>
@ -339,7 +339,7 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Enable_COPPA']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_COPPA_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Enable_COPPA']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_COPPA_explain']; ?></span></td>
<td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $coppa_enable_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="coppa_enable" value="0" <?php echo $coppa_enable_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $coppa_enable_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="coppa_enable" value="0" <?php echo $coppa_enable_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['COPPA_fax']; ?>: </td> <td class="row1"><?php echo $user->lang['COPPA_fax']; ?>: </td>
@ -427,7 +427,7 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Use_SMTP']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Use_SMTP_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Use_SMTP']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Use_SMTP_explain']; ?></span></td>
<td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['SMTP_server']; ?>: </td> <td class="row1"><?php echo $user->lang['SMTP_server']; ?>: </td>
@ -485,7 +485,7 @@ switch ($mode)
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Enable_gzip']; ?>: </td> <td class="row1"><?php echo $user->lang['Enable_gzip']; ?>: </td>
<td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['No']; ?></td> <td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['YES']; ?>&nbsp;&nbsp;<input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['NO']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $user->lang['Smilies_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Smilies_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_path_explain']; ?></span></td>
@ -561,7 +561,7 @@ switch ($mode)
?> ?>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $user->lang['Reset']; ?>" class="liteoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -38,7 +38,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
$mode = (isset($_GET['mode'])) ? $_GET['mode'] : ''; $mode = (isset($_GET['mode'])) ? $_GET['mode'] : '';

View file

@ -35,7 +35,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Get mode // Get mode
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';

View file

@ -36,7 +36,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Define some vars // Define some vars
if (isset($_REQUEST['f'])) if (isset($_REQUEST['f']))

View file

@ -36,7 +36,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Do we have permission? // Do we have permission?
if (!$auth->acl_get('a_prune')) if (!$auth->acl_get('a_prune'))

View file

@ -17,28 +17,24 @@ if ( !empty($setmodules) )
} }
define('IN_PHPBB', 1); define('IN_PHPBB', 1);
//
// Include files // Include files
//
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
//
// Do we have styles admin permissions? // Do we have styles admin permissions?
// if (!$auth->acl_get('a_styles'))
if ( !$auth->acl_get('a_styles') )
{ {
message_die(MESSAGE, $user->lang['No_admin']); trigger_error($user->lang['No_admin']);
} }
/* /*
$dp = opendir($phpbb_root_path . 'templates/cache/'); $dp = opendir($phpbb_root_path . 'templates/cache/');
while ( $file = readdir($dp) ) while ($file = readdir($dp))
{ {
if ( !is_file($phpbb_root_path . 'templates/cache/' . $file) && !is_link($phpbb_root_path . 'templates/cache/' . $file) && $file != '.' && $file != '..' ) if (!is_file($phpbb_root_path . 'templates/cache/' . $file) && !is_link($phpbb_root_path . 'templates/cache/' . $file) && $file != '.' && $file != '..')
{ {
$selected = ( $tplroot == $file ) ? ' selected="selected"' : ''; $selected = ($tplroot == $file) ? ' selected="selected"' : '';
$tplroot_options .= '<option name="' . $file . '"' . $selected . '>' . $file . '</option>'; $tplroot_options .= '<option name="' . $file . '"' . $selected . '>' . $file . '</option>';
} }
} }
@ -46,19 +42,17 @@ closedir($dp);
*/ */
// //
// $mode = (isset($_GET['mode'])) ? $_GET['mode'] : $_POST['mode'];
//
$mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode'];
switch ( $mode ) switch ($mode)
{ {
case 'editimageset': case 'editimageset':
$imgroot = ( isset($_POST['imgroot']) ) ? $_POST['imgroot'] : $config['default_style']; $imgroot = (isset($_POST['imgroot'])) ? $_POST['imgroot'] : $config['default_style'];
if ( isset($_POST['img_addconfig']) ) if (isset($_POST['img_addconfig']))
{ {
} }
else if ( isset($_POST['img_addlocal']) ) else if (isset($_POST['img_addlocal']))
{ {
} }
@ -70,27 +64,25 @@ switch ( $mode )
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$imgroot_options = ''; $imgroot_options = '';
while ( $row = $db->sql_fetchrow($result) ) while ($row = $db->sql_fetchrow($result))
{ {
$selected = ( $imgroot == $row['imageset_path'] ) ? ' selected="selected"' : ''; $selected = ($imgroot == $row['imageset_path']) ? ' selected="selected"' : '';
$imgroot_options .= '<option name="' . $row['imageset_path'] . '"' . $selected . '>' . $row['imageset_path'] . '</option>'; $imgroot_options .= '<option name="' . $row['imageset_path'] . '"' . $selected . '>' . $row['imageset_path'] . '</option>';
} }
$imgname_options = ''; $imgname_options = '';
$dp = opendir($phpbb_root_path . 'imagesets/' . $imgroot . '/'); $dp = opendir($phpbb_root_path . 'imagesets/' . $imgroot . '/');
while ( $file = readdir($dp) ) while ($file = readdir($dp))
{ {
if ( preg_match('#\.(gif|png|jpg|jpeg)$#', $file) && is_file($phpbb_root_path . 'imagesets/' . $imgroot . '/' . $file) ) if (preg_match('#\.(gif|png|jpg|jpeg)$#', $file) && is_file($phpbb_root_path . 'imagesets/' . $imgroot . '/' . $file))
{ {
$selected = ( $imgname == $file ) ? ' selected="selected"' : ''; $selected = ($imgname == $file) ? ' selected="selected"' : '';
$imgname_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>'; $imgname_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
} }
} }
closedir($dp); closedir($dp);
//
// Output page // Output page
//
page_header($user->lang['Edit_Imageset']); page_header($user->lang['Edit_Imageset']);
?> ?>
@ -105,7 +97,7 @@ switch ( $mode )
<?php <?php
if ( isset($_POST['img_root']) ) if (isset($_POST['img_root']))
{ {
$sql = "SELECT * $sql = "SELECT *
FROM " . STYLES_IMAGE_TABLE . " FROM " . STYLES_IMAGE_TABLE . "
@ -123,9 +115,9 @@ switch ( $mode )
for($i = 1; $i < count($imageset); $i++) for($i = 1; $i < count($imageset); $i++)
{ {
$row_class = ( !($i%2) ) ? 'row1' : 'row2'; $row_class = (!($i%2)) ? 'row1' : 'row2';
$img = ( !empty($images[$imageset[$i]]) ) ? '<img src=' . $images[$imageset[$i]] . ' />' : ''; $img = (!empty($images[$imageset[$i]])) ? '<img src=' . $images[$imageset[$i]] . ' />' : '';
$img = str_replace('"imagesets/', '"../imagesets/', $img); $img = str_replace('"imagesets/', '"../imagesets/', $img);
$img = str_replace('{LANG}', $user->img_lang, $img); $img = str_replace('{LANG}', $user->img_lang, $img);
$img = str_replace('{RATE}', 3, $img); $img = str_replace('{RATE}', 3, $img);
@ -155,13 +147,13 @@ switch ( $mode )
case 'edittemplate': case 'edittemplate':
$tplcols = ( isset($_POST['tplcols']) ) ? max(60, intval($_POST['tplcols'])) : 90; $tplcols = (isset($_POST['tplcols'])) ? max(60, intval($_POST['tplcols'])) : 90;
$tplrows = ( isset($_POST['tplrows']) ) ? max(4, intval($_POST['tplrows'])) : 30; $tplrows = (isset($_POST['tplrows'])) ? max(4, intval($_POST['tplrows'])) : 30;
$tplname = ( isset($_POST['tplname']) ) ? $_POST['tplname'] : ''; $tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
$tplroot = ( isset($_POST['tplroot']) ) ? $_POST['tplroot'] : 'subSilver'; $tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
$str = ''; $str = '';
if ( isset($_POST['tpl_compile']) && !empty($_POST['decompile']) ) if (isset($_POST['tpl_compile']) && !empty($_POST['decompile']))
{ {
$str = "<?php\n" . $template->compile(stripslashes($_POST['decompile'])) . "\n?".">"; $str = "<?php\n" . $template->compile(stripslashes($_POST['decompile'])) . "\n?".">";
@ -175,10 +167,10 @@ switch ( $mode )
exit; exit;
} }
else if ( !empty($tplname) && isset($_POST['tpl_name']) ) else if (!empty($tplname) && isset($_POST['tpl_name']))
{ {
$fp = fopen($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r'); $fp = fopen($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r');
while ( !feof($fp) ) while (!feof($fp))
{ {
$str .= fread($fp, 4096); $str .= fread($fp, 4096);
} }
@ -188,10 +180,10 @@ switch ( $mode )
} }
else else
{ {
$str = ( !empty($_POST['decompile']) ) ? stripslashes($_POST['decompile']) : ''; $str = (!empty($_POST['decompile'])) ? stripslashes($_POST['decompile']) : '';
} }
if ( isset($_POST['tpl_download']) ) if (isset($_POST['tpl_download']))
{ {
header("Content-Type: text/html; name=\"" . $tplname . ".html\""); header("Content-Type: text/html; name=\"" . $tplname . ".html\"");
header("Content-disposition: attachment; filename=" . $tplname . ".html"); header("Content-disposition: attachment; filename=" . $tplname . ".html");
@ -204,19 +196,17 @@ switch ( $mode )
$tplname_options = ''; $tplname_options = '';
$dp = @opendir($phpbb_root_path . 'templates/cache/' . $tplroot . '/'); $dp = @opendir($phpbb_root_path . 'templates/cache/' . $tplroot . '/');
while ( $file = readdir($dp) ) while ($file = readdir($dp))
{ {
if ( strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $file) ) if (strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $file))
{ {
$tpl = substr($file, 0, strpos($file, '.')); $tpl = substr($file, 0, strpos($file, '.'));
$selected = ( $tplname == $tpl ) ? ' selected="selected"' : ''; $selected = ($tplname == $tpl) ? ' selected="selected"' : '';
$tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>'; $tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
} }
} }
closedir($dp); closedir($dp);
//
//
// //
page_header($user->lang['Edit_template']); page_header($user->lang['Edit_template']);
@ -255,21 +245,21 @@ switch ( $mode )
case 'edittheme': case 'edittheme':
$theme_id = ( isset($_POST['themeroot']) ) ? $_POST['themeroot'] : ''; $theme_id = (isset($_POST['themeroot'])) ? $_POST['themeroot'] : '';
if ( isset($_POST['update']) ) if (isset($_POST['update']))
{ {
$sql = "SELECT theme_id, theme_name $sql = "SELECT theme_id, theme_name
FROM " . STYLES_CSS_TABLE . " FROM " . STYLES_CSS_TABLE . "
WHERE theme_id = $theme_id"; WHERE theme_id = $theme_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) if ($row = $db->sql_fetchrow($result))
{ {
$theme_name = $row['theme_name']; $theme_name = $row['theme_name'];
$css_data = ( !empty($_POST['css_data']) ) ? htmlentities($_POST['css_data']) : ''; $css_data = (!empty($_POST['css_data'])) ? htmlentities($_POST['css_data']) : '';
$css_external = ( !empty($_POST['css_data']) ) ? $_POST['css_data'] : ''; $css_external = (!empty($_POST['css_data'])) ? $_POST['css_data'] : '';
$sql = "UPDATE " > STYLES_CSS_TABLE . " $sql = "UPDATE " > STYLES_CSS_TABLE . "
SET css_data = '$css_data', css_external = '$css_external' SET css_data = '$css_data', css_external = '$css_external'
@ -289,26 +279,26 @@ switch ( $mode )
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$theme_options = ''; $theme_options = '';
if ( $row = $db->sql_fetchrow($result) ) if ($row = $db->sql_fetchrow($result))
{ {
do do
{ {
$theme_options .= ( ( $theme_options != '' ) ? ', ' : '' ) . '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>'; $theme_options .= (($theme_options != '') ? ', ' : '') . '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>';
} }
while ( $row = $db->sql_fetchrow($result) ); while ($row = $db->sql_fetchrow($result));
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$css_data = ''; $css_data = '';
$css_external = ''; $css_external = '';
if ( $theme_id ) if ($theme_id)
{ {
$sql = "SELECT css_data, css_external $sql = "SELECT css_data, css_external
FROM " . STYLES_CSS_TABLE . " FROM " . STYLES_CSS_TABLE . "
WHERE theme_id = $theme_id"; WHERE theme_id = $theme_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) if ($row = $db->sql_fetchrow($result))
{ {
$css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']); $css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']);
$css_external = $row['css_external']; $css_external = $row['css_external'];
@ -348,8 +338,6 @@ switch ( $mode )
} }
//
//
// //
function get_templates($tplroot = '') function get_templates($tplroot = '')
{ {
@ -361,9 +349,9 @@ function get_templates($tplroot = '')
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$tplroot_options = ''; $tplroot_options = '';
while ( $row = $db->sql_fetchrow($result) ) while ($row = $db->sql_fetchrow($result))
{ {
$selected = ( $tplroot == $row['template_path'] ) ? ' selected="selected"' : ''; $selected = ($tplroot == $row['template_path']) ? ' selected="selected"' : '';
$tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>'; $tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
} }

View file

@ -36,7 +36,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Set mode // Set mode
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main'; $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main';
@ -117,11 +117,6 @@ if (isset($_POST['username']) || isset($_GET['u']) || isset($_POST['u']))
<tr> <tr>
<td align="right"><b>Main</b> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=profile">Profile</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=pref">Preferences</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=avatar">Avatar</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=permissions">Permissions</a></td> <td align="right"><b>Main</b> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=profile">Profile</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=pref">Preferences</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=avatar">Avatar</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&amp;u=<?php echo $userdata['user_id']; ?>&amp;mode=permissions">Permissions</a></td>
</tr> </tr>
<tr>
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
<th colspan="2"><?php echo $user->lang[$mode]; ?></td>
</tr>
<?php <?php
switch ($mode) switch ($mode)
@ -129,6 +124,8 @@ if (isset($_POST['username']) || isset($_GET['u']) || isset($_POST['u']))
case 'main': case 'main':
?> ?>
<tr>
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
<tr> <tr>
<td class="row1">Username: <br /><span class="gensmall">Click profile to edit</span></td> <td class="row1">Username: <br /><span class="gensmall">Click profile to edit</span></td>
<td class="row2"><?php echo $userdata['username']; ?> [ <a href="admin_ban.<?php echo $phpEx . $SID; ?>&amp;mode=user&amp;ban=<?php echo $userdata['username']; ?>&amp;bansubmit=true">Ban</a> ]</td> <td class="row2"><?php echo $userdata['username']; ?> [ <a href="admin_ban.<?php echo $phpEx . $SID; ?>&amp;mode=user&amp;ban=<?php echo $userdata['username']; ?>&amp;bansubmit=true">Ban</a> ]</td>
@ -212,27 +209,27 @@ if (isset($_POST['username']) || isset($_GET['u']) || isset($_POST['u']))
?> ?>
<tr> <tr>
<td colspan="2"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> <td colspan="2"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<td class="cat" colspan="3" align="right">Select permission set: <select name="acl_type"><?php
$acl_types = '<option>Global Settings</option><option>---------------</option>';
$acl_types .= '<option value="a">' . $user->lang['ADMINISTRATOR'] . '</option><option value="u">' . $user->lang['USER'] . '</option>';
$acl_types .= '<option>Forum Settings</option><option>---------------</option>';
$acl_types .= make_forum_select(false, false, false);
echo $acl_types;
?></select>&nbsp;</td>
</tr>
<tr> <tr>
<th>&nbsp;<?php echo $user->lang['Option']; ?>&nbsp;</th> <th>&nbsp;<?php echo $user->lang['Option']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Allow']; ?>&nbsp;</th> <th>&nbsp;<?php echo $user->lang['Allow']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Deny']; ?>&nbsp;</th> <th>&nbsp;<?php echo $user->lang['Deny']; ?>&nbsp;</th>
</tr> </tr>
<?php <?php
$type_lang = array(
'f' => 'Forum',
'a' => 'Administrator',
'm' => 'Moderator',
'u' => 'User',
);
foreach ($global as $type => $auth_ary) foreach ($global as $type => $auth_ary)
{ {
?>
<tr>
<td class="cat" colspan="3"><?php echo $type_lang[$type]; ?></td>
</tr>
<?php
foreach ($auth_ary as $option => $allow) foreach ($auth_ary as $option => $allow)
{ {
if ($option != $type .'_') if ($option != $type .'_')

View file

@ -35,7 +35,7 @@ define('IN_PHPBB', 1);
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
// Do we have forum admin permissions? // Do we have forum admin permissions?
if (!$auth->acl_get('a_words')) if (!$auth->acl_get('a_words'))