diff options
| author | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 | 
|---|---|---|
| committer | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 | 
| commit | a06a38ae692551dc1c0416b835ce9924b3d9f7f5 (patch) | |
| tree | 1bb2c2b3d8d56668585513890afc1d641cead0b1 /phpBB/includes/mcp/mcp_main.php | |
| parent | 2db884ac2e5122be1db0582b76bf7204783a0c0d (diff) | |
| parent | 19a47dfbbc4265e33c14d6679b5693d80120db4b (diff) | |
| download | forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.gz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.bz2 forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.xz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.zip | |
Merging with upstream 3.0.11
Diffstat (limited to 'phpBB/includes/mcp/mcp_main.php')
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 68 | 
1 files changed, 34 insertions, 34 deletions
| diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index d5551f5114..ffede11d37 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -286,14 +286,6 @@ function change_topic_type($action, $topic_ids)  {  	global $auth, $user, $db, $phpEx, $phpbb_root_path; -	// For changing topic types, we only allow operations in one forum. -	$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'), true); - -	if ($forum_id === false) -	{ -		return; -	} -  	switch ($action)  	{  		case 'make_announce': @@ -316,11 +308,18 @@ function change_topic_type($action, $topic_ids)  		default:  			$new_topic_type = POST_NORMAL; -			$check_acl = ''; +			$check_acl = false;  			$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS';  		break;  	} +	$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true); + +	if ($forum_id === false) +	{ +		return; +	} +  	$redirect = request_var('redirect', build_url(array('action', 'quickmod')));  	$s_hidden_fields = array( @@ -1048,37 +1047,38 @@ function mcp_fork_topic($topic_ids)  		$total_posts = 0;  		$new_topic_id_list = array(); -		if ($topic_data['enable_indexing']) -		{ -			// Select the search method and do some additional checks to ensure it can actually be utilised -			$search_type = basename($config['search_type']); -			if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +		foreach ($topic_data as $topic_id => $topic_row) +		{ +			if (!isset($search_type) && $topic_row['enable_indexing'])  			{ -				trigger_error('NO_SUCH_SEARCH_MODULE'); -			} +				// Select the search method and do some additional checks to ensure it can actually be utilised +				$search_type = basename($config['search_type']); -			if (!class_exists($search_type)) -			{ -				include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); -			} +				if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +				{ +					trigger_error('NO_SUCH_SEARCH_MODULE'); +				} -			$error = false; -			$search = new $search_type($error); -			$search_mode = 'post'; +				if (!class_exists($search_type)) +				{ +					include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); +				} -			if ($error) +				$error = false; +				$search = new $search_type($error); +				$search_mode = 'post'; + +				if ($error) +				{ +					trigger_error($error); +				} +			} +			else if (!isset($search_type) && !$topic_row['enable_indexing'])  			{ -				trigger_error($error); +				$search_type = false;  			} -		} -		else -		{ -			$search_type = false; -		} -		foreach ($topic_data as $topic_id => $topic_row) -		{  			$sql_ary = array(  				'forum_id'					=> (int) $to_forum_id,  				'icon_id'					=> (int) $topic_row['icon_id'], @@ -1187,9 +1187,9 @@ function mcp_fork_topic($topic_ids)  				// Copy whether the topic is dotted  				markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']); -				if ($search_type) +				if (!empty($search_type))  				{ -					$search->index($search_mode, $sql_ary['post_id'], $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id); +					$search->index($search_mode, $new_post_id, $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);  					$search_mode = 'reply'; // After one we index replies  				} | 
