1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

Changed $board_config to $config, more posting "stuff", altered polling code in viewtopic and loads of new problems, poor coding, etc. created :)

git-svn-id: file:///svn/phpbb/trunk@2983 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2002-10-30 00:57:27 +00:00
parent 9075298051
commit 691f50ada9
43 changed files with 1072 additions and 1044 deletions

View File

@@ -530,7 +530,7 @@ switch ( $mode )
$auth_select = '';
foreach ( $auth_plugins as $method )
{
$selected = ( $board_config['auth_method'] == $method ) ? ' selected="selected"' : '';
$selected = ( $config['auth_method'] == $method ) ? ' selected="selected"' : '';
$auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
}
@@ -557,7 +557,7 @@ switch ( $mode )
//
foreach( $config_fields as $field )
{
if ( !isset($board_config[$field]) )
if ( !isset($config[$field]) )
{
$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
VALUES ('$field', '')";

View File

@@ -94,16 +94,16 @@ if ( isset($_POST['submit']) )
// Let's do some checking to make sure that mass mail functions
// are working in win32 versions of php.
//
if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])
if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery'])
{
// We are running on windows, force delivery to use
// our smtp functions since php's are broken by default
$board_config['smtp_delivery'] = 1;
$board_config['smtp_host'] = get_cfg_var('SMTP');
$config['smtp_delivery'] = 1;
$config['smtp_host'] = get_cfg_var('SMTP');
}
$emailer = new emailer($board_config['smtp_delivery']);
$emailer = new emailer($config['smtp_delivery']);
$email_headers = 'From: ' . $board_config['board_email'] . "\n";
$email_headers = 'From: ' . $config['board_email'] . "\n";
$bcc_list = '';
for($i = 0; $i < count($email_list); $i++)
@@ -119,13 +119,13 @@ if ( isset($_POST['submit']) )
$email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\n";
$emailer->use_template('admin_send_email');
$emailer->email_address($board_config['board_email']);
$emailer->email_address($config['board_email']);
$emailer->set_subject($subject);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'BOARD_EMAIL' => $board_config['board_email'],
'SITENAME' => $config['sitename'],
'BOARD_EMAIL' => $config['board_email'],
'MESSAGE' => $message)
);

View File

@@ -530,12 +530,6 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
<tr>
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['Update']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="<?php echo $user->lang['Cancel']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td>
</tr>
<!-- tr>
<th colspan="4"><?php echo $user->lang['Applies_to_' . $l_type]; ?></th>
</tr>
<tr>
<td class="row1" colspan="4" align="center"><textarea cols="40" rows="3"><?php echo trim($ug); ?></textarea></td>
</tr -->
</table></td>
</tr>
</table></form>

View File

@@ -278,7 +278,7 @@ if ( isset($_POST['start']) || isset($_GET['batchstart']) )
// Remove common words after the first 2 batches and after every 4th batch after that.
if ( $batchcount % 4 == 3 )
{
// remove_common('global', $board_config['common_search']);
// remove_common('global', $config['common_search']);
}
$batchcount++;

View File

@@ -53,7 +53,7 @@ $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode'];
switch ( $mode )
{
case 'editimageset':
$imgroot = ( isset($_POST['imgroot']) ) ? $_POST['imgroot'] : $board_config['default_style'];
$imgroot = ( isset($_POST['imgroot']) ) ? $_POST['imgroot'] : $config['default_style'];
if ( isset($_POST['img_addconfig']) )
{

View File

@@ -197,16 +197,17 @@ if ( isset($_POST['username']) || isset($_GET['u']) || isset( $_POST['u']) )
$userauth = new auth();
$userauth->acl($userdata);
foreach ($acl_options['global'] as $option_name => $option_id)
{
$type = substr($option_name, 0, strpos('_', $option_name) +1 );
$global[$type][$option_name] = $userauth->acl_get($option_name);
}
$sql = "SELECT forum_id, forum_name
FROM " . FORUMS_TABLE . "
ORDER BY left_id";
$result = $db->sql_query($sql);
foreach ($acl_options['global'] as $option_name => $option_id)
{
$global[$option_name] = $userauth->acl_get($option_name);
}
$permissions = array();
while( $row = $db->sql_fetchrow($result) )
{
@@ -220,13 +221,47 @@ if ( isset($_POST['username']) || isset($_GET['u']) || isset( $_POST['u']) )
?>
<tr>
<td>Board-wide options</td>
<td><table cellspacing="1" cellpadding="0" border="0">
<td colspan="2"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th>&nbsp;<?php echo $user->lang['Option']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Allow']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Deny']; ?>&nbsp;</th>
</tr>
<?php
$type_lang = array(
'f' => 'Forum',
'a' => 'Administrator',
'm' => 'Moderator',
'u' => 'User',
);
foreach ($global as $type => $auth_ary)
{
?>
<tr>
<td class="cat" colspan="3"><?php echo $type_lang[$type]; ?></td>
</tr>
<?php
foreach ($global as $option => $allow)
foreach ($auth_ary as $option => $allow)
{
echo '<tr><td>' . $option . ' => ' . ( ( $allow ) ? 'Allowed' : 'Denied' ) . '</td></tr>';
if ( $option != $type .'_' )
{
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1';
$l_can_cell = ( !empty($user->lang['acl_' . $option]) ) ? $user->lang['acl_' . $option] : ucfirst(preg_replace('#.*?_#', '', $option));
$allow_type = ( $allow == ACL_ALLOW ) ? ' checked="checked"' : '';
$deny_type = ( $allow == ACL_DENY ) ? ' checked="checked"' : '';
?>
<tr>
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio"<?php echo $allow_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio"<?php echo $deny_type; ?> /></td>
</tr>
<?php
}
}
}
?>
@@ -245,7 +280,7 @@ if ( isset($_POST['username']) || isset($_GET['u']) || isset( $_POST['u']) )
foreach ($auth_ary as $option => $allow)
{
echo '<tr><td>' . $option . ' => ' . ( ( $allow ) ? 'Allowed' : 'Denied' ) . '</td></tr>';
echo '<tr><td>' . $user->lang['acl_' . $option] . ' => ' . ( ( $allow ) ? 'Allowed' : 'Denied' ) . '</td></tr>';
}
?>
@@ -296,9 +331,9 @@ function ipwhois($ip)
$match = array(
'#RIPE\.NET#is' => 'whois.ripe.net',
'#whois\.apnic\.net#is' => 'whois.ripe.net',
'#nic\.ad\.jp#is' => 'whois.ripe.net',
'#whois\.registro\.br#is' => 'whois.ripe.net'
'#whois\.apnic\.net#is' => 'whois.apnic.net',
'#nic\.ad\.jp#is' => 'whois.nic.ad.jp',
'#whois\.registro\.br#is' => 'whois.registro.br'
);
if ( ($fsk = fsockopen('whois.arin.net', 43)) )

View File

@@ -196,7 +196,7 @@ if ( $mode == 'mod' )
//
$log_data = array();
$log_count = 0;
view_log($mode, $log_data, $log_count, $board_config['topics_per_page'], $start, $forum_id, $where_sql, $sort_sql);
view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, $where_sql, $sort_sql);
if ( $log_count )
{
@@ -242,7 +242,7 @@ else
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="top">&nbsp;<span class="nav"><?php echo on_page($log_count, $board_config['topics_per_page'], $start); ?></span></td>
<td align="left" valign="top">&nbsp;<span class="nav"><?php echo on_page($log_count, $config['topics_per_page'], $start); ?></span></td>
<td align="right" valign="top" nowrap="nowrap"><?php
if ( $auth->acl_get('a_clearlogs') )
@@ -253,7 +253,7 @@ else
}
$pagination = generate_pagination("admin_viewlogs.$phpEx$SID&amp;mode=$mode&amp;sort_days=$sort_days&amp;sort_key=$sort_key&amp;sort_dir=$sort_dir", $log_count, $board_config['topics_per_page'], $start);
$pagination = generate_pagination("admin_viewlogs.$phpEx$SID&amp;mode=$mode&amp;sort_days=$sort_days&amp;sort_key=$sort_key&amp;sort_dir=$sort_dir", $log_count, $config['topics_per_page'], $start);
?><span class="nav"><?php echo $pagination; ?></span></td>
</tr>

View File

@@ -27,7 +27,7 @@ if ( !empty($setmodules) )
}
$file = basename(__FILE__);
$module['General']['Word_Censor'] = "$file$SID";
$module['Posts']['Word_Censor'] = "$file$SID";
return;
}

View File

@@ -174,13 +174,13 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
}
// Get forum statistics
$total_posts = $board_config['num_posts'];
$total_topics = $board_config['num_topics'];
$total_users = $board_config['num_users'];
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
$total_users = $config['num_users'];
$start_date = $user->format_date($board_config['board_startdate']);
$start_date = $user->format_date($config['board_startdate']);
$boarddays = ( time() - $board_config['board_startdate'] ) / 86400;
$boarddays = ( time() - $config['board_startdate'] ) / 86400;
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
@@ -188,13 +188,13 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
$avatar_dir_size = 0;
if ( $avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']) )
if ( $avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']) )
{
while ( $file = @readdir($avatar_dir) )
{
if ( $file != '.' && $file != '..' )
{
$avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . '/' . $file);
$avatar_dir_size += @filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
}
@closedir($avatar_dir);
@@ -360,10 +360,10 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Database_size']; ?>:</td>
<td class="row2"><b><?php echo $dbsize; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Gzip_compression']; ?>:</td>
<td class="row2"><b><?php echo ( $board_config['gzip_compress'] ) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
<td class="row2"><b><?php echo ( $config['gzip_compress'] ) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
</tr>
<!-- tr>
<td class="row1" colspan="4"><?php echo sprintf($user->lang['Record_online_users'], $board_config['record_online_users'], $user->format_date($board_config['record_online_date'])); ?></td>
<td class="row1" colspan="4"><?php echo sprintf($user->lang['Record_online_users'], $config['record_online_users'], $user->format_date($config['record_online_date'])); ?></td>
</tr -->
</table>

View File

@@ -48,12 +48,12 @@ if ($_REQUEST['sid'] != $user->data['session_id'])
// Functions
function page_header($sub_title, $meta = '', $table_html = true)
{
global $board_config, $db, $user, $phpEx;
global $config, $db, $user, $phpEx;
define('HEADER_INC', true);
// gzip_compression
if ( $board_config['gzip_compress'] )
if ( $config['gzip_compress'] )
{
if ( extension_loaded('zlib') && strstr($HTTP_USER_AGENT,'compatible') && !headers_sent() )
{
@@ -81,7 +81,7 @@ th { background-image: url('images/cellpic3.gif') }
td.cat { background-image: url('images/cellpic1.gif') }
//-->
</style>
<title><?php echo $board_config['sitename'] . ' - ' . $page_title; ?></title>
<title><?php echo $config['sitename'] . ' - ' . $page_title; ?></title>
</head>
<body>
@@ -111,7 +111,7 @@ td.cat { background-image: url('images/cellpic1.gif') }
function page_footer($copyright_html = true)
{
global $board_config, $db, $phpEx;
global $config, $db, $phpEx;
// Close our DB connection.
$db->sql_close();
@@ -127,7 +127,7 @@ function page_footer($copyright_html = true)
?>
<div align="center"><span class="copyright">Powered by phpBB <?php echo $board_config['version']; ?> &copy; 2002 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a></span></div>
<div align="center"><span class="copyright">Powered by phpBB <?php echo $config['version']; ?> &copy; 2002 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a></span></div>
<br clear="all" />