Vergleich private.php - 1.8.21 - 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();

}

$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" => $db->escape_string($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)

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

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

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

	}

	}

	else
{
$sel = '';

	else
{
$sel = '';

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")."\";");
// Manipulate search folder selection to omit "Unread"


// Manipulate search folder selection & move selector to omit "Unread"

	if($folder_id != 1)
{
if($folder_id == 0)
{
$folder_id = 1;
}

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

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

Zeile 116Zeile 94

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


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

{

{

	case "send":
add_breadcrumb($lang->nav_send);
break;

	case "send":
add_breadcrumb($lang->nav_send);
break;

Zeile 191Zeile 169
	if($mybb->get_input('message', MyBB::INPUT_INT) == 1)
{
$resulttype = "pmmessages";

	if($mybb->get_input('message', MyBB::INPUT_INT) == 1)
{
$resulttype = "pmmessages";

	}
else
{

	}
else
{

		$resulttype = "pmsubjects";
}


		$resulttype = "pmsubjects";
}


Zeile 269Zeile 247
	}

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

$sortby_accepted = array('subject', 'username', 'dateline');

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

$sortby_accepted = array('subject', 'username', 'dateline');





	if(in_array($sortby, $sortby_accepted))
{
$query_sortby = $sortby;

	if(in_array($sortby, $sortby_accepted))
{
$query_sortby = $sortby;

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

		{
$query_sortby = "fromusername";
}

	}

	}

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

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

Zeile 293Zeile 271
	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;

Zeile 369Zeile 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("

	}

$query = $db->query("

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

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

		}

		}

		else if($message['status'] == 3)
{
$msgstatus = 're_pm';

		else if($message['status'] == 3)
{
$msgstatus = 're_pm';

Zeile 471Zeile 449
			$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("private_messagebit_icon")."\";");

			$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("private_messagebit_icon")."\";");

		}
else

		}
else

		{
$icon = '&#009;';
}

		{
$icon = '&#009;';
}

Zeile 876Zeile 854
					else
{
$to .= htmlspecialchars_uni($user['username']).', ';

					else
{
$to .= htmlspecialchars_uni($user['username']).', ';

					}
}
}
}

					}
}
}
}

		else
{
// forward/reply
$subject = preg_replace("#(FW|RE):( *)#is", '', $subject);
$message = "[quote='{$pm['quotename']}']\n$message\n[/quote]";
$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);

		else
{
// forward/reply
$subject = preg_replace("#(FW|RE):( *)#is", '', $subject);
$message = "[quote='{$pm['quotename']}']\n$message\n[/quote]";
$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);





			require_once MYBB_ROOT."inc/functions_posting.php";

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

			require_once MYBB_ROOT."inc/functions_posting.php";

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

			}

			}


if($mybb->input['do'] == 'forward')
{


if($mybb->input['do'] == 'forward')
{

Zeile 905Zeile 883
				if($mybb->user['uid'] == $uid)
{
$to = $mybb->user['username'];

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

				}

				}

				else
{
$query = $db->simple_select('users', 'username', "uid='{$uid}'");

				else
{
$query = $db->simple_select('users', 'username', "uid='{$uid}'");

Zeile 930Zeile 908
						}
$recipientids .= ','.$recipient;
}

						}
$recipientids .= ','.$recipient;
}

				}

				}

				$comma = '';
$query = $db->simple_select('users', 'uid, username', "uid IN ({$recipientids})");
while($user = $db->fetch_array($query))

				$comma = '';
$query = $db->simple_select('users', 'uid, username', "uid IN ({$recipientids})");
while($user = $db->fetch_array($query))

Zeile 956Zeile 934
	}

if($send_errors)

	}

if($send_errors)

	{

	{

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

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

Zeile 1057Zeile 1035
		);

if(isset($receiptadd))

		);

if(isset($receiptadd))

		{

		{

			$updatearray['receipt'] = $receiptadd;

			$updatearray['receipt'] = $receiptadd;

		}

$db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");


		}

$db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");


		// Update the unread count - it has now changed.
update_pm_count($mybb->user['uid'], 6);

		// Update the unread count - it has now changed.
update_pm_count($mybb->user['uid'], 6);





		// Update PM notice value if this is our last unread PM
if($mybb->user['unreadpms']-1 <= 0 && $mybb->user['pmnotice'] == 2)

		// Update PM notice value if this is our last unread PM
if($mybb->user['unreadpms']-1 <= 0 && $mybb->user['pmnotice'] == 2)

		{

		{

			$updated_user = array(
"pmnotice" => 1
);

			$updated_user = array(
"pmnotice" => 1
);

Zeile 1080Zeile 1058
	{
$reply_string = $lang->you_replied_on;
$reply_date = my_date('relative', $pm['statustime']);

	{
$reply_string = $lang->you_replied_on;
$reply_date = my_date('relative', $pm['statustime']);


if((TIME_NOW - $pm['statustime']) < 3600)
{


if((TIME_NOW - $pm['statustime']) < 3600)
{

			// Relative string for the first hour
$reply_string = $lang->you_replied;
}

			// Relative string for the first hour
$reply_string = $lang->you_replied;
}

Zeile 1128Zeile 1106
	{
$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 1153Zeile 1131
		}
// 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 1227Zeile 1205
			$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 1277Zeile 1255
	$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)

	{
$page = $pages;
}

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

if($page)

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

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

Zeile 1685Zeile 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']))
{