Vergleich private.php - 1.8.19 - 1.8.20

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


	error_no_permission();
}


 
$update = false;

if(!$mybb->user['pmfolders'])
{

if(!$mybb->user['pmfolders'])
{

	$mybb->user['pmfolders'] = "1**$%%$2**$%%$3**$%%$4**";










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

	$sql_array = array(
"pmfolders" => $mybb->user['pmfolders']
);

Zeile 110Zeile 123
		break;
case "export":
add_breadcrumb($lang->nav_export);

		break;
case "export":
add_breadcrumb($lang->nav_export);

		break;

		break;

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

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

Zeile 275Zeile 288
	}

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

	}

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

	{

	{

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


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


Zeile 296Zeile 309
		}
}
else

		}
}
else

	{

	{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

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

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

	}

// Do Multi Pages
if($upper > $pmscount)
{

	}

// Do Multi Pages
if($upper > $pmscount)
{

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

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

Zeile 1129Zeile 1142
		else if(in_array($recipient['uid'], $pm['recipients']['to']))
{
$to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);

		else if(in_array($recipient['uid'], $pm['recipients']['to']))
{
$to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);

		}
}


		}
}


	$bcc = '';
if(count($bcc_recipients) > 0)
{

	$bcc = '';
if(count($bcc_recipients) > 0)
{

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

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





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

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

	{

	{

		$mybb->settings['postsperpage'] = 20;

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


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


Zeile 1251Zeile 1264
	$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 1281Zeile 1294
		LIMIT {$start}, {$perpage}
");
while($readmessage = $db->fetch_array($query))

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

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

Zeile 1293Zeile 1306
	if(!empty($readmessages))
{
eval("\$stoptrackingread = \"".$templates->get("private_tracking_readmessage_stop")."\";");

	if(!empty($readmessages))
{
eval("\$stoptrackingread = \"".$templates->get("private_tracking_readmessage_stop")."\";");

	}


	}


	if(!$readmessages)
{
eval("\$readmessages = \"".$templates->get("private_tracking_nomessage")."\";");
}

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

	if(!$readmessages)
{
eval("\$readmessages = \"".$templates->get("private_tracking_nomessage")."\";");
}

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

	$postcount = $db->fetch_field($query, "unreadpms");


	$postcount = $db->fetch_field($query, "unreadpms");


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

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

Zeile 1404Zeile 1417
		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)

		$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[$pmid] = (int)$pmid;
}


Zeile 1418Zeile 1431
			while($pm = $db->fetch_array($query))
{
$pmuids[$pm['uid']] = $pm['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 1446Zeile 1459

$plugins->run_hooks("private_stopalltracking_end");
redirect("private.php?action=tracking", $lang->redirect_allpmstrackingstopped);


$plugins->run_hooks("private_stopalltracking_end");
redirect("private.php?action=tracking", $lang->redirect_allpmstrackingstopped);

}


}


if($mybb->input['action'] == "folders")
{
$plugins->run_hooks("private_folders_start");

if($mybb->input['action'] == "folders")
{
$plugins->run_hooks("private_folders_start");





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

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

Zeile 1460Zeile 1473
		$foldername = $folderinfo[1];
$fid = $folderinfo[0];
$foldername = get_pm_folder_name($fid, $foldername);

		$foldername = $folderinfo[1];
$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")."\";");
unset($name);

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

		}

		}

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

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

Zeile 1475Zeile 1488

$newfolders = '';
for($i = 1; $i <= 5; ++$i)


$newfolders = '';
for($i = 1; $i <= 5; ++$i)

	{

	{

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

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

Zeile 1503Zeile 1516
		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;
}
else // Editing an existing folder
{
if($key > $highestid)

				++$highestid;
$fid = (int)$highestid;
}
else // Editing an existing folder
{
if($key > $highestid)

				{

				{

					$highestid = $key;
}

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

					$highestid = $key;
}

$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 there is a name or if this is a default folder, save it
$foldername = $db->escape_string(htmlspecialchars_uni($val));

Zeile 2086Zeile 2076

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 2179Zeile 2170

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


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

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

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

	}
else
{

	}
else
{

		$page_url = "private.php?fid={$folder}";

		$page_url = "private.php?fid={$fid}";

	}

$multipage = multipage($pmscount, $perpage, $page, $page_url);

	}

$multipage = multipage($pmscount, $perpage, $page, $page_url);

	$messagelist = '';


	$selective = $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

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

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

			$u = "u.";
}
else

			$u = "u.";
}
else

Zeile 2219Zeile 2210
			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 2253Zeile 2244
	}
else
{

	}
else
{

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


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

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

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