Vergleich private.php - 1.8.6 - 1.8.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
define("IGNORE_CLEAN_VARS", "sid");
define('THIS_SCRIPT', 'private.php');


define("IGNORE_CLEAN_VARS", "sid");
define('THIS_SCRIPT', 'private.php');


$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage,private_orderarrow,usercp_nav_attachments,usercp_nav_messenger_compose,private_tracking_readmessage_stop";
$templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav,private_empty_folder,private_empty,private_archive_txt,private_archive_csv,private_archive_html,private_tracking_unreadmessage_stop";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,usercp_nav_editsignature,posticons_icon";
$templatelist .= ",private_messagebit,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to,postbit_online,postbit_warninglevel_formatted,postbit_iplogged_hiden";

$templatelist = "private_send,private_send_buddyselect,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage,usercp_nav_attachments,usercp_nav_messenger_compose,private_tracking_readmessage_stop";
$templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav,private_empty_folder,private_archive_txt,private_archive_csv,private_archive_html,private_tracking_unreadmessage_stop";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start";
$templatelist .= ",private_messagebit,codebuttons,posticons,private_send_autocomplete,private_messagebit_denyreceipt,postbit_warninglevel_formatted,private_emptyexportlink,postbit_purgespammer,postbit_gotopost,private_read";

$templatelist .= ",postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages,postbit_author_guest,private_multiple_recipients_user,private_multiple_recipients_bcc,private_multiple_recipients,usercp_nav_messenger_folder";

$templatelist .= ",postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages,postbit_author_guest,private_multiple_recipients_user,private_multiple_recipients_bcc,private_multiple_recipients,usercp_nav_messenger_folder";

$templatelist .= ",private_search_messagebit,private_search_results_nomessages,private_search_results,private_advanced_search,previewpost,private_send_tracking,private_send_signature,private_read_bcc,private_composelink,postbit_purgespammer";
$templatelist .= ",private_archive,private_quickreply,private_pmspace,private_limitwarning,postbit_groupimage,postbit_offline,postbit_www,postbit_replyall_pm,postbit_signature,postbit_classic,postbit_gotopost,postbit_userstar,postbit_reputation_formatted_link,postbit_icon";
$templatelist .= ",private_archive_folders_folder,private_archive_folders,postbit_warninglevel,postbit_author_user,postbit_reply_pm,postbit_forward_pm,private_messagebit_icon,private_jump_folders_folder,private_advanced_search_folders";
$templatelist .= ",private_jump_folders,postbit_avatar,postbit_warn,postbit_rep_button,postbit_email,postbit_reputation,private_move,private_read_action,postbit_away,postbit_pm,usercp_nav_messenger_tracking,postbit_find,private_emptyexportlink";


$templatelist .= ",private_search_messagebit,private_search_results_nomessages,private_search_results,private_advanced_search,previewpost,private_send_tracking,private_send_signature,private_read_bcc,private_composelink";
$templatelist .= ",private_archive,private_quickreply,private_pmspace,private_limitwarning,postbit_groupimage,postbit_offline,postbit_www,postbit_replyall_pm,postbit_signature,postbit_classic,postbit_reputation_formatted_link";
$templatelist .= ",private_archive_folders_folder,private_archive_folders,postbit_warninglevel,postbit_author_user,postbit_forward_pm,private_messagebit_icon,private_jump_folders_folder,private_advanced_search_folders,usercp_nav_home";
$templatelist .= ",private_jump_folders,postbit_avatar,postbit_warn,postbit_rep_button,postbit_email,postbit_reputation,private_move,private_read_action,postbit_away,postbit_pm,usercp_nav_messenger_tracking,postbit_find";
$templatelist .= ",usercp_nav_editsignature,posticons_icon,postbit_icon,postbit_iplogged_hiden,usercp_nav_profile,usercp_nav_misc,postbit_userstar,private_read_to,postbit_online,private_empty,private_orderarrow,postbit_reply_pm";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

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

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

}

// On a random occassion, recount the user's pms just to make sure everything is in sync.
$rand = my_rand(0, 9);
if($rand == 5)
{
update_pm_count();

 
}

$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 = '';





$foldernames = array();
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders)
{
$folderinfo = explode("**", $folders, 2);
if($mybb->input['fid'] == $folderinfo[0])

$foldernames = array();
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders)
{
$folderinfo = explode("**", $folders, 2);
if($mybb->input['fid'] == $folderinfo[0])

	{

	{

		$sel = ' selected="selected"';
}
else

		$sel = ' selected="selected"';
}
else

Zeile 85Zeile 79
	eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
eval("\$foldersearch_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")."\";");
}

 

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


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


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

Zeile 360Zeile 356
	");
while($message = $db->fetch_array($query))
{

	");
while($message = $db->fetch_array($query))
{

		$msgalt = $msgsuffix = $msgprefix = '';

		$msgalt = $msgstatus = '';


// Determine Folder Icon
if($message['status'] == 0)
{


// Determine Folder Icon
if($message['status'] == 0)
{

			$msgfolder = 'new_pm.png';

			$msgstatus = 'new_pm';

			$msgalt = $lang->new_pm;

			$msgalt = $lang->new_pm;

			$msgprefix = "<strong>";
$msgsuffix = "</strong>";

 
		}

		}

		elseif($message['status'] == 1)

		else if($message['status'] == 1)

		{

		{

			$msgfolder = 'old_pm.png';

			$msgstatus = 'old_pm';

			$msgalt = $lang->old_pm;
}

			$msgalt = $lang->old_pm;
}

		elseif($message['status'] == 3)

		else if($message['status'] == 3)

		{

		{

			$msgfolder = 're_pm.png';

			$msgstatus = 're_pm';

			$msgalt = $lang->reply_pm;
}
else if($message['status'] == 4)
{

			$msgalt = $lang->reply_pm;
}
else if($message['status'] == 4)
{

			$msgfolder = 'fw_pm.png';

			$msgstatus = 'fw_pm';

			$msgalt = $lang->fwd_pm;
}


			$msgalt = $lang->fwd_pm;
}


Zeile 400Zeile 394
				{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

				{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

 
					$user['username'] = htmlspecialchars_uni($user['username']);

					$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$to_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}

					$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$to_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}

Zeile 410Zeile 405
					{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

					{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

 
						$user['username'] = htmlspecialchars_uni($user['username']);

						$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}

						$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}

Zeile 419Zeile 415
			}
else if($message['toid'])
{

			}
else if($message['toid'])
{

				$tofromusername = $message['tousername'];

				$tofromusername = htmlspecialchars_uni($message['tousername']);

				$tofromuid = $message['toid'];
}
else

				$tofromuid = $message['toid'];
}
else

Zeile 429Zeile 425
		}
else
{

		}
else
{

			$tofromusername = $message['fromusername'];

			$tofromusername = htmlspecialchars_uni($message['fromusername']);

			$tofromuid = $message['fromid'];
if($tofromuid == 0)
{

			$tofromuid = $message['fromid'];
if($tofromuid == 0)
{

Zeile 629Zeile 625
	if(isset($mybb->input['options']['readreceipt']))
{
$pm['options']['readreceipt'] = $mybb->input['options']['readreceipt'];

	if(isset($mybb->input['options']['readreceipt']))
{
$pm['options']['readreceipt'] = $mybb->input['options']['readreceipt'];

	}

	}


if(!empty($mybb->input['saveasdraft']))
{
$pm['saveasdraft'] = 1;


if(!empty($mybb->input['saveasdraft']))
{
$pm['saveasdraft'] = 1;

	}

	}

	$pmhandler->set_data($pm);

// Now let the pm handler do all the hard work.

	$pmhandler->set_data($pm);

// Now let the pm handler do all the hard work.

Zeile 650Zeile 646
		$plugins->run_hooks("private_do_send_end");

if(isset($pminfo['draftsaved']))

		$plugins->run_hooks("private_do_send_end");

if(isset($pminfo['draftsaved']))

		{

		{

			redirect("private.php", $lang->redirect_pmsaved);
}
else

			redirect("private.php", $lang->redirect_pmsaved);
}
else

Zeile 663Zeile 659
if($mybb->input['action'] == "send")
{
if($mybb->usergroup['cansendpms'] == 0)

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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


Zeile 838Zeile 834
			if(!empty($recipientids))
{
$query = $db->simple_select("users", "uid, username", "uid IN ({$recipientids})");

			if(!empty($recipientids))
{
$query = $db->simple_select("users", "uid, username", "uid IN ({$recipientids})");

				while($user = $db->fetch_array($query))

				while($user = $db->fetch_array($query))

				{
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc']))
{

				{
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc']))
{

Zeile 908Zeile 904
				{
$to .= $comma.htmlspecialchars_uni($user['username']);
$comma = $lang->comma;

				{
$to .= $comma.htmlspecialchars_uni($user['username']);
$comma = $lang->comma;

				}
}
}

				}
}
}

	}

// New PM with recipient preset

	}

// New PM with recipient preset

Zeile 1081Zeile 1077
	if($pm['fromid'] == 0)
{
$pm['username'] = $lang->mybb_engine;

	if($pm['fromid'] == 0)
{
$pm['username'] = $lang->mybb_engine;

	}


	}


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


Zeile 1096Zeile 1092
		$uid_sql = implode(',', $pm['recipients']['to']);
}
else

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

	{

	{

		$uid_sql = $pm['toid'];
$pm['recipients']['to'] = array($pm['toid']);

		$uid_sql = $pm['toid'];
$pm['recipients']['to'] = array($pm['toid']);

	}


	}


	$show_bcc = 0;

// If we have any BCC recipients and this user is an Administrator, add them on to the query

	$show_bcc = 0;

// If we have any BCC recipients and this user is an Administrator, add them on to the query

Zeile 1116Zeile 1112
	while($recipient = $db->fetch_array($query))
{
// User is a BCC recipient

	while($recipient = $db->fetch_array($query))
{
// User is a BCC recipient

 
		$recipient['username'] = htmlspecialchars_uni($recipient['username']);

		if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc']))

		if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc']))

		{

		{

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

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

Zeile 1188Zeile 1185
		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']);


		if($mybb->user['uid'] == $pm['fromid'])
{
$to = htmlspecialchars_uni($mybb->user['username']);

		if($mybb->user['uid'] == $pm['fromid'])
{
$to = htmlspecialchars_uni($mybb->user['username']);

Zeile 1200Zeile 1197
		{
$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'));

		}

		}


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


$private_send_tracking = '';
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")."\";");
}


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


Zeile 1246Zeile 1244
	$pages = ceil($pages);

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

	$pages = ceil($pages);

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

	{
$page = $pages;
}

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

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

	{
$page = $pages;
}

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

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


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



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


Zeile 1278Zeile 1276
	while($readmessage = $db->fetch_array($query))
{
$readmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($readmessage['subject']));

	while($readmessage = $db->fetch_array($query))
{
$readmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($readmessage['subject']));

 
		$readmessage['tousername'] = htmlspecialchars_uni($readmessage['tousername']);

		$readmessage['profilelink'] = build_profile_link($readmessage['tousername'], $readmessage['toid']);
$readdate = my_date('relative', $readmessage['readtime']);
eval("\$readmessages .= \"".$templates->get("private_tracking_readmessage")."\";");

		$readmessage['profilelink'] = build_profile_link($readmessage['tousername'], $readmessage['toid']);
$readdate = my_date('relative', $readmessage['readtime']);
eval("\$readmessages .= \"".$templates->get("private_tracking_readmessage")."\";");

Zeile 1334Zeile 1333
	while($unreadmessage = $db->fetch_array($query))
{
$unreadmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($unreadmessage['subject']));

	while($unreadmessage = $db->fetch_array($query))
{
$unreadmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($unreadmessage['subject']));

 
		$unreadmessage['tousername'] = htmlspecialchars_uni($unreadmessage['tousername']);

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

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

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

		{

		{

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

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

Zeile 1472Zeile 1472
		$fid = "new$i";
$foldername = '';
eval("\$newfolders .= \"".$templates->get("private_folders_folder")."\";");

		$fid = "new$i";
$foldername = '';
eval("\$newfolders .= \"".$templates->get("private_folders_folder")."\";");

	}


	}


	$plugins->run_hooks("private_folders_end");

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

	$plugins->run_hooks("private_folders_end");

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

Zeile 1542Zeile 1542
			{
// 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 != '' || ($key >= 1 && $key <= 4))

			{

			{

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


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


Zeile 1561Zeile 1561
				{
error($lang->error_invalidpmfoldername);
}

				{
error($lang->error_invalidpmfoldername);
}

			}

			}

			else
{
// Delete PMs from the folder

			else
{
// Delete PMs from the folder

Zeile 1569Zeile 1569
			}
}
}

			}
}
}





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

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


// Update PM count
update_pm_count();



// Update PM count
update_pm_count();


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

	}

$plugins->run_hooks("private_empty_start");


	}

$plugins->run_hooks("private_empty_start");


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

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

Zeile 1604Zeile 1604
		$foldercount = my_number_format($thing['pmsinfolder']);
eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";");
}

		$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 1612Zeile 1612
}

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

$plugins->run_hooks("private_do_empty_start");

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

$plugins->run_hooks("private_do_empty_start");





	$emptyq = '';
$mybb->input['empty'] = $mybb->get_input('empty', MyBB::INPUT_ARRAY);
$keepunreadq = '';

	$emptyq = '';
$mybb->input['empty'] = $mybb->get_input('empty', MyBB::INPUT_ARRAY);
$keepunreadq = '';

Zeile 1638Zeile 1638
				}
$emptyq .= "folder='$key'";
}

				}
$emptyq .= "folder='$key'";
}

		}


		}


		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}");

Zeile 1647Zeile 1647
	}

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

Zeile 1717Zeile 1717
				if(!empty($deletepms[$key]))
{
$db->delete_query("privatemessages", "pmid='$key' AND uid='".$mybb->user['uid']."'");

				if(!empty($deletepms[$key]))
{
$db->delete_query("privatemessages", "pmid='$key' AND uid='".$mybb->user['uid']."'");

				}

				}

				else
{
$sql_array = array(

				else
{
$sql_array = array(

Zeile 1739Zeile 1739
		{
redirect("private.php", $lang->redirect_pmsdeleted);
}

		{
redirect("private.php", $lang->redirect_pmsdeleted);
}

	}

	}

}

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

}

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

Zeile 1753Zeile 1753
	if($db->num_rows($query) == 1)
{
$db->delete_query("privatemessages", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."'");

	if($db->num_rows($query) == 1)
{
$db->delete_query("privatemessages", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."'");

	}
else

	}
else

	{
$sql_array = array(
"folder" => 4,
"deletetime" => TIME_NOW
);
$db->update_query("privatemessages", $sql_array, "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."'");

	{
$sql_array = array(
"folder" => 4,
"deletetime" => TIME_NOW
);
$db->update_query("privatemessages", $sql_array, "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."'");

	}


	}


	// Update PM count
update_pm_count();


	// Update PM count
update_pm_count();


Zeile 1778Zeile 1778
	}

$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 1787Zeile 1787
		$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);

$folder_id = $folderinfo[0];

		$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);

$folder_id = $folderinfo[0];

		$folder_name = $folderinfo[1];


		$folder_name = $folderinfo[1];


		eval("\$folderlist_folder .= \"".$templates->get("private_archive_folders_folder")."\";");

		eval("\$folderlist_folder .= \"".$templates->get("private_archive_folders_folder")."\";");

	}

eval("\$folderlist = \"".$templates->get("private_archive_folders")."\";");

	}

eval("\$folderlist = \"".$templates->get("private_archive_folders")."\";");


$plugins->run_hooks("private_export_end");



$plugins->run_hooks("private_export_end");


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


	$plugins->run_hooks("private_do_export_start");


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

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

	$exdate = my_date($mybb->settings['dateformat'], TIME_NOW, 0, 0);
$extime = my_date($mybb->settings['timeformat'], TIME_NOW, 0, 0);
$lang->exported_date = $lang->sprintf($lang->exported_date, $exdate, $extime);

	$exdate = my_date($mybb->settings['dateformat'], TIME_NOW, 0, 0);
$extime = my_date($mybb->settings['timeformat'], TIME_NOW, 0, 0);
$lang->exported_date = $lang->sprintf($lang->exported_date, $exdate, $extime);

Zeile 1823Zeile 1823
	if($mybb->get_input('pmid', MyBB::INPUT_INT))
{
$wsql = "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."' AND uid='".$mybb->user['uid']."'";

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

	}

	}

	else
{
if($mybb->get_input('daycut', MyBB::INPUT_INT) && ($mybb->get_input('dayway') != "disregard"))

	else
{
if($mybb->get_input('daycut', MyBB::INPUT_INT) && ($mybb->get_input('dayway') != "disregard"))

		{

		{

			$datecut = TIME_NOW-($mybb->get_input('daycut', MyBB::INPUT_INT) * 86400);
$wsql = "pm.dateline";
if($mybb->get_input('dayway') == "older")

			$datecut = TIME_NOW-($mybb->get_input('daycut', MyBB::INPUT_INT) * 86400);
$wsql = "pm.dateline";
if($mybb->get_input('dayway') == "older")

			{

			{

				$wsql .= "<=";
}
else

				$wsql .= "<=";
}
else

			{

			{

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

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

		}

		}

		else
{
$wsql = "1=1";

		else
{
$wsql = "1=1";

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

				{
$folderlst = '';
break;

				}
else
{

				}
else
{

					if(!$folderlst)
{
$folderlst = " AND pm.folder IN ('$val'";

					if(!$folderlst)
{
$folderlst = " AND pm.folder IN ('$val'";

Zeile 1928Zeile 1928
		{
$tofromuid = $message['fromid'];
if($mybb->input['exporttype'] == "txt")

		{
$tofromuid = $message['fromid'];
if($mybb->input['exporttype'] == "txt")

			{

			{

				$tofromusername = $message['fromusername'];
}
else

				$tofromusername = $message['fromusername'];
}
else

Zeile 1956Zeile 1956
		$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";
}
else

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

Zeile 1989Zeile 1989

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 2014Zeile 2014
					}
else
{

					}
else
{

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

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

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

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

Zeile 2040Zeile 2040
		$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")
{

	}

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

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

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

	{

	{

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

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

	}
else

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





	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 2078Zeile 2078
	$plugins->run_hooks("private_inbox");

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

	$plugins->run_hooks("private_inbox");

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

	{

	{

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


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


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

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

	}

	}

	else
{
$start = 0;

	else
{
$start = 0;

Zeile 2165Zeile 2165
	}

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

	}

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

	{
$page_url = "private.php?fid={$folder}&sortby={$sortby}&order={$mybb->input['order']}";

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

	}
else
{

	}
else
{

Zeile 2175Zeile 2175

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


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





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

// Cache users in multiple recipients for sent & drafts folder

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

// Cache users in multiple recipients for sent & drafts folder

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

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

		}

		}

		else
{
$u = "pm.";

		else
{
$u = "pm.";

Zeile 2197Zeile 2197
			FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
WHERE pm.folder='{$folder}' AND pm.uid='{$mybb->user['uid']}'

			FROM ".TABLE_PREFIX."privatemessages pm
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
WHERE pm.folder='{$folder}' AND pm.uid='{$mybb->user['uid']}'

			ORDER BY {$u}{$sortfield} {$mybb->input['order']}

			ORDER BY {$u}{$sortfield} {$sortordernow}

			LIMIT {$start}, {$perpage}
");
while($row = $db->fetch_array($users_query))

			LIMIT {$start}, {$perpage}
");
while($row = $db->fetch_array($users_query))

Zeile 2264Zeile 2264
	{
while($message = $db->fetch_array($query))
{

	{
while($message = $db->fetch_array($query))
{

			$msgalt = $msgsuffix = $msgprefix = '';


			$msgalt = $msgstatus = '';


			// Determine Folder Icon
if($message['status'] == 0)
{

			// Determine Folder Icon
if($message['status'] == 0)
{

				$msgfolder = 'new_pm.png';

				$msgstatus = 'new_pm';

				$msgalt = $lang->new_pm;

				$msgalt = $lang->new_pm;

				$msgprefix = "<strong>";
$msgsuffix = "</strong>";

 
			}

			}

			elseif($message['status'] == 1)

			else if($message['status'] == 1)

			{

			{

				$msgfolder = 'old_pm.png';

				$msgstatus = 'old_pm';

				$msgalt = $lang->old_pm;
}

				$msgalt = $lang->old_pm;
}

			elseif($message['status'] == 3)

			else if($message['status'] == 3)

			{

			{

				$msgfolder = 're_pm.png';

				$msgstatus = 're_pm';

				$msgalt = $lang->reply_pm;
}

				$msgalt = $lang->reply_pm;
}

			elseif($message['status'] == 4)

			else if($message['status'] == 4)

			{

			{

				$msgfolder = 'fw_pm.png';

				$msgstatus = 'fw_pm';

				$msgalt = $lang->fwd_pm;
}


				$msgalt = $lang->fwd_pm;
}


Zeile 2294Zeile 2293
			{ // 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)
{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

				{
foreach($recipients['to'] as $uid)
{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

 
						$user['username'] = htmlspecialchars_uni($user['username']);

						$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if(!$user['username'])
{

						$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if(!$user['username'])
{

Zeile 2314Zeile 2314
						{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

						{
$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];

 
							$user['username'] = htmlspecialchars_uni($user['username']);

							$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if(!$user['username'])
{

							$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
if(!$user['username'])
{

Zeile 2327Zeile 2328
				}
else if($message['toid'])
{

				}
else if($message['toid'])
{

					$tofromusername = $message['tousername'];

					$tofromusername = htmlspecialchars_uni($message['tousername']);

					$tofromuid = $message['toid'];

					$tofromuid = $message['toid'];

				}

				}

				else
{
$tofromusername = $lang->not_sent;

				else
{
$tofromusername = $lang->not_sent;

Zeile 2337Zeile 2338
			}
else
{

			}
else
{

				$tofromusername = $message['fromusername'];

				$tofromusername = htmlspecialchars_uni($message['fromusername']);

				$tofromuid = $message['fromid'];
if($tofromuid == 0)
{

				$tofromuid = $message['fromid'];
if($tofromuid == 0)
{

Zeile 2401Zeile 2402
	}

$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 2465Zeile 2466
	}

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