mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- some SQL:2003 changes (basicly joins, mysql5 is sql:2003 compliant in strict mode now) - postgresql not supporting this standard. :/
- acp changes git-svn-id: file:///svn/phpbb/trunk@5313 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0dc59b9e0d
commit
6d101df7dc
23 changed files with 296 additions and 79 deletions
|
@ -1406,7 +1406,7 @@ class acp_attachments_info
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'filename' => 'acp_attachments',
|
'filename' => 'acp_attachments',
|
||||||
'title' => 'Attachments',
|
'title' => 'ACP_ATTACHMENTS',
|
||||||
'version' => '1.0.0',
|
'version' => '1.0.0',
|
||||||
'modes' => array(
|
'modes' => array(
|
||||||
'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach'),
|
'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach'),
|
||||||
|
|
|
@ -25,6 +25,7 @@ class acp_bbcodes
|
||||||
$bbcode_id = request_var('bbcode', 0);
|
$bbcode_id = request_var('bbcode', 0);
|
||||||
|
|
||||||
$this->tpl_name = 'acp_bbcodes';
|
$this->tpl_name = 'acp_bbcodes';
|
||||||
|
$this->page_title = 'ACP_BBCODES';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ class acp_jabber_info
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'filename' => 'acp_jabber',
|
'filename' => 'acp_jabber',
|
||||||
'title' => 'Jabber',
|
'title' => 'ACP_JABBER_SETTINGS',
|
||||||
'version' => '1.0.0',
|
'version' => '1.0.0',
|
||||||
'modes' => array(
|
'modes' => array(
|
||||||
'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_server'),
|
'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_server'),
|
||||||
|
|
169
phpBB/includes/acp/acp_logs.php
Normal file
169
phpBB/includes/acp/acp_logs.php
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package acp
|
||||||
|
* @version $Id$
|
||||||
|
* @copyright (c) 2005 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package acp
|
||||||
|
*/
|
||||||
|
class acp_logs
|
||||||
|
{
|
||||||
|
function main($id, $mode)
|
||||||
|
{
|
||||||
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||||
|
|
||||||
|
$user->add_lang('mcp');
|
||||||
|
|
||||||
|
// Set up general vars
|
||||||
|
$action = request_var('action', '');
|
||||||
|
$forum_id = request_var('f', 0);
|
||||||
|
$start = request_var('start', 0);
|
||||||
|
$deletemark = (isset($_POST['delmarked'])) ? true : false;
|
||||||
|
$deleteall = (isset($_POST['delall'])) ? true : false;
|
||||||
|
$marked = request_var('mark', array(0));
|
||||||
|
|
||||||
|
// Sort keys
|
||||||
|
$sort_days = request_var('st', 0);
|
||||||
|
$sort_key = request_var('sk', 't');
|
||||||
|
$sort_dir = request_var('sd', 'd');
|
||||||
|
|
||||||
|
$this->tpl_name = 'acp_logs';
|
||||||
|
$this->log_type = constant('LOG_' . strtoupper($mode));
|
||||||
|
|
||||||
|
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
||||||
|
|
||||||
|
// Delete entries if requested and able
|
||||||
|
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
|
||||||
|
{
|
||||||
|
$where_sql = '';
|
||||||
|
if ($deletemark && $marked)
|
||||||
|
{
|
||||||
|
$sql_in = array();
|
||||||
|
foreach ($marked as $mark)
|
||||||
|
{
|
||||||
|
$sql_in[] = $mark;
|
||||||
|
}
|
||||||
|
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
|
||||||
|
unset($sql_in);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($where_sql)
|
||||||
|
{
|
||||||
|
$sql = 'DELETE FROM ' . LOG_TABLE . "
|
||||||
|
WHERE log_type = {$this->log_type}
|
||||||
|
$where_sql";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
add_log('admin', 'LOG_' . strtoupper($mode) . '_CLEAR');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sorting
|
||||||
|
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
|
||||||
|
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
|
||||||
|
$sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
|
||||||
|
|
||||||
|
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
|
||||||
|
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
|
||||||
|
|
||||||
|
// Define where and sort sql for use in displaying logs
|
||||||
|
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
|
||||||
|
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
|
||||||
|
|
||||||
|
$l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
|
||||||
|
$l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN'];
|
||||||
|
|
||||||
|
$this->page_title = $l_title;
|
||||||
|
|
||||||
|
// Define forum list if we're looking @ mod logs
|
||||||
|
if ($mode == 'mod')
|
||||||
|
{
|
||||||
|
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'S_SHOW_FORUMS' => true,
|
||||||
|
'S_FORUM_BOX' => $forum_box)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grab log data
|
||||||
|
$log_data = array();
|
||||||
|
$log_count = 0;
|
||||||
|
view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'L_TITLE' => $l_title,
|
||||||
|
'L_EXPLAIN' => $l_title_explain,
|
||||||
|
'U_ACTION' => $u_action,
|
||||||
|
|
||||||
|
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
||||||
|
'PAGINATION' => generate_pagination($u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
||||||
|
|
||||||
|
'S_LIMIT_DAYS' => $s_limit_days,
|
||||||
|
'S_SORT_KEY' => $s_sort_key,
|
||||||
|
'S_SORT_DIR' => $s_sort_dir,
|
||||||
|
'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'),
|
||||||
|
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($log_data as $row)
|
||||||
|
{
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
foreach (array('viewtopic', 'viewlogs', 'viewforum') as $check)
|
||||||
|
{
|
||||||
|
if (isset($row[$check]) && $row[$check])
|
||||||
|
{
|
||||||
|
$data[] = '<a href="' . $row[$check] . '">' . $user->lang['LOGVIEW_' . strtoupper($check)] . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$template->assign_block_vars('log', array(
|
||||||
|
'USERNAME' => $row['username'],
|
||||||
|
'IP' => $row['ip'],
|
||||||
|
'DATE' => $user->format_date($row['time']),
|
||||||
|
'ACTION' => $row['action'],
|
||||||
|
'DATA' => (sizeof($data)) ? implode(' | ', $data) : '',
|
||||||
|
'ID' => $row['id'],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package module_install
|
||||||
|
*/
|
||||||
|
class acp_logs_info
|
||||||
|
{
|
||||||
|
function module()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'filename' => 'acp_logs',
|
||||||
|
'title' => 'ACP_LOGGING',
|
||||||
|
'version' => '1.0.0',
|
||||||
|
'modes' => array(
|
||||||
|
'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_'),
|
||||||
|
'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_'),
|
||||||
|
'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function install()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function uninstall()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -716,8 +716,8 @@ class acp_modules
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
$sql = 'SELECT m2.*
|
$sql = 'SELECT m2.*
|
||||||
FROM (' . MODULES_TABLE . ' m1
|
FROM ' . MODULES_TABLE . ' m1
|
||||||
LEFT JOIN ' . MODULES_TABLE . " m2 ON $condition)
|
LEFT JOIN ' . MODULES_TABLE . " m2 ON ($condition)
|
||||||
WHERE m1.module_class = '" . $db->sql_escape($this->module_class) . "'
|
WHERE m1.module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||||
AND m2.module_class = '" . $db->sql_escape($this->module_class) . "'
|
AND m2.module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||||
AND m1.module_id = $module_id
|
AND m1.module_id = $module_id
|
||||||
|
|
|
@ -20,7 +20,10 @@ if (!defined('SQL_LAYER'))
|
||||||
/**
|
/**
|
||||||
* @package dbal
|
* @package dbal
|
||||||
* MySQL4 Database Abstraction Layer
|
* MySQL4 Database Abstraction Layer
|
||||||
* Minimum Requirement is 4.0+ (4.1+ compatible)
|
* Compatible with:
|
||||||
|
* MySQL 4.0+
|
||||||
|
* MySQL 4.1+
|
||||||
|
* MySQL 5.0+
|
||||||
*/
|
*/
|
||||||
class dbal_mysql4 extends dbal
|
class dbal_mysql4 extends dbal
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,8 @@ if (!defined('SQL_LAYER'))
|
||||||
/**
|
/**
|
||||||
* @package dbal
|
* @package dbal
|
||||||
* MySQLi Database Abstraction Layer
|
* MySQLi Database Abstraction Layer
|
||||||
* Minimum Requirement is MySQL 4.1+ and the mysqli-extension
|
* mysqli-extension has to be compiled with:
|
||||||
|
* MySQL 4.1+ or MySQL 5.0+
|
||||||
*/
|
*/
|
||||||
class dbal_mysqli extends dbal
|
class dbal_mysqli extends dbal
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,6 +120,11 @@ class dbal_postgres extends dbal
|
||||||
{
|
{
|
||||||
global $cache;
|
global $cache;
|
||||||
|
|
||||||
|
if (strpos($query, 'SELECT') === 0 && strpos($query, 'FROM (') !== false)
|
||||||
|
{
|
||||||
|
$query = preg_replace('#FROM \((.+)\) #', 'FROM \1 ', $query);
|
||||||
|
}
|
||||||
|
|
||||||
// EXPLAIN only in extra debug mode
|
// EXPLAIN only in extra debug mode
|
||||||
if (defined('DEBUG_EXTRA'))
|
if (defined('DEBUG_EXTRA'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -201,7 +201,7 @@ function size_select($select_name, $size_compare)
|
||||||
/**
|
/**
|
||||||
* Obtain authed forums list
|
* Obtain authed forums list
|
||||||
*/
|
*/
|
||||||
function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only = FALSE, $no_cache = FALSE)
|
function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = false, $no_cache = false)
|
||||||
{
|
{
|
||||||
global $db, $auth;
|
global $db, $auth;
|
||||||
static $forum_rows;
|
static $forum_rows;
|
||||||
|
@ -242,7 +242,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = TRUE, $postable_only =
|
||||||
/**
|
/**
|
||||||
* Get forum branch
|
* Get forum branch
|
||||||
*/
|
*/
|
||||||
function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = TRUE)
|
function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $include_forum = true)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -263,8 +263,8 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
$sql = 'SELECT f2.*
|
$sql = 'SELECT f2.*
|
||||||
FROM (' . FORUMS_TABLE . ' f1
|
FROM ' . FORUMS_TABLE . ' f1
|
||||||
LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition)
|
LEFT JOIN ' . FORUMS_TABLE . " f2 ON ($condition)
|
||||||
WHERE f1.forum_id = $forum_id
|
WHERE f1.forum_id = $forum_id
|
||||||
ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
|
ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
@ -431,7 +431,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||||
/**
|
/**
|
||||||
* Remove topic(s)
|
* Remove topic(s)
|
||||||
*/
|
*/
|
||||||
function delete_topics($where_type, $where_ids, $auto_sync = TRUE)
|
function delete_topics($where_type, $where_ids, $auto_sync = true)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$forum_ids = $topic_ids = array();
|
$forum_ids = $topic_ids = array();
|
||||||
|
@ -502,7 +502,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
/**
|
/**
|
||||||
* Remove post(s)
|
* Remove post(s)
|
||||||
*/
|
*/
|
||||||
function delete_posts($where_type, $where_ids, $auto_sync = TRUE)
|
function delete_posts($where_type, $where_ids, $auto_sync = true)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -567,7 +567,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
* ids => (post_ids, topic_ids, attach_ids, user_ids)
|
* ids => (post_ids, topic_ids, attach_ids, user_ids)
|
||||||
* resync => set this to false if you are deleting posts or topics...
|
* resync => set this to false if you are deleting posts or topics...
|
||||||
*/
|
*/
|
||||||
function delete_attachments($mode, $ids, $resync = TRUE)
|
function delete_attachments($mode, $ids, $resync = true)
|
||||||
{
|
{
|
||||||
global $db, $config;
|
global $db, $config;
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ function delete_attachments($mode, $ids, $resync = TRUE)
|
||||||
/**
|
/**
|
||||||
* Remove topic shadows
|
* Remove topic shadows
|
||||||
*/
|
*/
|
||||||
function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE)
|
function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true)
|
||||||
{
|
{
|
||||||
$where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', $forum_id) . ')' : (($forum_id) ? "AND t.forum_id = $forum_id" : '');
|
$where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', $forum_id) . ')' : (($forum_id) ? "AND t.forum_id = $forum_id" : '');
|
||||||
|
|
||||||
|
@ -799,7 +799,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE)
|
||||||
if ($auto_sync)
|
if ($auto_sync)
|
||||||
{
|
{
|
||||||
$where_type = ($forum_id) ? 'forum_id' : '';
|
$where_type = ($forum_id) ? 'forum_id' : '';
|
||||||
sync('forum', $where_type, $forum_id, TRUE);
|
sync('forum', $where_type, $forum_id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ function phpbb_unlink($filename, $mode = 'file')
|
||||||
* - post_attachement Same as post_reported, thanks to a quick Search/Replace
|
* - post_attachement Same as post_reported, thanks to a quick Search/Replace
|
||||||
* - topic_attachement Same as topic_reported, thanks to a quick Search/Replace
|
* - topic_attachement Same as topic_reported, thanks to a quick Search/Replace
|
||||||
*/
|
*/
|
||||||
function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE, $sync_extra = FALSE)
|
function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $sync_extra = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -1346,14 +1346,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
|
||||||
// Now we delete empty topics and orphan posts
|
// Now we delete empty topics and orphan posts
|
||||||
if (sizeof($delete_posts))
|
if (sizeof($delete_posts))
|
||||||
{
|
{
|
||||||
delete_posts('topic_id', array_keys($delete_posts), FALSE);
|
delete_posts('topic_id', array_keys($delete_posts), false);
|
||||||
unset($delete_posts);
|
unset($delete_posts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sizeof($topic_data))
|
if (!sizeof($topic_data))
|
||||||
{
|
{
|
||||||
// If we get there, topic ids were invalid or topics did not contain any posts
|
// If we get there, topic ids were invalid or topics did not contain any posts
|
||||||
delete_topics($where_type, $where_ids, TRUE);
|
delete_topics($where_type, $where_ids, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sizeof($delete_topics))
|
if (sizeof($delete_topics))
|
||||||
|
@ -1365,7 +1365,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
|
||||||
$delete_topic_ids[] = $topic_id;
|
$delete_topic_ids[] = $topic_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_topics('topic_id', $delete_topic_ids, FALSE);
|
delete_topics('topic_id', $delete_topic_ids, false);
|
||||||
unset($delete_topics, $delete_topic_ids);
|
unset($delete_topics, $delete_topic_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1476,7 +1476,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = FALSE,
|
||||||
// batch processing.
|
// batch processing.
|
||||||
if ($resync_parents && sizeof($resync_forums) && $where_type != 'range')
|
if ($resync_parents && sizeof($resync_forums) && $where_type != 'range')
|
||||||
{
|
{
|
||||||
sync('forum', 'forum_id', $resync_forums, TRUE);
|
sync('forum', 'forum_id', $resync_forums, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1636,9 +1636,8 @@ function split_sql_file($sql, $delimiter)
|
||||||
// we don't actually care about the matches preg gives us.
|
// we don't actually care about the matches preg gives us.
|
||||||
$matches = array();
|
$matches = array();
|
||||||
|
|
||||||
// this is faster than calling count($oktens) every time thru the loop.
|
// this is faster than calling sizeof($oktens) every time thru the loop.
|
||||||
$token_count = sizeof($tokens);
|
for ($i = 0, $token_count = sizeof($tokens); $i < $token_count; $i++)
|
||||||
for ($i = 0; $i < $token_count; $i++)
|
|
||||||
{
|
{
|
||||||
// Don't wanna add an empty string as the last thing in the array.
|
// Don't wanna add an empty string as the last thing in the array.
|
||||||
if ($i != $token_count - 1)
|
if ($i != $token_count - 1)
|
||||||
|
|
|
@ -48,7 +48,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
|
|
||||||
if ($config['load_db_track'] && $user->data['is_registered'])
|
if ($config['load_db_track'] && $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))';
|
$sql_from = FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)';
|
||||||
$lastread_select = ', ft.mark_time ';
|
$lastread_select = ', ft.mark_time ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -358,6 +358,11 @@ class p_master
|
||||||
{
|
{
|
||||||
global $user;
|
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 (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,8 +118,8 @@ function mcp_front_view($id, $mode, $action, $url)
|
||||||
if ($total)
|
if ($total)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name
|
$sql = 'SELECT r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name
|
||||||
FROM ' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr,' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
|
FROM (' . REPORTS_TABLE . ' r, ' . REASONS_TABLE . ' rr,' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u)
|
||||||
LEFT JOIN ' . FORUMS_TABLE . ' f ON f.forum_id = p.forum_id
|
LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = p.forum_id)
|
||||||
WHERE r.post_id = p.post_id
|
WHERE r.post_id = p.post_id
|
||||||
AND r.reason_id = rr.reason_id
|
AND r.reason_id = rr.reason_id
|
||||||
AND p.topic_id = t.topic_id
|
AND p.topic_id = t.topic_id
|
||||||
|
|
|
@ -103,7 +103,7 @@ class bbcode_firstpass extends bbcode
|
||||||
'attachment'=> array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
|
'attachment'=> array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
|
||||||
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
|
||||||
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
|
||||||
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#ie' => "\$this->validate_url('\$2', '\$3')")),
|
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
|
||||||
'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
|
'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")),
|
||||||
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
|
'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
|
||||||
'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
|
'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
|
||||||
|
@ -1508,7 +1508,7 @@ class fulltext_search
|
||||||
// Remove words with no matches ... this is a potentially nasty query
|
// Remove words with no matches ... this is a potentially nasty query
|
||||||
$sql = 'SELECT w.word_id
|
$sql = 'SELECT w.word_id
|
||||||
FROM ' . SEARCH_WORD_TABLE . ' w
|
FROM ' . SEARCH_WORD_TABLE . ' w
|
||||||
LEFT JOIN ' . SEARCH_MATCH_TABLE . ' m ON w.word_id = m.word_id
|
LEFT JOIN ' . SEARCH_MATCH_TABLE . ' m ON (w.word_id = m.word_id)
|
||||||
WHERE w.word_common = 0 AND m.word_id IS NULL
|
WHERE w.word_common = 0 AND m.word_id IS NULL
|
||||||
GROUP BY m.word_id';
|
GROUP BY m.word_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
|
@ -294,20 +294,21 @@ class ucp_main
|
||||||
|
|
||||||
if ($config['load_db_lastread'])
|
if ($config['load_db_lastread'])
|
||||||
{
|
{
|
||||||
$sql_from = '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id))';
|
$sql_join = ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)';
|
||||||
$lastread_select = ', ft.mark_time ';
|
$lastread_select = ', ft.mark_time ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql_from = FORUMS_TABLE . ' f ';
|
$sql_join = '';
|
||||||
$lastread_select = '';
|
$lastread_select = '';
|
||||||
|
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array();
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT f.*$lastread_select
|
$sql = "SELECT f.*$lastread_select
|
||||||
FROM $sql_from, " . FORUMS_WATCH_TABLE . ' fw
|
FROM (" . FORUMS_TABLE . ' f, ' . FORUMS_WATCH_TABLE . " fw)
|
||||||
WHERE fw.user_id = ' . $user->data['user_id'] . '
|
$sql_join
|
||||||
|
WHERE fw.user_id = " . $user->data['user_id'] . '
|
||||||
AND f.forum_id = fw.forum_id
|
AND f.forum_id = fw.forum_id
|
||||||
ORDER BY left_id';
|
ORDER BY left_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
@ -390,30 +391,29 @@ class ucp_main
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : '';
|
$sql_join = ($config['load_db_lastread']) ? ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : '';
|
||||||
$sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : '';
|
$sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : '';
|
||||||
|
|
||||||
$sql_from = TOPICS_TABLE . ' t';
|
|
||||||
$sql_t_select = '';
|
$sql_t_select = '';
|
||||||
|
|
||||||
if ($config['load_db_track'])
|
if ($config['load_db_track'])
|
||||||
{
|
{
|
||||||
$sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id
|
$sql_join .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.topic_id = t.topic_id
|
||||||
AND tp.user_id = ' . $user->data['user_id'] . ')';
|
AND tp.user_id = ' . $user->data['user_id'] . ')';
|
||||||
$sql_t_select .= ', tp.topic_posted';
|
$sql_t_select .= ', tp.topic_posted';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['load_db_lastread'])
|
if ($config['load_db_lastread'])
|
||||||
{
|
{
|
||||||
$sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id
|
$sql_join .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id
|
||||||
AND tt.user_id = ' . $user->data['user_id'] . ')';
|
AND tt.user_id = ' . $user->data['user_id'] . ')';
|
||||||
$sql_t_select .= ', tt.mark_time';
|
$sql_t_select .= ', tt.mark_time';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT t.* $sql_f_select $sql_t_select
|
$sql = "SELECT t.* $sql_f_select $sql_t_select
|
||||||
FROM $sql_from $sql_f_tracking, " . TOPICS_WATCH_TABLE . ' tw
|
FROM (" . TOPICS_TABLE . ' t, ' . TOPICS_WATCH_TABLE . " tw
|
||||||
WHERE tw.user_id = ' . $user->data['user_id'] . '
|
$sql_join
|
||||||
|
WHERE tw.user_id = " . $user->data['user_id'] . '
|
||||||
AND t.topic_id = tw.topic_id
|
AND t.topic_id = tw.topic_id
|
||||||
ORDER BY t.topic_last_post_time DESC';
|
ORDER BY t.topic_last_post_time DESC';
|
||||||
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
||||||
|
@ -590,8 +590,8 @@ class ucp_main
|
||||||
// But since bookmarks are sensible to the user, they should not be deleted without notice.
|
// But since bookmarks are sensible to the user, they should not be deleted without notice.
|
||||||
$sql = 'SELECT b.order_id, b.topic_id as b_topic_id, t.*, f.forum_name
|
$sql = 'SELECT b.order_id, b.topic_id as b_topic_id, t.*, f.forum_name
|
||||||
FROM ' . BOOKMARKS_TABLE . ' b
|
FROM ' . BOOKMARKS_TABLE . ' b
|
||||||
LEFT JOIN ' . TOPICS_TABLE . ' t ON b.topic_id = t.topic_id
|
LEFT JOIN ' . TOPICS_TABLE . ' t ON (b.topic_id = t.topic_id)
|
||||||
LEFT JOIN ' . FORUMS_TABLE . ' f ON t.forum_id = f.forum_id
|
LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
|
||||||
WHERE b.user_id = ' . $user->data['user_id'] . '
|
WHERE b.user_id = ' . $user->data['user_id'] . '
|
||||||
ORDER BY b.order_id ASC';
|
ORDER BY b.order_id ASC';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
|
@ -94,14 +94,14 @@ $available_dbms = array(
|
||||||
'COMMENTS' => 'remove_remarks'
|
'COMMENTS' => 'remove_remarks'
|
||||||
),
|
),
|
||||||
'mysqli' => array(
|
'mysqli' => array(
|
||||||
'LABEL' => 'MySQL 4.1.x (MySQLi)',
|
'LABEL' => 'MySQL 4.1.x/5.x (MySQLi)',
|
||||||
'SCHEMA' => 'mysql',
|
'SCHEMA' => 'mysql',
|
||||||
'MODULE' => 'mysqli',
|
'MODULE' => 'mysqli',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
'COMMENTS' => 'remove_remarks'
|
'COMMENTS' => 'remove_remarks'
|
||||||
),
|
),
|
||||||
'mysql4' => array(
|
'mysql4' => array(
|
||||||
'LABEL' => 'MySQL 4',
|
'LABEL' => 'MySQL 4.x/5.x',
|
||||||
'SCHEMA' => 'mysql',
|
'SCHEMA' => 'mysql',
|
||||||
'MODULE' => 'mysql',
|
'MODULE' => 'mysql',
|
||||||
'DELIM' => ';',
|
'DELIM' => ';',
|
||||||
|
|
|
@ -30,6 +30,7 @@ if (empty($lang) || !is_array($lang))
|
||||||
|
|
||||||
// Common
|
// Common
|
||||||
$lang += array(
|
$lang += array(
|
||||||
|
'ACP_ADMIN_LOGS' => 'Admin Log',
|
||||||
'ACP_ATTACHMENTS' => 'Attachments',
|
'ACP_ATTACHMENTS' => 'Attachments',
|
||||||
'ACP_ATTACHMENT_SETTINGS' => 'Attachment Settings',
|
'ACP_ATTACHMENT_SETTINGS' => 'Attachment Settings',
|
||||||
'ACP_AUTH_SETTINGS' => 'Authentication',
|
'ACP_AUTH_SETTINGS' => 'Authentication',
|
||||||
|
@ -40,20 +41,32 @@ $lang += array(
|
||||||
'ACP_BOARD_SETTINGS' => 'Board Settings',
|
'ACP_BOARD_SETTINGS' => 'Board Settings',
|
||||||
'ACP_BOTS' => 'Spiders/Robots',
|
'ACP_BOTS' => 'Spiders/Robots',
|
||||||
'ACP_CAT_GENERAL' => 'General',
|
'ACP_CAT_GENERAL' => 'General',
|
||||||
|
'ACP_CAT_MAINTANENCE' => 'Maintanence',
|
||||||
|
'ACP_CAT_POSTING' => 'Posting',
|
||||||
|
'ACP_CAT_SYSTEM' => 'System',
|
||||||
|
'ACP_CAT_USERGROUP' => 'Users and Groups',
|
||||||
|
'ACP_CLIENT_COMMUNICATION' => 'Client Communication',
|
||||||
'ACP_COOKIE_SETTINGS' => 'Cookie Settings',
|
'ACP_COOKIE_SETTINGS' => 'Cookie Settings',
|
||||||
|
'ACP_CRITICAL_LOGS' => 'Error Log',
|
||||||
'ACP_EMAIL_SETTINGS' => 'Email Settings',
|
'ACP_EMAIL_SETTINGS' => 'Email Settings',
|
||||||
'ACP_EXTENSION_GROUPS' => 'Manage Extension Groups',
|
'ACP_EXTENSION_GROUPS' => 'Manage Extension Groups',
|
||||||
|
'ACP_FORUM_LOGS' => 'Forum Logs',
|
||||||
|
'ACP_GENERAL_CONFIGURATION' => 'General Configuration',
|
||||||
'ACP_ICONS' => 'Topic Icons',
|
'ACP_ICONS' => 'Topic Icons',
|
||||||
'ACP_ICONS_SMILIES' => 'Topic Icons/Smilies',
|
'ACP_ICONS_SMILIES' => 'Topic Icons/Smilies',
|
||||||
|
'ACP_INDEX' => 'Admin index',
|
||||||
'ACP_JABBER_SETTINGS' => 'Jabber Settings',
|
'ACP_JABBER_SETTINGS' => 'Jabber Settings',
|
||||||
'ACP_LOAD_SETTINGS' => 'Load Settings',
|
'ACP_LOAD_SETTINGS' => 'Load Settings',
|
||||||
|
'ACP_LOGGING' => 'Logging',
|
||||||
'ACP_MAIN' => 'Admin index',
|
'ACP_MAIN' => 'Admin index',
|
||||||
'ACP_MANAGE_EXTENSIONS' => 'Manage Extensions',
|
'ACP_MANAGE_EXTENSIONS' => 'Manage Extensions',
|
||||||
|
'ACP_MESSAGES' => 'Messages',
|
||||||
'ACP_MESSAGE_SETTINGS' => 'Message Settings',
|
'ACP_MESSAGE_SETTINGS' => 'Message Settings',
|
||||||
'ACP_MODULE_MANAGEMENT' => 'Module Management',
|
'ACP_MODULE_MANAGEMENT' => 'Module Management',
|
||||||
|
'ACP_MOD_LOGS' => 'Moderator Log',
|
||||||
'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments',
|
'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments',
|
||||||
'ACP_PHP_INFO' => 'PHP Information',
|
'ACP_PHP_INFO' => 'PHP Information',
|
||||||
'ACP_POSTING' => 'Posting',
|
'ACP_SERVER_CONFIGURATION' => 'Server Configuration',
|
||||||
'ACP_SERVER_SETTINGS' => 'Server Settings',
|
'ACP_SERVER_SETTINGS' => 'Server Settings',
|
||||||
'ACP_SMILIES' => 'Smilies',
|
'ACP_SMILIES' => 'Smilies',
|
||||||
'ACP_WORDS' => 'Word Censoring',
|
'ACP_WORDS' => 'Word Censoring',
|
||||||
|
@ -112,6 +125,22 @@ $lang += array(
|
||||||
'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by support or other Team Member on the support forums.',
|
'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by support or other Team Member on the support forums.',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Logs
|
||||||
|
$lang += array(
|
||||||
|
'ACP_ADMIN_LOGS_EXPLAIN' => 'This lists all the actions carried out by board administrators. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
|
||||||
|
'ACP_CRITICAL_LOGS_EXPLAIN' => 'This lists the actions carried out by the board itself. These log provides you with information you are able to use for solving specific problems, for example non-delivery of emails. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
|
||||||
|
'ACP_MOD_LOGS_EXPLAIN' => 'This lists the actions carried out by board moderators, select a forum from the drop down list. You can sort by username, date, IP or action. If you have appropriate permissions you can also clear individual operations or the log as a whole.',
|
||||||
|
'ALL_ENTRIES' => 'All entries',
|
||||||
|
|
||||||
|
'DISPLAY_LOG' => 'Display entries from previous',
|
||||||
|
|
||||||
|
'NO_ENTRIES' => 'No log entries for this period',
|
||||||
|
|
||||||
|
'SORT_IP' => 'IP address',
|
||||||
|
'SORT_DATE' => 'Date',
|
||||||
|
'SORT_ACTION' => 'Log action',
|
||||||
|
);
|
||||||
|
|
||||||
// Index page
|
// Index page
|
||||||
$lang += array(
|
$lang += array(
|
||||||
'ADMIN_INTRO' => 'Thank you for choosing phpBB as your forum solution. This screen will give you a quick overview of all the various statistics of your board. The links on the left hand side of this screen allow you to control every aspect of your forum experience. Each page will have instructions on how to use the tools.',
|
'ADMIN_INTRO' => 'Thank you for choosing phpBB as your forum solution. This screen will give you a quick overview of all the various statistics of your board. The links on the left hand side of this screen allow you to control every aspect of your forum experience. Each page will have instructions on how to use the tools.',
|
||||||
|
@ -216,6 +245,9 @@ $lang += array(
|
||||||
'LOG_WORD_DELETE' => '<b>Deleted word censor</b><br />» %s',
|
'LOG_WORD_DELETE' => '<b>Deleted word censor</b><br />» %s',
|
||||||
'LOG_WORD_EDIT' => '<b>Edited word censor</b><br />» %s',
|
'LOG_WORD_EDIT' => '<b>Edited word censor</b><br />» %s',
|
||||||
|
|
||||||
|
'LOG_ADMIN_CLEAR' => '<b>Cleared admin log</b>',
|
||||||
|
'LOG_MOD_CLEAR' => '<b>Cleared moderator log</b>',
|
||||||
|
'LOG_CRITICAL_CLEAR' => '<b>Cleared error log</b>',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -181,6 +181,7 @@ $lang += array(
|
||||||
'JOINED' => 'Joined',
|
'JOINED' => 'Joined',
|
||||||
'JUMP_PAGE' => 'Enter the page number you wish to goto',
|
'JUMP_PAGE' => 'Enter the page number you wish to goto',
|
||||||
'JUMP_TO' => 'Jump to',
|
'JUMP_TO' => 'Jump to',
|
||||||
|
'JUMP_TO_PAGE' => 'Click to jump to page...',
|
||||||
|
|
||||||
'KB' => 'KB',
|
'KB' => 'KB',
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,8 @@ function get_post_data($post_ids, $acl_list = false)
|
||||||
$rowset = array();
|
$rowset = array();
|
||||||
|
|
||||||
$sql = 'SELECT p.*, u.*, t.*, f.*
|
$sql = 'SELECT p.*, u.*, t.*, f.*
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . TOPICS_TABLE . ' t
|
FROM (' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . TOPICS_TABLE . ' t)
|
||||||
LEFT JOIN ' . FORUMS_TABLE . ' f ON f.forum_id = p.forum_id
|
LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = p.forum_id)
|
||||||
WHERE p.post_id IN (' . implode(', ', $post_ids) . ')
|
WHERE p.post_id IN (' . implode(', ', $post_ids) . ')
|
||||||
AND u.user_id = p.poster_id
|
AND u.user_id = p.poster_id
|
||||||
AND t.topic_id = p.topic_id';
|
AND t.topic_id = p.topic_id';
|
||||||
|
|
|
@ -102,7 +102,7 @@ switch ($mode)
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id
|
$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id
|
||||||
FROM ' . USERS_TABLE . ' u, ' . GROUPS_TABLE . ' g
|
FROM (' . USERS_TABLE . ' u, ' . GROUPS_TABLE . ' g)
|
||||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id AND ug.user_id = ' . $user->data['user_id'] . ')
|
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id AND ug.user_id = ' . $user->data['user_id'] . ')
|
||||||
WHERE u.user_id IN (' . implode(', ', $admin_id_ary + $mod_id_ary) . ')
|
WHERE u.user_id IN (' . implode(', ', $admin_id_ary + $mod_id_ary) . ')
|
||||||
AND u.group_id = g.group_id
|
AND u.group_id = g.group_id
|
||||||
|
@ -294,7 +294,7 @@ switch ($mode)
|
||||||
$group_options .= '<option value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
$group_options .= '<option value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// We left join on the session table to see if the user is currently online
|
//
|
||||||
$sql = 'SELECT username, user_id, user_type, user_colour, user_permissions, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_occ, user_interests, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_avatar, user_avatar_width, user_avatar_height, user_avatar_type, user_lastvisit
|
$sql = 'SELECT username, user_id, user_type, user_colour, user_permissions, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_occ, user_interests, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_avatar, user_avatar_width, user_avatar_height, user_avatar_type, user_lastvisit
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE user_id = $user_id
|
WHERE user_id = $user_id
|
||||||
|
|
|
@ -82,9 +82,9 @@ if ($keywords || $author || $search_id || $search_session_id)
|
||||||
// Which forums can we view?
|
// Which forums can we view?
|
||||||
$sql_where = (sizeof($search_forum) && !$search_child) ? 'WHERE f.forum_id IN (' . implode(', ', $search_forum) . ')' : '';
|
$sql_where = (sizeof($search_forum) && !$search_child) ? 'WHERE f.forum_id IN (' . implode(', ', $search_forum) . ')' : '';
|
||||||
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
|
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
|
||||||
FROM (' . FORUMS_TABLE . ' f
|
FROM ' . FORUMS_TABLE . ' f
|
||||||
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
||||||
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "'))
|
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')
|
||||||
$sql_where
|
$sql_where
|
||||||
ORDER BY f.left_id";
|
ORDER BY f.left_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
@ -583,9 +583,9 @@ if ($keywords || $author || $search_id || $search_session_id)
|
||||||
// Search forum
|
// Search forum
|
||||||
$s_forums = '';
|
$s_forums = '';
|
||||||
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, fa.user_id
|
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, fa.user_id
|
||||||
FROM (' . FORUMS_TABLE . ' f
|
FROM ' . FORUMS_TABLE . ' f
|
||||||
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
|
||||||
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "'))
|
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')
|
||||||
ORDER BY f.left_id ASC";
|
ORDER BY f.left_id ASC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,8 @@ if (!$user->data['is_registered'])
|
||||||
$update_time = $config['load_online_time'] * 60;
|
$update_time = $config['load_online_time'] * 60;
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT u.user_id, u.username, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline
|
$sql = 'SELECT DISTINCT u.user_id, u.username, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline
|
||||||
FROM ((' . ZEBRA_TABLE . ' z
|
FROM (' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u)
|
||||||
LEFT JOIN ' . SESSIONS_TABLE . ' s ON s.session_user_id = z.zebra_id), ' . USERS_TABLE . ' u)
|
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = z.zebra_id)
|
||||||
WHERE z.user_id = ' . $user->data['user_id'] . '
|
WHERE z.user_id = ' . $user->data['user_id'] . '
|
||||||
AND z.friend = 1
|
AND z.friend = 1
|
||||||
AND u.user_id = z.zebra_id
|
AND u.user_id = z.zebra_id
|
||||||
|
|
|
@ -36,27 +36,28 @@ if (!$forum_id)
|
||||||
trigger_error('NO_FORUM');
|
trigger_error('NO_FORUM');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql_from = FORUMS_TABLE . ' f';
|
||||||
|
|
||||||
// Grab appropriate forum data
|
// Grab appropriate forum data
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_lastread = 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
|
$sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
|
||||||
AND ft.forum_id = f.forum_id)';
|
AND ft.forum_id = f.forum_id)';
|
||||||
$lastread_select = ', ft.mark_time';
|
$lastread_select = ', ft.mark_time';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql_lastread = $lastread_select = '';
|
$lastread_select = '';
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array();
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->data['is_registered'])
|
if ($user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_from = ($sql_lastread) ? '((' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ")) $sql_lastread)" : '(' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . '))';
|
$sql_from .= ' LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ')';
|
||||||
$lastread_select .= ', fw.notify_status';
|
$lastread_select .= ', fw.notify_status';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql_from = FORUMS_TABLE . ' f';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT f.* $lastread_select
|
$sql = "SELECT f.* $lastread_select
|
||||||
|
|
|
@ -72,7 +72,7 @@ if ($view && !$post_id)
|
||||||
$topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0;
|
$topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0;
|
||||||
|
|
||||||
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id
|
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id
|
||||||
FROM (' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t)
|
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
|
||||||
WHERE t.topic_id = $topic_id
|
WHERE t.topic_id = $topic_id
|
||||||
AND p.topic_id = t.topic_id
|
AND p.topic_id = t.topic_id
|
||||||
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
||||||
|
@ -146,6 +146,7 @@ if ($view && !$post_id)
|
||||||
// also allows for direct linking to a post (and the calculation of which
|
// also allows for direct linking to a post (and the calculation of which
|
||||||
// page the post is on and the correct display of viewtopic)
|
// page the post is on and the correct display of viewtopic)
|
||||||
$join_sql_table = '';
|
$join_sql_table = '';
|
||||||
|
$select_sql = 't.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags, f.forum_rules_bbcode_uid, f.forum_rules_bbcode_bitfield';
|
||||||
|
|
||||||
if (!$post_id)
|
if (!$post_id)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +164,7 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$extra_fields = (!$post_id) ? '' : ', COUNT(p2.post_id) AS prev_posts';
|
$extra_fields = (!$post_id) ? '' : ', COUNT(p2.post_id) AS prev_posts';
|
||||||
$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style, f.forum_password ORDER BY p.post_id ASC';
|
$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, ' . $select_sql . ' ORDER BY p.post_id ASC';
|
||||||
|
|
||||||
if ($user->data['is_registered'])
|
if ($user->data['is_registered'])
|
||||||
{
|
{
|
||||||
|
@ -189,14 +190,13 @@ if ($user->data['is_registered'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$join_sql_table .= (!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2 ';
|
|
||||||
|
|
||||||
// Join to forum table on topic forum_id unless topic forum_id is zero
|
// Join to forum table on topic forum_id unless topic forum_id is zero
|
||||||
// whereupon we join on the forum_id passed as a parameter ... this
|
// whereupon we join on the forum_id passed as a parameter ... this
|
||||||
// is done so navigation, forum name, etc. remain consistent with where
|
// is done so navigation, forum name, etc. remain consistent with where
|
||||||
// user clicked to view a global topic
|
// user clicked to view a global topic
|
||||||
$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_attachment, t.topic_status, t.topic_approved, t.topic_replies_real, t.topic_replies, t.topic_first_post_id, t.topic_last_post_id, t.topic_last_poster_id, t.topic_last_post_time, t.topic_poster, t.topic_time, t.topic_time_limit, t.topic_type, t.topic_bumped, t.topic_bumper, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, t.poll_vote_change, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_type, f.forum_id, f.forum_style, f.forum_password, f.forum_rules, f.forum_rules_link, f.forum_rules_flags, f.forum_rules_bbcode_uid, f.forum_rules_bbcode_bitfield' . $extra_fields . '
|
$sql = "SELECT $select_sql $extra_fields
|
||||||
FROM ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t' . $join_sql_table . "
|
FROM (" . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t' . ((!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2') . ') ' .
|
||||||
|
$join_sql_table . "
|
||||||
WHERE $join_sql
|
WHERE $join_sql
|
||||||
AND (f.forum_id = t.forum_id
|
AND (f.forum_id = t.forum_id
|
||||||
" . ((!$forum_id) ? '' : 'OR (t.topic_type = ' . POST_GLOBAL . " AND f.forum_id = $forum_id)") . "
|
" . ((!$forum_id) ? '' : 'OR (t.topic_type = ' . POST_GLOBAL . " AND f.forum_id = $forum_id)") . "
|
||||||
|
@ -757,8 +757,8 @@ if (!sizeof($post_list))
|
||||||
$max_post_time = 0;
|
$max_post_time = 0;
|
||||||
|
|
||||||
$sql = 'SELECT u.username, u.user_id, u.user_colour, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_jabber, u.user_regdate, u.user_msnm, u.user_allow_viewemail, u.user_allow_viewonline, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.friend, z.foe, p.*
|
$sql = 'SELECT u.username, u.user_id, u.user_colour, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_jabber, u.user_regdate, u.user_msnm, u.user_allow_viewemail, u.user_allow_viewonline, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, z.friend, z.foe, p.*
|
||||||
FROM (' . POSTS_TABLE . ' p
|
FROM (' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u)
|
||||||
LEFT JOIN ' . ZEBRA_TABLE . ' z ON (z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id)), ' . USERS_TABLE . ' u
|
LEFT JOIN ' . ZEBRA_TABLE . ' z ON (z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id)
|
||||||
WHERE p.post_id IN (' . implode(', ', $post_list) . ')
|
WHERE p.post_id IN (' . implode(', ', $post_list) . ')
|
||||||
AND u.user_id = p.poster_id';
|
AND u.user_id = p.poster_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
@ -1131,7 +1131,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
|
|
||||||
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
|
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
|
||||||
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig']));
|
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig']));
|
||||||
$user_cache[$poster_id]['sig_parsed'] = TRUE;
|
$user_cache[$poster_id]['sig_parsed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the message and subject
|
// Parse the message and subject
|
||||||
|
@ -1302,9 +1302,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
|
|
||||||
'POST_ID' => $row['post_id'],
|
'POST_ID' => $row['post_id'],
|
||||||
|
|
||||||
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? TRUE : FALSE,
|
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
|
||||||
'S_POST_UNAPPROVED' => ($row['post_approved']) ? FALSE : TRUE,
|
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
|
||||||
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? TRUE : FALSE,
|
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? true : false,
|
||||||
'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'],
|
'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'],
|
||||||
'S_FRIEND' => ($row['friend']) ? true : false,
|
'S_FRIEND' => ($row['friend']) ? true : false,
|
||||||
'S_UNREAD_POST' => $post_unread,
|
'S_UNREAD_POST' => $post_unread,
|
||||||
|
|
Loading…
Add table
Reference in a new issue