phpBB

Code Changes

File: posting.php

  Unmodified   Added   Modified   Removed
Line 84Line 84
*							NOTE: Should be actual language strings, NOT
* language keys.
* @since 3.1.0-a1

*							NOTE: Should be actual language strings, NOT
* language keys.
* @since 3.1.0-a1

* @change 3.1.2-RC1			Removed 'delete' var as it does not exist

* @changed 3.1.2-RC1			Removed 'delete' var as it does not exist

*/
$vars = array(
'post_id',

*/
$vars = array(
'post_id',

Line 340Line 340
			// Fall back to soft_delete if we have no permissions to delete posts but to soft delete them
$is_authed = true;
$mode = 'soft_delete';

			// Fall back to soft_delete if we have no permissions to delete posts but to soft delete them
$is_authed = true;
$mode = 'soft_delete';

		}
else if (!$is_authed)
{
// Display the same error message for softdelete we use for delete
$mode = 'delete';

 
		}
break;
}

		}
break;
}

Line 394Line 389
);
extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars)));


);
extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars)));


if (!$is_authed)

if (!$is_authed || !empty($error))

{

{

	$check_auth = ($mode == 'quote') ? 'reply' : $mode;

	$check_auth = ($mode == 'quote') ? 'reply' : (($mode == 'soft_delete') ? 'delete' : $mode);


if ($user->data['is_registered'])
{


if ($user->data['is_registered'])
{

		trigger_error('USER_CANNOT_' . strtoupper($check_auth));

		trigger_error(empty($error) ? 'USER_CANNOT_' . strtoupper($check_auth) : implode('<br/>', $error));

	}
$message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)];


	}
$message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)];


Line 694Line 689
	{
if (confirm_box(true))
{

	{
if (confirm_box(true))
{

 
			$message_parser->message = $message;
$message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']);


			$sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user->data['user_id'],
'topic_id' => (int) $topic_id,
'forum_id' => (int) $forum_id,
'save_time' => (int) $current_time,
'draft_subject' => (string) $subject,

			$sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user->data['user_id'],
'topic_id' => (int) $topic_id,
'forum_id' => (int) $forum_id,
'save_time' => (int) $current_time,
'draft_subject' => (string) $subject,

				'draft_message'	=> (string) $message)

				'draft_message'	=> (string) $message_parser->message)

			);
$db->sql_query($sql);


			);
$db->sql_query($sql);


Line 945Line 943
	*				is posting a new topic or editing a post)
* @var bool refresh Whether or not to retain previously submitted data
* @var object message_parser The message parser object

	*				is posting a new topic or editing a post)
* @var bool refresh Whether or not to retain previously submitted data
* @var object message_parser The message parser object

 
	* @var	array	error		Array of errors

	* @since 3.1.2-RC1

	* @since 3.1.2-RC1

 
	* @changed 3.1.11-RC1 Added error

	*/
$vars = array(
'post_data',

	*/
$vars = array(
'post_data',

Line 960Line 960
		'cancel',
'refresh',
'message_parser',

		'cancel',
'refresh',
'message_parser',

 
		'error',

	);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_message_text', compact($vars)));


	);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_message_text', compact($vars)));


Line 1066Line 1067

// Validate username
if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username']))


// Validate username
if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username']))

 
	{
if (!function_exists('validate_username'))

	{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

	{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

 
		}


$user->add_lang('ucp');



$user->add_lang('ucp');


Line 1183Line 1187
	{
// We have a poll but the editing user is not permitted to create/edit it.
// So we just keep the original poll-data.

	{
// We have a poll but the editing user is not permitted to create/edit it.
// So we just keep the original poll-data.

 
		// Decode the poll title and options text fisrt.
$original_poll_data['poll_title'] = $bbcode_utils->unparse($original_poll_data['poll_title']);
$original_poll_data['poll_option_text'] = $bbcode_utils->unparse($original_poll_data['poll_option_text']);
$original_poll_data['poll_options'] = explode("\n", $original_poll_data['poll_option_text']);


		$poll = array_merge($original_poll_data, array(
'enable_bbcode' => $post_data['enable_bbcode'],
'enable_urls' => $post_data['enable_urls'],

		$poll = array_merge($original_poll_data, array(
'enable_bbcode' => $post_data['enable_bbcode'],
'enable_urls' => $post_data['enable_urls'],

Line 1267Line 1276
	* @var	array	error		Any error strings; a non-empty array aborts form submission.
* NOTE: Should be actual language strings, NOT language keys.
* @since 3.1.0-RC5

	* @var	array	error		Any error strings; a non-empty array aborts form submission.
* NOTE: Should be actual language strings, NOT language keys.
* @since 3.1.0-RC5

	* @change 3.1.5-RC1 Added poll array to the event
* @change 3.2.0-a1 Removed undefined page_title

	* @changed 3.1.5-RC1 Added poll array to the event
* @changed 3.2.0-a1 Removed undefined page_title

	*/
$vars = array(
'post_data',

	*/
$vars = array(
'post_data',

Line 1885Line 1894
*				posting page via $template->assign_vars()
* @var object message_parser The message parser object
* @since 3.1.0-a1

*				posting page via $template->assign_vars()
* @var object message_parser The message parser object
* @since 3.1.0-a1

* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title,

* @changed 3.1.0-b3 Added vars post_data, moderators, mode, page_title,

*		s_topic_icons, form_enctype, s_action, s_hidden_fields,
* post_id, topic_id, forum_id, submit, preview, save, load,
* delete, cancel, refresh, error, page_data, message_parser

*		s_topic_icons, form_enctype, s_action, s_hidden_fields,
* post_id, topic_id, forum_id, submit, preview, save, load,
* delete, cancel, refresh, error, page_data, message_parser

* @change 3.1.2-RC1 Removed 'delete' var as it does not exist
* @change 3.1.5-RC1 Added poll variables to the page_data array
* @change 3.1.6-RC1 Added 'draft_id' var

* @changed 3.1.2-RC1 Removed 'delete' var as it does not exist
* @changed 3.1.5-RC1 Added poll variables to the page_data array
* @changed 3.1.6-RC1 Added 'draft_id' var

*/
$vars = array(
'post_data',

*/
$vars = array(
'post_data',