mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
modified some files to get the admin index page working, as well as index page in logged in state and not logged in state
additionally prepare for a working installation git-svn-id: file:///svn/phpbb/trunk@9272 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2287,11 +2287,9 @@ function cache_moderators()
|
||||
*/
|
||||
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
|
||||
{
|
||||
global $db, $user, $auth;
|
||||
|
||||
$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
|
||||
|
||||
$profile_url = (defined('IN_ADMIN')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview') : append_sid('memberlist', 'mode=viewprofile');
|
||||
$profile_url = (defined('IN_ADMIN')) ? phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview') : phpbb::$url->append_sid('memberlist', 'mode=viewprofile');
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
@@ -2309,7 +2307,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
}
|
||||
else if (is_array($forum_id))
|
||||
{
|
||||
$sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
|
||||
$sql_forum = 'AND ' . phpbb::$db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2343,11 +2341,11 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
" . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . "
|
||||
$sql_forum
|
||||
ORDER BY $sort_by";
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
$result = phpbb::$db->sql_query_limit($sql, $limit, $offset);
|
||||
|
||||
$i = 0;
|
||||
$log = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['topic_id'])
|
||||
{
|
||||
@@ -2375,15 +2373,15 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
'forum_id' => $row['forum_id'],
|
||||
'topic_id' => $row['topic_id'],
|
||||
|
||||
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid('viewforum', 'f=' . $row['forum_id']) : false,
|
||||
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||
'viewforum' => ($row['forum_id'] && phpbb::$acl->acl_get('f_read', $row['forum_id'])) ? phpbb::$url->append_sid('viewforum', 'f=' . $row['forum_id']) : false,
|
||||
'action' => (isset(phpbb::$user->lang[$row['log_operation']])) ? phpbb::$user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||
);
|
||||
|
||||
if (!empty($row['log_data']))
|
||||
{
|
||||
$log_data_ary = unserialize($row['log_data']);
|
||||
|
||||
if (isset($user->lang[$row['log_operation']]))
|
||||
if (isset(phpbb::$user->lang[$row['log_operation']]))
|
||||
{
|
||||
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
|
||||
// It doesn't matter if we add more arguments than placeholders
|
||||
@@ -2417,7 +2415,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($topic_id_list))
|
||||
{
|
||||
@@ -2427,25 +2425,25 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
// although it's also used to determine if the topic still exists in the database
|
||||
$sql = 'SELECT topic_id, forum_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', array_map('intval', $topic_id_list));
|
||||
$result = $db->sql_query($sql);
|
||||
WHERE ' . phpbb::$db->sql_in_set('topic_id', array_map('intval', $topic_id_list));
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$default_forum_id = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['forum_id'])
|
||||
{
|
||||
if ($auth->acl_getf_global('f_read'))
|
||||
if (phpbb::$acl->acl_getf_global('f_read'))
|
||||
{
|
||||
if (!$default_forum_id)
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST;
|
||||
$f_result = $db->sql_query_limit($sql, 1);
|
||||
$default_forum_id = (int) $db->sql_fetchfield('forum_id', $f_result);
|
||||
$db->sql_freeresult($f_result);
|
||||
$f_result = phpbb::$db->sql_query_limit($sql, 1);
|
||||
$default_forum_id = (int) phpbb::$db->sql_fetchfield('forum_id', $f_result);
|
||||
phpbb::$db->sql_freeresult($f_result);
|
||||
}
|
||||
|
||||
$is_auth[$row['topic_id']] = $default_forum_id;
|
||||
@@ -2453,23 +2451,23 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($auth->acl_get('f_read', $row['forum_id']))
|
||||
if (phpbb::$acl->acl_get('f_read', $row['forum_id']))
|
||||
{
|
||||
$is_auth[$row['topic_id']] = $row['forum_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($auth->acl_gets('a_', 'm_', $row['forum_id']))
|
||||
if (phpbb::$acl->acl_gets('a_', 'm_', $row['forum_id']))
|
||||
{
|
||||
$is_mod[$row['topic_id']] = $row['forum_id'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid('mcp', 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : false;
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? phpbb::$url->append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? phpbb::$url->append_sid('mcp', 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, phpbb::$user->session_id) : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2480,14 +2478,14 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
$sql = 'SELECT user_id, username, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $reportee_id_list);
|
||||
$result = $db->sql_query($sql);
|
||||
WHERE ' . phpbb::$db->sql_in_set('user_id', $reportee_id_list);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$reportee_names_list[$row['user_id']] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
@@ -2506,9 +2504,9 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
WHERE l.log_type = $log_type
|
||||
AND l.log_time >= $limit_days
|
||||
$sql_forum";
|
||||
$result = $db->sql_query($sql);
|
||||
$log_count = (int) $db->sql_fetchfield('total_entries');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$log_count = (int) phpbb::$db->sql_fetchfield('total_entries');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2629,15 +2627,13 @@ function update_foes($group_id = false, $user_id = false)
|
||||
*/
|
||||
function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC')
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT COUNT(user_id) AS user_count
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . phpbb::USER_INACTIVE .
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '');
|
||||
$result = $db->sql_query($sql);
|
||||
$user_count = (int) $db->sql_fetchfield('user_count');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$user_count = (int) phpbb::$db->sql_fetchfield('user_count');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($offset >= $user_count)
|
||||
{
|
||||
@@ -2649,27 +2645,27 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
||||
WHERE user_type = ' . phpbb::USER_INACTIVE .
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
|
||||
ORDER BY $sort_by";
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
$result = phpbb::$db->sql_query_limit($sql, $limit, $offset);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_UNKNOWN'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_UNKNOWN'];
|
||||
switch ($row['user_inactive_reason'])
|
||||
{
|
||||
case INACTIVE_REGISTER:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REGISTER'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_REGISTER'];
|
||||
break;
|
||||
|
||||
case INACTIVE_PROFILE:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_PROFILE'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_PROFILE'];
|
||||
break;
|
||||
|
||||
case INACTIVE_MANUAL:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_MANUAL'];
|
||||
break;
|
||||
|
||||
case INACTIVE_REMIND:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_REMIND'];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2711,18 +2707,18 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi
|
||||
*/
|
||||
function get_database_size()
|
||||
{
|
||||
global $db, $user, $table_prefix;
|
||||
global $table_prefix;
|
||||
|
||||
$database_size = false;
|
||||
|
||||
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
|
||||
switch ($db->dbms_type)
|
||||
switch (phpbb::$db->dbms_type)
|
||||
{
|
||||
case 'mysql':
|
||||
$sql = 'SELECT VERSION() AS mysql_version';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($row)
|
||||
{
|
||||
@@ -2730,14 +2726,14 @@ function get_database_size()
|
||||
|
||||
if (preg_match('#(3\.23|[45]\.)#', $version))
|
||||
{
|
||||
$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->dbname}`" : $db->dbname;
|
||||
$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`" . phpbb::$db->dbname . "`" : phpbb::$db->dbname;
|
||||
|
||||
$sql = 'SHOW TABLE STATUS
|
||||
FROM ' . $db_name;
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
|
||||
$database_size = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
|
||||
{
|
||||
@@ -2754,7 +2750,7 @@ function get_database_size()
|
||||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2783,22 +2779,22 @@ function get_database_size()
|
||||
case 'mssql':
|
||||
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||
FROM sysfiles';
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
$database_size = ($row = phpbb::$db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
$sql = "SELECT proname
|
||||
FROM pg_proc
|
||||
WHERE proname = 'pg_database_size'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($row['proname'] == 'pg_database_size')
|
||||
{
|
||||
$database = $db->dbname;
|
||||
$database = phpbb::$db->dbname;
|
||||
if (strpos($database, '.') !== false)
|
||||
{
|
||||
list($database, ) = explode('.', $database);
|
||||
@@ -2807,16 +2803,16 @@ function get_database_size()
|
||||
$sql = "SELECT oid
|
||||
FROM pg_database
|
||||
WHERE datname = '$database'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$oid = $row['oid'];
|
||||
|
||||
$sql = 'SELECT pg_database_size(' . $oid . ') as size';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$database_size = $row['size'];
|
||||
}
|
||||
@@ -2825,13 +2821,13 @@ function get_database_size()
|
||||
case 'oracle':
|
||||
$sql = 'SELECT SUM(bytes) as dbsize
|
||||
FROM user_segments';
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
$database_size = ($row = phpbb::$db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
break;
|
||||
}
|
||||
|
||||
$database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : $user->lang['NOT_AVAILABLE'];
|
||||
$database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : phpbb::$user->lang['NOT_AVAILABLE'];
|
||||
|
||||
return $database_size;
|
||||
}
|
||||
|
@@ -323,7 +323,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
if ($subforum_row['display'] && $subforum_row['name'])
|
||||
{
|
||||
$subforums_list[] = array(
|
||||
'link' => append_sid('viewforum', 'f=' . $subforum_id),
|
||||
'link' => phpbb::$url->append_sid('viewforum', 'f=' . $subforum_id),
|
||||
'name' => $subforum_row['name'],
|
||||
'unread' => $subforum_unread,
|
||||
);
|
||||
@@ -465,7 +465,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
}
|
||||
|
||||
phpbb::$template->assign_vars(array(
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? append_sid('viewforum', 'hash=' . phpbb::$security->hash_link('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? phpbb::$url->append_sid('viewforum', 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
|
||||
'L_SUBFORUM' => phpbb::$user->lang('SUBFORUMS', $visible_forums),
|
||||
'LAST_POST_IMG' => phpbb::$user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
|
||||
@@ -538,7 +538,7 @@ function generate_forum_nav(&$forum_data)
|
||||
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $parent_name,
|
||||
'FORUM_ID' => $parent_forum_id,
|
||||
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $parent_forum_id))
|
||||
'U_VIEW_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $parent_forum_id))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ function generate_forum_nav(&$forum_data)
|
||||
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_ID' => $forum_data['forum_id'],
|
||||
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_data['forum_id']))
|
||||
'U_VIEW_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $forum_data['forum_id']))
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
@@ -999,8 +999,8 @@ function display_user_activity(&$userdata)
|
||||
'ACTIVE_TOPIC' => censor_text($active_t_name),
|
||||
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
|
||||
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
|
||||
'U_ACTIVE_FORUM' => append_sid('viewforum', 'f=' . $active_f_id),
|
||||
'U_ACTIVE_TOPIC' => append_sid('viewtopic', 't=' . $active_t_id),
|
||||
'U_ACTIVE_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $active_f_id),
|
||||
'U_ACTIVE_TOPIC' => phpbb::$url->append_sid('viewtopic', 't=' . $active_t_id),
|
||||
'S_SHOW_ACTIVITY' => true,
|
||||
));
|
||||
}
|
||||
@@ -1043,7 +1043,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$uid = request_var('uid', 0);
|
||||
if ($uid != $user_id)
|
||||
{
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
@@ -1057,7 +1057,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
|
||||
meta_refresh(3, $redirect_url);
|
||||
|
||||
@@ -1083,7 +1083,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
if (phpbb_request::is_set('watch', phpbb_request::GET))
|
||||
{
|
||||
$token = request_var('hash', '');
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
|
||||
if (phpbb_request::variable('watch', '', false, phpbb_request::GET) == $mode && check_link_hash($token, "{$mode}_$match_id"))
|
||||
{
|
||||
@@ -1124,7 +1124,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
|
||||
if ($can_watch)
|
||||
{
|
||||
$s_watching['link'] = append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['link'] = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['is_watching'] = $is_watching;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class p_master
|
||||
*/
|
||||
public function __construct($include_path = false)
|
||||
{
|
||||
$this->include_path = ($include_path !== false) ? $include_path : PHPBB_ROOT_PATH . 'includes/';
|
||||
$this->include_path = ($include_path !== false) ? $include_path : PHPBB_ROOT_PATH . 'modules/';
|
||||
|
||||
// Make sure the path ends with /
|
||||
if (substr($this->include_path, -1) !== '/')
|
||||
@@ -78,8 +78,6 @@ class p_master
|
||||
*/
|
||||
function list_modules($p_class)
|
||||
{
|
||||
global $auth, $db, $user;
|
||||
|
||||
// Sanitise for future path use, it's escaped as appropriate for queries
|
||||
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
|
||||
|
||||
@@ -89,16 +87,16 @@ class p_master
|
||||
// Get modules
|
||||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->p_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->p_class) . "'
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$rows = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$rows[$row['module_id']] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$this->module_cache = array();
|
||||
foreach ($rows as $module_id => $row)
|
||||
@@ -243,7 +241,7 @@ class p_master
|
||||
|
||||
'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '',
|
||||
|
||||
'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
|
||||
'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : phpbb::$user->lang($row['module_langname']),
|
||||
'langname' => $row['module_langname'],
|
||||
|
||||
'left' => $row['left_id'],
|
||||
@@ -310,8 +308,6 @@ class p_master
|
||||
*/
|
||||
function module_auth($module_auth, $forum_id = false)
|
||||
{
|
||||
global $auth;
|
||||
|
||||
$module_auth = trim($module_auth);
|
||||
|
||||
// Generally allowed to access module if module_auth is empty
|
||||
@@ -358,7 +354,7 @@ class p_master
|
||||
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
|
||||
|
||||
$is_auth = false;
|
||||
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) phpbb::$config[\'\\1\']', 'phpbb_request::variable(\'\\1\', false)'), $module_auth) . ');');
|
||||
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) phpbb::$acl->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) phpbb::$acl->acl_getf_global(\'\\1\')', '(int) phpbb::$config[\'\\1\']', 'phpbb_request::variable(\'\\1\', false)'), $module_auth) . ');');
|
||||
|
||||
return $is_auth;
|
||||
}
|
||||
@@ -426,8 +422,6 @@ class p_master
|
||||
*/
|
||||
function load_active($mode = false, $module_url = false, $execute_module = true)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$module_path = $this->include_path . $this->p_class;
|
||||
$icat = request_var('icat', '');
|
||||
|
||||
@@ -471,7 +465,7 @@ class p_master
|
||||
}
|
||||
|
||||
// Not being able to overwrite ;)
|
||||
$this->module->u_action = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
$this->module->u_action = phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -482,10 +476,10 @@ class p_master
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->module->u_action = PHPBB_ROOT_PATH . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
|
||||
$this->module->u_action = PHPBB_ROOT_PATH . ((phpbb::$user->page['page_dir']) ? phpbb::$user->page['page_dir'] . '/' : '') . phpbb::$user->page['page_name'];
|
||||
}
|
||||
|
||||
$this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
$this->module->u_action = phpbb::$url->append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
}
|
||||
|
||||
// Add url_extra parameter to u_action url
|
||||
@@ -560,8 +554,6 @@ class p_master
|
||||
*/
|
||||
function get_parents($parent_id, $left_id, $right_id, &$all_parents)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$parents = array();
|
||||
|
||||
if ($parent_id > 0)
|
||||
@@ -646,8 +638,6 @@ class p_master
|
||||
*/
|
||||
function assign_tpl_vars($module_url)
|
||||
{
|
||||
global $template;
|
||||
|
||||
$current_id = $right_id = false;
|
||||
|
||||
// Make sure the module_url has a question mark set, effectively determining the delimiter to use
|
||||
@@ -747,7 +737,7 @@ class p_master
|
||||
'U_TITLE' => $u_title
|
||||
);
|
||||
|
||||
$template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
phpbb::$template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
}
|
||||
|
||||
$tpl_ary = array(
|
||||
@@ -756,7 +746,7 @@ class p_master
|
||||
'U_TITLE' => $u_title
|
||||
);
|
||||
|
||||
$template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
phpbb::$template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
|
||||
$current_depth = $depth;
|
||||
}
|
||||
@@ -775,14 +765,12 @@ class p_master
|
||||
*/
|
||||
function get_page_title()
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!isset($this->module->page_title))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title;
|
||||
return phpbb::$user->lang($this->module->page_title);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -804,10 +792,8 @@ class p_master
|
||||
*/
|
||||
function display($page_title, $display_online_list = true)
|
||||
{
|
||||
global $template, $user;
|
||||
|
||||
// Generate the page
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('IN_ADMIN') && isset(phpbb::$user->data['session_admin']) && phpbb::$user->data['session_admin'])
|
||||
{
|
||||
adm_page_header($page_title);
|
||||
}
|
||||
@@ -816,11 +802,11 @@ class p_master
|
||||
page_header($page_title, $display_online_list);
|
||||
}
|
||||
|
||||
$template->set_filenames(array(
|
||||
phpbb::$template->set_filenames(array(
|
||||
'body' => $this->get_tpl_name())
|
||||
);
|
||||
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('IN_ADMIN') && isset(phpbb::$user->data['session_admin']) && phpbb::$user->data['session_admin'])
|
||||
{
|
||||
adm_page_footer();
|
||||
}
|
||||
@@ -849,13 +835,11 @@ class p_master
|
||||
*/
|
||||
function add_mod_info($module_class)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (file_exists($user->lang_path . $user->lang_name . '/mods'))
|
||||
if (file_exists(phpbb::$user->lang_path . phpbb::$user->lang_name . '/mods'))
|
||||
{
|
||||
$add_files = array();
|
||||
|
||||
$dir = @opendir($user->lang_path . $user->lang_name . '/mods');
|
||||
$dir = @opendir(phpbb::$user->lang_path . phpbb::$user->lang_name . '/mods');
|
||||
|
||||
if ($dir)
|
||||
{
|
||||
@@ -871,7 +855,7 @@ class p_master
|
||||
|
||||
if (sizeof($add_files))
|
||||
{
|
||||
$user->add_lang($add_files);
|
||||
phpbb::$user->add_lang($add_files);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user