phpBB

Code Changes

File: includes/functions_privmsgs.php

  Unmodified   Added   Modified   Removed
Line 889Line 889
		SET pm_unread = 0
WHERE msg_id = $msg_id
AND user_id = $user_id

		SET pm_unread = 0
WHERE msg_id = $msg_id
AND user_id = $user_id

			AND folder_id = $folder_id";


			AND folder_id = $folder_id
AND pm_unread = 1";

	$db->sql_query($sql);

	$db->sql_query($sql);

 

// If the message is already marked as read, we just skip the rest to avoid negative PM count
if (!$db->sql_affectedrows())
{
return;
}


$sql = 'UPDATE ' . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1


$sql = 'UPDATE ' . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1

Line 1415Line 1422
		$_types = array('u', 'g');
foreach ($_types as $type)
{

		$_types = array('u', 'g');
foreach ($_types as $type)
{

			if (sizeof($$type))

			if (sizeof(${$type}))

			{

			{

				foreach ($$type as $id)

				foreach (${$type} as $id)

				{
$address[$type][$id] = $check_type;
}

				{
$address[$type][$id] = $check_type;
}

Line 1594Line 1601
		'percent'		=> ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? floor(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);


		'percent'		=> ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? floor(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);


	$return['message']	= $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), $return['cur'], $return['percent']);

	$return['message']	= $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), (int) $return['cur'], $return['percent']);


return $return;
}


return $return;
}

Line 1957Line 1964
*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{

*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{

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

	global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth;


// Select all receipts and the author from the pm we currently view, to only display their pm-history
$sql = 'SELECT author_id, user_id


// Select all receipts and the author from the pm we currently view, to only display their pm-history
$sql = 'SELECT author_id, user_id

Line 2009Line 2016
	$title = $row['message_subject'];

$rowset = array();

	$title = $row['message_subject'];

$rowset = array();

	$bbcode_bitfield = '';

 
	$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder=';

do

	$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder=';

do

Line 2025Line 2031
		else
{
$rowset[$row['msg_id']] = $row;

		else
{
$rowset[$row['msg_id']] = $row;

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

 
		}
}
while ($row = $db->sql_fetchrow($result));

		}
}
while ($row = $db->sql_fetchrow($result));

Line 2034Line 2039
	if (sizeof($rowset) == 1 && !$in_post_mode)
{
return false;

	if (sizeof($rowset) == 1 && !$in_post_mode)
{
return false;

	}

// Instantiate BBCode class
if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '')
{
if (!class_exists('bbcode'))
{
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
}
$bbcode = new bbcode(base64_encode($bbcode_bitfield));

 
	}

$title = censor_text($title);

	}

$title = censor_text($title);