diff options
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/bbcode.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_admin.php | 78 | ||||
| -rw-r--r-- | phpBB/includes/functions_posting.php | 220 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 45 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 473 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 2 | ||||
| -rw-r--r-- | phpBB/language/en/common.php | 1 | ||||
| -rw-r--r-- | phpBB/language/en/email/post_approved.txt | 15 | ||||
| -rw-r--r-- | phpBB/language/en/email/post_disapproved.txt | 13 | ||||
| -rw-r--r-- | phpBB/language/en/email/topic_approved.txt | 12 | ||||
| -rw-r--r-- | phpBB/language/en/email/topic_disapproved.txt | 13 | ||||
| -rw-r--r-- | phpBB/language/en/mcp.php | 5 | ||||
| -rw-r--r-- | phpBB/mcp.php | 17 | ||||
| -rw-r--r-- | phpBB/posting.php | 230 | ||||
| -rw-r--r-- | phpBB/styles/subSilver/template/mcp_approve.html | 92 | ||||
| -rw-r--r-- | phpBB/styles/subSilver/template/mcp_front.html | 66 | ||||
| -rw-r--r-- | phpBB/styles/subSilver/template/mcp_post.html | 245 | ||||
| -rw-r--r-- | phpBB/viewforum.php | 2 | ||||
| -rw-r--r-- | phpBB/viewtopic.php | 2 | 
21 files changed, 1095 insertions, 447 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 144dafbb30..92a455ce26 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -458,7 +458,7 @@ class bbcode  				$code = str_replace("\t", '   ', $code);  				$code = str_replace('  ', '  ', $code);  				$code = str_replace('  ', '  ', $code); -				$code = preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '\1', $code); +				$code = preg_replace(array('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '#&(\#[0-9]+;)#'), array('\1', '&\1'), $code);  		}  		$code = $this->bbcode_tpl('code_open') . $code . $this->bbcode_tpl('code_close'); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 067f463325..0507d68c40 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2149,6 +2149,84 @@ if (class_exists('auth'))  	}  } +// Update Post Informations (First/Last Post in topic/forum) +// Should be used instead of sync() if only the last post informations are out of sync... faster +function update_post_information($type, $ids) +{ +	global $db; + +	if (!is_array($ids)) +	{ +		$ids = array($ids); +	} + +	$update_sql = $empty_forums = array(); +	$sql = 'SELECT ' . $type . '_id, MAX(post_id) as last_post_id +		FROM ' . POSTS_TABLE . " +		WHERE post_approved = 1 +			AND {$type}_id IN (" . implode(', ', $ids) . ") +		GROUP BY {$type}_id"; +	$result = $db->sql_query($sql); + +	$last_post_ids = array(); +	while ($row = $db->sql_fetchrow($result)) +	{ +		if ($type == 'forum') +		{ +			$empty_forums[] = $row['forum_id']; +		} + +		$last_post_ids[] = $row['last_post_id']; +	} +	$db->sql_freeresult($result); + +	if ($type == 'forum') +	{ +		$empty_forums = array_diff($ids, $empty_forums); + +		foreach ($empty_forums as $void => $forum_id) +		{ +			$update_sql[$forum_id][] = 'forum_last_post_id = 0'; +			$update_sql[$forum_id][] =	'forum_last_post_time = 0'; +			$update_sql[$forum_id][] = 'forum_last_poster_id = 0'; +			$update_sql[$forum_id][] = "forum_last_poster_name = ''"; +		} +	} + +	if (sizeof($last_post_ids)) +	{ +		$sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_time, p.poster_id, p.post_username, u.user_id, u.username +			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u +			WHERE p.poster_id = u.user_id +				AND p.post_id IN (' . implode(', ', $last_post_ids) . ')'; +		$result = $db->sql_query($sql); + +		while ($row = $db->sql_fetchrow($result)) +		{ +			$update_sql[$row["{$type}_id"]][] = $type . '_last_post_id = ' . (int) $row['post_id']; +			$update_sql[$row["{$type}_id"]][] = $type . '_last_post_time = ' . (int) $row['post_time']; +			$update_sql[$row["{$type}_id"]][] = $type . '_last_poster_id = ' . (int) $row['poster_id']; +			$update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; +		} +		$db->sql_freeresult($result); +	} +	unset($empty_forums, $ids, $last_post_ids); + +	if (!sizeof($update_sql)) +	{ +		return; +	} + +	$table = ($type == 'forum') ? FORUMS_TABLE : TOPICS_TABLE; + +	foreach ($update_sql as $update_id => $update_sql_ary) +	{ +		$sql = "UPDATE $table +			SET " . implode(', ', $update_sql_ary) . " +			WHERE {$type}_id = $update_id"; +		$db->sql_query($sql); +	} +}  ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index d793e66586..4ab2a13157 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1013,4 +1013,224 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id  	return true;  } +// User Notification +function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) +{ +	global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; + +	$topic_notification = ($mode == 'reply' || $mode == 'quote'); +	$forum_notification = ($mode == 'post'); + +	if (!$topic_notification && !$forum_notification) +	{ +		trigger_error('WRONG_NOTIFICATION_MODE'); +	} + +	$topic_title = ($topic_notification) ? $topic_title : $subject; +	decode_text($topic_title); +	$topic_title = censor_text($topic_title); + +	// Get banned User ID's +	$sql = 'SELECT ban_userid  +		FROM ' . BANLIST_TABLE; +	$result = $db->sql_query($sql); + +	$sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; +	while ($row = $db->sql_fetchrow($result)) +	{ +		if (isset($row['ban_userid'])) +		{ +			$sql_ignore_users .= ', ' . $row['ban_userid']; +		} +	} +	$db->sql_freeresult($result); + +	$notify_rows = array(); + +	// -- get forum_userids	|| topic_userids +	$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber  +		FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u +		WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " +			AND w.user_id NOT IN ($sql_ignore_users) +			AND w.notify_status = 0 +			AND u.user_id = w.user_id"; +	$result = $db->sql_query($sql); + +	while ($row = $db->sql_fetchrow($result)) +	{ +		$notify_rows[$row['user_id']] = array( +			'user_id'		=> $row['user_id'], +			'username'		=> $row['username'], +			'user_email'	=> $row['user_email'], +			'user_jabber'	=> $row['user_jabber'],  +			'user_lang'		=> $row['user_lang'],  +			'notify_type'	=> ($topic_notification) ? 'topic' : 'forum', +			'template'		=> ($topic_notification) ? 'topic_notify' : 'newtopic_notify', +			'method'		=> $row['user_notify_type'],  +			'allowed'		=> false +		); +	} +	$db->sql_freeresult($result); +	 +	// forum notification is sent to those not receiving post notification +	if ($topic_notification) +	{ +		if (sizeof($notify_rows)) +		{ +			$sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); +		} + +		$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber  +			FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u +			WHERE fw.forum_id = $forum_id +				AND fw.user_id NOT IN ($sql_ignore_users) +				AND fw.notify_status = 0 +				AND u.user_id = fw.user_id"; +		$result = $db->sql_query($sql); + +		while ($row = $db->sql_fetchrow($result)) +		{ +			$notify_rows[$row['user_id']] = array( +				'user_id'		=> $row['user_id'], +				'username'		=> $row['username'], +				'user_email'	=> $row['user_email'], +				'user_jabber'	=> $row['user_jabber'],  +				'user_lang'		=> $row['user_lang'], +				'notify_type'	=> 'forum', +				'template'		=> 'forum_notify', +				'method'		=> $row['user_notify_type'],  +				'allowed'		=> false +			); +		} +		$db->sql_freeresult($result); +	} + +	if (!sizeof($notify_rows)) +	{ +		return; +	} + +	foreach ($auth->acl_get_list(array_keys($notify_rows), 'f_read', $forum_id) as $forum_id => $forum_ary) +	{ +		foreach ($forum_ary as $auth_option => $user_ary) +		{ +			foreach ($user_ary as $user_id) +			{ +				$notify_rows[$user_id]['allowed'] = true; +			} +		} +	} + + +	// Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) +	$msg_users = $delete_ids = $update_notification = array(); +	foreach ($notify_rows as $user_id => $row) +	{ +		if (!$row['allowed'] || !trim($row['user_email'])) +		{ +			$delete_ids[$row['notify_type']][] = $row['user_id']; +		} +		else +		{ +			$msg_users[] = $row; +			$update_notification[$row['notify_type']][] = $row['user_id']; +		} +	} +	unset($notify_rows); + +	// Now, we are able to really send out notifications +	if (sizeof($msg_users)) +	{ +		include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); +		$messenger = new messenger(); + +		$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); + +		$msg_list_ary = array(); +		foreach ($msg_users as $row) +		{  +			$pos = sizeof($msg_list_ary[$row['template']]); + +			$msg_list_ary[$row['template']][$pos]['method']	= $row['method']; +			$msg_list_ary[$row['template']][$pos]['email']	= $row['user_email']; +			$msg_list_ary[$row['template']][$pos]['jabber']	= $row['user_jabber']; +			$msg_list_ary[$row['template']][$pos]['name']	= $row['username']; +			$msg_list_ary[$row['template']][$pos]['lang']	= $row['user_lang']; +		} +		unset($msg_users); + +		foreach ($msg_list_ary as $email_template => $email_list) +		{ +			foreach ($email_list as $addr) +			{ +				$messenger->template($email_template, $addr['lang']); + +				$messenger->replyto($config['board_email']); +				$messenger->to($addr['email'], $addr['name']); +				$messenger->im($addr['jabber'], $addr['name']); + +				$messenger->assign_vars(array( +					'EMAIL_SIG'		=> $email_sig, +					'SITENAME'		=> $config['sitename'], +					'USERNAME'		=> $addr['name'], +					'TOPIC_TITLE'	=> $topic_title,   +					'FORUM_NAME'	=> $forum_name, + +					'U_FORUM'				=> generate_board_url() . "/viewforum.$phpEx?f=$forum_id&e=0", +					'U_TOPIC'				=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&e=0", +					'U_NEWEST_POST'			=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id", +					'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic", +					'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum",  +				)); + +				$messenger->send($addr['method']); +				$messenger->reset(); +			} +		} +		unset($msg_list_ary); + +		if ($messenger->queue) +		{ +			$messenger->queue->save(); +		} +	} + +	// Handle the DB updates +	$db->sql_transaction(); + +	if (sizeof($update_notification['topic'])) +	{ +		$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . " +			SET notify_status = 1 +			WHERE topic_id = $topic_id +				AND user_id IN (" . implode(', ', $update_notification['topic']) . ")"); +	} + +	if (sizeof($update_notification['forum'])) +	{ +		$db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . " +			SET notify_status = 1 +			WHERE forum_id = $forum_id +				AND user_id IN (" . implode(', ', $update_notification['forum']) . ")"); +	} + +	// Now delete the user_ids not authorized to receive notifications on this topic/forum +	if (sizeof($delete_ids['topic'])) +	{ +		$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " +			WHERE topic_id = $topic_id +				AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); +	} + +	if (sizeof($delete_ids['forum'])) +	{ +		$db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " +			WHERE forum_id = $forum_id +				AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); +	} + +	$db->sql_transaction('commit'); + +} +  ?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 07f80a87f0..7de44547e3 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -176,11 +176,11 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)  		$topic_title = censor_text($row['topic_title']);  		$template->assign_block_vars('topicrow', array( -			'U_VIEW_TOPIC'		=> "mcp.$phpEx$SID&t=" . $row['topic_id'] . '&mode=topic_view', +			'U_VIEW_TOPIC'		=> "mcp.$phpEx$SID&f=$forum_id&t={$row['topic_id']}&mode=topic_view",  			'S_SELECT_TOPIC'	=> ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,  			'U_SELECT_TOPIC'	=> $url . '&mode=topic_view&action=merge&to_topic_id=' . $row['topic_id'] . $selected_ids, -			'U_MCP_QUEUE'		=> $url . '&i=queue&mode=approve&t=' . $row['topic_id'], +			'U_MCP_QUEUE'		=> $url . '&i=queue&mode=approve_details&t=' . $row['topic_id'],  			'U_MCP_REPORT'		=> "mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports",  			'ATTACH_ICON_IMG'	=> ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index c593e6ae90..b8d6c12b27 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -62,22 +62,19 @@ function mcp_front_view($id, $mode, $action, $url)  			while ($row = $db->sql_fetchrow($result))  			{ -				if ($row['poster_id'] == ANONYMOUS) -				{ -					$author = ($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']; -				} -				else -				{ -					$author = '<a href="memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['poster_id'] . '">' . $row['username'] . '</a>'; -				} -  				$template->assign_block_vars('unapproved', array( -					'U_POST_DETAILS'	=> $url . '&mode=post_details', -					'FORUM'				=> (!empty($row['forum_id'])) ? '<a href="viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '">' . $row['forum_name'] . '</a>' : $user->lang['POST_GLOBAL'], -					'TOPIC'				=>	'<a href="viewtopic.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a>', -					'AUTHOR'			=>	$author, -					'SUBJECT'			=>	'<a href="mcp.' . $phpEx . $SID . '&p=' . $row['post_id'] . '&mode=post_details">' . (($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT']) . '</a>', -					'POST_TIME'			=>	$user->format_date($row['post_time'])) +					'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . '&mode=post_details', +					'U_MCP_FORUM'	=> ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . '&mode=forum_view' : '', +					'U_MCP_TOPIC'	=> $url . '&t=' . $row['topic_id'] . '&mode=topic_view', +					'U_FORUM'		=> ($row['forum_id']) ? 'viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'] : '', +					'U_TOPIC'		=> 'viewtopic.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '&t=' . $row['topic_id'], +					'U_AUTHOR'		=> ($row['poster_id'] == ANONYMOUS) ? '' : 'memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['poster_id'], + +					'FORUM_NAME'	=> ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'], +					'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']))  				);				  			}  		} @@ -128,12 +125,18 @@ function mcp_front_view($id, $mode, $action, $url)  			while ($row = $db->sql_fetchrow($result))  			{  				$template->assign_block_vars('report', array( -					'U_POST_DETAILS'	=> $url . '&mode=post_details', -					'FORUM'				=> (!empty($row['forum_id'])) ? '<a href="viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '">' . $row['forum_name'] . '</a>' : $user->lang['POST_GLOBAL'], -					'TOPIC'				=> '<a href="viewtopic.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a>', -					'REPORTER'			=> ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : '<a href="memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a>', -					'SUBJECT'			=> '<a href="mcp.' . $phpEx . $SID . '&p=' . $row['post_id'] . '&mode=post_details">' . (($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT']) . '</a>', -					'REPORT_TIME'		=>	$user->format_date($row['report_time'])) +					'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . '&mode=post_details', +					'U_MCP_FORUM'	=> ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . '&mode=forum_view' : '', +					'U_MCP_TOPIC'	=> $url . '&t=' . $row['topic_id'] . '&mode=topic_view', +					'U_FORUM'		=> ($row['forum_id']) ? 'viewforum.' . $phpEx . $SID . '&f=' . $row['forum_id'] : '', +					'U_TOPIC'		=> 'viewtopic.' . $phpEx . $SID . '&f=' . $row['forum_id'] . '&t=' . $row['topic_id'], +					'U_REPORTER'	=> ($row['user_id'] == ANONYMOUS) ? '' : 'memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'], + +					'FORUM_NAME'	=> ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'], +					'TOPIC_TITLE'	=> $row['topic_title'], +					'REPORTER'		=> ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'], +					'SUBJECT'		=> ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], +					'REPORT_TIME'	=> $user->format_date($row['report_time']))  				);				  			}  		} diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 00a1abd96d..68cceebc66 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -143,18 +143,21 @@ function mcp_post_details($id, $mode, $action, $url)  		'U_VIEW_PROFILE'		=> "memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'],  		'U_MCP_USERNOTES'		=> "mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'],  		'U_MCP_WARNINGS'		=> "mcp.$phpEx$SID&i=warnings&mode=view_user&u=" . $post_info['user_id'], +		'U_EDIT'				=> ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '',  		'RETURN_TOPIC'			=> sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>'),  		'RETURN_FORUM'			=> sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&f={$post_info['forum_id']}&start={$start}\">", '</a>'),  		'REPORTED_IMG'			=> $user->img('icon_reported', $user->lang['POST_REPORTED']),  		'UNAPPROVED_IMG'		=> $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), +		'EDIT_IMG'				=> $user->img('btn_edit', $user->lang['EDIT_POST']),  		'POSTER_NAME'			=> $poster,  		'POST_PREVIEW'			=> $message,  		'POST_SUBJECT'			=> $post_info['post_subject'],  		'POST_DATE'				=> $user->format_date($post_info['post_time']),  		'POST_IP'				=> $post_info['poster_ip'], -		'POST_IPADDR'			=> @gethostbyaddr($post_info['poster_ip'])) +		'POST_IPADDR'			=> @gethostbyaddr($post_info['poster_ip']), +		'POST_ID'				=> $post_info['post_id'])  	);  	// Get Reports diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 0106f8c6e2..171751219f 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -26,6 +26,24 @@ class mcp_queue extends module  		{  			case 'approve':  			case 'disapprove': +				include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); +				include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + +				$post_id_list = get_array('post_id_list', 0); + +				if (!$post_id_list) +				{ +					trigger_error('NO_POST_SELECTED'); +				} + +				if ($mode == 'approve') +				{ +					approve_post($post_id_list); +				} +				else +				{ +					disapprove_post($post_id_list); +				}  				break; @@ -35,6 +53,14 @@ class mcp_queue extends module  				include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);  				$post_id = request_var('p', 0); +				$topic_id = request_var('t', 0); + +				if ($topic_id) +				{ +					$topic_info = get_topic_data(array($topic_id), 'm_approve'); +					$post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; +				} +  				$post_info = get_post_data(array($post_id), 'm_approve');  				if (!sizeof($post_info)) @@ -66,6 +92,7 @@ class mcp_queue extends module  				$message = smilie_text($message);  				$template->assign_vars(array( +					'S_MCP_QUEUE'			=> true,  					'S_APPROVE_ACTION'		=> "mcp.$phpEx$SID&i=queue&p=$post_id&f=$forum_id",  					'S_CAN_VIEWIP'			=> $auth->acl_get('m_ip', $post_info['forum_id']), @@ -78,19 +105,22 @@ class mcp_queue extends module  					'U_VIEW_PROFILE'		=> "memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'],  					'U_MCP_USERNOTES'		=> "mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'],  					'U_MCP_WARNINGS'		=> "mcp.$phpEx$SID&i=warnings&mode=view_user&u=" . $post_info['user_id'], +					'U_EDIT'				=> ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '',  					'REPORTED_IMG'			=> $user->img('icon_reported', $user->lang['POST_REPORTED']),  					'UNAPPROVED_IMG'		=> $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), +					'EDIT_IMG'				=> $user->img('btn_edit', $user->lang['EDIT_POST']),  					'POSTER_NAME'			=> $poster,  					'POST_PREVIEW'			=> $message,  					'POST_SUBJECT'			=> $post_info['post_subject'],  					'POST_DATE'				=> $user->format_date($post_info['post_time']),  					'POST_IP'				=> $post_info['poster_ip'], -					'POST_IPADDR'			=> @gethostbyaddr($post_info['poster_ip'])) +					'POST_IPADDR'			=> @gethostbyaddr($post_info['poster_ip']), +					'POST_ID'				=> $post_info['post_id'])  				); -				$this->display($user->lang['MCP_QUEUE'], 'mcp_approve.html'); +				$this->display($user->lang['MCP_QUEUE'], 'mcp_post.html');  				break; @@ -221,7 +251,7 @@ class mcp_queue extends module  						$poster = $row['username'];  					} -					$s_checkbox = ($mode == 'unapproved_posts') ? '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />' : '<input type="checkbox" name="topic_id_list[]" value="' . $row['topic_id'] . '" />'; +					$s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />';  					$template->assign_block_vars('postrow', array(  						'U_VIEWFORUM'	=> "viewforum.$phpEx$SID&f=" . $row['forum_id'], @@ -272,4 +302,441 @@ class mcp_queue extends module  	}  } +// Approve Post/Topic +function approve_post($post_id_list) +{ +	global $db, $template, $user, $config; +	global $_REQUEST, $phpEx, $phpbb_root_path, $SID; + +	if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) +	{ +		trigger_error('NOT_AUTHORIZED'); +	} + +	$redirect = request_var('redirect', $user->data['session_page']); +	$success_msg = ''; + +	$s_hidden_fields = build_hidden_fields(array( +		'post_id_list'	=> $post_id_list, +		'f'				=> $forum_id, +		'mode'			=> 'approve', +		'redirect'		=> $redirect) +	); + +	if (confirm_box(true)) +	{ +		$notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false; +	 +		$post_info = get_post_data($post_id_list, 'm_approve'); +		 +		// If Topic -> total_topics = total_topics+1, total_posts = total_posts+1, forum_topics = forum_topics+1, forum_posts = forum_posts+1 +		// If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1 +		 +		$total_topics = $total_posts = $forum_topics = $forum_posts = 0; +		$topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = array(); +		 +		foreach ($post_info as $post_id => $post_data) +		{ +			$topic_id_list[$post_data['topic_id']] = 1; +			 +			// Topic or Post. ;) +			if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id) +			{ +				if ($post_data['forum_id']) +				{ +					$total_topics++; +					$forum_topics++; +				} + +				$topic_approve_sql[] = $post_data['topic_id']; +			} +			else +			{ +				if (!isset($topic_replies_sql[$post_data['topic_id']])) +				{ +					$topic_replies_sql[$post_data['topic_id']] = 1; +				} +				else +				{ +					$topic_replies_sql[$post_data['topic_id']]++; +				} +			} + +			if ($post_data['forum_id']) +			{ +				$total_posts++; +				$forum_posts++; +			} + +			$post_approve_sql[] = $post_id; +		} +		 +		if (sizeof($topic_approve_sql)) +		{ +			$sql = 'UPDATE ' . TOPICS_TABLE . ' +				SET topic_approved = 1 +				WHERE topic_id IN (' . implode(', ', $topic_approve_sql) . ')'; +			$db->sql_query($sql); +		} + +		if (sizeof($post_approve_sql)) +		{ +			$sql = 'UPDATE ' . POSTS_TABLE . ' +				SET post_approved = 1 +				WHERE post_id IN (' . implode(', ', $post_approve_sql) . ')'; +			$db->sql_query($sql); +		} + +		if (sizeof($topic_replies_sql)) +		{ +			foreach ($topic_replies_sql as $topic_id => $num_replies) +			{ +				$sql = 'UPDATE ' . TOPICS_TABLE . " +					SET topic_replies = topic_replies + $num_replies +					WHERE topic_id = $topic_id"; +				$db->sql_query($sql); +			} +		} + +		if ($forum_topics || $forum_posts) +		{ +			$sql = 'UPDATE ' . FORUMS_TABLE . ' +				SET '; +			$sql .= ($forum_topics) ? "forum_topics = forum_topics + $forum_topics" : ''; +			$sql .= ($forum_topics && $forum_posts) ? ', ' : ''; +			$sql .= ($forum_posts) ? "forum_posts = forum_posts + $forum_posts" : ''; +			$sql .= " WHERE forum_id = $forum_id"; + +			$db->sql_query($sql); +		} +		 +		if ($total_topics) +		{ +			set_config('num_topics', $config['num_topics'] + $total_topics, true); +		} + +		if ($total_posts) +		{ +			set_config('num_posts', $config['num_posts'] + $total_posts, true); +		} +		unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql); + +		update_post_information('topic', array_keys($topic_id_list)); +		update_post_information('forum', $forum_id); +		unset($topic_id_list); +		 +		$messenger = new messenger(); + +		// Notify Poster? +		if ($notify_poster) +		{ +			$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); +		 +			foreach ($post_info as $post_id => $post_data) +			{ +				if ($post_data['poster_id'] == ANONYMOUS) +				{ +					continue; +				} +				 +				$email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_approved' : 'post_approved'; + +				$messenger->template($email_template, $post_data['user_lang']); + +				$messenger->replyto($config['board_email']); +				$messenger->to($post_data['user_email'], $post_data['username']); +				$messenger->im($post_data['user_jabber'], $post_data['username']); + +				$messenger->assign_vars(array( +					'EMAIL_SIG'		=> $email_sig, +					'SITENAME'		=> $config['sitename'], +					'USERNAME'		=> $post_data['username'], +					'POST_SUBJECT'	=> censor_text($post_data['post_subject']), +					'TOPIC_TITLE'	=> censor_text($post_data['topic_title']), + +					'U_VIEW_TOPIC'	=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&e=0", +					'U_VIEW_POST'	=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&p=$post_id&e=$post_id") +				); + +				$messenger->send($post_data['user_notify_type']); +				$messenger->reset(); + +				if ($messenger->queue) +				{ +					$messenger->queue->save(); +				} +			} +		} + +		// Send out normal user notifications +		$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); +		 +		foreach ($post_info as $post_id => $post_data) +		{ +			if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) +			{ +				// Forum Notifications +				user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $forum_id, $post_data['topic_id'], $post_id); +			} +			else +			{ +				// Topic Notifications +				user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $forum_id, $post_data['topic_id'], $post_id); +			} +		} +		unset($post_info); + +		if ($forum_topics) +		{ +			$success_msg = ($forum_topics == 1) ? 'TOPIC_APPROVED_SUCCESS' : 'TOPICS_APPROVED_SUCCESS'; +		} +		else +		{ +			$success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS'; +		} +	} +	else +	{ +		$template->assign_vars(array( +			'S_NOTIFY_POSTER'	=> true, +			'S_APPROVE'			=> true) +		); + +		confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); +	} + +	$redirect = request_var('redirect', "index.$phpEx$SID"); + +	if (strpos($redirect, '?') === false) +	{ +		$redirect = substr_replace($redirect, ".$phpEx$SID&", strpos($redirect, '&'), 1); +	} + +	if (!$success_msg) +	{ +		redirect($redirect); +	} +	else +	{ +		meta_refresh(3, $redirect); +		trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>')); +	} +} + +// Disapprove Post/Topic +function disapprove_post($post_id_list) +{ +	global $db, $template, $user, $config; +	global $_REQUEST, $_POST, $phpEx, $phpbb_root_path, $SID; + +	if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) +	{ +		trigger_error('NOT_AUTHORIZED'); +	} + +	$redirect = request_var('redirect', $user->data['session_page']); +	$reason = request_var('reason', ''); +	$reason_id = request_var('reason_id', 0); +	$success_msg = $additional_msg = ''; + +	$s_hidden_fields = build_hidden_fields(array( +		'post_id_list'	=> $post_id_list, +		'f'				=> $forum_id, +		'mode'			=> 'disapprove', +		'redirect'		=> $redirect) +	); + +	$notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false; + +	if ($reason_id) +	{ +		$sql = 'SELECT reason_name  +			FROM ' . REASONS_TABLE . "  +			WHERE reason_id = $reason_id"; +		$result = $db->sql_query($sql); + +		if (!($row = $db->sql_fetchrow($result)) || (!$reason && $row['reason_name'] == 'other')) +		{ +			$additional_msg = 'Please give an appropiate reason for disapproval'; +			unset($_POST['confirm']); +		} +		else +		{ +			$disapprove_reason = ($row['reason_name'] != 'other') ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_name'])] : ''; +			$disapprove_reason .= ($reason) ? "\n\n" . $_REQUEST['reason'] : ''; +			unset($reason); +		} +		$db->sql_freeresult($result); +	} + +	if (confirm_box(true)) +	{ +		$post_info = get_post_data($post_id_list, 'm_approve'); +		 +		// If Topic -> forum_topics_real -= 1 +		// If Post -> topic_replies_real -= 1 +		 +		$forum_topics_real = 0; +		$topic_replies_real_sql = $post_disapprove_sql = $topic_id_list = array(); +		 +		foreach ($post_info as $post_id => $post_data) +		{ +			$topic_id_list[$post_data['topic_id']] = 1; +			 +			// Topic or Post. ;) +			if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id) +			{ +				if ($post_data['forum_id']) +				{ +					$forum_topics_real++; +				} +			} +			else +			{ +				if (!isset($topic_replies_real_sql[$post_data['topic_id']])) +				{ +					$topic_replies_real_sql[$post_data['topic_id']] = 1; +				} +				else +				{ +					$topic_replies_real_sql[$post_data['topic_id']]++; +				} +			} + +			$post_disapprove_sql[] = $post_id; +		} +		 +		if ($forum_topics_real) +		{ +			$sql = 'UPDATE ' . FORUMS_TABLE . " +				SET forum_topics_real = forum_topics_real - $forum_topics_real +				WHERE forum_id = $forum_id"; +			$db->sql_query($sql); +		} + +		if (sizeof($topic_replies_real_sql)) +		{ +			foreach ($topic_replies_real_sql as $topic_id => $num_replies) +			{ +				$sql = 'UPDATE ' . TOPICS_TABLE . " +					SET topic_replies_real = topic_replies_real - $num_replies +					WHERE topic_id = $topic_id"; +				$db->sql_query($sql); +			} +		} + +		if (sizeof($post_disapprove_sql)) +		{ +			// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts +			delete_posts('post_id', $post_disapprove_sql); +		} +		unset($post_disapprove_sql, $topic_replies_real_sql); + +		update_post_information('topic', array_keys($topic_id_list)); +		update_post_information('forum', $forum_id); +		unset($topic_id_list); +		 +		$messenger = new messenger(); + +		// Notify Poster? +		if ($notify_poster) +		{ +			$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); +		 +			foreach ($post_info as $post_id => $post_data) +			{ +				if ($post_data['poster_id'] == ANONYMOUS) +				{ +					continue; +				} +				 +				$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']); + +				$messenger->replyto($config['board_email']); +				$messenger->to($post_data['user_email'], $post_data['username']); +				$messenger->im($post_data['user_jabber'], $post_data['username']); + +				$messenger->assign_vars(array( +					'EMAIL_SIG'		=> $email_sig, +					'SITENAME'		=> $config['sitename'], +					'USERNAME'		=> $post_data['username'], +					'REASON'		=> stripslashes($disapprove_reason), +					'POST_SUBJECT'	=> censor_text($post_data['post_subject']), +					'TOPIC_TITLE'	=> censor_text($post_data['topic_title'])) +				); + +				$messenger->send($post_data['user_notify_type']); +				$messenger->reset(); + +				if ($messenger->queue) +				{ +					$messenger->queue->save(); +				} +			} +		} +		unset($post_info, $disapprove_reason); + +		if ($forum_topics_real) +		{ +			$success_msg = ($forum_topics_real == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS'; +		} +		else +		{ +			$success_msg = (sizeof($post_id_list) == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS'; +		} +	} +	else +	{ +		$sql = 'SELECT *  +			FROM ' . REASONS_TABLE . '  +			ORDER BY reason_priority ASC'; +		$result = $db->sql_query($sql); + +		while ($row = $db->sql_fetchrow($result)) +		{ +			$row['reason_name'] = strtoupper($row['reason_name']); + +			$reason_title = (!empty($user->lang['report_reasons']['TITLE'][$row['reason_name']])) ? $user->lang['report_reasons']['TITLE'][$row['reason_name']] : ucwords(str_replace('_', ' ', $row['reason_name'])); + +			$reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']] : $row['reason_desc']; + +			$template->assign_block_vars('reason', array( +				'ID'			=>	$row['reason_id'], +				'NAME'			=>	htmlspecialchars($reason_title), +				'DESCRIPTION'	=>	htmlspecialchars($reason_desc), +				'S_SELECTED'	=>	($row['reason_id'] == $reason_id) ? true : false) +			); +		} +		$db->sql_freeresult($result); + +		$template->assign_vars(array( +			'S_NOTIFY_POSTER'	=> true, +			'S_APPROVE'			=> false, +			'REASON'			=> $reason, +			'ADDITIONAL_MSG'	=> $additional_msg) +		); + +		confirm_box(false, 'APPROVE_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); +	} + +	$redirect = request_var('redirect', "index.$phpEx$SID"); + +	if (strpos($redirect, '?') === false) +	{ +		$redirect = substr_replace($redirect, ".$phpEx$SID&", strpos($redirect, '&'), 1); +	} + +	if (!$success_msg) +	{ +		redirect($redirect); +	} +	else +	{ +		meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); +		trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>')); +	} +} +  ?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 7d1cb201e4..2004e51874 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -144,7 +144,7 @@ function mcp_topic_view($id, $mode, $action, $url)  			'S_POST_UNAPPROVED'	=> ($row['post_approved']) ? false : true,  			'U_POST_DETAILS'	=> "$url&p={$row['post_id']}&mode=post_details", -			'U_MCP_APPROVE'		=> "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id']) +			'U_MCP_APPROVE'		=> "mcp.$phpEx$SID&i=queue&mode=approve&post_id_list[]=" . $row['post_id'])  		);  		unset($rowset[$i]); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5d5519a7c9..cda58dc804 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -212,6 +212,7 @@ $lang += array(  	'MESSAGE'			=> 'Message',  	'MESSAGE_BODY'		=> 'Message body',  	'MINUTES'			=> 'Minutes', +	'MODERATE'			=> 'Moderate',  	'MODERATOR'			=> 'Moderator',  	'MODERATORS'		=> 'Moderators',  	'MONTH'				=> 'Month', diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt new file mode 100644 index 0000000000..3d7c4902c5 --- /dev/null +++ b/phpBB/language/en/email/post_approved.txt @@ -0,0 +1,15 @@ +Subject: Post Approved - {POST_SUBJECT} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because your post "{POST_SUBJECT}" at {SITENAME} was approved by a moderator or admin. + +If you want to view the post click the following link: +{U_VIEW_POST} + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + + +{EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/post_disapproved.txt b/phpBB/language/en/email/post_disapproved.txt new file mode 100644 index 0000000000..c6055cb28e --- /dev/null +++ b/phpBB/language/en/email/post_disapproved.txt @@ -0,0 +1,13 @@ +Subject: Post Disapproved - {POST_SUBJECT} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because your post "{POST_SUBJECT}" at {SITENAME} was disapproved by a moderator or admin. + +The following reason was given for the disapproval: + +{REASON} + + +{EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/topic_approved.txt b/phpBB/language/en/email/topic_approved.txt new file mode 100644 index 0000000000..28927b5a29 --- /dev/null +++ b/phpBB/language/en/email/topic_approved.txt @@ -0,0 +1,12 @@ +Subject: Topic Approved - {TOPIC_TITLE} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because your topic "{TOPIC_TITLE}" at {SITENAME} was approved by a moderator or admin. + +If you want to view the topic, click the following link: +{U_VIEW_TOPIC} + + +{EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/topic_disapproved.txt b/phpBB/language/en/email/topic_disapproved.txt new file mode 100644 index 0000000000..52c1578861 --- /dev/null +++ b/phpBB/language/en/email/topic_disapproved.txt @@ -0,0 +1,13 @@ +Subject: Topic Disapproved - {TOPIC_TITLE} +Charset: iso-8859-1 + +Hello {USERNAME}, + +You are receiving this email because your topic "{TOPIC_TITLE}" at {SITENAME} was disapproved by a moderator or admin. + +The following reason was given for the disapproval: + +{REASON} + + +{EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 16e35a9cc8..49deed20c3 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -32,7 +32,10 @@ $lang += array(  	'ALL_ENTRIES'			=> 'All entries',  	'ALREADY_REPORTED'		=> 'This post has already been reported',  	'APPROVE'				=> 'Approve', +	'APPROVE_POST'			=> 'Approve Post', +	'APPROVE_POST_CONFIRM'	=> 'Are you sure you want to approve this post?',  	'APPROVE_POSTS'			=> 'Approve Posts', +	'APPROVE_POSTS_CONFIRM'	=> 'Are you sure you want to approve the selected posts?',  	'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it\'s already in',  	'CAN_LEAVE_BLANK'		=> 'This can be left blank.', @@ -138,6 +141,8 @@ $lang += array(  	'MOVE_TOPICS'			=> 'Move selected topics',  	'MOVE_TOPICS_CONFIRM'	=> 'Are you sure you want to move the selected topics into a new forum?', +	'NOTIFY_POSTER_APPROVAL'=> 'Notify poster about approval?', +	'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?',  	'NOT_MODERATOR'			=> 'You are not a moderator of this forum',  	'NO_DESTINATION_FORUM'	=> 'Please select a forum for destination',  	'NO_ENTRIES'			=> 'No log entries for this period', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index c5e975d9ae..5a066de76f 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -245,14 +245,22 @@ class module  	// Add Item to Submodule Title  	function add_menu_item($module_name, $mode)  	{ -		global $db, $user; +		global $db, $user, $auth;  		if ($module_name != 'queue')  		{  			return '';  		} -		$forum_list = get_forum_list('m_approve'); +		$forum_id = request_var('f', 0); +		if ($forum_id && $auth->acl_get('m_approve', $forum_id)) +		{ +			$forum_list = array($forum_id); +		} +		else +		{ +			$forum_list = get_forum_list('m_approve'); +		}  		switch ($mode)  		{ @@ -327,6 +335,11 @@ $mode	= request_var('mode', '');  $mode2	= (isset($_REQUEST['quick'])) ? request_var('mode2', '') : '';  $module = request_var('i', ''); +if (is_array($mode)) +{ +	list($mode, ) = each($mode); +} +  if ($mode2)  {  	$mode = $mode2; diff --git a/phpBB/posting.php b/phpBB/posting.php index a9de09ddbe..8368584767 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -415,6 +415,7 @@ if ($save && $user->data['user_id'] != ANONYMOUS && $auth->acl_get('u_savedrafts  	$subject = (!$subject && $mode != 'post') ? $topic_title : $subject;  	$message = (isset($_POST['message'])) ? htmlspecialchars(trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $_POST['message']))) : '';  	$message = preg_replace('#&(\#[0-9]+;)#', '&\1', $message); +//	$message = request_var('message', '', true, true);  	if ($subject && $message)  	{ @@ -473,17 +474,19 @@ if ($load && $drafts)  if ($submit || $preview || $refresh)  {  	$topic_cur_post_id	= request_var('topic_cur_post_id', 0); +  	$subject			= request_var('subject', ''); +//	$subject			= request_var('subject', '', false, true);  	if (strcmp($subject, strtoupper($subject)) == 0 && $subject)  	{  		$subject = phpbb_strtolower($subject);  	} -	$subject = preg_replace('#&(\#[0-9]+;)#', '&\1', $subject); -  	$message_parser->message = (isset($_POST['message'])) ? htmlspecialchars(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $_POST['message'])) : '';  	$message_parser->message = preg_replace('#&(\#[0-9]+;)#', '&\1', $message_parser->message); +//	$message_parser->message = request_var('message', '', true, true); +  	$username			= (isset($_POST['username'])) ? request_var('username', '') : $username;  	$post_edit_reason	= (isset($_POST['edit_reason']) && !empty($_POST['edit_reason']) && $mode == 'edit' && $user->data['user_id'] != $poster_id) ? request_var('edit_reason', '') : ''; @@ -790,7 +793,7 @@ if (!sizeof($error) && $preview)  	format_display($preview_message, $preview_signature, $message_parser->bbcode_uid, $preview_signature_uid, $enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $enable_sig);  	// Poll Preview -	if (($mode == 'post' || ($mode == 'edit' && $post_id == $topic_first_post_id && !$poll_last_vote)) && ($auth->acl_get('f_poll', $forum_id) || $auth->acl_get('m_edit', $forum_id))) +	if (($mode == 'post' || ($mode == 'edit' && $post_id == $topic_first_post_id && !$poll_last_vote)) && ($auth->acl_get('f_poll', $forum_id) || $auth->acl_get('m_edit', $forum_id)) && $poll_title)  	{  		decode_text($poll_title, $message_parser->bbcode_uid);  		$preview_poll_title = format_display($poll_title, $null, $message_parser->bbcode_uid, false, $enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false, false); @@ -1050,227 +1053,6 @@ page_footer();  // FUNCTIONS  // - -// User Notification -function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id) -{ -	global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; - -	$topic_notification = ($mode == 'reply' || $mode == 'quote'); -	$forum_notification = ($mode == 'post'); - -	if (!$topic_notification && !$forum_notification) -	{ -		trigger_error('WRONG_NOTIFICATION_MODE'); -	} - -	$topic_title = ($topic_notification) ? $topic_title : $subject; -	decode_text($topic_title); -	$topic_title = censor_text($topic_title); - -	// Get banned User ID's -	$sql = 'SELECT ban_userid  -		FROM ' . BANLIST_TABLE; -	$result = $db->sql_query($sql); - -	$sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; -	while ($row = $db->sql_fetchrow($result)) -	{ -		if (isset($row['ban_userid'])) -		{ -			$sql_ignore_users .= ', ' . $row['ban_userid']; -		} -	} -	$db->sql_freeresult($result); - -	$notify_rows = array(); - -	// -- get forum_userids	|| topic_userids -	$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber  -		FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u -		WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " -			AND w.user_id NOT IN ($sql_ignore_users) -			AND w.notify_status = 0 -			AND u.user_id = w.user_id"; -	$result = $db->sql_query($sql); - -	while ($row = $db->sql_fetchrow($result)) -	{ -		$notify_rows[$row['user_id']] = array( -			'user_id'		=> $row['user_id'], -			'username'		=> $row['username'], -			'user_email'	=> $row['user_email'], -			'user_jabber'	=> $row['user_jabber'],  -			'user_lang'		=> $row['user_lang'],  -			'notify_type'	=> ($topic_notification) ? 'topic' : 'forum', -			'template'		=> ($topic_notification) ? 'topic_notify' : 'newtopic_notify', -			'method'		=> $row['user_notify_type'],  -			'allowed'		=> false -		); -	} -	$db->sql_freeresult($result); -	 -	// forum notification is sent to those not receiving post notification -	if ($topic_notification) -	{ -		if (sizeof($notify_rows)) -		{ -			$sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); -		} - -		$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber  -			FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u -			WHERE fw.forum_id = $forum_id -				AND fw.user_id NOT IN ($sql_ignore_users) -				AND fw.notify_status = 0 -				AND u.user_id = fw.user_id"; -		$result = $db->sql_query($sql); - -		while ($row = $db->sql_fetchrow($result)) -		{ -			$notify_rows[$row['user_id']] = array( -				'user_id'		=> $row['user_id'], -				'username'		=> $row['username'], -				'user_email'	=> $row['user_email'], -				'user_jabber'	=> $row['user_jabber'],  -				'user_lang'		=> $row['user_lang'], -				'notify_type'	=> 'forum', -				'template'		=> 'forum_notify', -				'method'		=> $row['user_notify_type'],  -				'allowed'		=> false -			); -		} -		$db->sql_freeresult($result); -	} - -	if (!sizeof($notify_rows)) -	{ -		return; -	} - -	foreach ($auth->acl_get_list(array_keys($notify_rows), 'f_read', $forum_id) as $forum_id => $forum_ary) -	{ -		foreach ($forum_ary as $auth_option => $user_ary) -		{ -			foreach ($user_ary as $user_id) -			{ -				$notify_rows[$user_id]['allowed'] = true; -			} -		} -	} - - -	// Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) -	$msg_users = $delete_ids = $update_notification = array(); -	foreach ($notify_rows as $user_id => $row) -	{ -		if (!$row['allowed'] || !trim($row['user_email'])) -		{ -			$delete_ids[$row['notify_type']][] = $row['user_id']; -		} -		else -		{ -			$msg_users[] = $row; -			$update_notification[$row['notify_type']][] = $row['user_id']; -		} -	} -	unset($notify_rows); - -	// Now, we are able to really send out notifications -	if (sizeof($msg_users)) -	{ -		include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); -		$messenger = new messenger(); - -		$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - -		$msg_list_ary = array(); -		foreach ($msg_users as $row) -		{  -			$pos = sizeof($msg_list_ary[$row['template']]); - -			$msg_list_ary[$row['template']][$pos]['method']	= $row['method']; -			$msg_list_ary[$row['template']][$pos]['email']	= $row['user_email']; -			$msg_list_ary[$row['template']][$pos]['jabber']	= $row['user_jabber']; -			$msg_list_ary[$row['template']][$pos]['name']	= $row['username']; -			$msg_list_ary[$row['template']][$pos]['lang']	= $row['user_lang']; -		} -		unset($msg_users); - -		foreach ($msg_list_ary as $email_template => $email_list) -		{ -			foreach ($email_list as $addr) -			{ -				$messenger->template($email_template, $addr['lang']); - -				$messenger->replyto($config['board_email']); -				$messenger->to($addr['email'], $addr['name']); -				$messenger->im($addr['jabber'], $addr['name']); - -				$messenger->assign_vars(array( -					'EMAIL_SIG'		=> $email_sig, -					'SITENAME'		=> $config['sitename'], -					'USERNAME'		=> $addr['name'], -					'TOPIC_TITLE'	=> $topic_title,   -					'FORUM_NAME'	=> $forum_name, - -					'U_FORUM'				=> generate_board_url() . "/viewforum.$phpEx?f=$forum_id&e=0", -					'U_TOPIC'				=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&e=0", -					'U_NEWEST_POST'			=> generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id", -					'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic", -					'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum",  -				)); - -				$messenger->send($addr['method']); -				$messenger->reset(); -			} -		} -		unset($msg_list_ary); - -		if ($messenger->queue) -		{ -			$messenger->queue->save(); -		} -	} - -	// Handle the DB updates -	$db->sql_transaction(); - -	if (sizeof($update_notification['topic'])) -	{ -		$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . " -			SET notify_status = 1 -			WHERE topic_id = $topic_id -				AND user_id IN (" . implode(', ', $update_notification['topic']) . ")"); -	} - -	if (sizeof($update_notification['forum'])) -	{ -		$db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . " -			SET notify_status = 1 -			WHERE forum_id = $forum_id -				AND user_id IN (" . implode(', ', $update_notification['forum']) . ")"); -	} - -	// Now delete the user_ids not authorized to receive notifications on this topic/forum -	if (sizeof($delete_ids['topic'])) -	{ -		$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " -			WHERE topic_id = $topic_id -				AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); -	} - -	if (sizeof($delete_ids['forum'])) -	{ -		$db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " -			WHERE forum_id = $forum_id -				AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); -	} - -	$db->sql_transaction('commit'); - -} -  // Delete Post  function delete_post($mode, $post_id, $topic_id, $forum_id, $data)  { diff --git a/phpBB/styles/subSilver/template/mcp_approve.html b/phpBB/styles/subSilver/template/mcp_approve.html index 55f878609f..e825a83acf 100644 --- a/phpBB/styles/subSilver/template/mcp_approve.html +++ b/phpBB/styles/subSilver/template/mcp_approve.html @@ -1,46 +1,56 @@ -<!-- INCLUDE mcp_header.html --> +<!-- INCLUDE overall_header.html --> +<!-- $Id$ --> -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp" action="{S_APPROVE_ACTION}"> -	<tr> -		<th colspan="2" height="28" align="center">{L_POST_DETAILS}</th> -	</tr> -	<tr> -		<td class="row3" colspan="2" align="center"><span class="gensmall">{RETURN_QUEUE}</span></td> -	</tr> -	<tr> -		<td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td> -		<td class="row2"><span class="gen">{POST_SUBJECT}</span></td> -	</tr> -	<tr> -		<td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td> -		<td class="row2" width="80%"><span class="gen">{POSTER_NAME}   [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]<!-- IF S_USER_NOTES --> [ <a href="{U_MCP_USERNOTES}">{L_READ_USERNOTES}</a> ]<!-- ENDIF --><!-- IF S_USER_WARNINGS --> [ <a href="{U_MCP_WARNINGS}">{L_READ_WARNINGS}</a> ]<!-- ENDIF --></span></td> -	</tr> -	<!-- IF S_CAN_VIEWIP --> -	<tr> -		<td class="row1"><b class="gen">{L_THIS_POST_IP}: </b></td> -		<td class="row2"><span class="gen">{POST_IP} [ {POST_IPADDR} ]</span></td> -	</tr> -	<!-- ENDIF --> -	<tr> -		<td class="row1"><b class="gen">{L_POSTED}: </b></td> -		<td class="row2"><span class="postdetails">{POST_DATE}</span></td> -	</tr> -	</tr> -	<tr> -		<th colspan="2" height="28" align="center">{L_PREVIEW}</th> -	</th> -	<tr> -		<td class="row1" colspan="2"><div class="gen" style="overflow: auto; width: 100%; height: 80pt; border: 1px;">{POST_PREVIEW}</div></td> -	</tr> -	<!-- IF S_POST_UNAPPROVED --> -	<tr> -		<td class="cat" align="center" colspan="2"><input class="btnmain" type="submit" value="{L_APPROVE}" name="mode[approve]" />   <input class="btnlite" type="submit" value="{L_DISAPPROVE}" name="mode[disapprove]" /></td> -	</tr> -	<!-- ENDIF --> -</form></table> +<div id="pagecontent"> + +	<form name="confirm" action="{S_CONFIRM_ACTION}" method="post"> +	 +	<table class="tablebg" width="100%" cellspacing="1"> +	<tr> +		<th>{MESSAGE_TITLE}</th> +	</tr> +	<tr> +		<td class="row1" align="center"> +			<!-- IF ADDITIONAL_MSG --> +				<span class="gen" style="color:red">{ADDITIONAL_MSG}</span><br /> +			<!-- ENDIF --> +			<!-- IF S_NOTIFY_POSTER --> +				<input type="checkbox" name="notify_poster" checked="checked" /><span class="gen"><!-- IF S_APPROVE -->{L_NOTIFY_POSTER_APPROVAL}<!-- ELSE -->{L_NOTIFY_POSTER_DISAPPROVAL}<!-- ENDIF --></span><br /> +			<!-- ENDIF --> +			<!-- IF not S_APPROVE --> +				<br /> +				<table border="0" width="90%" cellspacing="2" cellpadding="1"> +				<tr> +					<td class="row2" width="22%"><b class="gen">{L_DISAPPROVE_REASON}:</b></td> +					<td class="row2" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></td> +				</tr> +				<tr> +					<td class="row2" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td> +					<td class="row2"><textarea class="post" style="width:500px" name="reason" rows="10" cols="40">{REASON}</textarea></td> +				</tr> +				</table> +				<br /> +			<!-- ENDIF --> +			<br />{S_HIDDEN_FIELDS}<span class="gen">{MESSAGE_TEXT}</span><br /><br /> +			<input type="submit" name="confirm" value="{YES_VALUE}" class="btnmain" />  <input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></span> +		</td> +	</tr> +	</table> +	</form> +	 +</div>  <br clear="all" /> -<!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> +<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> +<tr> +	<td class="row1"> +		<p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> +		<p class="datetime">{S_TIMEZONE}</p> +	</td> +</tr> +</table> + +<br clear="all" /> -<!-- INCLUDE mcp_footer.html -->
\ No newline at end of file +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/styles/subSilver/template/mcp_front.html b/phpBB/styles/subSilver/template/mcp_front.html index 0717fdb470..5796d1312a 100644 --- a/phpBB/styles/subSilver/template/mcp_front.html +++ b/phpBB/styles/subSilver/template/mcp_front.html @@ -3,7 +3,7 @@  	<!-- $Id$ -->  <!-- IF S_SHOW_UNAPPROVED --> -<table class="tablebg" width="100%" cellspacing="1"> +	<table class="tablebg" width="100%" cellspacing="1">  	<tr>  		<td class="row3" colspan="5" align="center"><b class="gen">{L_LATEST_UNAPPROVED}</b></td>  	</tr> @@ -15,30 +15,30 @@  		<th> {L_POST_TIME} </th>  	</tr>  	<!-- BEGIN unapproved --> -	<tr> -		<td class="row1" width="15%"><span class="gen">{unapproved.FORUM}</span></td> -		<td class="row2" width="18%"><span class="gen">{unapproved.TOPIC}</span></td> -		<td class="row1"><span class="gen">{unapproved.SUBJECT}</span></td> -		<td class="row2" align="center" width="15%" nowrap="nowrap"><span class="gen">{unapproved.AUTHOR}</span></td> -		<td class="row1" align="center" width="15%" nowrap="nowrap"><span class="gensmall">{unapproved.POST_TIME}</span></td> -	</tr> +		<tr> +			<td class="row1" width="15%" valign="top"><span class="gen"><!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --></span><!-- IF unapproved.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td> +			<td class="row2" valign="top"><span class="gen"><a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td> +			<td class="row1" valign="top"><span class="gen">{unapproved.SUBJECT}</span><br /><span class="gensmall">[ <a href="{unapproved.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td> +			<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen"><!-- IF unapproved.U_AUTHOR --><a href="{unapproved.U_AUTHOR}">{unapproved.AUTHOR}</a><!-- ELSE -->{unapproved.AUTHOR}<!-- ENDIF --></span></td> +			<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{unapproved.POST_TIME}</span></td> +		</tr>  	<!-- BEGINELSE --> -	<tr> -		<td class="row1" colspan="5" align="center"><span class="gen">{L_UNAPPROVED_POSTS_ZERO_TOTAL}</span></td> -	</tr> +		<tr> +			<td class="row1" colspan="5" align="center"><span class="gen">{L_UNAPPROVED_POSTS_ZERO_TOTAL}</span></td> +		</tr>  	<!-- END unapproved -->  	<!-- IF S_HAS_UNAPPROVED_POSTS --> -	<tr> -		<td class="row3" colspan="5"><span class="gensmall">{L_UNAPPROVED_TOTAL}</span></td> -	</tr> +		<tr> +			<td class="row3" colspan="5"><span class="gensmall">{L_UNAPPROVED_TOTAL}</span></td> +		</tr>  	<!-- ENDIF --> -</table> +	</table> -<br clear="all" /><br /> +	<br clear="all" /><br />  <!-- ENDIF -->  <!-- IF S_SHOW_REPORTS --> -<table class="tablebg" width="100%" cellspacing="1"> +	<table class="tablebg" width="100%" cellspacing="1">  	<tr>  		<td class="row3" colspan="5" align="center"><b class="gen">{L_LATEST_REPORTED}</b></td>  	</tr> @@ -50,26 +50,26 @@  		<th> {L_REPORT_TIME} </th>  	</tr>  	<!-- BEGIN report --> -	<tr> -		<td class="row1" width="15%"><span class="gen">{report.FORUM}</span></td> -		<td class="row2" width="18%"><span class="gen">{report.TOPIC}</span></td> -		<td class="row1"><span class="gen">{report.SUBJECT}</span></td> -		<td class="row2" align="center" width="15%" nowrap="nowrap"><span class="gen">{report.REPORTER}</span></td> -		<td class="row1" align="center" width="15%" nowrap="nowrap"><span class="gensmall">{report.REPORT_TIME}</span></td> -	</tr> +		<tr> +			<td class="row1" width="15%" valign="top"><span class="gen"><!-- IF report.U_FORUM --><a href="{report.U_FORUM}">{report.FORUM_NAME}</a><!-- ELSE -->{report.FORUM_NAME}<!-- ENDIF --></span><!-- IF report.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{report.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td> +			<td class="row2" valign="top"><span class="gen"><a href="{report.U_TOPIC}">{report.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{report.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td> +			<td class="row1" valign="top"><span class="gen">{report.SUBJECT}</span><br /><span class="gensmall">[ <a href="{report.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td> +			<td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen"><!-- IF report.U_REPORTER --><a href="{report.U_REPORTER}">{report.REPORTER}</a><!-- ELSE -->{report.REPORTER}<!-- ENDIF --></span></td> +			<td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{report.REPORT_TIME}</span></td> +		</tr>  	<!-- BEGINELSE --> -	<tr> -		<td class="row1" colspan="5" align="center"><span class="gen">{L_REPORTS_ZERO_TOTAL}</span></td> -	</tr> +		<tr> +			<td class="row1" colspan="5" align="center"><span class="gen">{L_REPORTS_ZERO_TOTAL}</span></td> +		</tr>  	<!-- END report -->  	<!-- IF S_HAS_REPORTS --> -	<tr> -		<td class="row3" colspan="5"><span class="gensmall">{L_REPORTS_TOTAL}</span></td> -	</tr> +		<tr> +			<td class="row3" colspan="5"><span class="gensmall">{L_REPORTS_TOTAL}</span></td> +		</tr>  	<!-- ENDIF --> -</table> +	</table> -<br clear="all" /><br clear="all" /> +	<br clear="all" /><br />  <!-- ENDIF -->  <!-- IF S_SHOW_LOGS --> @@ -88,7 +88,7 @@  	<tr>  		<td class="row1" nowrap="nowrap"><span class="gen">{log.USERNAME}</span></td>  		<td class="row1" align="center" nowrap="nowrap"><span class="gen">{log.IP}</span></td> -		<td class="row1"><span class="gen">{log.ACTION}</span></td> +		<td class="row1"><span class="genmed">{log.ACTION}</span></td>  		<td class="row1" align="center" nowrap="nowrap"><span class="gensmall"><!-- IF log.U_VIEWTOPIC --><a href="{log.U_VIEWTOPIC}">{L_VIEW_TOPIC}</a><!-- IF log.U_VIEWLOGS --> | <!-- ENDIF --><!-- ENDIF --><!-- IF log.U_VIEWLOGS --><a href="{log.U_VIEWLOGS}">{L_VIEW_TOPIC_LOGS}</a><!-- ENDIF --></span></td>  		<td class="row1" align="center" nowrap="nowrap"><span class="gensmall">{log.TIME}</span></td>  	</tr> diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index 87d2bcedbd..aba3f5edd0 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -1,138 +1,151 @@  <!-- INCLUDE mcp_header.html -->  <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp" action="{S_APPROVE_ACTION}"> -	<tr> -		<th colspan="2" height="28" align="center">{L_POST_DETAILS}</th> -	</tr> -	<tr> -		<td class="row3" colspan="2" align="center"><span class="gensmall">{RETURN_TOPIC}</span></td> -	</tr> -	<tr> -		<td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td> -		<td class="row2"><span class="gen">{POST_SUBJECT}</span></td> -	</tr> -	<tr> -		<td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td> -		<td class="row2" width="80%"><span class="gen">{POSTER_NAME}   [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]<!-- IF S_USER_NOTES --> [ <a href="{U_MCP_USERNOTES}">{L_READ_USERNOTES}</a> ]<!-- ENDIF --><!-- IF S_USER_WARNINGS --> [ <a href="{U_MCP_WARNINGS}">{L_READ_WARNINGS}</a> ]<!-- ENDIF --></span></td> -	</tr> -	<!-- IF S_CAN_VIEWIP --> +<tr> +	<th colspan="2" height="28" align="center">{L_POST_DETAILS}</th> +</tr> +<tr> +	<td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE}<!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td> +</tr> +<tr> +	<td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td> +	<td class="row2"><span class="gen">{POST_SUBJECT}</span></td> +</tr> +<tr> +	<td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td> +	<td class="row2" width="80%"><span class="gen">{POSTER_NAME}   [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]<!-- IF S_USER_NOTES --> [ <a href="{U_MCP_USERNOTES}">{L_READ_USERNOTES}</a> ]<!-- ENDIF --><!-- IF S_USER_WARNINGS --> [ <a href="{U_MCP_WARNINGS}">{L_READ_WARNINGS}</a> ]<!-- ENDIF --></span></td> +</tr> +<!-- IF S_CAN_VIEWIP -->  	<tr>  		<td class="row1"><b class="gen">{L_THIS_POST_IP}: </b></td>  		<td class="row2"><span class="gen">{POST_IP} [ {POST_IPADDR} ]</span></td>  	</tr> -	<!-- ENDIF --> -	<tr> -		<td class="row1"><b class="gen">{L_POSTED}: </b></td> -		<td class="row2"><span class="postdetails">{POST_DATE}</span></td> -	</tr> -	</tr> -	<tr> -		<th colspan="2" height="28" align="center">{L_PREVIEW}</th> -	</th> -	<tr> -		<td class="row1" colspan="2"><div class="gen" style="overflow: auto; width: 100%; height: 80pt; border: 1px;">{POST_PREVIEW}</div></td> -	</tr> -	<!-- IF S_POST_UNAPPROVED --> +<!-- ENDIF --> +<tr> +	<td class="row1"><b class="gen">{L_POSTED}: </b></td> +	<td class="row2"><span class="postdetails">{POST_DATE}</span></td> +</tr> +<tr> +	<th colspan="2" height="28" align="center">{L_PREVIEW}</th> +</tr> +<tr> +	<td class="row1" colspan="2"><div class="gen" style="overflow: auto; width: 100%; height: 80pt; border: 1px;">{POST_PREVIEW}</div><!-- IF U_EDIT --><div class="gen" style="float: right;"><a href="{U_EDIT}">{EDIT_IMG}</a></div><!-- ENDIF --></td> +</tr> +<!-- IF S_POST_UNAPPROVED -->  	<tr>  		<td class="cat" align="center" colspan="2"><input class="btnmain" type="submit" value="{L_APPROVE}" name="mode[approve]" />   <input class="btnlite" type="submit" value="{L_DISAPPROVE}" name="mode[disapprove]" /></td>  	</tr> -	<!-- ENDIF --> -</form></table> +	<input type="hidden" name="post_id_list[]" value="{POST_ID}" /> +<!-- ENDIF --> +</table> +</form> -<!-- IF S_SHOW_REPORTS --> -<br /><a name="reports"></a> +<!-- IF S_MCP_QUEUE --> +	<br clear="all" /> -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> -	<tr> -		<th colspan="2" height="28" align="center">{L_REPORTS}</th> -	</tr> -	<!-- BEGIN reports --> -	<tr> -		<td class="row1"><b class="genmed">{reports.REPORT_TIME}</b></td> -		<td class="row2"><span class="gen">{reports.REASON_TITLE} » {reports.REASON_DESC}</span></td> -	</tr> -	<tr> -		<td class="row1"><b class="genmed">{L_REPORTER}: </b></td> -		<td class="row2"><span class="gen"><!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --></span></td> -	</tr> -	<!-- IF reports.REPORT_TEXT --> -	<tr> -		<td class="row1" valign="top"><b class="genmed">{L_MORE_INFO}: </b></td> -		<td class="row2"><span class="gen">{reports.REPORT_TEXT}</span></td> -	</tr> -	<!-- ENDIF --> -	<tr> -		<td colspan="2" class="spacer"></td> -	</tr> -	<!-- END reports --> -</table> -<!-- ENDIF --> +	<!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> +<!-- ELSE --> -<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER --> -<br /><a name="mod"></a> +	<!-- IF S_SHOW_REPORTS --> +		<br /><a name="reports"></a> -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> -	<tr> -		<th colspan="2" height="28" align="center">{L_MOD_OPTIONS}</th> -	</tr> -	<!-- IF S_CAN_CHGPOSTER --> -	<tr><form method="post" name="mcp" action="{S_CHGPOSTER_ACTION}"{S_FORM_ENCTYPE}> -		<td class="row1" valign="top"><b class="gen">{L_CHANGE_POSTER}</b></td> -		<td class="row2"><!-- IF S_USER_SELECT --><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter]" value="{L_CONFIRM}" /><br /><!-- ENDIF --> <input class="post" type="text" name="username" value="{SEARCH_USERNAME}" /> <input class="btnlite" type="submit" value="{L_SEARCH}" name="action[chgposter_search]" /></td> -	</form></tr> -	<!-- ENDIF --> -	<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST --> -	<tr><form method="post" name="mcp" action="{S_MCP_ACTION}"{S_FORM_ENCTYPE}> -		<td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td> -		<td class="row2"><select name="mode"><!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --><!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --></select> <input class="btnmain" type="submit" value="{L_SUBMIT}" /></td> -	</form></tr> +		<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> +		<tr> +			<th colspan="2" height="28" align="center">{L_REPORTS}</th> +		</tr> +		<!-- BEGIN reports --> +			<tr> +				<td class="row1"><b class="genmed">{reports.REPORT_TIME}</b></td> +				<td class="row2"><span class="gen">{reports.REASON_TITLE} » {reports.REASON_DESC}</span></td> +			</tr> +			<tr> +				<td class="row1"><b class="genmed">{L_REPORTER}: </b></td> +				<td class="row2"><span class="gen"><!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --></span></td> +			</tr> +			<!-- IF reports.REPORT_TEXT --> +				<tr> +					<td class="row1" valign="top"><b class="genmed">{L_MORE_INFO}: </b></td> +					<td class="row2"><span class="gen">{reports.REPORT_TEXT}</span></td> +				</tr> +			<!-- ENDIF --> +			<tr> +				<td colspan="2" class="spacer"></td> +			</tr> +		<!-- END reports --> +		</table>  	<!-- ENDIF --> -</table> -<!-- ENDIF --> -<!-- IF S_CAN_VIEWIP --> -<br /><a name="ip"></a> +	<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER --> +		<br /><a name="mod"></a> -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> -	<tr> -		<th colspan="2" height="28" align="center">{L_IP_INFO}</th> -	</tr> -	<tr> -		<td colspan="2" height="28" class="cat"><b class="gen">{L_OTHER_USERS}</b></td> -	</tr> -	<!-- BEGIN userrow --> -	<!-- IF userrow.S_ROW_COUNT is even --> -	<tr class="row1"> -	<!-- ELSE --> -	<tr class="row2"> +		<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> +		<tr> +			<th colspan="2" height="28" align="center">{L_MOD_OPTIONS}</th> +		</tr> +		<!-- IF S_CAN_CHGPOSTER --> +			<tr> +				<form method="post" name="mcp" action="{S_CHGPOSTER_ACTION}"{S_FORM_ENCTYPE}> +					<td class="row1" valign="top"><b class="gen">{L_CHANGE_POSTER}</b></td> +					<td class="row2"><!-- IF S_USER_SELECT --><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter]" value="{L_CONFIRM}" /><br /><!-- ENDIF --> <input class="post" type="text" name="username" value="{SEARCH_USERNAME}" /> <input class="btnlite" type="submit" value="{L_SEARCH}" name="action[chgposter_search]" /></td> +				</form> +			</tr> +		<!-- ENDIF --> +		<!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST --> +			<tr> +				<form method="post" name="mcp" action="{S_MCP_ACTION}"{S_FORM_ENCTYPE}> +					<td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td> +					<td class="row2"><select name="mode"><!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --><!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --></select> <input class="btnmain" type="submit" value="{L_SUBMIT}" /></td> +				</form> +			</tr> +		<!-- ENDIF --> +		</table>  	<!-- ENDIF --> -		<td><span class="gen"><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td> -		<td align="center"><a href="{userrow.U_SEARCHPOSTS}">{SEARCH_IMG}</a></td> -	</tr> -	<!-- BEGINELSE --> -	<tr class="row1"> -		<td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td> -	</tr> -	<!-- END userrow --> -	<tr> -		<td height="28" class="cat"><b class="gen">{L_OTHER_IPS}</b></td> -		<td class="cat" width="10%" nowrap="nowrap"><!-- IF U_LOOKUP_ALL --><span class="gen">[ <a href="{U_LOOKUP_ALL}">{L_LOOKUP_ALL}</a> ]</span><!-- ENDIF --></td> -	</tr> -	<!-- BEGIN iprow --> -	<!-- IF iprow.S_ROW_COUNT is even --> -	<tr class="row1"> -	<!-- ELSE --> -	<tr class="row2"> + +	<!-- IF S_CAN_VIEWIP --> +		<br /><a name="ip"></a> + +		<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> +		<tr> +			<th colspan="2" height="28" align="center">{L_IP_INFO}</th> +		</tr> +		<tr> +			<td colspan="2" height="28" class="cat"><b class="gen">{L_OTHER_USERS}</b></td> +		</tr> +		<!-- BEGIN userrow --> +			<!-- IF userrow.S_ROW_COUNT is even --> +				<tr class="row1"> +			<!-- ELSE --> +				<tr class="row2"> +			<!-- ENDIF --> +				<td><span class="gen"><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td> +				<td align="center"><a href="{userrow.U_SEARCHPOSTS}">{SEARCH_IMG}</a></td> +			</tr> +		<!-- BEGINELSE --> +			<tr class="row1"> +				<td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td> +			</tr> +		<!-- END userrow --> +		<tr> +			<td height="28" class="cat"><b class="gen">{L_OTHER_IPS}</b></td> +			<td class="cat" width="10%" nowrap="nowrap"><!-- IF U_LOOKUP_ALL --><span class="gen">[ <a href="{U_LOOKUP_ALL}">{L_LOOKUP_ALL}</a> ]</span><!-- ENDIF --></td> +		</tr> +		<!-- BEGIN iprow --> +			<!-- IF iprow.S_ROW_COUNT is even --> +				<tr class="row1"> +			<!-- ELSE --> +				<tr class="row2"> +			<!-- ENDIF --> +				<td><span class="gen"><!-- IF iprow.HOSTNAME --><a href="{iprow.U_WHOIS}">{iprow.HOSTNAME}</a> ({iprow.IP})<!-- ELSE --><a href="{iprow.U_WHOIS}">{iprow.IP}</a><!-- ENDIF --> [ {iprow.NUM_POSTS} {iprow.L_POST_S} ]</span></td> +				<td align="center"><!-- IF iprow.U_LOOKUP_IP --><span class="gen">[ <a href="{iprow.U_LOOKUP_IP}">{L_LOOKUP_IP}</a> ]</span><!-- ENDIF --></td> +			</tr> +		<!-- BEGINELSE --> +			<tr class="row1"> +				<td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td> +			</tr> +		<!-- END iprow --> +		</table>  	<!-- ENDIF --> -		<td><span class="gen"><!-- IF iprow.HOSTNAME --><a href="{iprow.U_WHOIS}">{iprow.HOSTNAME}</a> ({iprow.IP})<!-- ELSE --><a href="{iprow.U_WHOIS}">{iprow.IP}</a><!-- ENDIF --> [ {iprow.NUM_POSTS} {iprow.L_POST_S} ]</span></td> -		<td align="center"><!-- IF iprow.U_LOOKUP_IP --><span class="gen">[ <a href="{iprow.U_LOOKUP_IP}">{L_LOOKUP_IP}</a> ]</span><!-- ENDIF --></td> -	</tr> -	<!-- BEGINELSE --> -	<tr class="row1"> -		<td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td> -	</tr> -	<!-- END iprow --> -</table> +  <!-- ENDIF -->  <!-- INCLUDE mcp_footer.html -->
\ No newline at end of file diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 03b6dec26d..3ab5393cd9 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -572,7 +572,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16)  				'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '',  				'U_VIEW_TOPIC'		=> $view_topic_url,  				'U_MCP_REPORT'		=> "mcp.$phpEx?sid={$user->session_id}&mode=reports&t=$topic_id", -				'U_MCP_QUEUE'		=> "mcp.$phpEx?sid={$user->session_id}&mode=mod_queue&t=$topic_id") +				'U_MCP_QUEUE'		=> "mcp.$phpEx?sid={$user->session_id}&i=queue&mode=approve_details&t=$topic_id")  			);  			$s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 4181b8ac24..b9f1408518 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1262,7 +1262,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)  		'U_RATE_BAD'		=> "viewtopic.$phpEx$SID&rate=bad&p=" . $row['post_id'],   		'U_REPORT'			=> "report.$phpEx$SID&p=" . $row['post_id'],  		'U_MCP_REPORT'		=> ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', -		'U_MCP_APPROVE'		=> ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'] : '', +		'U_MCP_APPROVE'		=> ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&i=queue&mode=approve&post_id_list[]=" . $row['post_id'] : '',  		'U_MCP_DETAILS'		=> ($auth->acl_get('m_', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '',  		'U_MINI_POST'		=> "viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'],  		'U_POST_ID' 		=> ($unread_post_id == $row['post_id']) ? 'unread' : $row['post_id'],  | 
