From 0e0100c5255dd288cc479274a112e4eb42a4bacf Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 8 Sep 2008 13:39:34 +0000 Subject: merge r8829, r8830, r8831, r8832, r8833, r8834, r8835, r8836, r8837, r8838 git-svn-id: file:///svn/phpbb/trunk@8839 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 4 ++-- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_admin.php | 4 ++-- phpBB/includes/mcp/mcp_queue.php | 44 ++++++++++++++++++++++++++++++++++++-- phpBB/includes/mcp/mcp_reports.php | 3 ++- phpBB/includes/ucp/ucp_profile.php | 2 +- 6 files changed, 50 insertions(+), 9 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index a87758540d..aec2a58abd 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -633,7 +633,7 @@ class acp_users if (sizeof($topic_id_ary)) { - sync('reported', 'topic_id', $topic_id_ary); + sync('topic_reported', 'topic_id', $topic_id_ary); sync('topic', 'topic_id', $topic_id_ary); } @@ -1092,7 +1092,7 @@ class acp_users 'website' => array( array('string', true, 12, 255), array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), - 'location' => array('string', true, 2, 255), + 'location' => array('string', true, 2, 100), 'occupation' => array('string', true, 2, 500), 'interests' => array('string', true, 2, 500), 'bday_day' => array('num', true, 1, 31), diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index dc297632d2..3e4ce3474a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1986,7 +1986,7 @@ function redirect($url, $return = false, $disable_cd_check = false) $url = substr($url, 1); } - $url = $dir . '/' . $url; + $url = (!empty($dir) ? $dir . '/' : '') . $url; $url = generate_board_url() . '/' . $url; } } diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a91988a8d8..ec3a3e79f6 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -551,7 +551,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s 'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0, ); - $sql = 'SELECT topic_id, forum_id, topic_approved + $sql = 'SELECT topic_id, forum_id, topic_approved, topic_moved_id FROM ' . TOPICS_TABLE . ' WHERE ' . $where_clause; $result = $db->sql_query($sql); @@ -561,7 +561,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s $forum_ids[] = $row['forum_id']; $topic_ids[] = $row['topic_id']; - if ($row['topic_approved']) + if ($row['topic_approved'] && !$row['topic_moved_id']) { $approved_topics++; } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 4be1a9e554..d9c5dbb759 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -814,6 +814,13 @@ function disapprove_post($post_id_list, $id, $mode) // If the reason is defined within the language file, we will use the localized version, else just use the database entry... $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; $disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; + + if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) + { + $disapprove_reason_lang = strtoupper($row['reason_title']); + } + + $email_disapprove_reason = $disapprove_reason; } } @@ -933,6 +940,8 @@ function disapprove_post($post_id_list, $id, $mode) // Notify Poster? if ($notify_poster) { + $lang_reasons = array(); + foreach ($post_info as $post_id => $post_data) { if ($post_data['poster_id'] == ANONYMOUS) @@ -940,6 +949,35 @@ function disapprove_post($post_id_list, $id, $mode) continue; } + if (isset($disapprove_reason_lang)) + { + // Okay we need to get the reason from the posters language + if (!isset($lang_reasons[$post_data['user_lang']])) + { + // Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity. + $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + + // Only load up the language pack if the language is different to the current one + if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx)) + { + // Load up the language pack + $lang = array(); + @include($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx); + + // If we find the reason in this language pack use it + if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang])) + { + $lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + } + + unset($lang); // Free memory + } + } + + $email_disapprove_reason = $lang_reasons[$post_data['user_lang']]; + $email_disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; + } + $email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_disapproved' : 'post_disapproved'; $messenger->template($email_template, $post_data['user_lang']); @@ -949,15 +987,17 @@ function disapprove_post($post_id_list, $id, $mode) $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($post_data['username']), - 'REASON' => htmlspecialchars_decode($disapprove_reason), + 'REASON' => htmlspecialchars_decode($email_disapprove_reason), 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title']))) ); $messenger->send($post_data['user_notify_type']); } + + unset($lang_reasons); } - unset($post_info, $disapprove_reason); + unset($post_info, $disapprove_reason, $email_disapprove_reason, $disapprove_reason_lang); $messenger->save_queue(); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 98d66aedff..344481c844 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -554,7 +554,8 @@ function close_report($report_id_list, $mode, $action) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_reported = 0 - WHERE ' . $db->sql_in_set('topic_id', $close_report_topics); + WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' + OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); $db->sql_query($sql); } } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 782293294e..b19fd1056e 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -315,7 +315,7 @@ class ucp_profile 'website' => array( array('string', true, 12, 255), array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), - 'location' => array('string', true, 2, 255), + 'location' => array('string', true, 2, 100), 'occupation' => array('string', true, 2, 500), 'interests' => array('string', true, 2, 500), ); -- cgit v1.2.1