Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Online list
|
||||
* Last Updated: $Date: 2009-08-24 20:56:22 -0400 (Mon, 24 Aug 2009) $
|
||||
* Last Updated: $Date: 2010-10-28 08:16:00 -0400 (Thu, 28 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 5041 $
|
||||
* @version $Revision: 7061 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -29,42 +31,42 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Page title
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
private $_title;
|
||||
protected $_title;
|
||||
|
||||
/**
|
||||
* Navigation
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var array[ 0 => [ title, url ] ]
|
||||
*/
|
||||
private $_navigation;
|
||||
protected $_navigation;
|
||||
|
||||
/**
|
||||
* Post Key
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var string Md5 key
|
||||
*/
|
||||
private $_postKey;
|
||||
protected $_postKey;
|
||||
|
||||
/**
|
||||
* Flag: Can we upload?
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var int 1 or 0
|
||||
*/
|
||||
private $_canUpload;
|
||||
protected $_canUpload;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
private $_errorString = '';
|
||||
protected $_errorString = '';
|
||||
|
||||
/**
|
||||
* Class entry point
|
||||
@@ -81,22 +83,22 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( ! $this->memberData['g_use_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10222 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10222, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( $this->memberData['members_disable_pm'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10223 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10223, null, null, 403 );
|
||||
}
|
||||
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10224 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_guests', 10224, null, null, 403 );
|
||||
}
|
||||
|
||||
if( ! IPSLib::moduleIsEnabled( 'messaging', 'members' ) )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_disabled', 10227, null, null, 404 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -141,8 +143,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Grab class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );
|
||||
$this->messengerFunctions = new messengerFunctions( $registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members' );
|
||||
$this->messengerFunctions = new $classToLoad( $registry );
|
||||
|
||||
/* Messenger Totals */
|
||||
$totals = $this->messengerFunctions->buildMessageTotals();
|
||||
@@ -207,7 +209,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->addContent( $this->registry->getClass('output')->getTemplate('messaging')->messengerTemplate( $html, $this->messengerFunctions->_jumpMenu, $this->messengerFunctions->_dirData, $totals, array(), $this->_errorString ) );
|
||||
$this->registry->output->setTitle( $this->_title );
|
||||
$this->registry->output->setTitle( $this->_title . ' - ' . ipsRegistry::$settings['board_name']);
|
||||
|
||||
$this->registry->output->addNavigation( $this->lang->words['messenger__nav'], 'app=members&module=messaging' );
|
||||
|
||||
@@ -225,10 +227,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Deletes a reply
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
private function _deleteReply()
|
||||
protected function _deleteReply()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -244,7 +246,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->request['authKey'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -253,7 +255,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $topicID ) !== TRUE )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -262,7 +264,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->messengerFunctions->deleteMessages( array( $msgID ), $this->memberData['member_id'] ) !== TRUE )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_delete_permission', 10264 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_delete_permission', 10264, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -275,10 +277,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends a reply
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return mixed void, or HTML form
|
||||
*/
|
||||
private function _sendReply()
|
||||
protected function _sendReply()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -299,7 +301,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->request['authKey'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -324,14 +326,14 @@ class public_members_messaging_send extends ipsCommand
|
||||
{
|
||||
$_msgString = $this->lang->words[ 'err_' . $msg ];
|
||||
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
|
||||
}
|
||||
|
||||
|
||||
return $this->_showForm( 'reply', $_msgString );
|
||||
}
|
||||
|
||||
@@ -345,10 +347,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends a reply
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return mixed void, or HTML form
|
||||
*/
|
||||
private function _sendEdit()
|
||||
protected function _sendEdit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -370,7 +372,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->request['authKey'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -395,7 +397,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
{
|
||||
$_msgString = $this->lang->words[ 'err_' . $msg ];
|
||||
$_msgString = str_replace( '#NAMES#' , implode( ",", $this->messengerFunctions->exceptionData ), $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $toMember['members_display_name'] , $_msgString );
|
||||
$_msgString = str_replace( '#TONAME#' , $this->messengerFunctions->exceptionData[0], $_msgString );
|
||||
$_msgString = str_replace( '#FROMNAME#', $this->memberData['members_display_name'], $_msgString );
|
||||
}
|
||||
else
|
||||
@@ -416,10 +418,10 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Sends the PM
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @return void, or HTML form
|
||||
*/
|
||||
private function _sendNewPersonalTopic()
|
||||
protected function _sendNewPersonalTopic()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -457,14 +459,14 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->request['auth_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->getClass('output')->_showNewTopicForm( 'messenger_bad_key', 2024 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_bad_key', 2024 );
|
||||
}
|
||||
|
||||
if ( $sendToID AND $sendToName == "" )
|
||||
if ( !$sendToID AND !$sendToName )
|
||||
{
|
||||
return $this->_showNewTopicForm( $this->lang->words['err_no_chosen_member'] );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Invite Users
|
||||
//-----------------------------------------
|
||||
@@ -528,7 +530,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
{
|
||||
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
|
||||
}
|
||||
|
||||
|
||||
return $this->_showNewTopicForm( $_msgString );
|
||||
}
|
||||
|
||||
@@ -543,7 +545,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = "Your message has been saved as a draft";
|
||||
$text = $this->lang->words['saved_as_a_draft'];
|
||||
}
|
||||
|
||||
$this->registry->getClass('output')->redirectScreen( $text , $this->settings['base_url'] . 'app=members&module=messaging&section=view&do=inbox' );
|
||||
@@ -552,12 +554,12 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Show PM form
|
||||
*
|
||||
* @access private
|
||||
* @access protected
|
||||
* @param string Type of form (edit / reply)
|
||||
* @param array Array of errors
|
||||
* @param string Error message
|
||||
* @return string returns HTML
|
||||
*/
|
||||
private function _showForm( $type, $errors='' )
|
||||
protected function _showForm( $type, $errors='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -566,14 +568,14 @@ class public_members_messaging_send extends ipsCommand
|
||||
$topicID = intval( $this->request['topicID'] );
|
||||
$msgID = intval( $this->request['msgID'] );
|
||||
$preview = isset( $this->request['previewReply'] ) ? 1 : 0;
|
||||
$displayData = array( 'errors' => $errors,
|
||||
$displayData = array( 'errors' => $errors ? array( $errors ) : array(),
|
||||
'topicID' => $topicID,
|
||||
'msgID' => $msgID,
|
||||
'type' => $type,
|
||||
'message' => '' );
|
||||
|
||||
$_POST['Post-NS'] = isset($_POST['msgContent']) ? $_POST['msgContent'] : '';
|
||||
$_POST['msgContent'] = IPSText::removeMacrosFromInput( IPSText::raw2form( isset($_POST['msgContent']) ? $_POST['msgContent'] : '' ) );
|
||||
$_POST['msgContent'] = IPSText::raw2form( isset($_POST['msgContent']) ? $_POST['msgContent'] : '' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fetch topic Data
|
||||
@@ -593,7 +595,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( $this->messengerFunctions->canAccessTopic( $this->memberData['member_id'], $topicData, $topicParticipants ) !== TRUE )
|
||||
{
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229 );
|
||||
$this->registry->getClass('output')->showError( 'messenger_no_msgid', 10229, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -611,7 +613,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
/* We're quoting a post... */
|
||||
if ( IPSText::getTextClass( 'editor' )->method == 'rte' )
|
||||
{
|
||||
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "' date='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($this->registry->getClass( 'class_localization')->getDate( $msgData['msg_date'], 'LONG', 1 ))."']<br />{$msgData['msg_post']}".'[/quote]'."<br /><br /><br />";
|
||||
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']<br />{$msgData['msg_post']}".'[/quote]'."<br /><br /><br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -623,7 +625,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
$msgData['msg_post'] = IPSText::getTextClass('bbcode')->preEditParse( $msgData['msg_post'] );
|
||||
|
||||
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "' date='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($this->registry->getClass( 'class_localization')->getDate( $msgData['msg_date'], 'LONG', 1 ))."']\n{$msgData['msg_post']}".'[/quote]'."\n\n\n";
|
||||
$displayData['message'] = "[quote name='".IPSText::getTextClass( 'bbcode' )->makeQuoteSafe($msgData['members_display_name'])."' timestamp='" . $msgData['msg_date'] . "']\n{$msgData['msg_post']}".'[/quote]'."\n\n\n";
|
||||
}
|
||||
}
|
||||
else if ( $type == 'edit' )
|
||||
@@ -680,8 +682,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Grab render attach class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$this->class_attach = new class_attach( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -701,7 +703,12 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Errors
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $errors OR ( IPSText::getTextClass('bbcode')->error != "" ) )
|
||||
if( is_array($errors) AND count($errors) )
|
||||
{
|
||||
$preview = 1;
|
||||
}
|
||||
|
||||
if ( IPSText::getTextClass('bbcode')->error != "" )
|
||||
{
|
||||
if ( IPSText::getTextClass('bbcode')->error )
|
||||
{
|
||||
@@ -726,7 +733,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
|
||||
{
|
||||
if ( count( $errors ) or $preview )
|
||||
if ( $preview )
|
||||
{
|
||||
$displayData['message'] = stripslashes( $displayData['message'] );
|
||||
}
|
||||
@@ -734,8 +741,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
|
||||
}
|
||||
else if ( $displayData['message'] )
|
||||
{
|
||||
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
|
||||
{
|
||||
// Not needed as is handled in above $type == 'edit' block
|
||||
}
|
||||
|
||||
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'msgContent' );
|
||||
@@ -751,8 +758,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Load attachments so we get some stats
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$class_attach = new class_attach( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$class_attach = new $classToLoad( $this->registry );
|
||||
$class_attach->type = 'msg';
|
||||
$class_attach->init();
|
||||
$class_attach->getUploadFormSettings();
|
||||
@@ -785,11 +792,11 @@ class public_members_messaging_send extends ipsCommand
|
||||
/**
|
||||
* Show PM form
|
||||
*
|
||||
* @access private
|
||||
* @param array Array of errors
|
||||
* @access protected
|
||||
* @param string Error message
|
||||
* @return string returns HTML
|
||||
*/
|
||||
private function _showNewTopicForm( $errors='' )
|
||||
protected function _showNewTopicForm( $errors='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -812,16 +819,16 @@ class public_members_messaging_send extends ipsCommand
|
||||
$topicID = intval($this->request['topicID']);
|
||||
$preview = $this->request['preview'];
|
||||
$inviteUsers = array();
|
||||
$displayData = array( 'errors' => $errors,
|
||||
$displayData = array( 'errors' => $errors ? array( $errors ) : array(),
|
||||
'topicID' => $topicID,
|
||||
'preview' => '',
|
||||
'name' => '',
|
||||
'title' => '',
|
||||
'message' => '' );
|
||||
|
||||
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
|
||||
$_POST['Post'] = IPSText::removeMacrosFromInput( IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' ) );
|
||||
|
||||
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
|
||||
$_POST['Post'] = IPSText::raw2form( isset($_POST['Post']) ? $_POST['Post'] : '' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Preview post?
|
||||
//-----------------------------------------
|
||||
@@ -841,7 +848,15 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
$this->settings['max_emos'] = 0;
|
||||
|
||||
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
|
||||
if( $this->request['_from'] == 'quickPM' )
|
||||
{
|
||||
$old_msg = $_POST['Post'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$old_msg = IPSText::getTextClass('editor')->processRawPost( 'Post-NS' );
|
||||
}
|
||||
|
||||
$old_msg = IPSText::getTextClass('bbcode')->preDisplayParse( IPSText::getTextClass('bbcode')->preDbParse( $old_msg ) );
|
||||
|
||||
if ( ! is_object( $this->class_attach ) )
|
||||
@@ -850,8 +865,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Grab render attach class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$this->class_attach = new class_attach( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -906,39 +921,58 @@ class public_members_messaging_send extends ipsCommand
|
||||
if ( $preview )
|
||||
{
|
||||
$displayData['message'] = $_POST['Post-NS'];
|
||||
|
||||
if( $this->request['_from'] == 'quickPM' )
|
||||
{
|
||||
$displayData['message'] = IPSText::parseCleanValue( $displayData['message'], true );
|
||||
}
|
||||
|
||||
$displayData['title'] = str_replace( "'", "'", str_replace( '"', '"', IPSText::stripslashes($_POST['msg_title']) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sending as draft...
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( $topicID )
|
||||
{
|
||||
$draftTopic = $this->messengerFunctions->fetchTopicDataWithMessage( $topicID, TRUE );
|
||||
|
||||
if ( $draftTopic['mt_to_member_id'] )
|
||||
/* Permission to view this? */
|
||||
if ( $draftTopic['mt_starter_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
$displayData['name'] = $draftTopic['from_name'];
|
||||
}
|
||||
|
||||
if ( $draftTopic['mt_title'] )
|
||||
{
|
||||
$_member = IPSMember::load( $draftTopic['mt_to_member_id'], 'core' );
|
||||
|
||||
$displayData['name'] = $_member['members_display_name'];
|
||||
$displayData['title'] = $draftTopic['mt_title'];
|
||||
$_msg_id = $draftTopic['msg_id'];
|
||||
$this->_postKey = $draftTopic['msg_post_key'];
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $draftTopic['msg_post'] );
|
||||
}
|
||||
if ( $draftTopic['mt_to_member_id'] )
|
||||
{
|
||||
$displayData['name'] = $draftTopic['from_name'];
|
||||
}
|
||||
|
||||
if ( $draftTopic['mt_title'] )
|
||||
{
|
||||
$_member = IPSMember::load( $draftTopic['mt_to_member_id'], 'core' );
|
||||
|
||||
$displayData['name'] = $_member['members_display_name'];
|
||||
$displayData['title'] = $draftTopic['mt_title'];
|
||||
$_msg_id = $draftTopic['msg_id'];
|
||||
$this->_postKey = $draftTopic['msg_post_key'];
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' )
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $draftTopic['msg_post'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $draftTopic['msg_post'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// CC Boxes
|
||||
//-----------------------------------------
|
||||
@@ -981,31 +1015,18 @@ class public_members_messaging_send extends ipsCommand
|
||||
// PM returns
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] AND $fromMsgID )
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( nl2br( $displayData['message'] ) );
|
||||
}
|
||||
else if( IPSText::getTextClass('editor')->method == 'std' AND $displayData['message'] AND $fromMsgID )
|
||||
{
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this RTE? If so, convert BBCode
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
|
||||
if ( IPSText::getTextClass('editor')->method == 'rte' AND $displayData['message'] )
|
||||
{
|
||||
if ( count( $errors ) or $preview )
|
||||
{
|
||||
$displayData['message'] = stripslashes( $displayData['message'] );
|
||||
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
|
||||
}
|
||||
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->convertForRTE( $displayData['message'] );
|
||||
}
|
||||
else if ( $displayData['message'] )
|
||||
{
|
||||
$displayData['message'] = IPSText::stripslashes( $displayData['message'] );
|
||||
$displayData['message'] = IPSText::getTextClass('bbcode')->preEditParse( $displayData['message'] );
|
||||
}
|
||||
|
||||
$displayData['editor'] = IPSText::getTextClass('editor')->showEditor( $displayData['message'], 'Post' );
|
||||
@@ -1021,8 +1042,8 @@ class public_members_messaging_send extends ipsCommand
|
||||
// Load attachments so we get some stats
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php' );
|
||||
$class_attach = new class_attach( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$class_attach = new $classToLoad( $this->registry );
|
||||
$class_attach->type = 'msg';
|
||||
$class_attach->init();
|
||||
$class_attach->getUploadFormSettings();
|
||||
@@ -1035,7 +1056,7 @@ class public_members_messaging_send extends ipsCommand
|
||||
|
||||
$this->_title = $this->lang->words['sendMsgTitle'];
|
||||
$this->_navigation[] = array( $this->lang->words['sendMsgTitle'], '' );
|
||||
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('messaging')->sendNewPersonalTopicForm( $displayData );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user