Vergleich private.php - 1.2.0 - 1.2.8

  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 3171 2007-06-29 04:57:39Z chris $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

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

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

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

// Preview

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

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

Zeile 213Zeile 236
		$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();

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

if($options['signature'] == "yes")
{
$optionschecked['signature'] = "checked";
}
if($options['disablesmilies'] == "yes")


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

		{

		{

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

			$post['includesig'] = 'no';

		}

		}

		if($options['savecopy'] != "no")
{
$optionschecked['savecopy'] = "checked";

		else
{
$post['includesig'] = 'yes';

		}

		}

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

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





	}

	}

	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 251Zeile 272
		}
$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 281Zeile 303
			}
}
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']);
$message = "[quote=$pm[quotename]]\n$message\n[/quote]";
$quoted['message'] = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $quoted['message']);

			$subject = preg_replace("#(FW|RE):( *)#is", "", $subject);
$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']);





			if($mybb->input['do'] == "forward")
{
$subject = "Fw: $subject";

			if($mybb->input['do'] == "forward")
{
$subject = "Fw: $subject";

Zeile 298Zeile 320
				$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.

	eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");

	eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");


$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 323Zeile 350
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 336Zeile 363
	");
$pm = $db->fetch_array($query);
if($pm['folder'] == 3)

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

	{

	{

		header("Location: private.php?action=send&pmid={$pm['pmid']}");
exit;
}

		header("Location: private.php?action=send&pmid={$pm['pmid']}");
exit;
}

Zeile 543Zeile 570
				{
case 1:
if($val == $lang->folder_inbox)

				{
case 1:
if($val == $lang->folder_inbox)

						{
$val = '';

						{
$val = '';

						}
break;
case 2:

						}
break;
case 2:

Zeile 658Zeile 685
	$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 696
				$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 685Zeile 712
			foreach($mybb->input['check'] as $key => $val)
{
if($pmssql)

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

				{

				{

					$pmssql .= ",";
}
$pmssql .= "'".intval($key)."'";

					$pmssql .= ",";
}
$pmssql .= "'".intval($key)."'";

Zeile 694Zeile 721
			while($delpm = $db->fetch_array($query))
{
$deletepms[$delpm['pmid']] = 1;

			while($delpm = $db->fetch_array($query))
{
$deletepms[$delpm['pmid']] = 1;

			}

			}

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

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

Zeile 720Zeile 747
}

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

}

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

{

{

	$plugins->run_hooks("private_delete_start");

$sql_array = array(

	$plugins->run_hooks("private_delete_start");

$sql_array = array(

Zeile 746Zeile 773
		$folderinfo = explode("**", $folders, 2);
$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$folderlist .= "<option value=\"$folderinfo[0]\">$folderinfo[1]</option>\n";

		$folderinfo = explode("**", $folders, 2);
$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$folderlist .= "<option value=\"$folderinfo[0]\">$folderinfo[1]</option>\n";

	}

	}

	$folderlist .= "</select>\n";
eval("\$archive = \"".$templates->get("private_archive")."\";");
$plugins->run_hooks("private_export_end");

	$folderlist .= "</select>\n";
eval("\$archive = \"".$templates->get("private_archive")."\";");
$plugins->run_hooks("private_export_end");

Zeile 755Zeile 782

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