Vergleich private.php - 1.2.2 - 1.2.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: private.php 2265 2006-09-26 14:49:36Z Tikitiki $

 * $Id: private.php 3520 2007-12-01 00:43:25Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 48Zeile 48
	$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']);
}


	$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']);
}


// On a random occassion, recount the users pm's just to make sure everything is in sync.
if($rand == 5)
{
update_pm_count();
}

$timecut = time()-(60*60*24*7); 
$db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");








$timecut = time()-(60*60*24*7);
$db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");




// On a random occassion, recount the users pm's just to make sure everything is in sync. 
if($rand == 5 || $db->affected_rows() > 0)
{
update_pm_count();
}


$folderjump = "<select name=\"jumpto\">\n";
$folderoplist = "<select name=\"fid\">\n";


$folderjump = "<select name=\"jumpto\">\n";
$folderoplist = "<select name=\"fid\">\n";

Zeile 68Zeile 68
	if($fid == $folderinfo[0])
{
$sel = "selected";

	if($fid == $folderinfo[0])
{
$sel = "selected";

	}

	}

	else
{
$sel = "";

	else
{
$sel = "";

Zeile 84Zeile 84
$folderoplist .= "</select>\n";

usercp_menu();

$folderoplist .= "</select>\n";

usercp_menu();







// Make navigation
add_breadcrumb($lang->nav_pms, "private.php");


// Make navigation
add_breadcrumb($lang->nav_pms, "private.php");


Zeile 96Zeile 96
		break;
case "tracking":
add_breadcrumb($lang->nav_tracking);

		break;
case "tracking":
add_breadcrumb($lang->nav_tracking);

		break;

		break;

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

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

		break;

		break;

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

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

}

}

if($mybb->input['preview'])
{
$mybb->input['action'] = "send";
}

if($mybb->input['preview'])
{
$mybb->input['action'] = "send";
}





$send_errors = '';

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

$send_errors = '';

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

 
	if($mybb->usergroup['cansendpms'] == "no")
{
error_no_permission();
}


	$plugins->run_hooks("private_send_do_send");

// Attempt to see if this PM is a duplicate or not

	$plugins->run_hooks("private_send_do_send");

// Attempt to see if this PM is a duplicate or not

Zeile 170Zeile 175
		$plugins->run_hooks("private_do_send_end");

if(isset($pminfo['draftsaved']))

		$plugins->run_hooks("private_do_send_end");

if(isset($pminfo['draftsaved']))

		{

		{

			redirect("private.php", $lang->redirect_pmsaved);
}
else
{
redirect("private.php", $lang->redirect_pmsent);
}

			redirect("private.php", $lang->redirect_pmsaved);
}
else
{
redirect("private.php", $lang->redirect_pmsent);
}





	}
}

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

	}
}

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







	if($mybb->usergroup['cansendpms'] == "no")
{
error_no_permission();
}


	$plugins->run_hooks("private_send_start");

if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0)

	$plugins->run_hooks("private_send_start");

if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0)

	{

	{

		$codebuttons = build_mycode_inserter();

		$codebuttons = build_mycode_inserter();

 
		if($mybb->settings['pmsallowsmilies'] != "no")
{
$smilieinserter = build_clickable_smilies();
}

	}

	}

	if($mybb->settings['pmsallowsmilies'] != "no")
{
$smilieinserter = build_clickable_smilies();
}








	$posticons = get_post_icons();
$previewmessage = $mybb->input['message'];
$message = htmlspecialchars_uni($mybb->input['message']);

	$posticons = get_post_icons();
$previewmessage = $mybb->input['message'];
$message = htmlspecialchars_uni($mybb->input['message']);

 
	$subject = $previewsubject = htmlspecialchars_uni($mybb->input['subject']);





 
	if($mybb->input['preview'] || $send_errors)
{
$options = $mybb->input['options'];
if($options['signature'] == "yes")
{
$optionschecked['signature'] = "checked=\"checked\"";
}
if($options['disablesmilies'] == "yes")
{
$optionschecked['disablesmilies'] = "checked=\"checked\"";
}
if($options['savecopy'] != "no")
{
$optionschecked['savecopy'] = "checked=\"checked\"";
}
if($options['readreceipt'] != "no")
{
$optionschecked['readreceipt'] = "checked=\"checked\"";
}
$to = htmlspecialchars_uni($mybb->input['to']);
}

// Preview

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

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

		$options = $mybb->input['options'];

 
		$query = $db->query("
SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem
FROM ".TABLE_PREFIX."users u

		$query = $db->query("
SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem
FROM ".TABLE_PREFIX."users u

Zeile 213Zeile 245
		$post['userusername'] = $mybb->user['username'];
$post['postusername'] = $mybb->user['username'];
$post['message'] = $previewmessage;

		$post['userusername'] = $mybb->user['username'];
$post['postusername'] = $mybb->user['username'];
$post['message'] = $previewmessage;

		$post['subject'] = $mybb->input['subject'];

		$post['subject'] = $previewsubject;

		$post['icon'] = $mybb->input['icon'];
$post['smilieoff'] = $options['disablesmilies'];
$post['dateline'] = time();

		$post['icon'] = $mybb->input['icon'];
$post['smilieoff'] = $options['disablesmilies'];
$post['dateline'] = time();

Zeile 235Zeile 267
		}
$postbit = build_postbit($post, 2);
eval("\$preview = \"".$templates->get("previewpost")."\";");

		}
$postbit = build_postbit($post, 2);
eval("\$preview = \"".$templates->get("previewpost")."\";");


if($options['signature'] == "yes")
{
$optionschecked['signature'] = "checked";
}
if($options['disablesmilies'] == "yes")
{
$optionschecked['disablesmilies'] = "checked";
}
if($options['savecopy'] != "no")
{
$optionschecked['savecopy'] = "checked";
}
if($options['readreceipt'] != "no")
{
$optionschecked['readreceipt'] = "checked";
}
$to = htmlspecialchars_uni($mybb->input['to']);
$subject = htmlspecialchars_uni($mybb->input['subject']);

 
	}

	}

	else

	else if(!$send_errors)

	{

	{

 
		// New PM, so load default settings

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

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

Zeile 267Zeile 281
		}
$optionschecked['savecopy'] = "checked";
}

		}
$optionschecked['savecopy'] = "checked";
}

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


	// Draft, reply, forward
if($mybb->input['pmid'] > 0 && !$mybb->input['preview'])

	{
$query = $db->query("
SELECT pm.*, u.username AS quotename

	{
$query = $db->query("
SELECT pm.*, u.username AS quotename

Zeile 297Zeile 312
			}
}
else

			}
}
else

		{

		{ // forward/reply

			$subject = preg_replace("#(FW|RE):( *)#is", "", $subject);
$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);

			$subject = preg_replace("#(FW|RE):( *)#is", "", $subject);
$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']);
$posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);

Zeile 314Zeile 329
				$uid = $pm['fromid'];
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".$uid."'");
$user = $db->fetch_array($query);

				$uid = $pm['fromid'];
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".$uid."'");
$user = $db->fetch_array($query);

				$to = $user['username'];

				$to = htmlspecialchars_uni($user['username']);

			}
}
}

			}
}
}

 
	// New PM with recipient preset

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

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

	$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
$to = $user['username'];

		$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
$to = htmlspecialchars_uni($user['username']);

	}

// Load the auto complete javascript if it is enabled.

	}

// Load the auto complete javascript if it is enabled.

Zeile 330Zeile 346

$pmid = $mybb->input['pmid'];
$do = $mybb->input['do'];


$pmid = $mybb->input['pmid'];
$do = $mybb->input['do'];

 
	if($do != "forward" && $do != "reply")
{
$do = "";
}

	eval("\$send = \"".$templates->get("private_send")."\";");
$plugins->run_hooks("private_send_end");
output_page($send);

	eval("\$send = \"".$templates->get("private_send")."\";");
$plugins->run_hooks("private_send_end");
output_page($send);

}



}



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

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





	$pmid = intval($mybb->input['pmid']);

$query = $db->query("

	$pmid = intval($mybb->input['pmid']);

$query = $db->query("

Zeile 349Zeile 369
		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE pm.pmid='".intval($mybb->input['pmid'])."' AND pm.uid='".$mybb->user['uid']."'

		LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE pm.pmid='".intval($mybb->input['pmid'])."' AND pm.uid='".$mybb->user['uid']."'

	");

	");

	$pm = $db->fetch_array($query);
if($pm['folder'] == 3)
{

	$pm = $db->fetch_array($query);
if($pm['folder'] == 3)
{

Zeile 382Zeile 402
		if($receiptadd != "")
{
$updatearray['receipt'] = $receiptadd;

		if($receiptadd != "")
{
$updatearray['receipt'] = $receiptadd;

		}


		}


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

// Update the unread count - it has now changed.

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

// Update the unread count - it has now changed.

Zeile 391Zeile 411
	}
$pm['userusername'] = $pm['username'];
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

	}
$pm['userusername'] = $pm['username'];
$pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));

	if($pm['fromid'] == -2)

	if($pm['fromid'] == 0)

	{
$pm['username'] = "MyBB Engine";
}

	{
$pm['username'] = "MyBB Engine";
}

Zeile 448Zeile 468
		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(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
}

			{
$sql_array = array(
"receipt" => 0
);
$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
}

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

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

Zeile 468Zeile 488
					"receipt" => 0
);
$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);

					"receipt" => 0
);
$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);

			}
}

			}
}

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

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

Zeile 478Zeile 498
		if(is_array($mybb->input['unreadcheck']))
{
foreach($mybb->input['unreadcheck'] as $pmid => $val)

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

			{

			{

				$pmids[$pmid] = intval($pmid);
}
$pmids = implode(",", $pmids);

				$pmids[$pmid] = intval($pmid);
}
$pmids = implode(",", $pmids);

Zeile 486Zeile 506
			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(TABLE_PREFIX."privatemessages", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'");
foreach($pmuids as $uid)
{

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

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

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

	}

	}

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

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

Zeile 571Zeile 591
						break;
case 3:
if($val == $lang->folder_drafts)

						break;
case 3:
if($val == $lang->folder_drafts)

						{
$val = '';
}
break;

						{
$val = '';
}
break;

					case 4:
if($val == $lang->folder_trash)
{

					case 4:
if($val == $lang->folder_trash)
{

Zeile 588Zeile 608
				$foldername = $val;
$foldername = $db->escape_string(htmlspecialchars_uni($foldername));
if(strpos($foldername, "$%%$") === false)

				$foldername = $val;
$foldername = $db->escape_string(htmlspecialchars_uni($foldername));
if(strpos($foldername, "$%%$") === false)

				{

				{

					if($folders != '')
{
$folders .= "$%%$";

					if($folders != '')
{
$folders .= "$%%$";

Zeile 599Zeile 619
				{
error($lang->error_invalidpmfoldername);
}

				{
error($lang->error_invalidpmfoldername);
}

			}

			}

			else
{
$db->delete_query(TABLE_PREFIX."privatemessages", "folder='$fid' AND uid='".$mybb->user['uid']."'");

			else
{
$db->delete_query(TABLE_PREFIX."privatemessages", "folder='$fid' AND uid='".$mybb->user['uid']."'");

			}
}

			}
}

	}

$sql_array = array(
"pmfolders" => $folders
);
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");

	}

$sql_array = array(
"pmfolders" => $folders
);
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");

 
	// Update PM count
update_pm_count();

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

Zeile 674Zeile 696
	$plugins->run_hooks("private_do_stuff");
if($mybb->input['hop'])
{

	$plugins->run_hooks("private_do_stuff");
if($mybb->input['hop'])
{

		header("Location: private.php?fid=".$mybb->input['jumpto']);

		header("Location: private.php?fid=".intval($mybb->input['jumpto']));

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

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

Zeile 685Zeile 707
				$sql_array = array(
"folder" => intval($mybb->input['fid'])
);

				$sql_array = array(
"folder" => intval($mybb->input['fid'])
);

				$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND uid=".$mybb->user['uid']);

				$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid='".intval($key)."' AND uid='".$mybb->user['uid']."'");

			}
}
// Update PM count

			}
}
// Update PM count

Zeile 771Zeile 793

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


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

 
	if($mybb->input['exporttype'] != "csv" && $mybb->input['exporttype'] != "text" && $mybb->input['exporttype'] != "html")
{
exit;
}


	$plugins->run_hooks("private_do_export_start");
$lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']);
$exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);

	$plugins->run_hooks("private_do_export_start");
$lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']);
$exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);

Zeile 784Zeile 811
	else
{
if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))

	else
{
if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))

		{

		{

			$datecut = time()-($mybb->input['daycut'] * 86400);
$wsql = "pm.dateline";
if($mybb->input['dayway'] == "older")

			$datecut = time()-($mybb->input['daycut'] * 86400);
$wsql = "pm.dateline";
if($mybb->input['dayway'] == "older")

			{

			{

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

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

Zeile 796Zeile 823
				$wsql .= ">=";
}
$wsql .= "'$datecut'";

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

		}
else

		}
else

		{
$wsql = "1=1";
}

		{
$wsql = "1=1";
}

Zeile 823Zeile 850
					{
$folderlst .= ",'$val'";
}

					{
$folderlst .= ",'$val'";
}

				}

				}

			}
if($folderlst)
{

			}
if($folderlst)
{

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

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

	{

	{

		error($lang->error_nopmsarchive);
}
$pmsdownload = '';

		error($lang->error_nopmsarchive);
}
$pmsdownload = '';

Zeile 875Zeile 902
				$tofromusername = $lang->not_sent;
}
$tofrom = $lang->to;

				$tofromusername = $lang->not_sent;
}
$tofrom = $lang->to;

		}
else

		}
else

		{
$tofromuid = $message['fromid'];
if($mybb->input['exporttype'] == "txt")

		{
$tofromuid = $message['fromid'];
if($mybb->input['exporttype'] == "txt")

			{

			{

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

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

			if($tofromuid == -2)



if($tofromuid == 0)

			{
$tofromusername = "MyBB Engine";
}
$tofrom = $lang->from;
}

			{
$tofromusername = "MyBB Engine";
}
$tofrom = $lang->from;
}

		if($tofromuid == -2)

		if($tofromuid == 0)

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

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

Zeile 912Zeile 940
		else
{
$senddate = $lang->not_sent;

		else
{
$senddate = $lang->not_sent;

		}

		}

		if($mybb->input['exporttype'] == "html")
{
$parser_options = array(

		if($mybb->input['exporttype'] == "html")
{
$parser_options = array(

Zeile 929Zeile 957
		{
$message['message'] = str_replace("\r\n", "\n", $message['message']);
$message['message'] = str_replace("\n", "\r\n", $message['message']);

		{
$message['message'] = str_replace("\r\n", "\n", $message['message']);
$message['message'] = str_replace("\n", "\r\n", $message['message']);

		}

		}

		if(!$donefolder[$message['folder']])
{
reset($foldersexploded);

		if(!$donefolder[$message['folder']])
{
reset($foldersexploded);

Zeile 946Zeile 974
					$donefolder[$message['folder']] = 1;
}
}

					$donefolder[$message['folder']] = 1;
}
}

		}

		}

		eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_message", 1, 0)."\";");
$ids .= ",'$message[pmid]'";
}

		eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_message", 1, 0)."\";");
$ids .= ",'$message[pmid]'";
}

Zeile 980Zeile 1008
	header("Content-type: ".$contenttype);
$plugins->run_hooks("private_do_export_end");
if($mybb->input['exporttype'] == "html")

	header("Content-type: ".$contenttype);
$plugins->run_hooks("private_do_export_end");
if($mybb->input['exporttype'] == "html")

	{

	{

		output_page($archived);
}
else

		output_page($archived);
}
else

Zeile 1012Zeile 1040
	if($folder == 2 || $folder == 3)
{ // Sent Items Folder
$sender = $lang->sentto;

	if($folder == 2 || $folder == 3)
{ // Sent Items Folder
$sender = $lang->sentto;

	}
else

	}
else

	{
$sender = $lang->sender;

	{
$sender = $lang->sender;

	}

	}

	$doneunread = 0;
$doneread = 0;
// get total messages

	$doneunread = 0;
$doneread = 0;
// get total messages

Zeile 1030Zeile 1058
	// Do Multi Pages
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'");
$pmscount = $db->fetch_array($query);

	// Do Multi Pages
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'");
$pmscount = $db->fetch_array($query);





	$perpage = $mybb->settings['threadsperpage'];
$page = intval($mybb->input['page']);
if(intval($mybb->input['page']) > 0)

	$perpage = $mybb->settings['threadsperpage'];
$page = intval($mybb->input['page']);
if(intval($mybb->input['page']) > 0)

Zeile 1064Zeile 1092
		LIMIT $start, $perpage
");
if($db->num_rows($query) > 0)

		LIMIT $start, $perpage
");
if($db->num_rows($query) > 0)

	{

	{

		while($message = $db->fetch_array($query))
{

		while($message = $db->fetch_array($query))
{

			$msgalt = '';

			$msgalt = $msgsuffix = $msgprefix = '';

			// Determine Folder Icon
if($message['status'] == 0)
{
$msgfolder = 'new_pm.gif';
$msgalt = $lang->new_pm;

			// Determine Folder Icon
if($message['status'] == 0)
{
$msgfolder = 'new_pm.gif';
$msgalt = $lang->new_pm;

				$doneunread = 1;


				$msgprefix = "<strong>";
$msgsuffix = "</strong>";

			}
elseif($message['status'] == 1)
{
$msgfolder = 'old_pm.gif';
$msgalt = $lang->old_pm;

			}
elseif($message['status'] == 1)
{
$msgfolder = 'old_pm.gif';
$msgalt = $lang->old_pm;

				$doneread = 1;

 
			}
elseif($message['status'] == 3)
{
$msgfolder = 're_pm.gif';
$msgalt = $lang->reply_pm;

			}
elseif($message['status'] == 3)
{
$msgfolder = 're_pm.gif';
$msgalt = $lang->reply_pm;

				$doneread = 1;

 
			}
elseif($message['status'] == 4)
{
$msgfolder = 'fw_pm.gif';
$msgalt = $lang->fwd_pm;

			}
elseif($message['status'] == 4)
{
$msgfolder = 'fw_pm.gif';
$msgalt = $lang->fwd_pm;

				$doneread = 1;

 
			}
if($folder == 2 || $folder == 3)
{ // Sent Items or Drafts Folder Check

			}
if($folder == 2 || $folder == 3)
{ // Sent Items or Drafts Folder Check

Zeile 1103Zeile 1129
				else
{
$tofromusername = $lang->not_sent;

				else
{
$tofromusername = $lang->not_sent;

				}
}
else
{

				}
}
else
{

				$tofromusername = $message['fromusername'];
$tofromuid = $message['fromid'];

				$tofromusername = $message['fromusername'];
$tofromuid = $message['fromid'];

				if($tofromuid == -2)

				if($tofromuid == 0)

				{
$tofromusername = 'MyBB Engine';
}

				{
$tofromusername = 'MyBB Engine';
}

			}

			}

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

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

			{

			{

				eval("\$denyreceipt = \"".$templates->get("private_messagebit_denyreceipt")."\";");
}
else
{
$denyreceipt = '';

				eval("\$denyreceipt = \"".$templates->get("private_messagebit_denyreceipt")."\";");
}
else
{
$denyreceipt = '';

			}

			}

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

Zeile 1141Zeile 1167
			else
{
$senddate = $lang->not_sent;

			else
{
$senddate = $lang->not_sent;

			}
if($doneunread && $doneread)
{
eval("\$messagelist .= \"".$templates->get("private_messagebit_sep")."\";");
$doneunread = 0;
$doneread = 0;

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

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

		}
}

		}
}

	else

	else

	{

	{

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


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


	if($mybb->usergroup['pmquota'] != '0')

	if($mybb->usergroup['pmquota'] > 0)

	{
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'");
$pmscount = $db->fetch_array($query);

	{
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'");
$pmscount = $db->fetch_array($query);

		$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;








		if($pmscount['total'] == 0)
{
$spaceused = 0;
}
else
{
$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;
}

		$spaceused2 = 100 - $spaceused;
if($spaceused <= "50")
{

		$spaceused2 = 100 - $spaceused;
if($spaceused <= "50")
{