phpBB

Code Changes

File: includes/functions_posting.php

  Unmodified   Added   Modified   Removed
Line 310Line 310
			{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,

			{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,

 
					'ICON_NAME'		=> $data['img'],

					'ICON_IMG'		=> $root_path . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],

					'ICON_IMG'		=> $root_path . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],

Line 701Line 702

$used_imagick = false;



$used_imagick = false;


	// Only use imagemagick if defined and the passthru function not disabled

	// Only use ImageMagick if defined and the passthru function not disabled

	if ($config['img_imagick'] && function_exists('passthru'))
{
if (substr($config['img_imagick'], -1) !== '/')

	if ($config['img_imagick'] && function_exists('passthru'))
{
if (substr($config['img_imagick'], -1) !== '/')

Line 1036Line 1037
*/
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
{

*/
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
{

	global $user, $auth, $db, $template, $bbcode, $cache;
global $config, $phpbb_root_path, $phpEx, $phpbb_container;

	global $user, $auth, $db, $template, $cache;
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;


$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';


$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';

Line 1094Line 1095
	$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);


	$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);


	$bbcode_bitfield = '';

 
	$rowset = array();
$has_attachments = false;
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['post_id']] = $row;

	$rowset = array();
$has_attachments = false;
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['post_id']] = $row;

		$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);

 

if ($row['post_attachment'])
{


if ($row['post_attachment'])
{

Line 1108Line 1107
		}
}
$db->sql_freeresult($result);

		}
}
$db->sql_freeresult($result);


// Instantiate BBCode class
if (!isset($bbcode) && $bbcode_bitfield !== '')
{
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}

 

// Grab extensions
$extensions = $attachments = array();


// Grab extensions
$extensions = $attachments = array();

Line 1136Line 1128
		}
$db->sql_freeresult($result);
}

		}
$db->sql_freeresult($result);
}

 

/**
* Event to modify the posts list for topic reviews
*
* @event core.topic_review_modify_post_list
* @var array attachments Array with the post attachments data
* @var int cur_post_id Post offset ID
* @var int forum_id The topic's forum ID
* @var string mode The topic review mode
* @var array post_list Array with the post IDs
* @var array rowset Array with the posts data
* @var bool show_quote_button Flag indicating if the quote button should be displayed
* @var int topic_id The topic ID that is being reviewed
* @since 3.1.9-RC1
*/
$vars = array(
'attachments',
'cur_post_id',
'forum_id',
'mode',
'post_list',
'rowset',
'show_quote_button',
'topic_id',
);
extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_post_list', compact($vars)));


for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{


for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{

Line 1176Line 1194
		$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&amp;t=$topic_id&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}");


		$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&amp;t=$topic_id&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}");


		$template->assign_block_vars($mode . '_row', array(

		$post_row = array(

			'POST_AUTHOR_FULL'		=> get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),

			'POST_AUTHOR_FULL'		=> get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),

Line 1195Line 1213
			'POST_ID'			=> $row['post_id'],
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',

			'POST_ID'			=> $row['post_id'],
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',

			'POSTER_QUOTE'		=> ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')

			'POSTER_QUOTE'		=> ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',

		);

		);

 

$current_row_number = $i;

/**
* Event to modify the template data block for topic reviews
*
* @event core.topic_review_modify_row
* @var string mode The review mode
* @var int topic_id The topic that is being reviewed
* @var int forum_id The topic's forum
* @var int cur_post_id Post offset id
* @var int current_row_number Number of the current row being iterated
* @var array post_row Template block array of the current post
* @var array row Array with original post and user data
* @since 3.1.4-RC1
*/
$vars = array(
'mode',
'topic_id',
'forum_id',
'cur_post_id',
'current_row_number',
'post_row',
'row',
);
extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_row', compact($vars)));

$template->assign_block_vars($mode . '_row', $post_row);


// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))


// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))

Line 1523Line 1569
		return false;
}


		return false;
}


 
	if (!empty($data['post_time']))
{
$current_time = $data['post_time'];
}
else
{

	$current_time = time();

	$current_time = time();

 
	}


if ($mode == 'post')
{


if ($mode == 'post')
{

Line 1582Line 1635
				$post_visibility = ITEM_REAPPROVE;
break;
}

				$post_visibility = ITEM_REAPPROVE;
break;
}

 
	}
else if (isset($data['post_visibility']) && $data['post_visibility'] !== false)
{
$post_visibility = $data['post_visibility'];

	}

// MODs/Extensions are able to force any visibility on posts

	}

// MODs/Extensions are able to force any visibility on posts

Line 1719Line 1776
				'topic_type'				=> $topic_type,
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,

				'topic_type'				=> $topic_type,
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,

 
				'topic_status'				=> (isset($data['topic_status'])) ? $data['topic_status'] : ITEM_UNLOCKED,

			);

if (isset($poll['poll_options']) && !empty($poll['poll_options']))

			);

if (isset($poll['poll_options']) && !empty($poll['poll_options']))

Line 1824Line 1882

break;
}


break;
}

 

/**
* Modify sql query data for post submitting
*
* @event core.submit_post_modify_sql_data
* @var array data Array with the data for the post
* @var array poll Array with the poll data for the post
* @var string post_mode Variable containing posting mode value
* @var bool sql_data Array with the data for the posting SQL query
* @var string subject Variable containing post subject value
* @var int topic_type Variable containing topic type value
* @var string username Variable containing post author name
* @since 3.1.3-RC1
*/
$vars = array(
'data',
'poll',
'post_mode',
'sql_data',
'subject',
'topic_type',
'username',
);
extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars)));


// Submit new topic
if ($post_mode == 'post')


// Submit new topic
if ($post_mode == 'post')

Line 2166Line 2248
		}

$error = false;

		}

$error = false;

		$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);

		$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);


if ($error)
{


if ($error)
{

Line 2351Line 2433

$params = $add_anchor = '';



$params = $add_anchor = '';


	if ($post_visibility == ITEM_APPROVED)



	if ($post_visibility == ITEM_APPROVED ||
($auth->acl_get('m_softdelete', $data['forum_id']) && $post_visibility == ITEM_DELETED) ||
($auth->acl_get('m_approve', $data['forum_id']) && in_array($post_visibility, array(ITEM_UNAPPROVED, ITEM_REAPPROVE))))

	{
$params .= '&amp;t=' . $data['topic_id'];


	{
$params .= '&amp;t=' . $data['topic_id'];