Vergleich private.php - 1.8.20 - 1.8.24

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

}

$update = false;
if(!$mybb->user['pmfolders'])
{
$update = true;
$mybb->user['pmfolders'] = "0**$%%$1**$%%$2**$%%$3**$%%$4**";
}
elseif ((int)my_substr($mybb->user['pmfolders'], 0, 1) != 0)
{
// Old folder structure. Need to update
// Since MyBB 1.8.20 fid[0] represents 'Inbox' and fid[1] represents 'Unread'
$update = true;
$mybb->user['pmfolders'] = '0'. ltrim(str_replace("$%%$2**", "$%%$1**$%%$2**", $mybb->user['pmfolders']), '1');
}

// Folder structure update required?
if($update)
{
$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 = '';





$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 89Zeile 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 494Zeile 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 834Zeile 825
			if(isset($recipients['to']) && is_array($recipients['to']))
{
foreach($recipients['to'] as $recipient)

			if(isset($recipients['to']) && is_array($recipients['to']))
{
foreach($recipients['to'] as $recipient)

				{

				{

					$recipient_list['to'][] = $recipient;
$recipientids .= $comma.$recipient;
$comma = ',';

					$recipient_list['to'][] = $recipient;
$recipientids .= $comma.$recipient;
$comma = ',';

Zeile 1351Zeile 1342
		LIMIT {$start}, {$perpage}
");
while($unreadmessage = $db->fetch_array($query))

		LIMIT {$start}, {$perpage}
");
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']);

		$unreadmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($unreadmessage['subject']));
$unreadmessage['tousername'] = htmlspecialchars_uni($unreadmessage['tousername']);
$unreadmessage['profilelink'] = build_profile_link($unreadmessage['tousername'], $unreadmessage['toid']);

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

$sql_array = array(

	$plugins->run_hooks("private_stopalltracking_start");

$sql_array = array(

Zeile 1481Zeile 1472
			unset($name);
}
else

			unset($name);
}
else

		{

		{

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

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

Zeile 1578Zeile 1569
	$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)
{
error($lang->error_nopms);


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

	}


	}


	$plugins->run_hooks("private_empty_start");

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

	$plugins->run_hooks("private_empty_start");

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

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

		}
}

// 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
verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("private_do_stuff");

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

$plugins->run_hooks("private_do_stuff");





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

	if(!empty($mybb->input['hop']))
{
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 1712Zeile 1717
			{
$key = (int)$key;
if(!empty($deletepms[$key]))

			{
$key = (int)$key;
if(!empty($deletepms[$key]))

				{

				{

					$db->delete_query("privatemessages", "pmid='$key' AND uid='".$mybb->user['uid']."'");
}
else

					$db->delete_query("privatemessages", "pmid='$key' AND uid='".$mybb->user['uid']."'");
}
else

Zeile 1729Zeile 1734
		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 1740Zeile 1745
}

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

}

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

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

$plugins->run_hooks("private_delete_start");

{
// 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'));
if($db->num_rows($query) == 1)


$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'));
if($db->num_rows($query) == 1)

	{

	{

		$db->delete_query("privatemessages", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."'");
}
else

		$db->delete_query("privatemessages", "pmid='".$mybb->get_input('pmid', MyBB::INPUT_INT)."'");
}
else

	{

	{

		$sql_array = array(
"folder" => 4,
"deletetime" => TIME_NOW

		$sql_array = array(
"folder" => 4,
"deletetime" => TIME_NOW

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

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

	}

$plugins->run_hooks("private_export_start");

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

	}

$plugins->run_hooks("private_export_start");

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

	$folder_name = $folder_id = '';
foreach($foldersexploded as $key => $folders)
{

	$folder_name = $folder_id = '';
foreach($foldersexploded as $key => $folders)
{

Zeile 1871Zeile 1876
				$folderlst .= ")";
}
$wsql .= "$folderlst";

				$folderlst .= ")";
}
$wsql .= "$folderlst";

		}
else
{

		}
else
{

			error($lang->error_pmnoarchivefolders);
}


			error($lang->error_pmnoarchivefolders);
}


Zeile 1938Zeile 1943
				$tofromusername = $lang->mybb_engine;
}
$tofrom = $lang->from;

				$tofromusername = $lang->mybb_engine;
}
$tofrom = $lang->from;

		}

		}


if($tofromuid == 0)
{


if($tofromuid == 0)
{

Zeile 2002Zeile 2007
				{
$foldername = $folderinfo[1];
if($mybb->input['exporttype'] != "csv")

				{
$foldername = $folderinfo[1];
if($mybb->input['exporttype'] != "csv")

					{

					{

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

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

Zeile 2067Zeile 2072
	{
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $archived;

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

	}

	}

}

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

}

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

Zeile 2132Zeile 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'");







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

	$pmscount = $db->fetch_field($query, "total");

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

Zeile 2246Zeile 2257
	{
if($fid == 1)
{

	{
if($fid == 1)
{

			$selective = ' AND pm.status="0"';

			$selective = " AND pm.status='0'";

		}

if($sortfield == "username")

		}

if($sortfield == "username")