Vergleich private.php - 1.8.16 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 42Zeile 42
	error_no_permission();
}


	error_no_permission();
}


if(!$mybb->user['pmfolders'])
{
$mybb->user['pmfolders'] = "1**$%%$2**$%%$3**$%%$4**";

$sql_array = array(
"pmfolders" => $mybb->user['pmfolders']
);
$db->update_query("users", $sql_array, "uid = ".$mybb->user['uid']);
}

$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);

$folder_id = $folder_name = '';


$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);

$folder_id = $folder_name = $folderjump_folder = $folderoplist_folder = $foldersearch_folder ='';












$foldernames = array();
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders)

$foldernames = array();
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders)

Zeile 64Zeile 54
	if($mybb->input['fid'] == $folderinfo[0])
{
$sel = ' selected="selected"';

	if($mybb->input['fid'] == $folderinfo[0])
{
$sel = ' selected="selected"';

	}

	}

	else
{
$sel = '';

	else
{
$sel = '';

Zeile 76Zeile 66
	$folder_name = $folderinfo[1];

eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_folder")."\";");

	$folder_name = $folderinfo[1];

eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_folder")."\";");

	eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
eval("\$foldersearch_folder .= \"".$templates->get("private_jump_folders_folder")."\";");











// Manipulate search folder selection & move selector to omit "Unread"
if($folder_id != 1)
{
if($folder_id == 0)
{
$folder_id = 1;
}
eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
eval("\$foldersearch_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
}

}

$from_fid = $mybb->input['fid'];

}

$from_fid = $mybb->input['fid'];

Zeile 85Zeile 84
eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";");
eval("\$folderoplist = \"".$templates->get("private_move")."\";");
eval("\$foldersearch = \"".$templates->get("private_advanced_search_folders")."\";");

eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";");
eval("\$folderoplist = \"".$templates->get("private_move")."\";");
eval("\$foldersearch = \"".$templates->get("private_advanced_search_folders")."\";");


usercp_menu();


usercp_menu();


$plugins->run_hooks("private_start");

// Make navigation
add_breadcrumb($lang->nav_pms, "private.php");


$plugins->run_hooks("private_start");

// Make navigation
add_breadcrumb($lang->nav_pms, "private.php");





$mybb->input['action'] = $mybb->get_input('action');
switch($mybb->input['action'])
{

$mybb->input['action'] = $mybb->get_input('action');
switch($mybb->input['action'])
{

Zeile 101Zeile 100
		break;
case "tracking":
add_breadcrumb($lang->nav_tracking);

		break;
case "tracking":
add_breadcrumb($lang->nav_tracking);

		break;

		break;

	case "folders":
add_breadcrumb($lang->nav_folders);
break;

	case "folders":
add_breadcrumb($lang->nav_folders);
break;

Zeile 122Zeile 121
if(!empty($mybb->input['preview']))
{
$mybb->input['action'] = "send";

if(!empty($mybb->input['preview']))
{
$mybb->input['action'] = "send";

}

}


if(($mybb->input['action'] == "do_search" || $mybb->input['action'] == "do_stuff" && ($mybb->get_input('quick_search') || !$mybb->get_input('hop') && !$mybb->get_input('moveto') && !$mybb->get_input('delete'))) && $mybb->request_method == "post")
{


if(($mybb->input['action'] == "do_search" || $mybb->input['action'] == "do_stuff" && ($mybb->get_input('quick_search') || !$mybb->get_input('hop') && !$mybb->get_input('moveto') && !$mybb->get_input('delete'))) && $mybb->request_method == "post")
{

Zeile 159Zeile 158
				$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb->settings['searchfloodtime'], $remaining_time);
}
error($lang->error_searchflooding);

				$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb->settings['searchfloodtime'], $remaining_time);
}
error($lang->error_searchflooding);

		}

		}

	}

if($mybb->get_input('subject', MyBB::INPUT_INT) != 1 && $mybb->get_input('message', MyBB::INPUT_INT) != 1)

	}

if($mybb->get_input('subject', MyBB::INPUT_INT) != 1 && $mybb->get_input('message', MyBB::INPUT_INT) != 1)

Zeile 230Zeile 229
	else
{
$sortorder = "desc";

	else
{
$sortorder = "desc";

	}


	}


	$plugins->run_hooks("private_do_search_end");
redirect("private.php?action=results&sid=".$sid."&sortby=".$sortby."&order=".$sortorder, $lang->redirect_searchresults);
}

	$plugins->run_hooks("private_do_search_end");
redirect("private.php?action=results&sid=".$sid."&sortby=".$sortby."&order=".$sortorder, $lang->redirect_searchresults);
}

Zeile 243Zeile 242
	$search = $db->fetch_array($query);

if(!$search)

	$search = $db->fetch_array($query);

if(!$search)

	{

	{

		error($lang->error_invalidsearch);

		error($lang->error_invalidsearch);

	}

$plugins->run_hooks("private_results_start");


	}

$plugins->run_hooks("private_results_start");


	// Decide on our sorting fields and sorting order.
$order = my_strtolower($mybb->get_input('order'));
$sortby = my_strtolower($mybb->get_input('sortby'));

	// Decide on our sorting fields and sorting order.
$order = my_strtolower($mybb->get_input('order'));
$sortby = my_strtolower($mybb->get_input('sortby'));

Zeile 267Zeile 266
	else
{
$sortby = $query_sortby = "dateline";

	else
{
$sortby = $query_sortby = "dateline";

	}


	}


	if($order != "asc")
{
$order = "desc";
}

if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)

	if($order != "asc")
{
$order = "desc";
}

if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)

	{

	{

		$mybb->settings['threadsperpage'] = 20;
}

		$mybb->settings['threadsperpage'] = 20;
}

 

$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "pmid IN(".$db->escape_string($search['querycache']).")");
$pmscount = $db->fetch_field($query, "total");


// Work out pagination, which page we're at, as well as the limits.
$perpage = $mybb->settings['threadsperpage'];
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0)


// Work out pagination, which page we're at, as well as the limits.
$perpage = $mybb->settings['threadsperpage'];
$page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0)

	{

	{

		$start = ($page-1) * $perpage;

		$start = ($page-1) * $perpage;

 
		$pages = ceil($pmscount / $perpage);
if($page > $pages)
{
$start = 0;
$page = 1;
}

	}
else

	}
else

	{

	{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

Zeile 300Zeile 308
	if($search['keywords'])
{
$highlight = "&amp;highlight=".urlencode($search['keywords']);

	if($search['keywords'])
{
$highlight = "&amp;highlight=".urlencode($search['keywords']);

	}


	}


	// Do Multi Pages

	// Do Multi Pages

	$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "pmid IN(".$db->escape_string($search['querycache']).")");
$pmscount = $db->fetch_array($query);


 
	if($upper > $pmscount)
{
$upper = $pmscount;
}

	if($upper > $pmscount)
{
$upper = $pmscount;
}

	$multipage = multipage($pmscount['total'], $perpage, $page, "private.php?action=results&amp;sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&amp;sortby={$sortby}&amp;order={$order}");

	$multipage = multipage($pmscount, $perpage, $page, "private.php?action=results&amp;sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&amp;sortby={$sortby}&amp;order={$order}");

	$messagelist = '';

$icon_cache = $cache->read("posticons");

	$messagelist = '';

$icon_cache = $cache->read("posticons");

Zeile 322Zeile 327
	while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

	while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

		if(is_array($recipients['to']) && count($recipients['to']))
{

		if(isset($recipients['to']) && is_array($recipients['to']) && count($recipients['to']))
{

			$get_users = array_merge($get_users, $recipients['to']);
}

if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc']))

			$get_users = array_merge($get_users, $recipients['to']);
}

if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc']))

		{

		{

			$get_users = array_merge($get_users, $recipients['bcc']);

			$get_users = array_merge($get_users, $recipients['bcc']);

		}
}


		}
}


	$get_users = implode(',', array_unique($get_users));

// Grab info

	$get_users = implode(',', array_unique($get_users));

// Grab info

Zeile 342Zeile 347
		while($user = $db->fetch_array($users_query))
{
$cached_users[$user['uid']] = $user;

		while($user = $db->fetch_array($users_query))
{
$cached_users[$user['uid']] = $user;

		}
}


		}
}


	$query = $db->query("
SELECT pm.*, fu.username AS fromusername, tu.username as tousername
FROM ".TABLE_PREFIX."privatemessages pm

	$query = $db->query("
SELECT pm.*, fu.username AS fromusername, tu.username as tousername
FROM ".TABLE_PREFIX."privatemessages pm

Zeile 368Zeile 373
		{
$msgstatus = 'old_pm';
$msgalt = $lang->old_pm;

		{
$msgstatus = 'old_pm';
$msgalt = $lang->old_pm;

		}

		}

		else if($message['status'] == 3)
{
$msgstatus = 're_pm';
$msgalt = $lang->reply_pm;

		else if($message['status'] == 3)
{
$msgstatus = 're_pm';
$msgalt = $lang->reply_pm;

		}

		}

		else if($message['status'] == 4)
{
$msgstatus = 'fw_pm';
$msgalt = $lang->fwd_pm;

		else if($message['status'] == 4)
{
$msgstatus = 'fw_pm';
$msgalt = $lang->fwd_pm;

		}

$folder = $message['folder'];


		}

$folder = $message['folder'];


		$tofromuid = 0;
if($folder == 2 || $folder == 3)
{
// Sent Items or Drafts Folder Check
$recipients = my_unserialize($message['recipients']);
$to_users = $bcc_users = '';

		$tofromuid = 0;
if($folder == 2 || $folder == 3)
{
// Sent Items or Drafts Folder Check
$recipients = my_unserialize($message['recipients']);
$to_users = $bcc_users = '';

			if(count($recipients['to']) > 1 || (count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))




			if(
isset($recipients['to']) &&
(count($recipients['to']) > 1 || (count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))
)

			{
foreach($recipients['to'] as $uid)
{

			{
foreach($recipients['to'] as $uid)
{

Zeile 453Zeile 461
		if(!trim($message['subject']))
{
$message['subject'] = $lang->pm_no_subject;

		if(!trim($message['subject']))
{
$message['subject'] = $lang->pm_no_subject;

		}

$message['subject'] = $parser->parse_badwords($message['subject']);

		}

$message['subject'] = $parser->parse_badwords($message['subject']);


if(my_strlen($message['subject']) > 50)
{
$message['subject'] = htmlspecialchars_uni(my_substr($message['subject'], 0, 50)."...");


if(my_strlen($message['subject']) > 50)
{
$message['subject'] = htmlspecialchars_uni(my_substr($message['subject'], 0, 50)."...");

		}

		}

		else
{
$message['subject'] = htmlspecialchars_uni($message['subject']);

		else
{
$message['subject'] = htmlspecialchars_uni($message['subject']);

		}

		}


if($message['folder'] != "3")
{
$senddate = my_date('relative', $message['dateline']);


if($message['folder'] != "3")
{
$senddate = my_date('relative', $message['dateline']);

		}

		}

		else
{
$senddate = $lang->not_sent;

		else
{
$senddate = $lang->not_sent;

		}

		}





		$foldername = $foldernames[$message['folder']];






		$fid = "0";
if((int)$message['folder'] > 1)
{
$fid = $message['folder'];
}
$foldername = $foldernames[$fid];


// What we do here is parse the post using our post parser, then strip the tags from it
$parser_options = array(


// What we do here is parse the post using our post parser, then strip the tags from it
$parser_options = array(

Zeile 492Zeile 505
		}

eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";");

		}

eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";");

	}

	}


if($db->num_rows($query) == 0)
{
eval("\$messagelist = \"".$templates->get("private_search_results_nomessages")."\";");


if($db->num_rows($query) == 0)
{
eval("\$messagelist = \"".$templates->get("private_search_results_nomessages")."\";");

	}

	}


$plugins->run_hooks("private_results_end");



$plugins->run_hooks("private_results_end");


Zeile 506Zeile 519
}

if($mybb->input['action'] == "advanced_search")

}

if($mybb->input['action'] == "advanced_search")

{

{

	$plugins->run_hooks("private_advanced_search");

eval("\$advanced_search = \"".$templates->get("private_advanced_search")."\";");

	$plugins->run_hooks("private_advanced_search");

eval("\$advanced_search = \"".$templates->get("private_advanced_search")."\";");

Zeile 529Zeile 542
		"pmnotice" => 1
);
$db->update_query("users", $updated_user, "uid='{$mybb->user['uid']}'");

		"pmnotice" => 1
);
$db->update_query("users", $updated_user, "uid='{$mybb->user['uid']}'");





	if(!empty($mybb->input['ajax']))
{
echo 1;

	if(!empty($mybb->input['ajax']))
{
echo 1;

Zeile 558Zeile 571

// Attempt to see if this PM is a duplicate or not
$to = array_map("trim", explode(",", $mybb->get_input('to')));


// Attempt to see if this PM is a duplicate or not
$to = array_map("trim", explode(",", $mybb->get_input('to')));

 
	$to = array_unique($to); // Filter out any duplicates

	$to_escaped = implode("','", array_map(array($db, 'escape_string'), array_map('my_strtolower', $to)));
$time_cutoff = TIME_NOW - (5 * 60 * 60);
$query = $db->query("

	$to_escaped = implode("','", array_map(array($db, 'escape_string'), array_map('my_strtolower', $to)));
$time_cutoff = TIME_NOW - (5 * 60 * 60);
$query = $db->query("

Zeile 567Zeile 581
		WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
LIMIT 0, 1
");

		WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
LIMIT 0, 1
");

	$duplicate_check = $db->fetch_field($query, "pmid");
if($duplicate_check)

	if($db->num_rows($query) > 0)


	{
error($lang->error_pm_already_submitted);
}

	{
error($lang->error_pm_already_submitted);
}

Zeile 639Zeile 652
		$pm_errors = $pmhandler->get_friendly_errors();
$send_errors = inline_error($pm_errors);
$mybb->input['action'] = "send";

		$pm_errors = $pmhandler->get_friendly_errors();
$send_errors = inline_error($pm_errors);
$mybb->input['action'] = "send";

	}
else

	}
else

	{
$pminfo = $pmhandler->insert_pm();
$plugins->run_hooks("private_do_send_end");

	{
$pminfo = $pmhandler->insert_pm();
$plugins->run_hooks("private_do_send_end");

Zeile 655Zeile 668
		}
}
}

		}
}
}





if($mybb->input['action'] == "send")
{
if($mybb->usergroup['cansendpms'] == 0)
{
error_no_permission();

if($mybb->input['action'] == "send")
{
if($mybb->usergroup['cansendpms'] == 0)
{
error_no_permission();

	}

$plugins->run_hooks("private_send_start");


	}

$plugins->run_hooks("private_send_start");


	$smilieinserter = $codebuttons = '';

if($mybb->settings['bbcodeinserter'] != 0 && $mybb->settings['pmsallowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)

	$smilieinserter = $codebuttons = '';

if($mybb->settings['bbcodeinserter'] != 0 && $mybb->settings['pmsallowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)

Zeile 673Zeile 686
		if($mybb->settings['pmsallowsmilies'] != 0)
{
$smilieinserter = build_clickable_smilies();

		if($mybb->settings['pmsallowsmilies'] != 0)
{
$smilieinserter = build_clickable_smilies();

		}
}

$lang->post_icon = $lang->message_icon;


		}
}

$lang->post_icon = $lang->message_icon;


	$posticons = get_post_icons();
$message = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('message')));
$subject = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('subject')));

	$posticons = get_post_icons();
$message = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('message')));
$subject = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('subject')));

Zeile 704Zeile 717
		{
$optionschecked['readreceipt'] = 'checked="checked"';
}

		{
$optionschecked['readreceipt'] = 'checked="checked"';
}

		$to = htmlspecialchars_uni($mybb->get_input('to'));
$bcc = htmlspecialchars_uni($mybb->get_input('bcc'));

		$to = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('to'))))));
$bcc = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('bcc'))))));

	}

$preview = '';

	}

$preview = '';

Zeile 924Zeile 937

if($send_errors)
{


if($send_errors)
{

		$to = htmlspecialchars_uni($mybb->get_input('to'));
$bcc = htmlspecialchars_uni($mybb->get_input('bcc'));

		$to = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('to'))))));
$bcc = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('bcc'))))));

	}

// Load the auto complete javascript if it is enabled.

	}

// Load the auto complete javascript if it is enabled.

Zeile 936Zeile 949
	if($do != "forward" && $do != "reply" && $do != "replyall")
{
$do = '';

	if($do != "forward" && $do != "reply" && $do != "replyall")
{
$do = '';

	}

	}


$buddy_select_to = $buddy_select_bcc = '';
// See if it's actually worth showing the buddylist icon.


$buddy_select_to = $buddy_select_bcc = '';
// See if it's actually worth showing the buddylist icon.

Zeile 1007Zeile 1020
		if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)
{
$receiptadd = 0;

		if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)
{
$receiptadd = 0;

		}
else
{

		}
else
{

			$receiptadd = 2;
}
}

			$receiptadd = 2;
}
}

Zeile 1082Zeile 1095
	if(!$pm['username'])
{
$pm['username'] = $lang->na;

	if(!$pm['username'])
{
$pm['username'] = $lang->na;

	}


	}


	// Fetch the recipients for this message
$pm['recipients'] = my_unserialize($pm['recipients']);

	// Fetch the recipients for this message
$pm['recipients'] = my_unserialize($pm['recipients']);


if(is_array($pm['recipients']['to']))
{


if(isset($pm['recipients']['to']) && is_array($pm['recipients']['to']))
{

		$uid_sql = implode(',', $pm['recipients']['to']);
}
else
{
$uid_sql = $pm['toid'];
$pm['recipients']['to'] = array($pm['toid']);

		$uid_sql = implode(',', $pm['recipients']['to']);
}
else
{
$uid_sql = $pm['toid'];
$pm['recipients']['to'] = array($pm['toid']);

	}

$show_bcc = 0;

	}

$show_bcc = 0;


// If we have any BCC recipients and this user is an Administrator, add them on to the query
if(isset($pm['recipients']['bcc']) && count($pm['recipients']['bcc']) > 0 && $mybb->usergroup['cancp'] == 1)


// If we have any BCC recipients and this user is an Administrator, add them on to the query
if(isset($pm['recipients']['bcc']) && count($pm['recipients']['bcc']) > 0 && $mybb->usergroup['cancp'] == 1)

Zeile 1120Zeile 1133
		}
// User is a normal recipient
else if(in_array($recipient['uid'], $pm['recipients']['to']))

		}
// User is a normal recipient
else if(in_array($recipient['uid'], $pm['recipients']['to']))

		{

		{

			$to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);
}
}

			$to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);
}
}

Zeile 1156Zeile 1169

add_breadcrumb($pm['subject']);
$message = build_postbit($pm, 2);


add_breadcrumb($pm['subject']);
$message = build_postbit($pm, 2);





	// Decide whether or not to show quick reply.
$quickreply = '';
if($mybb->settings['pmquickreply'] != 0 && $mybb->user['showquickreply'] != 0 && $mybb->usergroup['cansendpms'] != 0 && $pm['fromid'] != 0 && $pm['folder'] != 3)
{
$trow = alt_trow();


	// Decide whether or not to show quick reply.
$quickreply = '';
if($mybb->settings['pmquickreply'] != 0 && $mybb->user['showquickreply'] != 0 && $mybb->usergroup['cansendpms'] != 0 && $pm['fromid'] != 0 && $pm['folder'] != 3)
{
$trow = alt_trow();


		$optionschecked = array('savecopy' => 'checked="checked"');

		$optionschecked = array('savecopy' => 'checked="checked"', 'signature' => '', 'disablesmilies' => '');

		if(!empty($mybb->user['signature']))
{
$optionschecked['signature'] = 'checked="checked"';

		if(!empty($mybb->user['signature']))
{
$optionschecked['signature'] = 'checked="checked"';

		}

		}

		if($mybb->usergroup['cantrackpms'] == 1)
{
$optionschecked['readreceipt'] = 'checked="checked"';

		if($mybb->usergroup['cantrackpms'] == 1)
{
$optionschecked['readreceipt'] = 'checked="checked"';

		}

		}


require_once MYBB_ROOT.'inc/functions_posting.php';



require_once MYBB_ROOT.'inc/functions_posting.php';


Zeile 1181Zeile 1194
			'quote_is_pm' => true
);
$quoted_message = parse_quoted_message($quoted_message);

			'quote_is_pm' => true
);
$quoted_message = parse_quoted_message($quoted_message);





		if($mybb->settings['maxpmquotedepth'] != '0')
{
$quoted_message = remove_message_quotes($quoted_message, $mybb->settings['maxpmquotedepth']);

		if($mybb->settings['maxpmquotedepth'] != '0')
{
$quoted_message = remove_message_quotes($quoted_message, $mybb->settings['maxpmquotedepth']);

		}

		}


$subject = preg_replace("#(FW|RE):( *)#is", '', $pm['subject']);



$subject = preg_replace("#(FW|RE):( *)#is", '', $pm['subject']);


Zeile 1194Zeile 1207
			$to = htmlspecialchars_uni($mybb->user['username']);
}
else

			$to = htmlspecialchars_uni($mybb->user['username']);
}
else

		{

		{

			$query = $db->simple_select('users', 'username', "uid='{$pm['fromid']}'");
$to = htmlspecialchars_uni($db->fetch_field($query, 'username'));
}

			$query = $db->simple_select('users', 'username', "uid='{$pm['fromid']}'");
$to = htmlspecialchars_uni($db->fetch_field($query, 'username'));
}

Zeile 1203Zeile 1216
		if($mybb->usergroup['cantrackpms'])
{
$lang->options_read_receipt = $lang->quickreply_read_receipt;

		if($mybb->usergroup['cantrackpms'])
{
$lang->options_read_receipt = $lang->quickreply_read_receipt;





			eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";");
}

			eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";");
}

		
$expaltext = (in_array("quickreply", $collapse)) ? "[+]" : "[-]";
eval("\$quickreply = \"".$templates->get("private_quickreply")."\";");
}

















$postoptionschecked = $optionschecked; // Backwards compatability instead of correcting variable used in template

if(!isset($collapsedthead['quickreply']))
{
$collapsedthead['quickreply'] = '';
}
if(!isset($collapsedimg['quickreply']))
{
$collapsedimg['quickreply'] = '';
}
if(!isset($collapsed['quickreply_e']))
{
$collapsed['quickreply_e'] = '';
}

$expaltext = (in_array("quickreply", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
eval("\$quickreply = \"".$templates->get("private_quickreply")."\";");
}


$plugins->run_hooks("private_read_end");



$plugins->run_hooks("private_read_end");


Zeile 1223Zeile 1251
	{
error_no_permission();
}

	{
error_no_permission();
}





	$plugins->run_hooks("private_tracking_start");
$readmessages = '';
$unreadmessages = '';

	$plugins->run_hooks("private_tracking_start");
$readmessages = '';
$unreadmessages = '';

Zeile 1231Zeile 1259
	if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

	if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

	}


	}


	// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];


	// Figure out if we need to display multiple pages.
$perpage = $mybb->settings['postsperpage'];


Zeile 1301Zeile 1329
	$pages = ceil($pages);

if($mybb->get_input('unread_page') == "last")

	$pages = ceil($pages);

if($mybb->get_input('unread_page') == "last")

	{

	{

		$page = $pages;
}

if($page > $pages || $page <= 0)

		$page = $pages;
}

if($page > $pages || $page <= 0)

	{
$page = 1;
}


	{
$page = 1;
}


	if($page)
{
$start = ($page-1) * $perpage;

	if($page)
{
$start = ($page-1) * $perpage;

Zeile 1318Zeile 1346
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}

	}


$unread_multipage = multipage($postcount, $perpage, $page, "private.php?action=tracking&amp;unread_page={page}");



$unread_multipage = multipage($postcount, $perpage, $page, "private.php?action=tracking&amp;unread_page={page}");


Zeile 1337Zeile 1365
		$unreadmessage['profilelink'] = build_profile_link($unreadmessage['tousername'], $unreadmessage['toid']);
$senddate = my_date('relative', $unreadmessage['dateline']);
eval("\$unreadmessages .= \"".$templates->get("private_tracking_unreadmessage")."\";");

		$unreadmessage['profilelink'] = build_profile_link($unreadmessage['tousername'], $unreadmessage['toid']);
$senddate = my_date('relative', $unreadmessage['dateline']);
eval("\$unreadmessages .= \"".$templates->get("private_tracking_unreadmessage")."\";");

	}

	}


$stoptrackingunread = '';
if(!empty($unreadmessages))


$stoptrackingunread = '';
if(!empty($unreadmessages))

	{

	{

		eval("\$stoptrackingunread = \"".$templates->get("private_tracking_unreadmessage_stop")."\";");
}


		eval("\$stoptrackingunread = \"".$templates->get("private_tracking_unreadmessage_stop")."\";");
}


Zeile 1361Zeile 1389
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("private_do_tracking_start");

if(!empty($mybb->input['stoptracking']))

	$plugins->run_hooks("private_do_tracking_start");

if(!empty($mybb->input['stoptracking']))

Zeile 1370Zeile 1398
		if(!empty($mybb->input['readcheck']))
{
foreach($mybb->input['readcheck'] as $key => $val)

		if(!empty($mybb->input['readcheck']))
{
foreach($mybb->input['readcheck'] as $key => $val)

			{
$sql_array = array(
"receipt" => 0

			{
$sql_array = array(
"receipt" => 0

				);
$db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
}

				);
$db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
}

Zeile 1454Zeile 1482
		$fid = $folderinfo[0];
$foldername = get_pm_folder_name($fid, $foldername);


		$fid = $folderinfo[0];
$foldername = get_pm_folder_name($fid, $foldername);


		if($folderinfo[0] == "1" || $folderinfo[0] == "2" || $folderinfo[0] == "3" || $folderinfo[0] == "4")

		if((int)$folderinfo[0] < 5)

		{
$foldername2 = get_pm_folder_name($fid);
eval("\$folderlist .= \"".$templates->get("private_folders_folder_unremovable")."\";");

		{
$foldername2 = get_pm_folder_name($fid);
eval("\$folderlist .= \"".$templates->get("private_folders_folder_unremovable")."\";");

Zeile 1509Zeile 1537

$fid = (int)$key;
// Use default language strings if empty or value is language string


$fid = (int)$key;
// Use default language strings if empty or value is language string

				switch($fid)

				if($val == get_pm_folder_name($fid) || trim($val) == '')

				{

				{

					case 1:
if($val == $lang->folder_inbox || trim($val) == '')
{
$val = '';
}
break;
case 2:
if($val == $lang->folder_sent_items || trim($val) == '')
{
$val = '';
}
break;
case 3:
if($val == $lang->folder_drafts || trim($val) == '')
{
$val = '';
}
break;
case 4:
if($val == $lang->folder_trash || trim($val) == '')
{
$val = '';
}
break;

					$val = '';
























				}
}


				}
}


			if($val != '' && trim($val) == '' && !($key >= 1 && $key <= 4))
{
// If the name only contains whitespace and it's not a default folder, print an error
error($lang->error_emptypmfoldername);
}

if($val != '' || ($key >= 1 && $key <= 4))

			if($val != '' && trim($val) == '' && !(is_numeric($key) && $key <= 4))
{
// If the name only contains whitespace and it's not a default folder, print an error
error($lang->error_emptypmfoldername);
}

if($val != '' || (is_numeric($key) && $key <= 4))

			{
// If there is a name or if this is a default folder, save it
$foldername = $db->escape_string(htmlspecialchars_uni($val));

if(my_strpos($foldername, "$%%$") === false)

			{
// If there is a name or if this is a default folder, save it
$foldername = $db->escape_string(htmlspecialchars_uni($val));

if(my_strpos($foldername, "$%%$") === false)

				{

				{

					if($folders != '')
{
$folders .= "$%%$";

					if($folders != '')
{
$folders .= "$%%$";

Zeile 1569Zeile 1574
			}
}
}

			}
}
}





	$sql_array = array(
"pmfolders" => $folders
);

	$sql_array = array(
"pmfolders" => $folders
);

Zeile 1581Zeile 1586
	$plugins->run_hooks("private_do_folders_end");

redirect("private.php", $lang->redirect_pmfoldersupdated);

	$plugins->run_hooks("private_do_folders_end");

redirect("private.php", $lang->redirect_pmfoldersupdated);

}


}


if($mybb->input['action'] == "empty")
{
if($mybb->user['totalpms'] == 0)

if($mybb->input['action'] == "empty")
{
if($mybb->user['totalpms'] == 0)

	{

	{

		error($lang->error_nopms);
}


		error($lang->error_nopms);
}


Zeile 1597Zeile 1602
	foreach($foldersexploded as $key => $folders)
{
$folderinfo = explode("**", $folders, 2);

	foreach($foldersexploded as $key => $folders)
{
$folderinfo = explode("**", $folders, 2);

 
		$unread = ''; 

		$fid = $folderinfo[0];

		$fid = $folderinfo[0];

		$foldername = get_pm_folder_name($fid, $folderinfo[1]);
$query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid' AND uid='".$mybb->user['uid']."'");










		if($folderinfo[0] == "1")
{
$fid = "1";
$unread = " AND status='0'";
}
if($folderinfo[0] == "0")
{
$fid = "1";
}
$foldername = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid'$unread AND uid='".$mybb->user['uid']."'");

		$thing = $db->fetch_array($query);
$foldercount = my_number_format($thing['pmsinfolder']);
eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";");

		$thing = $db->fetch_array($query);
$foldercount = my_number_format($thing['pmsinfolder']);
eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";");

Zeile 1654Zeile 1669
}

if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post")

}

if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post")

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	$plugins->run_hooks("private_do_stuff");

if(!empty($mybb->input['hop']))

	$plugins->run_hooks("private_do_stuff");

if(!empty($mybb->input['hop']))

Zeile 1665Zeile 1680
		header("Location: private.php?fid=".$mybb->get_input('jumpto'));
}
elseif(!empty($mybb->input['moveto']))

		header("Location: private.php?fid=".$mybb->get_input('jumpto'));
}
elseif(!empty($mybb->input['moveto']))

	{
$mybb->input['check'] = $mybb->get_input('check', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['check']))

	{
$pms = array_map('intval', array_keys($mybb->get_input('check', MyBB::INPUT_ARRAY)));
if(!empty($pms))

		{

		{

			foreach($mybb->input['check'] as $key => $val)

			if(!$mybb->input['fid'])

			{

			{

				$sql_array = array(
"folder" => $mybb->input['fid']
);
$db->update_query("privatemessages", $sql_array, "pmid='".(int)$key."' AND uid='".$mybb->user['uid']."'");








				$mybb->input['fid'] = 1;
}

if(array_key_exists($mybb->input['fid'], $foldernames))
{
$db->update_query("privatemessages", array("folder" => $mybb->input['fid']), "pmid IN (".implode(",", $pms).") AND uid='".$mybb->user['uid']."'");
update_pm_count();
}
else
{
error($lang->error_invalidmovefid);

			}

			}

		}
// Update PM count
update_pm_count();

		}




if(!empty($mybb->input['fromfid']))
{


if(!empty($mybb->input['fromfid']))
{

Zeile 1695Zeile 1715
		if(!empty($mybb->input['check']))
{
$pmssql = '';

		if(!empty($mybb->input['check']))
{
$pmssql = '';

			foreach($mybb->input['check'] as $key => $val)

			foreach($mybb->input['check'] as $key => $val)

			{
if($pmssql)
{
$pmssql .= ",";

			{
if($pmssql)
{
$pmssql .= ",";

				}

				}

				$pmssql .= "'".(int)$key."'";
}


				$pmssql .= "'".(int)$key."'";
}


Zeile 1709Zeile 1729
			while($delpm = $db->fetch_array($query))
{
$deletepms[$delpm['pmid']] = 1;

			while($delpm = $db->fetch_array($query))
{
$deletepms[$delpm['pmid']] = 1;

			}

			}


foreach($mybb->input['check'] as $key => $val)
{


foreach($mybb->input['check'] as $key => $val)
{

Zeile 1732Zeile 1752
		update_pm_count();

if(!empty($mybb->input['fromfid']))

		update_pm_count();

if(!empty($mybb->input['fromfid']))

		{

		{

			redirect("private.php?fid=".$mybb->get_input('fromfid', MyBB::INPUT_INT), $lang->redirect_pmsdeleted);
}
else

			redirect("private.php?fid=".$mybb->get_input('fromfid', MyBB::INPUT_INT), $lang->redirect_pmsdeleted);
}
else

Zeile 1741Zeile 1761
		}
}
}

		}
}
}





if($mybb->input['action'] == "delete")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if($mybb->input['action'] == "delete")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("private_delete_start");

$query = $db->simple_select("privatemessages", "*", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."' AND folder='4'", array('order_by' => 'pmid'));

	$plugins->run_hooks("private_delete_start");

$query = $db->simple_select("privatemessages", "*", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."' AND folder='4'", array('order_by' => 'pmid'));

Zeile 1768Zeile 1788

$plugins->run_hooks("private_delete_end");
redirect("private.php", $lang->redirect_pmsdeleted);


$plugins->run_hooks("private_delete_end");
redirect("private.php", $lang->redirect_pmsdeleted);

}

}


if($mybb->input['action'] == "export")
{
if($mybb->user['totalpms'] == 0)


if($mybb->input['action'] == "export")
{
if($mybb->user['totalpms'] == 0)

	{

	{

		error($lang->error_nopms);

		error($lang->error_nopms);

	}

$plugins->run_hooks("private_export_start");


	}

$plugins->run_hooks("private_export_start");


	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
$folder_name = $folder_id = '';
foreach($foldersexploded as $key => $folders)

	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
$folder_name = $folder_id = '';
foreach($foldersexploded as $key => $folders)

Zeile 1805Zeile 1825
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("private_do_export_start");

$lang->private_messages_for = $lang->sprintf($lang->private_messages_for, htmlspecialchars_uni($mybb->user['username']));

	$plugins->run_hooks("private_do_export_start");

$lang->private_messages_for = $lang->sprintf($lang->private_messages_for, htmlspecialchars_uni($mybb->user['username']));

Zeile 1821Zeile 1841
	}

if($mybb->get_input('pmid', MyBB::INPUT_INT))

	}

if($mybb->get_input('pmid', MyBB::INPUT_INT))

	{

	{

		$wsql = "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."'";
}
else

		$wsql = "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."'";
}
else

Zeile 1839Zeile 1859
				$wsql .= ">=";
}
$wsql .= "'$datecut'";

				$wsql .= ">=";
}
$wsql .= "'$datecut'";

		}
else
{

		}
else
{

			$wsql = "1=1";

			$wsql = "1=1";

		}

		}


$mybb->input['exportfolders'] = $mybb->get_input('exportfolders', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['exportfolders']))


$mybb->input['exportfolders'] = $mybb->get_input('exportfolders', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['exportfolders']))

		{

		{

			$folderlst = '';
foreach($mybb->input['exportfolders'] as $key => $val)
{

			$folderlst = '';
foreach($mybb->input['exportfolders'] as $key => $val)
{

Zeile 1856Zeile 1876
				{
$folderlst = '';
break;

				{
$folderlst = '';
break;

				}

				}

				else
{
if(!$folderlst)

				else
{
if(!$folderlst)

					{

					{

						$folderlst = " AND pm.folder IN ('$val'";
}
else

						$folderlst = " AND pm.folder IN ('$val'";
}
else

Zeile 1875Zeile 1895
			}
$wsql .= "$folderlst";
}

			}
$wsql .= "$folderlst";
}

		else
{
error($lang->error_pmnoarchivefolders);
}

		else
{
error($lang->error_pmnoarchivefolders);
}


if($mybb->get_input('exportunread', MyBB::INPUT_INT) != 1)
{


if($mybb->get_input('exportunread', MyBB::INPUT_INT) != 1)
{

Zeile 1949Zeile 1969
		}

if(!$message['toid'] && $message['folder'] == 3)

		}

if(!$message['toid'] && $message['folder'] == 3)

		{

		{

			$message['tousername'] = $lang->not_sent;
}


			$message['tousername'] = $lang->not_sent;
}


Zeile 1963Zeile 1983
		else
{
$senddate = $lang->not_sent;

		else
{
$senddate = $lang->not_sent;

		}

		}


if($mybb->input['exporttype'] == "html")
{


if($mybb->input['exporttype'] == "html")
{

Zeile 1976Zeile 1996
				"me_username" => $mybb->user['username'],
"filter_badwords" => 1
);

				"me_username" => $mybb->user['username'],
"filter_badwords" => 1
);





			$message['message'] = $parser->parse_message($message['message'], $parser_options);
$message['subject'] = htmlspecialchars_uni($message['subject']);
}

			$message['message'] = $parser->parse_message($message['message'], $parser_options);
$message['subject'] = htmlspecialchars_uni($message['subject']);
}

Zeile 1985Zeile 2005
		{
$message['message'] = str_replace("\r\n", "\n", $message['message']);
$message['message'] = str_replace("\n", "\r\n", $message['message']);

		{
$message['message'] = str_replace("\r\n", "\n", $message['message']);
$message['message'] = str_replace("\n", "\r\n", $message['message']);

		}

		}


if($mybb->input['exporttype'] == "csv")
{


if($mybb->input['exporttype'] == "csv")
{

Zeile 2028Zeile 2048
	if($mybb->input['exporttype'] == "html")
{
// Gather global stylesheet for HTML

	if($mybb->input['exporttype'] == "html")
{
// Gather global stylesheet for HTML

		$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1));


		$css_tid = empty($theme['tid']) ? '' : "'". (int)$theme['tid'] ."',";
$query = $db->simple_select("themestylesheets", "stylesheet", "tid in ({$css_tid}'2','1') AND name = 'global.css'", array('order_by' => 'tid', 'order_dir' => 'DESC', 'limit' => 1));

		$css = $db->fetch_field($query, "stylesheet");
}


		$css = $db->fetch_field($query, "stylesheet");
}


Zeile 2079Zeile 2100

if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames))
{


if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames))
{

		$mybb->input['fid'] = 1;

		$mybb->input['fid'] = 0;

	}


	}


	$folder = $mybb->input['fid'];
$foldername = $foldernames[$folder];


	$fid = (int)$mybb->input['fid'];
$folder = !$fid ? 1 : $fid;
$foldername = $foldernames[$fid];


if($folder == 2 || $folder == 3)
{ // Sent Items Folder


if($folder == 2 || $folder == 3)
{ // Sent Items Folder

Zeile 2097Zeile 2119
	$mybb->input['order'] = htmlspecialchars_uni($mybb->get_input('order'));
$ordersel = array('asc' => '', 'desc');
switch(my_strtolower($mybb->input['order']))

	$mybb->input['order'] = htmlspecialchars_uni($mybb->get_input('order'));
$ordersel = array('asc' => '', 'desc');
switch(my_strtolower($mybb->input['order']))

	{

	{

		case "asc":
$sortordernow = "asc";
$ordersel['asc'] = "selected=\"selected\"";

		case "asc":
$sortordernow = "asc";
$ordersel['asc'] = "selected=\"selected\"";

Zeile 2109Zeile 2131
			$ordersel['desc'] = "selected=\"selected\"";
$oppsort = $lang->asc;
$oppsortnext = "asc";

			$ordersel['desc'] = "selected=\"selected\"";
$oppsort = $lang->asc;
$oppsortnext = "asc";

			break;
}


			break;
}


	// Sort by which field?
$sortby = htmlspecialchars_uni($mybb->get_input('sortby'));
switch($mybb->get_input('sortby'))

	// Sort by which field?
$sortby = htmlspecialchars_uni($mybb->get_input('sortby'));
switch($mybb->get_input('sortby'))

	{

	{

		case "subject":
$sortfield = "subject";
break;

		case "subject":
$sortfield = "subject";
break;

Zeile 2134Zeile 2156
	eval("\$orderarrow['$sortby'] = \"".$templates->get("private_orderarrow")."\";");

// Do Multi Pages

	eval("\$orderarrow['$sortby'] = \"".$templates->get("private_orderarrow")."\";");

// Do Multi Pages

	$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'");
$pmscount = $db->fetch_array($query);







	$selective = "";
if($fid == 1)
{
$selective = " AND status='0'";
}

$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'$selective");
$pmscount = $db->fetch_field($query, "total");


if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{


if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{

Zeile 2148Zeile 2176
	if($page > 0)
{
$start = ($page-1) *$perpage;

	if($page > 0)
{
$start = ($page-1) *$perpage;

	}
else
{







		$pages = ceil($pmscount / $perpage);
if($page > $pages)
{
$start = 0;
$page = 1;
}
}
else
{

		$start = 0;
$page = 1;

		$start = 0;
$page = 1;

	}


	}


	$end = $start + $perpage;
$lower = $start+1;
$upper = $end;

	$end = $start + $perpage;
$lower = $start+1;
$upper = $end;





	if($upper > $pmscount)
{
$upper = $pmscount;

	if($upper > $pmscount)
{
$upper = $pmscount;

	}

	}


if($mybb->input['order'] || ($sortby && $sortby != "dateline"))
{


if($mybb->input['order'] || ($sortby && $sortby != "dateline"))
{

		$page_url = "private.php?fid={$folder}&sortby={$sortby}&order={$sortordernow}";
}
else
{
$page_url = "private.php?fid={$folder}";

		$page_url = "private.php?fid={$fid}&sortby={$sortby}&order={$sortordernow}";
}
else
{
$page_url = "private.php?fid={$fid}";

	}


	}


	$multipage = multipage($pmscount['total'], $perpage, $page, $page_url);
$messagelist = '';

	$multipage = multipage($pmscount, $perpage, $page, $page_url);
$selective = $messagelist = '';


$icon_cache = $cache->read("posticons");



$icon_cache = $cache->read("posticons");


Zeile 2184Zeile 2218
		if($sortfield == "username")
{
$u = "u.";

		if($sortfield == "username")
{
$u = "u.";

		}
else
{

		}
else
{

			$u = "pm.";
}


			$u = "pm.";
}


Zeile 2204Zeile 2238
		{
$recipients = my_unserialize($row['recipients']);
if(is_array($recipients['to']) && count($recipients['to']))

		{
$recipients = my_unserialize($row['recipients']);
if(is_array($recipients['to']) && count($recipients['to']))

			{

			{

				$get_users = array_merge($get_users, $recipients['to']);
}


				$get_users = array_merge($get_users, $recipients['to']);
}


Zeile 2213Zeile 2247
				$get_users = array_merge($get_users, $recipients['bcc']);
}
}

				$get_users = array_merge($get_users, $recipients['bcc']);
}
}





		$get_users = implode(',', array_unique($get_users));

// Grab info

		$get_users = implode(',', array_unique($get_users));

// Grab info

Zeile 2221Zeile 2255
		{
$users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})");
while($user = $db->fetch_array($users_query))

		{
$users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})");
while($user = $db->fetch_array($users_query))

			{

			{

				$cached_users[$user['uid']] = $user;
}

				$cached_users[$user['uid']] = $user;
}

		}
}


		}
}


	if($folder == 2 || $folder == 3)

	if($folder == 2 || $folder == 3)

	{

	{

		if($sortfield == "username")

		if($sortfield == "username")

		{

		{

			$pm = "tu.";
}
else

			$pm = "tu.";
}
else

Zeile 2240Zeile 2274
	}
else
{

	}
else
{

 
		if($fid == 1)
{
$selective = " AND pm.status='0'";
}


		if($sortfield == "username")
{
$pm = "fu.";

		if($sortfield == "username")
{
$pm = "fu.";

Zeile 2255Zeile 2294
		FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users fu ON (fu.uid=pm.fromid)
LEFT JOIN ".TABLE_PREFIX."users tu ON (tu.uid=pm.toid)

		FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users fu ON (fu.uid=pm.fromid)
LEFT JOIN ".TABLE_PREFIX."users tu ON (tu.uid=pm.toid)

		WHERE pm.folder='$folder' AND pm.uid='".$mybb->user['uid']."'

		WHERE pm.folder='$folder' AND pm.uid='".$mybb->user['uid']."'{$selective}

		ORDER BY {$pm}{$sortfield} {$sortordernow}
LIMIT $start, $perpage
");

if($db->num_rows($query) > 0)
{

		ORDER BY {$pm}{$sortfield} {$sortordernow}
LIMIT $start, $perpage
");

if($db->num_rows($query) > 0)
{

 
		$bgcolor = alt_trow(true);

		while($message = $db->fetch_array($query))
{
$msgalt = $msgstatus = '';

		while($message = $db->fetch_array($query))
{
$msgalt = $msgstatus = '';

Zeile 2364Zeile 2404
			}

if($message['icon'] > 0 && $icon_cache[$message['icon']])

			}

if($message['icon'] > 0 && $icon_cache[$message['icon']])

			{

			{

				$icon = $icon_cache[$message['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['path'] = htmlspecialchars_uni($icon['path']);

				$icon = $icon_cache[$message['icon']];
$icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']);
$icon['path'] = htmlspecialchars_uni($icon['path']);

Zeile 2394Zeile 2434
			$plugins->run_hooks("private_message");

eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");

			$plugins->run_hooks("private_message");

eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");

 
			$bgcolor = alt_trow();

		}
}
else
{
eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";");
}

		}
}
else
{
eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";");
}





	$pmspacebar = '';
if($mybb->usergroup['pmquota'] != 0)
{

	$pmspacebar = '';
if($mybb->usergroup['pmquota'] != 0)
{

Zeile 2409Zeile 2450
		if($pmscount['total'] == 0)
{
$spaceused = 0;

		if($pmscount['total'] == 0)
{
$spaceused = 0;

		}

		}

		else
{
$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;

		else
{
$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;

Zeile 2430Zeile 2471
			if($spaceused <= "75")
{
$spaceused_severity = "medium";

			if($spaceused <= "75")
{
$spaceused_severity = "medium";

			}


			}


			else
{
$spaceused_severity = "high";
}

			else
{
$spaceused_severity = "high";
}

			



			$overhalf = round($spaceused, 0)."%";
if((int)$overhalf > 100)
{

			$overhalf = round($spaceused, 0)."%";
if((int)$overhalf > 100)
{