aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/functions_admin.php4
-rw-r--r--phpBB/includes/mcp/mcp_front.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php12
-rw-r--r--phpBB/includes/mcp/mcp_post.php18
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php2
-rw-r--r--phpBB/includes/ucp/ucp_register.php2
8 files changed, 41 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 5f633b0dfd..89038ff2e6 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1057,7 +1057,7 @@ class acp_users
$var_ary = array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
- 'tz' => array('num', false, -13, 13),
+ 'tz' => array('num', false, -14, 14),
'topic_sk' => array('string', false, 1, 1),
'topic_sd' => array('string', false, 1, 1),
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index da93b4e403..0a6bf8d126 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -544,8 +544,10 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
/**
* Marks a topic/forum as read
* Marks a topic as posted to
+*
+* @param int $user_id can only be used with $mode == 'post'
*/
-function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0)
+function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)
{
global $db, $user, $config;
@@ -786,7 +788,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0)
$db->sql_return_on_error(true);
$sql_ary = array(
- 'user_id' => $user->data['user_id'],
+ 'user_id' => (!$user_id) ? $user->data['user_id'] : $user_id,
'topic_id' => $topic_id,
'topic_posted' => 1
);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 0c259924d6..261cbe3f45 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -918,11 +918,15 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
}
else
{
+ // Do not sync the "global forum"
+ $where_ids = array_diff($where_ids, array(0));
+
if (!sizeof($where_ids))
{
// Empty array with IDs. This means that we don't have any work to do. Just return.
return;
}
+
// Limit the topics/forums we are syncing, use specific topic/forum IDs.
// $where_type contains the field for the where clause (forum_id, topic_id)
$where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')';
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 67f0885caf..653af87a45 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -115,6 +115,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT COUNT(r.report_id) AS total
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
WHERE r.post_id = p.post_id
+ AND r.report_closed = 0
AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -126,6 +127,7 @@ function mcp_front_view($id, $mode, $action)
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)
WHERE r.post_id = p.post_id
+ AND r.report_closed = 0
AND r.reason_id = rr.reason_id
AND p.topic_id = t.topic_id
AND r.user_id = u.user_id
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 9513bc96f8..5b7433a6a3 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -170,7 +170,14 @@ class mcp_main
mcp_post_details($id, $mode, $action);
- $this->tpl_name = 'mcp_post';
+ if ($action == 'whois')
+ {
+ $this->tpl_name = 'mcp_whois';
+ }
+ else
+ {
+ $this->tpl_name = 'mcp_post';
+ }
break;
default:
@@ -868,6 +875,9 @@ function mcp_fork_topic($topic_ids)
$db->sql_query('INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_post_id = $db->sql_nextid();
+ // Copy whether the topic is dotted
+ markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']);
+
// Copy Attachments
if ($row['post_attachment'])
{
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 5dfb5947f9..3880f036a8 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -34,6 +34,22 @@ function mcp_post_details($id, $mode, $action)
switch ($action)
{
+ case 'whois':
+ $ip = request_var('ip', '');
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+
+ $whois = user_ipwhois($ip);
+
+ $whois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1<a href="mailto:\2">\2</a>\3', $whois);
+ $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $whois);
+
+ $template->assign_vars(array(
+ 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;p=$post_id\">", '</a>'),
+ 'WHOIS' => trim($whois))
+ );
+ // We're done with the whois page so return
+ return;
+
case 'chgposter':
$username = request_var('username', '');
@@ -249,7 +265,7 @@ function mcp_post_details($id, $mode, $action)
'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'],
'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&amp;i=$id&amp;mode=post_details&amp;rdns={$row['poster_ip']}#ip",
- 'U_WHOIS' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=whois&amp;ip={$row['poster_ip']}")
+ 'U_WHOIS' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;action=whois&amp;p=$post_id&amp;ip={$row['poster_ip']}")
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 8bddeee325..580dced38e 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -52,7 +52,7 @@ class ucp_prefs
$var_ary = array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
- 'tz' => array('num', false, -13, 13),
+ 'tz' => array('num', false, -14, 14),
);
$error = validate_data($data, $var_ary);
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index b471e1a79c..5970ac4d99 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -122,7 +122,7 @@ class ucp_register
array('email')),
'email_confirm' => array('string', false, 6, 60),
'confirm_code' => array('string', !$config['enable_confirm'], 5, 8),
- 'tz' => array('num', false, -13, 13),
+ 'tz' => array('num', false, -14, 14),
'lang' => array('match', false, '#^[a-z_]{2,}$#i'),
);