1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

- m_warn is no longer a local moderation permission

- magic urls should properly use html entities
- speed up posting on big boards, MAX(post_id) query can be simplified a lot in certain cases
- user IP list should be labelled with "Other users" [Bug #9707]


git-svn-id: file:///svn/phpbb/trunk@7355 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann
2007-04-15 10:59:26 +00:00
parent 5cde784419
commit fb24543144
11 changed files with 30 additions and 18 deletions

View File

@@ -2620,11 +2620,11 @@ function make_clickable($text, $server_url = false)
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url_inline') . ')#ie';
$magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- m -->'";
$magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\">' . ((strlen('\$2') > 55) ? str_replace('&', '&amp;', substr(str_replace('&amp;', '&', '\$2'), 0, 39)) . ' ... ' . str_replace('&', '&amp;', substr(str_replace('&amp;', '&', '\$2'), -10)) : '\$2') . '</a><!-- m -->'";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('www_url_inline') . ')#ie';
$magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- w -->'";
$magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\">' . ((strlen('\$2') > 55) ? str_replace('&', '&amp;', substr(str_replace('&amp;', '&', '\$2'), 0, 39)) . ' ... ' . str_replace('&', '&amp;', substr(str_replace('&amp;', '&', '\$2'), -10)) : '\$2') . '</a><!-- w -->'";
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match[] = '/(^|[\n\t )])(' . get_preg_expression('email') . ')/ie';

View File

@@ -99,10 +99,12 @@ function generate_smilies($mode, $forum_id)
* Update last post information
* Should be used instead of sync() if only the last post information are out of sync... faster
*
* @param string $type Can be forum|topic
* @param mixed $ids topic/forum ids
* @param string $type Can be forum|topic
* @param mixed $ids topic/forum ids
* @param bool $return_update_sql true: SQL query shall be returned, false: execute SQL
* @param int $min_post_id 0: no bottom limit known, 1..n: MAX(post_id) >= n
*/
function update_post_information($type, $ids, $return_update_sql = false)
function update_post_information($type, $ids, $return_update_sql = false, $min_post_id = 0)
{
global $db;
@@ -113,6 +115,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
$update_sql = $empty_forums = $not_empty_forums = array();
$min_post_id_sql = ($min_post_id) ? ' AND p.post_id >= ' . $min_post_id : '';
if ($type != 'topic')
{
$topic_join = ', ' . TOPICS_TABLE . ' t';
@@ -130,7 +134,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
AND p.post_approved = 1";
AND p.post_approved = 1
$min_post_id_sql";
}
else
{
@@ -139,6 +144,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
AND p.post_approved = 1
$min_post_id_sql
GROUP BY p.{$type}_id";
}
$result = $db->sql_query($sql);
@@ -1872,14 +1878,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{
if ($topic_type != POST_GLOBAL)
{
$update_sql = update_post_information('forum', $data['forum_id'], true);
$update_sql = update_post_information('forum', $data['forum_id'], true, $data['post_id']);
if (sizeof($update_sql))
{
$sql_data[FORUMS_TABLE]['stat'][] = implode(', ', $update_sql[$data['forum_id']]);
}
}
$update_sql = update_post_information('topic', $data['topic_id'], true);
$update_sql = update_post_information('topic', $data['topic_id'], true, $data['post_id']);
if (sizeof($update_sql))
{
$sql_data[TOPICS_TABLE]['stat'][] = implode(', ', $update_sql[$data['topic_id']]);
@@ -1888,7 +1894,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($make_global)
{
$update_sql = update_post_information('forum', $data['forum_id'], true);
$update_sql = update_post_information('forum', $data['forum_id'], true, $data['post_id']);
if (sizeof($update_sql))
{
$sql_data[FORUMS_TABLE]['stat'][] = implode(', ', $update_sql[$data['forum_id']]);

View File

@@ -141,7 +141,7 @@ function mcp_post_details($id, $mode, $action)
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),

View File

@@ -143,7 +143,7 @@ class mcp_queue
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => $post_url,
'U_VIEW_TOPIC' => $topic_url,

View File

@@ -147,8 +147,8 @@ class mcp_reports
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_REPORTER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),