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

$config to phpbb::$config

git-svn-id: file:///svn/phpbb/trunk@9242 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2008-12-28 23:30:09 +00:00
parent 4ded6cf5ee
commit 19aed179e5
102 changed files with 1212 additions and 1293 deletions

View File

@@ -25,7 +25,7 @@ class mcp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
global $db, $user, $auth, $template;
include(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);

View File

@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_forum_view($id, $mode, $action, $forum_info)
{
global $template, $db, $user, $auth, $module, $config;
global $template, $db, $user, $auth, $module;
$user->add_lang(array('viewtopic', 'viewforum'));
@@ -90,7 +90,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
make_jumpbox($url . "&i=$id&action=$action&mode=$mode" . (($merge_select) ? $selected_ids : ''), $forum_id, false, 'm_', true);
$topics_per_page = ($forum_info['forum_topics_per_page']) ? $forum_info['forum_topics_per_page'] : $config['topics_per_page'];
$topics_per_page = ($forum_info['forum_topics_per_page']) ? $forum_info['forum_topics_per_page'] : phpbb::$config['topics_per_page'];
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
@@ -138,7 +138,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_rows = array();
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$read_tracking_join = ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')';
$read_tracking_select = ', tt.mark_time';
@@ -184,7 +184,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
// Get topic tracking info
if (sizeof($topic_list))
{
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $topic_rows, array($forum_id => $forum_info['mark_time']), array());
}

View File

@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_front_view($id, $mode, $action)
{
global $template, $db, $user, $auth, $module, $config;
global $template, $db, $user, $auth, $module;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -33,7 +33,7 @@ function mcp_front_view($id, $mode, $action)
$forum_id = request_var('f', 0);
$template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false);
if (!empty($forum_list))
{
$sql = 'SELECT COUNT(post_id) AS total

View File

@@ -33,7 +33,7 @@ class mcp_logs
function main($id, $mode)
{
global $auth, $db, $user, $template, $config;
global $auth, $db, $user, $template;
$user->add_lang('acp/common');
@@ -166,12 +166,12 @@ class mcp_logs
// Grab log data
$log_data = array();
$log_count = 0;
view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
view_log('mod', $log_data, $log_count, phpbb::$config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($log_count, phpbb::$config['topics_per_page'], $start),
'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, phpbb::$config['topics_per_page'], $start),
'L_TITLE' => $user->lang['MCP_LOGS'],
@@ -187,7 +187,7 @@ class mcp_logs
foreach ($log_data as $row)
{
$data = array();
$checks = array('viewtopic', 'viewforum');
foreach ($checks as $check)
{

View File

@@ -33,7 +33,7 @@ class mcp_main
function main($id, $mode)
{
global $auth, $db, $user, $template, $action, $config;
global $auth, $db, $user, $template, $action;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -931,7 +931,7 @@ function mcp_delete_post($post_ids)
*/
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
global $auth, $user, $db, $template;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
@@ -1174,8 +1174,8 @@ function mcp_fork_topic($topic_ids)
}
sync('forum', 'forum_id', $to_forum_id);
set_config('num_topics', $config['num_topics'] + sizeof($new_topic_id_list), true);
set_config('num_posts', $config['num_posts'] + $total_posts, true);
set_config('num_topics', phpbb::$config['num_topics'] + sizeof($new_topic_id_list), true);
set_config('num_posts', phpbb::$config['num_posts'] + $total_posts, true);
foreach ($new_topic_id_list as $topic_id => $new_topic_id)
{

View File

@@ -33,7 +33,7 @@ class mcp_notes
function main($id, $mode)
{
global $auth, $db, $user, $template, $config;
global $auth, $db, $user, $template;
$action = request_var('action', array('' => ''));
@@ -71,7 +71,7 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
$username = request_var('username', '', true);
@@ -193,7 +193,7 @@ class mcp_notes
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
view_log('user', $log_data, $log_count, phpbb::$config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
if ($log_count)
{
@@ -220,8 +220,8 @@ class mcp_notes
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&st=$st&sk=$sk&sd=$sd", $log_count, $config['posts_per_page'], $start),
'PAGE_NUMBER' => on_page($log_count, phpbb::$config['posts_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&st=$st&sk=$sk&sd=$sd", $log_count, phpbb::$config['posts_per_page'], $start),
'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
'USERNAME' => $userrow['username'],

View File

@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$user->add_lang('posting');
@@ -112,7 +112,7 @@ function mcp_post_details($id, $mode, $action)
$topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$tmp_topic_data = array($post_info['topic_id'] => $post_info);
$topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time']));
@@ -228,7 +228,7 @@ function mcp_post_details($id, $mode, $action)
// Get User Notes
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']);
view_log('user', $log_data, $log_count, phpbb::$config['posts_per_page'], 0, 0, 0, $post_info['user_id']);
if ($log_count)
{
@@ -394,7 +394,7 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
global $auth, $db, $config;
global $auth, $db;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -434,7 +434,7 @@ function change_poster(&$post_info, $userdata)
markread('post', $post_info['forum_id'], $post_info['topic_id'], time(), $userdata['user_id']);
// Remove the dotted topic option if the old user has no more posts within this topic
if ($config['load_db_track'] && $post_info['user_id'] != ANONYMOUS)
if (phpbb::$config['load_db_track'] && $post_info['user_id'] != ANONYMOUS)
{
$sql = 'SELECT topic_id
FROM ' . POSTS_TABLE . '
@@ -465,7 +465,7 @@ function change_poster(&$post_info, $userdata)
}
// refresh search cache of this post
$search_type = basename($config['search_type']);
$search_type = basename(phpbb::$config['search_type']);
if (file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT))
{

View File

@@ -34,7 +34,7 @@ class mcp_queue
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $action;
global $action;
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
@@ -112,7 +112,7 @@ class mcp_queue
$extensions = $attachments = $topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$tmp_topic_data = array($post_info['topic_id'] => $post_info);
$topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time']));
@@ -320,7 +320,7 @@ class mcp_queue
AND t.topic_first_post_id <> p.post_id
$limit_time_sql
ORDER BY $sort_order_sql";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$i = 0;
$post_ids = array();
@@ -371,7 +371,7 @@ class mcp_queue
AND topic_approved = 0
$limit_time_sql
ORDER BY $sort_order_sql";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$rowset = array();
while ($row = $db->sql_fetchrow($result))
@@ -445,8 +445,8 @@ class mcp_queue
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')),
'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true,
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, phpbb::$config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, phpbb::$config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => ($total == 1) ? (($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POST'] : $user->lang['VIEW_FORUM_TOPIC']) : sprintf((($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POSTS'] : $user->lang['VIEW_FORUM_TOPICS']), $total),
));
@@ -462,7 +462,7 @@ class mcp_queue
*/
function approve_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
global $db, $template, $user;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -651,12 +651,12 @@ function approve_post($post_id_list, $id, $mode)
if ($total_topics)
{
set_config('num_topics', $config['num_topics'] + $total_topics, true);
set_config('num_topics', phpbb::$config['num_topics'] + $total_topics, true);
}
if ($total_posts)
{
set_config('num_posts', $config['num_posts'] + $total_posts, true);
set_config('num_posts', phpbb::$config['num_posts'] + $total_posts, true);
}
unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql);
@@ -703,7 +703,7 @@ function approve_post($post_id_list, $id, $mode)
$messenger->save_queue();
// Send out normal user notifications
$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
$email_sig = str_replace('<br />', "\n", "-- \n" . phpbb::$config['board_email_sig']);
foreach ($post_info as $post_id => $post_data)
{
@@ -787,7 +787,7 @@ function approve_post($post_id_list, $id, $mode)
*/
function disapprove_post($post_id_list, $id, $mode)
{
global $db, $template, $user, $config;
global $db, $template, $user;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{

View File

@@ -34,7 +34,7 @@ class mcp_reports
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $action;
global $action;
include_once(PHPBB_ROOT_PATH . 'includes/functions_posting.' . PHP_EXT);
@@ -121,7 +121,7 @@ class mcp_reports
$topic_tracking_info = $extensions = $attachments = array();
// Get topic tracking info
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$tmp_topic_data = array($post_info['topic_id'] => $post_info);
$topic_tracking_info = get_topic_tracking($post_info['forum_id'], $post_info['topic_id'], $tmp_topic_data, array($post_info['forum_id'] => $post_info['forum_mark_time']));
@@ -351,7 +351,7 @@ class mcp_reports
AND t.topic_id = p.topic_id
$limit_time_sql
ORDER BY $sort_order_sql";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$i = 0;
$report_ids = array();
@@ -421,8 +421,8 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;f=$forum_id&amp;t=$topic_id&amp;st=$sort_days&amp;sk=$sort_key&amp;sd=$sort_dir", $total, phpbb::$config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, phpbb::$config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
@@ -440,7 +440,7 @@ class mcp_reports
*/
function close_report($report_id_list, $mode, $action)
{
global $db, $template, $user, $config;
global $db, $template, $user;
$sql = 'SELECT r.post_id
FROM ' . REPORTS_TABLE . ' r

View File

@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_topic_view($id, $mode, $action)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$url = append_sid(PHPBB_ROOT_PATH. 'mcp.' . PHP_EXT . '?' . extra_url());
@@ -108,7 +108,7 @@ function mcp_topic_view($id, $mode, $action)
$total = $topic_info['topic_replies'] + 1;
}
$posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
$posts_per_page = max(0, request_var('posts_per_page', intval(phpbb::$config['posts_per_page'])));
if ($posts_per_page == 0)
{
$posts_per_page = $total;
@@ -154,7 +154,7 @@ function mcp_topic_view($id, $mode, $action)
$topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'])
if (phpbb::$config['load_db_lastread'])
{
$tmp_topic_data = array($topic_id => $topic_info);
$topic_tracking_info = get_topic_tracking($topic_info['forum_id'], $topic_id, $tmp_topic_data, array($topic_info['forum_id'] => $topic_info['forum_mark_time']));
@@ -336,7 +336,7 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $auth, $config;
global $db, $template, $user, $auth;
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
@@ -500,7 +500,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Update forum statistics
set_config('num_topics', $config['num_topics'] + 1, true);
set_config('num_topics', phpbb::$config['num_topics'] + 1, true);
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');

View File

@@ -33,7 +33,7 @@ class mcp_warn
function main($id, $mode)
{
global $auth, $db, $user, $template, $config;
global $auth, $db, $user, $template;
$action = request_var('action', array('' => ''));
@@ -75,7 +75,7 @@ class mcp_warn
*/
function mcp_warn_front_view()
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$template->assign_vars(array(
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
@@ -133,7 +133,7 @@ class mcp_warn
*/
function mcp_warn_list_view($action)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$user->add_lang('memberlist');
@@ -156,7 +156,7 @@ class mcp_warn
$users = array();
$user_count = 0;
view_warned_users($users, $user_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
view_warned_users($users, $user_count, phpbb::$config['topics_per_page'], $start, $sql_where, $sql_sort);
foreach ($users as $row)
{
@@ -180,8 +180,8 @@ class mcp_warn
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination(append_sid('mcp', "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($user_count, phpbb::$config['topics_per_page'], $start),
'PAGINATION' => generate_pagination(append_sid('mcp', "i=warn&amp;mode=list&amp;st=$st&amp;sk=$sk&amp;sd=$sd"), $user_count, phpbb::$config['topics_per_page'], $start),
'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
));
}
@@ -191,7 +191,7 @@ class mcp_warn
*/
function mcp_warn_post_view($action)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
$post_id = request_var('p', 0);
$forum_id = request_var('f', 0);
@@ -246,7 +246,7 @@ class mcp_warn
}
// Check if can send a notification
if ($config['allow_privmsg'])
if (phpbb::$config['allow_privmsg'])
{
$auth2 = new auth();
$auth2->acl($user_row);
@@ -332,7 +332,7 @@ class mcp_warn
*/
function mcp_warn_user_view($action)
{
global $config, $module;
global $module;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
@@ -369,7 +369,7 @@ class mcp_warn
}
// Check if can send a notification
if ($config['allow_privmsg'])
if (phpbb::$config['allow_privmsg'])
{
$auth2 = new auth();
$auth2->acl($user_row);
@@ -438,14 +438,14 @@ class mcp_warn
*/
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
global $template, $db, $user, $auth, $config;
global $template, $db, $user, $auth;
if ($send_pm)
{
include_once(PHPBB_ROOT_PATH . 'includes/functions_privmsgs.' . PHP_EXT);
include_once(PHPBB_ROOT_PATH . 'includes/message_parser.' . PHP_EXT);
$user_row['user_lang'] = (file_exists(PHPBB_ROOT_PATH . 'language/' . $user_row['user_lang'] . '/mcp.' . PHP_EXT)) ? $user_row['user_lang'] : $config['default_lang'];
$user_row['user_lang'] = (file_exists(PHPBB_ROOT_PATH . 'language/' . $user_row['user_lang'] . '/mcp.' . PHP_EXT)) ? $user_row['user_lang'] : phpbb::$config['default_lang'];
include(PHPBB_ROOT_PATH . 'language/' . basename($user_row['user_lang']) . '/mcp.' . PHP_EXT);
$message_parser = new parse_message();