Vergleich inc/datahandlers/pm.php - 1.4.7 - 1.4.10

  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: pm.php 4277 2008-11-23 20:47:16Z Tikitiki $

 * $Id: pm.php 4502 2009-11-12 17:02:09Z Tomm $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 344Zeile 344
			$sender = get_user($pm['fromid']);

// Calculate last post

			$sender = get_user($pm['fromid']);

// Calculate last post

			$query = $db->simple_select("privatemessages", "dateline", "fromid='".$db->escape_string($pm['fromid'])."'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));

			$query = $db->simple_select("privatemessages", "dateline", "fromid='".$db->escape_string($pm['fromid'])."' AND toid != '0'", array('order_by' => 'dateline', 'order_dir' => 'desc', 'limit' => 1));

			$sender['lastpm'] = $db->fetch_field($query, "dateline");

// A little bit of calculation magic and moderator status checking.

			$sender['lastpm'] = $db->fetch_field($query, "dateline");

// A little bit of calculation magic and moderator status checking.

Zeile 492Zeile 492
		$recipient_list = serialize($recipient_list);

$this->pm_insert_data = array(

		$recipient_list = serialize($recipient_list);

$this->pm_insert_data = array(

			'fromid' => $pm['sender']['uid'],

			'fromid' => intval($pm['sender']['uid']),

			'folder' => $pm['folder'],
'subject' => $db->escape_string($pm['subject']),
'icon' => intval($pm['icon']),

			'folder' => $pm['folder'],
'subject' => $db->escape_string($pm['subject']),
'icon' => intval($pm['icon']),

Zeile 507Zeile 507
		);

// Check if we're updating a draft or not.

		);

// Check if we're updating a draft or not.

		$query = $db->simple_select("privatemessages", "pmid", "folder='3' AND uid='{$pm['sender']['uid']}' AND pmid='{$pm['pmid']}'");

		$query = $db->simple_select("privatemessages", "pmid, deletetime", "folder='3' AND uid='".intval($pm['sender']['uid'])."' AND pmid='{$pm['pmid']}'");

		$draftcheck = $db->fetch_array($query);

// This PM was previously a draft
if($draftcheck['pmid'])
{

		$draftcheck = $db->fetch_array($query);

// This PM was previously a draft
if($draftcheck['pmid'])
{

 
			if($draftcheck['deletetime'])
{
// This draft was a reply to a PM
$pm['pmid'] = $draftcheck['deletetime'];
$pm['do'] = "reply";
}


			// Delete the old draft as we no longer need it
$db->delete_query("privatemessages", "pmid='{$draftcheck['pmid']}'");
}

			// Delete the old draft as we no longer need it
$db->delete_query("privatemessages", "pmid='{$draftcheck['pmid']}'");
}





		// Saving this message as a draft
if($pm['saveasdraft'])
{
$this->pm_insert_data['uid'] = $pm['sender']['uid'];

		// Saving this message as a draft
if($pm['saveasdraft'])
{
$this->pm_insert_data['uid'] = $pm['sender']['uid'];

 

// If this is a reply, then piggyback into the deletetime to let us know in the future
if($pm['do'] == "reply" || $pm['do'] == "replyall")
{
$this->pm_insert_data['deletetime'] = $pm['pmid'];
}


			$plugins->run_hooks_by_ref("datahandler_pm_insert_updatedraft", $this);
$db->insert_query("privatemessages", $this->pm_insert_data);


			$plugins->run_hooks_by_ref("datahandler_pm_insert_updatedraft", $this);
$db->insert_query("privatemessages", $this->pm_insert_data);


Zeile 541Zeile 555
				if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{
$uselang = $recipient['language'];

				if($recipient['language'] != "" && $lang->language_exists($recipient['language']))
{
$uselang = $recipient['language'];

				}

				}

				elseif($mybb->settings['bblanguage'])
{
$uselang = $mybb->settings['bblanguage'];

				elseif($mybb->settings['bblanguage'])
{
$uselang = $mybb->settings['bblanguage'];

Zeile 597Zeile 611

// Are we replying or forwarding an existing PM?
if($pm['pmid'])


// Are we replying or forwarding an existing PM?
if($pm['pmid'])

		{
if($pm['do'] == "reply")
{

		{
if($pm['do'] == "reply" || $pm['do'] == "replyall")
{

				$sql_array = array(
'status' => 3,

				$sql_array = array(
'status' => 3,

					'statustime' => TIME_NOW
);

					'statustime' => TIME_NOW
);

				$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");
}
elseif($pm['do'] == "forward")

				$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");
}
elseif($pm['do'] == "forward")

Zeile 613Zeile 627
					'statustime' => TIME_NOW
);
$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");

					'statustime' => TIME_NOW
);
$db->update_query("privatemessages", $sql_array, "pmid={$pm['pmid']} AND uid={$pm['sender']['uid']}");

			}

			}

		}

// If we're saving a copy
if($pm['options']['savecopy'] != 0)
{
if(count($recipient_list['to']) == 1)

		}

// If we're saving a copy
if($pm['options']['savecopy'] != 0)
{
if(count($recipient_list['to']) == 1)

			{

			{

				$this->pm_insert_data['toid'] = $uid;

				$this->pm_insert_data['toid'] = $uid;

			}

			}

			else
{
$this->pm_insert_data['toid'] = 0;
}

			else
{
$this->pm_insert_data['toid'] = 0;
}

			$this->pm_insert_data['uid'] = $pm['sender']['uid'];

			$this->pm_insert_data['uid'] = intval($pm['sender']['uid']);

			$this->pm_insert_data['folder'] = 2;
$this->pm_insert_data['status'] = 1;
$this->pm_insert_data['receipt'] = 0;

			$this->pm_insert_data['folder'] = 2;
$this->pm_insert_data['status'] = 1;
$this->pm_insert_data['receipt'] = 0;