Vergleich private.php - 1.2.8 - 1.2.11

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

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

 * $Id: private.php 3171 2007-06-29 04:57:39Z chris $

 * $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

	}
else

	{
$sel = "";
}

	{
$sel = "";
}

Zeile 116Zeile 116

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


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 156Zeile 161
		$pm['saveasdraft'] = 1;
}
$pmhandler->set_data($pm);

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





	// Now let the pm handler do all the hard work.
if(!$pmhandler->validate_pm())
{

	// Now let the pm handler do all the hard work.
if(!$pmhandler->validate_pm())
{

Zeile 183Zeile 188

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)
{
$codebuttons = build_mycode_inserter();
if($mybb->settings['pmsallowsmilies'] != "no")

	$plugins->run_hooks("private_send_start");

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

		{

		{

			$smilieinserter = build_clickable_smilies();
}
}

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

Zeile 202Zeile 211

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


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

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

		if($options['signature'] == "yes")
{

		if($options['signature'] == "yes")
{

			$optionschecked['signature'] = "checked";

			$optionschecked['signature'] = "checked=\"checked\"";

		}
if($options['disablesmilies'] == "yes")
{

		}
if($options['disablesmilies'] == "yes")
{

			$optionschecked['disablesmilies'] = "checked";

			$optionschecked['disablesmilies'] = "checked=\"checked\"";

		}
if($options['savecopy'] != "no")
{

		}
if($options['savecopy'] != "no")
{

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

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

		}
if($options['readreceipt'] != "no")
{

		}
if($options['readreceipt'] != "no")
{

			$optionschecked['readreceipt'] = "checked";

			$optionschecked['readreceipt'] = "checked=\"checked\"";

		}
$to = htmlspecialchars_uni($mybb->input['to']);
}

		}
$to = htmlspecialchars_uni($mybb->input['to']);
}

Zeile 224Zeile 234
	// Preview
if($mybb->input['preview'])
{

	// 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 330Zeile 339
		$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);
$to = htmlspecialchars_uni($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.
eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");


// Load the auto complete javascript if it is enabled.
eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");

Zeile 346Zeile 355
	output_page($send);
}


	output_page($send);
}






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

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

{

{

	$plugins->run_hooks("private_read");

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

	$plugins->run_hooks("private_read");

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

Zeile 383Zeile 392
		}
}
if($pm['status'] == "0")

		}
}
if($pm['status'] == "0")

	{

	{

		$time = time();
$updatearray = array(
'status' => 1,

		$time = time();
$updatearray = array(
'status' => 1,

Zeile 402Zeile 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 470Zeile 479
		redirect("private.php", $lang->redirect_pmstrackingstopped);
}
elseif($mybb->input['stoptrackingunread'])

		redirect("private.php", $lang->redirect_pmstrackingstopped);
}
elseif($mybb->input['stoptrackingunread'])

	{

	{

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

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

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

		"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 786Zeile 797
	{
exit;
}

	{
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 797Zeile 809
		$wsql = "pmid='".intval($mybb->input['pmid'])."' AND uid='".$mybb->user['uid']."'";
}
else

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

	{

	{

		if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))
{
$datecut = time()-($mybb->input['daycut'] * 86400);

		if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))
{
$datecut = time()-($mybb->input['daycut'] * 86400);

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

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

			}

			}

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

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

			}

			}

			$wsql .= "'$datecut'";

			$wsql .= "'$datecut'";

		}

		}

		else

		else

		{

		{

			$wsql = "1=1";
}
if(is_array($mybb->input['exportfolders']))

			$wsql = "1=1";
}
if(is_array($mybb->input['exportfolders']))

Zeile 821Zeile 833
			$folderlst = '';
reset($mybb->input['exportfolders']);
foreach($mybb->input['exportfolders'] as $key => $val)

			$folderlst = '';
reset($mybb->input['exportfolders']);
foreach($mybb->input['exportfolders'] as $key => $val)

			{

			{

				$val = $db->escape_string($val);
if($val == "all")
{

				$val = $db->escape_string($val);
if($val == "all")
{

Zeile 833Zeile 845
					if(!$folderlst)
{
$folderlst = " AND pm.folder IN ('$val'";

					if(!$folderlst)
{
$folderlst = " AND pm.folder IN ('$val'";

					}

					}

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

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

Zeile 883Zeile 895
				else
{
$tofromusername = build_profile_link($message['tousername'], $tofromuid);

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

				}
}
else

				}
}
else

			{
$tofromusername = $lang->not_sent;
}

			{
$tofromusername = $lang->not_sent;
}

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

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

			{

			{

				$tofromusername = $message['fromusername'];

				$tofromusername = $message['fromusername'];

			}

			}

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

			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 1082Zeile 1095
	{
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 1124Zeile 1135
			{
$tofromusername = $message['fromusername'];
$tofromuid = $message['fromid'];

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

				if($tofromuid == -2)

				if($tofromuid == 0)

				{
$tofromusername = 'MyBB Engine';
}

				{
$tofromusername = 'MyBB Engine';
}

Zeile 1156Zeile 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")
{