diff options
author | Chris Smith <toonarmy@phpbb.com> | 2008-11-13 13:04:54 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2008-11-13 13:04:54 +0000 |
commit | ef0c0d4c82dadfb856357f6ae906263420d84791 (patch) | |
tree | b3df38203ab6a4f77e493bd9eb74623655e23ce9 /phpBB/includes | |
parent | 1739da933574ff2cd68120d7c6ac0dae914943a6 (diff) | |
download | forums-ef0c0d4c82dadfb856357f6ae906263420d84791.tar forums-ef0c0d4c82dadfb856357f6ae906263420d84791.tar.gz forums-ef0c0d4c82dadfb856357f6ae906263420d84791.tar.bz2 forums-ef0c0d4c82dadfb856357f6ae906263420d84791.tar.xz forums-ef0c0d4c82dadfb856357f6ae906263420d84791.zip |
been a while :( ... merge in r8997, r8998, r8999, r9000, r9001, r9002, r9003, r9004, r9005, r9007, r9008, r9009, r9010, r9011, r9012, r9013, r9014, r9015, r9022, r9023, r9029, r9030, r9034, r9048, r9049, r9054, r9056
git-svn-id: file:///svn/phpbb/trunk@9064 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/info/acp_email.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 4 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 2 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 15 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 2 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 11 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 11 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 42 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 5 |
13 files changed, 96 insertions, 16 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index e122273284..caaeb31404 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -481,7 +481,7 @@ class acp_main $template->assign_var('S_REMOVE_INSTALL', true); } - if (file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT)) + if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT)) { $template->assign_var('S_WRITABLE_CONFIG', true); } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 2fb4a80943..e205b15892 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -633,7 +633,7 @@ parse_css_file = {PARSE_CSS_FILE} { global $config, $db, $cache, $user, $template, $safe_mode; - if (defined('DISABLE_ACP_EDITOR')) + if (defined('PHPBB_DISABLE_ACP_EDITOR')) { trigger_error($user->lang['EDITOR_DISABLED'] . adm_back_link($this->u_action)); } diff --git a/phpBB/includes/acp/info/acp_email.php b/phpBB/includes/acp/info/acp_email.php index f2270892e0..4ad7bca58b 100644 --- a/phpBB/includes/acp/info/acp_email.php +++ b/phpBB/includes/acp/info/acp_email.php @@ -20,7 +20,7 @@ class acp_email_info 'title' => 'ACP_MASS_EMAIL', 'version' => '1.0.0', 'modes' => array( - 'email' => array('title' => 'ACP_MASS_EMAIL', 'auth' => 'acl_a_email', 'cat' => array('ACP_GENERAL_TASKS')), + 'email' => array('title' => 'ACP_MASS_EMAIL', 'auth' => 'acl_a_email && cfg_email_enable', 'cat' => array('ACP_GENERAL_TASKS')), ), ); } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index ad24758aee..635f6f80c5 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1603,7 +1603,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $post_approval = 1; // Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected. - if (($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts'] && !$auth->acl_get('m_approve', $data['forum_id'])) || !$auth->acl_get('f_noapprove', $data['forum_id'])) + if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id'])) { $post_approval = 0; } @@ -2101,7 +2101,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // we need to update the last forum information // only applicable if the topic is not global and it is approved // we also check to make sure we are not dealing with globaling the latest topic (pretty rare but still needs to be checked) - if ($topic_type != POST_GLOBAL && !$make_global && ($post_approved || !$data['post_approved'])) + if ($topic_type != POST_GLOBAL && !$make_global && ($post_approved != $data['post_approved'])) { // the last post makes us update the forum table. This can happen if... // We make a new topic diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 568239b000..66a2e2ad9d 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -245,7 +245,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'S_UNREAD_TOPIC' => $unread_topic, diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 4905640754..4b229c616f 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -26,7 +26,7 @@ function mcp_front_view($id, $mode, $action) // Latest 5 unapproved if ($module->loaded('queue')) { - $forum_list = get_forum_list('m_approve'); + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))); $post_list = array(); $forum_names = array(); @@ -80,7 +80,7 @@ function mcp_front_view($id, $mode, $action) if ($total) { - $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id + $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_list) . ' AND t.topic_id = p.topic_id @@ -102,12 +102,15 @@ function mcp_front_view($id, $mode, $action) 'U_MCP_TOPIC' => append_sid('mcp', 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']), 'U_FORUM' => (!$global_topic) ? append_sid('viewforum', 'f=' . $row['forum_id']) : '', 'U_TOPIC' => append_sid('viewtopic', 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), - 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid('memberlist', 'mode=viewprofile&u=' . $row['poster_id']), + + 'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']), + 'AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour']), + 'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']), + 'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']), 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'POST_ID' => $row['post_id'], 'TOPIC_TITLE' => $row['topic_title'], - 'AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? (($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_TIME' => $user->format_date($row['post_time'])) ); @@ -139,7 +142,7 @@ function mcp_front_view($id, $mode, $action) // Latest 5 reported if ($module->loaded('reports')) { - $forum_list = get_forum_list('m_report'); + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_report'))); $template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false); @@ -242,7 +245,7 @@ function mcp_front_view($id, $mode, $action) // Latest 5 logs if ($module->loaded('logs')) { - $forum_list = get_forum_list('m_'); + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_'))); if (!empty($forum_list)) { diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 3816d2eb17..22b413279f 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -62,7 +62,7 @@ class mcp_logs $this->tpl_name = 'mcp_logs'; $this->page_title = 'MCP_LOGS'; - $forum_list = get_forum_list('m_'); + $forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_'))); $forum_list[] = 0; $forum_id = $topic_id = 0; diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3ada0539f1..48bcd044f5 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -242,6 +242,17 @@ class mcp_queue } $forum_list_approve = get_forum_list('m_approve', false, true); + $forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs + + // Remove forums we cannot read + foreach ($forum_list_approve as $k => $forum_data) + { + if (!isset($forum_list_read[$forum_data['forum_id']])) + { + unset($forum_list_approve[$k]); + } + } + unset($forum_list_read); if (!$forum_id) { diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index df6c399abb..7e6bae1dc1 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -246,6 +246,17 @@ class mcp_reports $forum_info = array(); $forum_list_reports = get_forum_list('m_report', false, true); + $forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs + + // Remove forums we cannot read + foreach ($forum_list_reports as $k => $forum_data) + { + if (!isset($forum_list_read[$forum_data['forum_id']])) + { + unset($forum_list_reports[$k]); + } + } + unset($forum_list_read); if ($topic_id && $forum_id) { diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 83f2aaf8d1..18aacd53a9 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -113,11 +113,18 @@ function mcp_topic_view($id, $mode, $action) { $posts_per_page = $total; } + if ((!empty($sort_days_old) && $sort_days_old != $sort_days) || $total <= $posts_per_page) { $start = 0; } + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total) + { + $start = ($start < 0) ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page; + } + $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' @@ -492,6 +499,9 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $success_msg = 'TOPIC_SPLIT_SUCCESS'; + // Update forum statistics + set_config('num_topics', $config['num_topics'] + 1, true); + // Link back to both topics $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); } diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 4d38d05b57..d91b8b690a 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -245,6 +245,25 @@ class mcp_warn $this->u_action .= "&f=$forum_id&p=$post_id"; } + // Check if can send a notification + if ($config['allow_privmsg']) + { + $auth2 = new auth(); + $auth2->acl($user_row); + $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; + unset($auth2); + } + else + { + $s_can_notify = false; + } + + // Prevent against clever people + if ($notify && !$s_can_notify) + { + $notify = false; + } + if ($warning && $action == 'add_warning') { if (check_form_key('mcp_warn')) @@ -303,6 +322,8 @@ class mcp_warn 'RANK_IMG' => $rank_img, 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . '/viewtopic.' . PHP_EXT . "?f=$forum_id&p=$post_id#p$post_id"), + + 'S_CAN_NOTIFY' => $s_can_notify, )); } @@ -347,6 +368,25 @@ class mcp_warn $this->u_action .= "&u=$user_id"; } + // Check if can send a notification + if ($config['allow_privmsg']) + { + $auth2 = new auth(); + $auth2->acl($user_row); + $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; + unset($auth2); + } + else + { + $s_can_notify = false; + } + + // Prevent against clever people + if ($notify && !$s_can_notify) + { + $notify = false; + } + if ($warning && $action == 'add_warning') { if (check_form_key('mcp_warn')) @@ -385,6 +425,8 @@ class mcp_warn 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, + + 'S_CAN_NOTIFY' => $s_can_notify, )); return $user_id; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index d3b0c87c9a..abcab9c000 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -604,10 +604,10 @@ class bbcode_firstpass extends bbcode $out .= array_pop($list_end_tags) . ']'; $tok = '['; } - else if (preg_match('#^list(=[0-9a-z])?$#i', $buffer, $m)) + else if (preg_match('#^list(=[0-9a-z]+)?$#i', $buffer, $m)) { // sub-list, add a closing tag - if (empty($m[1]) || preg_match('/^(?:disc|square|circle)$/i', $m[1])) + if (empty($m[1]) || preg_match('/^=(?:disc|square|circle)$/i', $m[1])) { array_push($list_end_tags, '/list:u:' . $this->bbcode_uid); } diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index da110e4ac6..b52878509e 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -237,7 +237,10 @@ class ucp_main $l_unwatch .= '_TOPICS'; } $msg = $user->lang['UNWATCHED' . $l_unwatch]; - + } + else + { + $msg = $user->lang['NO_WATCHED_SELECTED']; } } else |