Vergleich private.php - 1.2.0 - 1.2.11

  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 2175 2006-08-31 04:27:16Z 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 115Zeile 115
$send_errors = '';

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

$send_errors = '';

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

{
$plugins->run_hooks("private_send_do_send");






{
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
$time_cutoff = time() - (5 * 60 * 60);


// Attempt to see if this PM is a duplicate or not
$time_cutoff = time() - (5 * 60 * 60);

Zeile 133Zeile 138

require_once MYBB_ROOT."inc/datahandlers/pm.php";
$pmhandler = new PMDataHandler();


require_once MYBB_ROOT."inc/datahandlers/pm.php";
$pmhandler = new PMDataHandler();





	$pm = array(
"subject" => $mybb->input['subject'],
"message" => $mybb->input['message'],

	$pm = array(
"subject" => $mybb->input['subject'],
"message" => $mybb->input['message'],

Zeile 182Zeile 187
}

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

}

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

{

$plugins->run_hooks("private_send_start");

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





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

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

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

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

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

		$query = $db->query("























		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'])
{
$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
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

			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
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

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

 
		if(!$options['signature']) 
{
$post['includesig'] = 'no';
}
else
{
$post['includesig'] = 'yes';
}
if(!$options['signature'])
{
$post['includesig'] = 'no';
}
else
{
$post['includesig'] = 'yes';
}

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

		}

		}

		if($mybb->usergroup['cantrackpms'] == "yes")
{
$optionschecked['readreceipt'] = "checked";
}
$optionschecked['savecopy'] = "checked";

		if($mybb->usergroup['cantrackpms'] == "yes")
{
$optionschecked['readreceipt'] = "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 281Zeile 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 298Zeile 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 314Zeile 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);

Zeile 375Zeile 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 595Zeile 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 658Zeile 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 669Zeile 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 755Zeile 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 768Zeile 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 780Zeile 823
				$wsql .= ">=";
}
$wsql .= "'$datecut'";

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

		}
else
{

		}
else
{

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

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

Zeile 796Zeile 839
				{
$folderlst = '';
break;

				{
$folderlst = '';
break;

				}

				}

				else
{
if(!$folderlst)

				else
{
if(!$folderlst)

Zeile 822Zeile 865
		if($mybb->input['exportunread'] != "yes")
{
$wsql .= " AND pm.status!='0'";

		if($mybb->input['exportunread'] != "yes")
{
$wsql .= " AND pm.status!='0'";

		}
}

		}
}

	$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 863Zeile 906
		else
{
$tofromuid = $message['fromid'];

		else
{
$tofromuid = $message['fromid'];

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

			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 1051Zeile 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 1093Zeile 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 1125Zeile 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")
{