Vergleich private.php - 1.8.9 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 40Zeile 40
if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['canusepms'] == 0)
{
error_no_permission();

if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['canusepms'] == 0)
{
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);

}

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

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'];


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();

$plugins->run_hooks("private_start");

usercp_menu();

$plugins->run_hooks("private_start");





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


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


Zeile 99Zeile 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 111Zeile 112
		break;
case "advanced_search":
add_breadcrumb($lang->nav_search);

		break;
case "advanced_search":
add_breadcrumb($lang->nav_search);

		break;

		break;

	case "results":
add_breadcrumb($lang->nav_results);
break;

	case "results":
add_breadcrumb($lang->nav_results);
break;

Zeile 239Zeile 240
	$sid = $mybb->get_input('sid');
$query = $db->simple_select("searchlog", "*", "sid='".$db->escape_string($sid)."' AND uid='{$mybb->user['uid']}'");
$search = $db->fetch_array($query);

	$sid = $mybb->get_input('sid');
$query = $db->simple_select("searchlog", "*", "sid='".$db->escape_string($sid)."' AND uid='{$mybb->user['uid']}'");
$search = $db->fetch_array($query);





	if(!$search)
{
error($lang->error_invalidsearch);

	if(!$search)
{
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'));


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

Zeile 261Zeile 262
		{
$query_sortby = "fromusername";
}

		{
$query_sortby = "fromusername";
}

	}

	}

	else

	else

	{

	{

		$sortby = $query_sortby = "dateline";

		$sortby = $query_sortby = "dateline";

	}

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


	}

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


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

	if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{
$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'];


// Work out pagination, which page we're at, as well as the limits.
$perpage = $mybb->settings['threadsperpage'];

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

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

	}







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

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 301Zeile 311
	}

// 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 473Zeile 480
			$senddate = $lang->not_sent;
}


			$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 556Zeile 568

// 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 702Zeile 715
		{
$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 922Zeile 935

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 1204Zeile 1217

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")."\";");

		eval("\$quickreply = \"".$templates->get("private_quickreply")."\";");

	}

	}


$plugins->run_hooks("private_read_end");


$plugins->run_hooks("private_read_end");





	eval("\$read = \"".$templates->get("private_read")."\";");
output_page($read);
}

	eval("\$read = \"".$templates->get("private_read")."\";");
output_page($read);
}

Zeile 1228Zeile 1242
	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'];





	$query = $db->simple_select("privatemessages", "COUNT(pmid) as readpms", "receipt='2' AND folder!='3' AND status!='0' AND fromid='".$mybb->user['uid']."'");
$postcount = $db->fetch_field($query, "readpms");

$page = $mybb->get_input('read_page', MyBB::INPUT_INT);
$pages = $postcount / $perpage;
$pages = ceil($pages);

	$query = $db->simple_select("privatemessages", "COUNT(pmid) as readpms", "receipt='2' AND folder!='3' AND status!='0' AND fromid='".$mybb->user['uid']."'");
$postcount = $db->fetch_field($query, "readpms");

$page = $mybb->get_input('read_page', MyBB::INPUT_INT);
$pages = $postcount / $perpage;
$pages = ceil($pages);





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

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

	{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}

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

	{
$page = $pages;
}

if($page > $pages || $page <= 0)
{
$page = 1;
}

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

	}
else
{

	}
else
{

Zeile 1346Zeile 1360
	{
$lang->no_readmessages = $lang->no_unreadmessages;
eval("\$unreadmessages = \"".$templates->get("private_tracking_nomessage")."\";");

	{
$lang->no_readmessages = $lang->no_unreadmessages;
eval("\$unreadmessages = \"".$templates->get("private_tracking_nomessage")."\";");

	}

	}


$plugins->run_hooks("private_tracking_end");

eval("\$tracking = \"".$templates->get("private_tracking")."\";");
output_page($tracking);
}


$plugins->run_hooks("private_tracking_end");

eval("\$tracking = \"".$templates->get("private_tracking")."\";");
output_page($tracking);
}





if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post")
{
// Verify incoming POST request

Zeile 1367Zeile 1381
		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
);
$db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
}
}
$plugins->run_hooks("private_do_tracking_end");
redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
}

			{
$sql_array = array(
"receipt" => 0
);
$db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
}
}
$plugins->run_hooks("private_do_tracking_end");
redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
}

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

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

Zeile 1394Zeile 1408
		redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
}
elseif(!empty($mybb->input['cancel']))

		redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
}
elseif(!empty($mybb->input['cancel']))

	{

	{

		$mybb->input['unreadcheck'] = $mybb->get_input('unreadcheck', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['unreadcheck']))
{
foreach($mybb->input['unreadcheck'] as $pmid => $val)
{
$pmids[$pmid] = (int)$pmid;

		$mybb->input['unreadcheck'] = $mybb->get_input('unreadcheck', MyBB::INPUT_ARRAY);
if(!empty($mybb->input['unreadcheck']))
{
foreach($mybb->input['unreadcheck'] as $pmid => $val)
{
$pmids[$pmid] = (int)$pmid;

			}

			}


$pmids = implode(",", $pmids);
$query = $db->simple_select("privatemessages", "uid", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'");
while($pm = $db->fetch_array($query))
{
$pmuids[$pm['uid']] = $pm['uid'];


$pmids = implode(",", $pmids);
$query = $db->simple_select("privatemessages", "uid", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'");
while($pm = $db->fetch_array($query))
{
$pmuids[$pm['uid']] = $pm['uid'];

			}

			}


$db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'");
foreach($pmuids as $uid)


$db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'");
foreach($pmuids as $uid)

Zeile 1423Zeile 1437
}

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

}

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

{
// 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_stopalltracking_start");



$plugins->run_hooks("private_stopalltracking_start");


Zeile 1451Zeile 1465
		$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 1489Zeile 1503
	$donefolders = array();
$mybb->input['folder'] = $mybb->get_input('folder', MyBB::INPUT_ARRAY);
foreach($mybb->input['folder'] as $key => $val)

	$donefolders = array();
$mybb->input['folder'] = $mybb->get_input('folder', MyBB::INPUT_ARRAY);
foreach($mybb->input['folder'] as $key => $val)

	{

	{

		if(empty($donefolders[$val]) )// Probably was a check for duplicate folder names, but doesn't seem to be used now
{
if(my_substr($key, 0, 3) == "new") // Create a new folder

		if(empty($donefolders[$val]) )// Probably was a check for duplicate folder names, but doesn't seem to be used now
{
if(my_substr($key, 0, 3) == "new") // Create a new folder

			{

			{

				++$highestid;
$fid = (int)$highestid;
}

				++$highestid;
$fid = (int)$highestid;
}

Zeile 1506Zeile 1520

$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($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 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 != '' || (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 1558Zeile 1549
				{
error($lang->error_invalidpmfoldername);
}

				{
error($lang->error_invalidpmfoldername);
}

			}

			}

			else
{
// Delete PMs from the folder

			else
{
// Delete PMs from the folder

Zeile 1566Zeile 1557
			}
}
}

			}
}
}





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

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

Zeile 1574Zeile 1565

// Update PM count
update_pm_count();


// Update PM count
update_pm_count();





	$plugins->run_hooks("private_do_folders_end");

	$plugins->run_hooks("private_do_folders_end");





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

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

}


}


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

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

{

{

	if($mybb->user['totalpms'] == 0)
{
error($lang->error_nopms);

	if($mybb->user['totalpms'] == 0)
{
error($lang->error_nopms);

	}

$plugins->run_hooks("private_empty_start");


	}

$plugins->run_hooks("private_empty_start");


	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);

	$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);

	$folderlist = '';

	$folderlist = $unread = '';

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

	foreach($foldersexploded as $key => $folders)
{
$folderinfo = explode("**", $folders, 2);
$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")."\";");
}





	$plugins->run_hooks("private_empty_end");

eval("\$folders = \"".$templates->get("private_empty")."\";");

	$plugins->run_hooks("private_empty_end");

eval("\$folders = \"".$templates->get("private_empty")."\";");

Zeile 1609Zeile 1609
}

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

}

if($mybb->input['action'] == "do_empty" && $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_empty_start");

$emptyq = '';

	$plugins->run_hooks("private_do_empty_start");

$emptyq = '';

Zeile 1640Zeile 1640
		if($emptyq != '')
{
$db->delete_query("privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."'{$keepunreadq}");

		if($emptyq != '')
{
$db->delete_query("privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."'{$keepunreadq}");

		}
}

		}
}


// Update PM count
update_pm_count();


// Update PM count
update_pm_count();





	$plugins->run_hooks("private_do_empty_end");
redirect("private.php", $lang->redirect_pmfoldersemptied);
}

	$plugins->run_hooks("private_do_empty_end");
redirect("private.php", $lang->redirect_pmfoldersemptied);
}





if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post")
{
// Verify incoming POST request

Zeile 1663Zeile 1663
	}
elseif(!empty($mybb->input['moveto']))
{

	}
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 1953Zeile 1958
		$message['subject'] = $parser->parse_badwords($message['subject']);
if($message['folder'] != "3")
{

		$message['subject'] = $parser->parse_badwords($message['subject']);
if($message['folder'] != "3")
{

			$senddate = my_date($mybb->settings['dateformat'], $message['dateline']);
$sendtime = my_date($mybb->settings['timeformat'], $message['dateline']);

			$senddate = my_date($mybb->settings['dateformat'], $message['dateline'], "", false);
$sendtime = my_date($mybb->settings['timeformat'], $message['dateline'], "", false);

			$senddate .= " $lang->at $sendtime";

			$senddate .= " $lang->at $sendtime";

		}

		}

		else
{
$senddate = $lang->not_sent;

		else
{
$senddate = $lang->not_sent;

Zeile 1986Zeile 1991

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


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

			$message['message'] = addslashes($message['message']);
$message['subject'] = addslashes($message['subject']);
$message['tousername'] = addslashes($message['tousername']);
$message['fromusername'] = addslashes($message['fromusername']);

			$message['message'] = my_escape_csv($message['message']);
$message['subject'] = my_escape_csv($message['subject']);
$message['tousername'] = my_escape_csv($message['tousername']);
$message['fromusername'] = my_escape_csv($message['fromusername']);

		}

if(empty($donefolder[$message['folder']]))

		}

if(empty($donefolder[$message['folder']]))

Zeile 2011Zeile 2016
					}
else
{

					}
else
{

						$foldername = addslashes($folderinfo[1]);

						$foldername = my_escape_csv($folderinfo[1]);

					}
$donefolder[$message['folder']] = 1;
}

					}
$donefolder[$message['folder']] = 1;
}

Zeile 2027Zeile 2032
		// Gather global stylesheet for HTML
$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1));
$css = $db->fetch_field($query, "stylesheet");

		// Gather global stylesheet for HTML
$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1));
$css = $db->fetch_field($query, "stylesheet");

	}


	}


	$plugins->run_hooks("private_do_export_end");

eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");

	$plugins->run_hooks("private_do_export_end");

eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");

Zeile 2037Zeile 2042
		$db->delete_query("privatemessages", "pmid IN ('0'$ids)");
// Update PM count
update_pm_count();

		$db->delete_query("privatemessages", "pmid IN ('0'$ids)");
// Update PM count
update_pm_count();

	}

	}


if($mybb->input['exporttype'] == "html")
{
$filename = "pm-archive.html";
$contenttype = "text/html";


if($mybb->input['exporttype'] == "html")
{
$filename = "pm-archive.html";
$contenttype = "text/html";

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

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

		$filename = "pm-archive.csv";
$contenttype = "application/octet-stream";
}
else

		$filename = "pm-archive.csv";
$contenttype = "application/octet-stream";
}
else

	{

	{

		$filename = "pm-archive.txt";
$contenttype = "text/plain";
}

		$filename = "pm-archive.txt";
$contenttype = "text/plain";
}





	$archived = str_replace("\\\'","'",$archived);
header("Content-disposition: filename=$filename");
header("Content-type: ".$contenttype);

	$archived = str_replace("\\\'","'",$archived);
header("Content-disposition: filename=$filename");
header("Content-type: ".$contenttype);

Zeile 2062Zeile 2067
	if($mybb->input['exporttype'] == "html")
{
output_page($archived);

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

	}

	}

	else
{
echo "\xEF\xBB\xBF"; // UTF-8 BOM

	else
{
echo "\xEF\xBB\xBF"; // UTF-8 BOM

Zeile 2076Zeile 2081

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 2131Zeile 2137
	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)
{
$mybb->settings['threadsperpage'] = 20;

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

	}


	}


	$perpage = $mybb->settings['threadsperpage'];
$page = $mybb->get_input('page', MyBB::INPUT_INT);

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

	$perpage = $mybb->settings['threadsperpage'];
$page = $mybb->get_input('page', MyBB::INPUT_INT);

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

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

	}
else
{
$start = 0;
$page = 1;

	}
else
{
$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($mybb->input['order'] || ($sortby && $sortby != "dateline"))

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

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

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

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

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

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


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



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


Zeile 2179Zeile 2197
	if($folder == 2 || $folder == 3)
{
if($sortfield == "username")

	if($folder == 2 || $folder == 3)
{
if($sortfield == "username")

		{

		{

			$u = "u.";
}
else

			$u = "u.";
}
else

		{

		{

			$u = "pm.";
}


			$u = "pm.";
}


Zeile 2203Zeile 2221
			if(is_array($recipients['to']) && count($recipients['to']))
{
$get_users = array_merge($get_users, $recipients['to']);

			if(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['bcc']);


if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc']))
{
$get_users = array_merge($get_users, $recipients['bcc']);

			}
}

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


			}
}

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


		// Grab info
if($get_users)
{

		// Grab info
if($get_users)
{

Zeile 2237Zeile 2255
	}
else
{

	}
else
{

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


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

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

Zeile 2252Zeile 2275
		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
");

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

Zeile 2290Zeile 2313
			{ // Sent Items or Drafts Folder Check
$recipients = my_unserialize($message['recipients']);
$to_users = $bcc_users = '';

			{ // 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 || (isset($recipients['to']) && count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))

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

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

Zeile 2399Zeile 2422
	}

$pmspacebar = '';

	}

$pmspacebar = '';

	if($mybb->usergroup['pmquota'] != '0' && $mybb->usergroup['cancp'] != 1)

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

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

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

Zeile 2463Zeile 2486
	}

$limitwarning = '';

	}

$limitwarning = '';

	if($mybb->usergroup['pmquota'] != "0" && $pmscount['total'] >= $mybb->usergroup['pmquota'] && $mybb->usergroup['cancp'] != 1)

	if($mybb->usergroup['pmquota'] != 0 && $pmscount['total'] >= $mybb->usergroup['pmquota'])

	{
eval("\$limitwarning = \"".$templates->get("private_limitwarning")."\";");
}

	{
eval("\$limitwarning = \"".$templates->get("private_limitwarning")."\";");
}