Vergleich private.php - 1.4.0 - 1.4.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: private.php 4031 2008-07-20 20:56:39Z Tikitiki $

 * $Id: private.php 4330 2009-03-16 02:17:06Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

 
define('THIS_SCRIPT', 'private.php');


$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage";
$templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav_changename,usercp_nav,private_empty_folder,private_empty,posticons";


$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage";
$templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav_changename,usercp_nav,private_empty_folder,private_empty,posticons";

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

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

	if($fid == $folderinfo[0])

	if($mybb->input['fid'] == $folderinfo[0])

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

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

Zeile 346Zeile 347
			// Get list of recipients
$recipients = unserialize($pm['recipients']);
$comma = '';

			// Get list of recipients
$recipients = unserialize($pm['recipients']);
$comma = '';

			$recipientids = $pm['fromid'];

 
			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)

Zeile 356Zeile 356
					$comma = ',';
}
}

					$comma = ',';
}
}



			

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

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

Zeile 367Zeile 367
				}	
}


				}	
}


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

			if(!empty($recipientids))


			{

			{

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


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

				{

				{

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




					if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc']))
{
$bcc .= htmlspecialchars_uni($user['username']).', ';
}
else
{
$to .= htmlspecialchars_uni($user['username']).', ';
}

				}
}
}

				}
}
}

Zeile 386Zeile 389
			$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);
$message = "[quote={$pm['quotename']}]\n$message\n[/quote]";

			$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);
$message = "[quote={$pm['quotename']}]\n$message\n[/quote]";

			$quoted['message'] = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $quoted['message']);

			$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);


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


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

Zeile 552Zeile 555
		
if($reply_date == $lang->today || $reply_date == $lang->yesterday)
{

		
if($reply_date == $lang->today || $reply_date == $lang->yesterday)
{

			$reply_data .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);

			$reply_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);

			$actioned_on = $lang->sprintf($lang->you_replied, $reply_date);
}
else
{

			$actioned_on = $lang->sprintf($lang->you_replied, $reply_date);
}
else
{

			$reply_data .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);

			$reply_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);

			$actioned_on = $lang->sprintf($lang->you_replied_on, $reply_date);
}


			$actioned_on = $lang->sprintf($lang->you_replied_on, $reply_date);
}


Zeile 567Zeile 570
	{
$forward_date = my_date($mybb->settings['dateformat'], $pm['statustime']);


	{
$forward_date = my_date($mybb->settings['dateformat'], $pm['statustime']);


		if(strpos($forward_date, $lang->today) !== false || strpos($forward_date, $lang->yesturday) !== false)

		if(strpos($forward_date, $lang->today) !== false || strpos($forward_date, $lang->yesterday) !== false)

		{
$forward_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
$actioned_on = $lang->sprintf($lang->you_forwarded, $forward_date);

		{
$forward_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
$actioned_on = $lang->sprintf($lang->you_forwarded, $forward_date);

Zeile 658Zeile 661
}

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

}

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

{

{

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

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

Zeile 722Zeile 725
		if(is_array($mybb->input['readcheck']))
{
foreach($mybb->input['readcheck'] as $key => $val)

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

			{
$sql_array = array(
"receipt" => 0
);
$db->update_query("privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
}
}
$plugins->run_hooks("private_do_tracking_end");
redirect("private.php", $lang->redirect_pmstrackingstopped);

			{
$sql_array = array(
"receipt" => 0
);
$db->update_query("privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
}
}
$plugins->run_hooks("private_do_tracking_end");
redirect("private.php", $lang->redirect_pmstrackingstopped);

	}
elseif($mybb->input['stoptrackingunread'])
{

	}
elseif($mybb->input['stoptrackingunread'])
{

Zeile 763Zeile 766
				$pmuids[$pm['uid']] = $pm['uid'];
}


				$pmuids[$pm['uid']] = $pm['uid'];
}


			$db->delete_query("privatemessages", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'");

			$db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'");

			foreach($pmuids as $uid)
{
// Message is canceled, update PM count for this user

			foreach($pmuids as $uid)
{
// Message is canceled, update PM count for this user

				update_pm_count($pm['uid']);

				update_pm_count($uid);

			}

			}

		}

		}

		$plugins->run_hooks("private_do_tracking_end");
redirect("private.php", $lang->redirect_pmstrackingcanceled);
}

		$plugins->run_hooks("private_do_tracking_end");
redirect("private.php", $lang->redirect_pmstrackingcanceled);
}

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

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

	}


	}


	eval("\$folders = \"".$templates->get("private_folders")."\";");
$plugins->run_hooks("private_folders_end");
output_page($folders);

	eval("\$folders = \"".$templates->get("private_folders")."\";");
$plugins->run_hooks("private_folders_end");
output_page($folders);

Zeile 1101Zeile 1104
}

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

}

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

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("private_do_export_start");

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("private_do_export_start");

	

	

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

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

Zeile 1120Zeile 1123
	}

if($mybb->input['pmid'])

	}

if($mybb->input['pmid'])

	{

	{

		$wsql = "pmid='".intval($mybb->input['pmid'])."' AND uid='".$mybb->user['uid']."'";
}
else

		$wsql = "pmid='".intval($mybb->input['pmid'])."' AND uid='".$mybb->user['uid']."'";
}
else

Zeile 1132Zeile 1135
			if($mybb->input['dayway'] == "older")
{
$wsql .= "<=";

			if($mybb->input['dayway'] == "older")
{
$wsql .= "<=";

			}
elseif($mybb->input['dayway'] == "newer")

			}
else

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

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

		}
else

		}
else

		{
$wsql = "1=1";
}

		{
$wsql = "1=1";
}

Zeile 1194Zeile 1197
	");
$numpms = $db->num_rows($query);
if(!$numpms)

	");
$numpms = $db->num_rows($query);
if(!$numpms)

	{

	{

		error($lang->error_nopmsarchive);
}


		error($lang->error_nopmsarchive);
}


Zeile 1231Zeile 1234
			else
{
$tofromusername = build_profile_link($message['fromusername'], $tofromuid);

			else
{
$tofromusername = build_profile_link($message['fromusername'], $tofromuid);

			}

			}

			
if($tofromuid == 0)
{
$tofromusername = "MyBB Engine";
}
$tofrom = $lang->from;

			
if($tofromuid == 0)
{
$tofromusername = "MyBB Engine";
}
$tofrom = $lang->from;

		}


		}


		if($tofromuid == 0)

		if($tofromuid == 0)

		{

		{

			$message['fromusername'] = "MyBB Engine";

			$message['fromusername'] = "MyBB Engine";

		}

		}

		
if(!$message['toid'] && $message['folder'] == 3)
{
$message['tousername'] = $lang->not_sent;

		
if(!$message['toid'] && $message['folder'] == 3)
{
$message['tousername'] = $lang->not_sent;

		}


		}


		$message['subject'] = $parser->parse_badwords($message['subject']);
if($message['folder'] != "3")
{

		$message['subject'] = $parser->parse_badwords($message['subject']);
if($message['folder'] != "3")
{

Zeile 1274Zeile 1277
			);

$message['message'] = $parser->parse_message($message['message'], $parser_options);

			);

$message['message'] = $parser->parse_message($message['message'], $parser_options);

 
			$message['subject'] = htmlspecialchars_uni($message['subject']);

		}

if($mybb->input['exporttype'] == "txt" || $mybb->input['exporttype'] == "csv")

		}

if($mybb->input['exporttype'] == "txt" || $mybb->input['exporttype'] == "csv")

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

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

						eval("\$pmsdownload .= \"".$templates->get("private_archive_".$nmybb->input['exporttype']."_folderhead", 1, 0)."\";");





						if($mybb->input['exporttype'] != "html")
{
$mybb->input['exporttype'] == "txt";
}
eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_folderhead", 1, 0)."\";");

					}
else
{

					}
else
{

Zeile 1323Zeile 1331
	eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");
if($mybb->input['deletepms'] == 1)
{ // delete the archived pms

	eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");
if($mybb->input['deletepms'] == 1)
{ // delete the archived pms

		$db->delete_query("privatemessages", "pmid IN (''$ids)");

		$db->delete_query("privatemessages", "pmid IN ('0'$ids)");

		// Update PM count
update_pm_count();
}

		// Update PM count
update_pm_count();
}

Zeile 1337Zeile 1345
	{
$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";
}

Zeile 1368Zeile 1376
	{
$mybb->input['fid'] = 1;
}

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




	
$folder = '';

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

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

Zeile 1430Zeile 1439
	{		
// Get all recipients into an array
$cached_users = $get_users = array();

	{		
// Get all recipients into an array
$cached_users = $get_users = array();

		$users_query = $db->simple_select("privatemessages", "recipients", "folder='$folder' AND uid='{$mybb->user['uid']}'", array('limit_start' => $start, 'limit' => $per_page));

		$users_query = $db->simple_select("privatemessages", "recipients", "folder='$folder' AND uid='{$mybb->user['uid']}'", array('limit_start' => $start, 'limit' => $perpage, 'order_by' => 'dateline', 'order_dir' => 'DESC'));

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

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

Zeile 1544Zeile 1553
				}
}


				}
}


			if($tofromuid != 0)
{
$tofromusername = build_profile_link($tofromusername, $tofromuid);
}

			$tofromusername = build_profile_link($tofromusername, $tofromuid);




			
if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2)
{

			
if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2)
{

Zeile 1561Zeile 1567
			if($message['icon'] > 0 && $icon_cache[$message['icon']])
{
$icon = $icon_cache[$message['icon']];

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

				$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" valign=\"middle\" align=\"center\" />&nbsp;";

				$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" align=\"center\" valign=\"middle\" />";

			}
else
{

			}
else
{

				$icon = '';

				$icon = '&nbsp;';

			}

if(!trim($message['subject']))

			}

if(!trim($message['subject']))