Vergleich private.php - 1.8.22 - 1.8.37

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


}

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


$folder_id = $folder_name = '';

$folder_id = $folder_name = $folderjump_folder = $folderoplist_folder = $foldersearch_folder ='';


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


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

Zeile 79Zeile 56
		$sel = ' selected="selected"';
}
else

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

	{

	{

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

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

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

	}
}

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


	}
}

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

Zeile 125Zeile 103
		break;
case "folders":
add_breadcrumb($lang->nav_folders);

		break;
case "folders":
add_breadcrumb($lang->nav_folders);

		break;

		break;

	case "empty":
add_breadcrumb($lang->nav_empty);
break;

	case "empty":
add_breadcrumb($lang->nav_empty);
break;

Zeile 134Zeile 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;

}

}


if(!empty($mybb->input['preview']))
{


if(!empty($mybb->input['preview']))
{

Zeile 151Zeile 129

// Simulate coming from our advanced search form with some preset options
if($mybb->get_input('quick_search'))


// Simulate coming from our advanced search form with some preset options
if($mybb->get_input('quick_search'))

	{

	{

		$mybb->input['action'] = "do_search";
$mybb->input['subject'] = 1;
$mybb->input['message'] = 1;

		$mybb->input['action'] = "do_search";
$mybb->input['subject'] = 1;
$mybb->input['message'] = 1;

Zeile 174Zeile 152
			if($remaining_time == 1)
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding_1, $mybb->settings['searchfloodtime']);

			if($remaining_time == 1)
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding_1, $mybb->settings['searchfloodtime']);

			}

			}

			else
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb->settings['searchfloodtime'], $remaining_time);

			else
{
$lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb->settings['searchfloodtime'], $remaining_time);

Zeile 349Zeile 327
	while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

	while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

		if(is_array($recipients['to']) && count($recipients['to']))

		if(isset($recipients['to']) && 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['to']);
}

if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc']))

		{
$get_users = array_merge($get_users, $recipients['bcc']);
}
}

		{
$get_users = array_merge($get_users, $recipients['bcc']);
}
}


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



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


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

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

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

Zeile 471Zeile 452
			$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 = '	';
}

		{
$icon = '	';
}

Zeile 600Zeile 581
		WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
LIMIT 0, 1
");

		WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
LIMIT 0, 1
");

	$duplicate_check = $db->fetch_field($query, "pmid");
if($duplicate_check)

	if($db->num_rows($query) > 0)


	{
error($lang->error_pm_already_submitted);
}

	{
error($lang->error_pm_already_submitted);
}

Zeile 661Zeile 641
	}

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

	}

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

	{

	{

		$pm['saveasdraft'] = 1;
}
$pmhandler->set_data($pm);

		$pm['saveasdraft'] = 1;
}
$pmhandler->set_data($pm);

Zeile 1030Zeile 1010
		'namestyle' => 'namestyle'
);


		'namestyle' => 'namestyle'
);


	foreach($data_key as $field => $key)

	if(isset($groupscache[$pm['usergroup']]))

	{

	{

		$pm[$key] = $groupscache[$pm['usergroup']][$field];




		foreach($data_key as $field => $key)
{
$pm[$key] = $groupscache[$pm['usergroup']][$field];
}

	}

if($pm['receipt'] == 1)

	}

if($pm['receipt'] == 1)

Zeile 1120Zeile 1103
	// Fetch the recipients for this message
$pm['recipients'] = my_unserialize($pm['recipients']);


	// Fetch the recipients for this message
$pm['recipients'] = my_unserialize($pm['recipients']);


	if(is_array($pm['recipients']['to']))

	if(isset($pm['recipients']['to']) && is_array($pm['recipients']['to']))

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

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

Zeile 1186Zeile 1169
	}

eval("\$pm['subject_extra'] = \"".$templates->get("private_read_to")."\";");

	}

eval("\$pm['subject_extra'] = \"".$templates->get("private_read_to")."\";");





	add_breadcrumb($pm['subject']);
$message = build_postbit($pm, 2);


	add_breadcrumb($pm['subject']);
$message = build_postbit($pm, 2);


Zeile 1196Zeile 1179
	{
$trow = alt_trow();


	{
$trow = alt_trow();


		$optionschecked = array('savecopy' => 'checked="checked"');

		$optionschecked = array('savecopy' => 'checked="checked"', 'signature' => '', 'disablesmilies' => '');

		if(!empty($mybb->user['signature']))
{
$optionschecked['signature'] = 'checked="checked"';

		if(!empty($mybb->user['signature']))
{
$optionschecked['signature'] = 'checked="checked"';

Zeile 1239Zeile 1222

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


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

		
$expaltext = (in_array("quickreply", $collapse)) ? "[+]" : "[-]";

















$postoptionschecked = $optionschecked; // Backwards compatability instead of correcting variable used in template

if(!isset($collapsedthead['quickreply']))
{
$collapsedthead['quickreply'] = '';
}
if(!isset($collapsedimg['quickreply']))
{
$collapsedimg['quickreply'] = '';
}
if(!isset($collapsed['quickreply_e']))
{
$collapsed['quickreply_e'] = '';
}

$expaltext = (in_array("quickreply", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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


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


Zeile 1566Zeile 1564
						$folders .= "$%%$";
}
$folders .= "$fid**$foldername";

						$folders .= "$%%$";
}
$folders .= "$fid**$foldername";

				}
else

				}
else

				{
error($lang->error_invalidpmfoldername);
}

				{
error($lang->error_invalidpmfoldername);
}

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

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

	$folderlist = '';

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

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

 
		$unread = ''; 

		$fid = $folderinfo[0];
if($folderinfo[0] == "1")

		$fid = $folderinfo[0];
if($folderinfo[0] == "1")

		{
$fid = "1";

		{
$fid = "1";

			$unread = " AND status='0'";
}
if($folderinfo[0] == "0")
{
$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")."\";");
}

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





	$plugins->run_hooks("private_empty_end");

	$plugins->run_hooks("private_empty_end");





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

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

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

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

{
// Verify incoming POST request

{
// Verify incoming POST request

	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("private_do_empty_start");

	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("private_do_empty_start");

Zeile 1662Zeile 1661
		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();


Zeile 1676Zeile 1675
{
// 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_stuff");

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

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

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

	$folderlist_folder = '';

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

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

Zeile 2047Zeile 2051
	if($mybb->input['exporttype'] == "html")
{
// Gather global stylesheet for HTML

	if($mybb->input['exporttype'] == "html")
{
// Gather global stylesheet for HTML

		$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1));


		$css_tid = empty($theme['tid']) ? '' : "'". (int)$theme['tid'] ."',";
$query = $db->simple_select("themestylesheets", "stylesheet", "tid in ({$css_tid}'2','1') AND name = 'global.css'", array('order_by' => 'tid', 'order_dir' => 'DESC', 'limit' => 1));

		$css = $db->fetch_field($query, "stylesheet");
}


		$css = $db->fetch_field($query, "stylesheet");
}


Zeile 2172Zeile 2177
	$page = $mybb->get_input('page', MyBB::INPUT_INT);

if($page > 0)

	$page = $mybb->get_input('page', MyBB::INPUT_INT);

if($page > 0)

	{

	{

		$start = ($page-1) *$perpage;
$pages = ceil($pmscount / $perpage);
if($page > $pages)

		$start = ($page-1) *$perpage;
$pages = ceil($pmscount / $perpage);
if($page > $pages)

Zeile 2235Zeile 2240
		while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

		while($row = $db->fetch_array($users_query))
{
$recipients = my_unserialize($row['recipients']);

			if(is_array($recipients['to']) && count($recipients['to']))

			if(isset($recipients['to']) && is_array($recipients['to']) && count($recipients['to']))

			{
$get_users = array_merge($get_users, $recipients['to']);
}

			{
$get_users = array_merge($get_users, $recipients['to']);
}

Zeile 2284Zeile 2289
		else
{
$pm = "pm.";

		else
{
$pm = "pm.";

		}
}


		}
}


	$query = $db->query("
SELECT pm.*, fu.username AS fromusername, tu.username as tousername
FROM ".TABLE_PREFIX."privatemessages pm

	$query = $db->query("
SELECT pm.*, fu.username AS fromusername, tu.username as tousername
FROM ".TABLE_PREFIX."privatemessages pm

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

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





	if($db->num_rows($query) > 0)
{

	if($db->num_rows($query) > 0)
{

 
		$bgcolor = alt_trow(true);

		while($message = $db->fetch_array($query))
{
$msgalt = $msgstatus = '';

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

		while($message = $db->fetch_array($query))
{
$msgalt = $msgstatus = '';

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

			{

			{

				$msgstatus = 'new_pm';
$msgalt = $lang->new_pm;
}
else if($message['status'] == 1)

				$msgstatus = 'new_pm';
$msgalt = $lang->new_pm;
}
else if($message['status'] == 1)

			{

			{

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

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

Zeile 2323Zeile 2329
			{
$msgstatus = 'fw_pm';
$msgalt = $lang->fwd_pm;

			{
$msgstatus = 'fw_pm';
$msgalt = $lang->fwd_pm;

			}

			}


$tofromuid = 0;
if($folder == 2 || $folder == 3)


$tofromuid = 0;
if($folder == 2 || $folder == 3)

Zeile 2333Zeile 2339
				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)

				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)

					{





					{
if(!isset($cached_users[$uid]))
{
continue;
}

						$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];
$user['username'] = htmlspecialchars_uni($user['username']);

						$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];
$user['username'] = htmlspecialchars_uni($user['username']);

Zeile 2349Zeile 2359
						eval("\$bcc_users = \"".$templates->get("private_multiple_recipients_bcc")."\";");
foreach($recipients['bcc'] as $uid)
{

						eval("\$bcc_users = \"".$templates->get("private_multiple_recipients_bcc")."\";");
foreach($recipients['bcc'] as $uid)
{

 
							if(!isset($cached_users[$uid]))
{
continue;
}

							$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];
$user['username'] = htmlspecialchars_uni($user['username']);

							$profilelink = get_profile_link($uid);
$user = $cached_users[$uid];
$user['username'] = htmlspecialchars_uni($user['username']);

Zeile 2360Zeile 2374
							eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}
}

							eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";");
}
}





					eval("\$tofromusername = \"".$templates->get("private_multiple_recipients")."\";");
}
else if($message['toid'])

					eval("\$tofromusername = \"".$templates->get("private_multiple_recipients")."\";");
}
else if($message['toid'])

Zeile 2398Zeile 2412
			else
{
$denyreceipt = '';

			else
{
$denyreceipt = '';

			}

			}


if($message['icon'] > 0 && $icon_cache[$message['icon']])
{


if($message['icon'] > 0 && $icon_cache[$message['icon']])
{

Zeile 2431Zeile 2445
			$plugins->run_hooks("private_message");

eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");

			$plugins->run_hooks("private_message");

eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");

 
			$bgcolor = alt_trow();

		}
}
else

		}
}
else

Zeile 2473Zeile 2488
			{
$spaceused_severity = "high";
}

			{
$spaceused_severity = "high";
}

			



			$overhalf = round($spaceused, 0)."%";
if((int)$overhalf > 100)
{

			$overhalf = round($spaceused, 0)."%";
if((int)$overhalf > 100)
{