Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
@@ -7,7 +7,7 @@
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
* @version $Rev: 12266 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -96,7 +96,8 @@ abstract class classes_comments_renderer
|
||||
* @param array
|
||||
*/
|
||||
protected $_settings;
|
||||
|
||||
protected $parser = null;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
@@ -132,6 +133,17 @@ abstract class classes_comments_renderer
|
||||
$this->request['selectedpids'] = IPSCookie::get( 'commentmodpids' );
|
||||
$this->request['selectedpidcount'] = intval( count( preg_split( "/,/", $this->request['commentmodpids'], -1, PREG_SPLIT_NO_EMPTY ) ) );
|
||||
IPSCookie::set('commentmodpids', '', 0);
|
||||
|
||||
/* Load parser */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
|
||||
$this->parser = new $classToLoad();
|
||||
|
||||
/* set up parser */
|
||||
$this->parser->set( array( 'memberData' => $this->memberData,
|
||||
'parseBBCode' => 1,
|
||||
'parseHtml' => 0,
|
||||
'parseEmoticons' => 1,
|
||||
'parseArea' => 'comments' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,9 +266,13 @@ abstract class classes_comments_renderer
|
||||
$data['captcha'] = $this->getCaptcha();
|
||||
|
||||
/* Got a reply? */
|
||||
if ( !empty( $this->request['_rcid'] ) )
|
||||
if ( !empty( $this->request['_rcid'] ) && is_array( $this->request['_rcid'] ) )
|
||||
{
|
||||
$preReply = $this->fetchReply( $parent['parent_id'], $this->request['_rcid'], $this->memberData );
|
||||
$preReply = '';
|
||||
foreach ( $this->request['_rcid'] as $_rcid )
|
||||
{
|
||||
$preReply .= $this->fetchReply( $parent['parent_id'], $_rcid, $this->memberData );
|
||||
}
|
||||
}
|
||||
|
||||
/* Give plugin a chance to adjust */
|
||||
@@ -402,7 +418,7 @@ abstract class classes_comments_renderer
|
||||
$this->_unpackRepCache();
|
||||
|
||||
/* Joins */
|
||||
$_post_joins = array( array( 'select' => 'm.*',
|
||||
$_post_joins = array( array( 'select' => 'm.member_id as my_member_id, m.*',
|
||||
'where' => 'm.member_id=c.' . $_remap['comment_author_id'],
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'type' => 'left', ),
|
||||
@@ -452,11 +468,8 @@ abstract class classes_comments_renderer
|
||||
}
|
||||
|
||||
/* Set up parser */
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = $this->bbcodeSection();
|
||||
|
||||
$this->parser->set( array( 'parseArea' => $this->bbcodeSection() ) );
|
||||
|
||||
/* Allow plugin to add additional where clauses, or modify existing ones */
|
||||
$query = array( 'select' => 'c.*',
|
||||
'from' => array( $this->table() => 'c' ),
|
||||
@@ -478,10 +491,14 @@ abstract class classes_comments_renderer
|
||||
{
|
||||
/* Reset member ID */
|
||||
$row['member_id'] = $row[ $_remap['comment_author_id'] ];
|
||||
|
||||
if( !$row['member_id'] AND $row['my_member_id'] )
|
||||
{
|
||||
$row['member_id'] = $row['my_member_id'];
|
||||
}
|
||||
|
||||
/* Set up parser */
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $row['mgroup_others'];
|
||||
$this->parser->set( array( 'memberData' => $row ) );
|
||||
|
||||
/* Remap */
|
||||
$row = $this->remapFromLocal( $row );
|
||||
@@ -493,7 +510,7 @@ abstract class classes_comments_renderer
|
||||
$row['_db_comment'] = $row['comment_text'];
|
||||
|
||||
/* Parse for display */
|
||||
$row['comment_text'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['comment_text'] );
|
||||
$row['comment_text'] = $this->parser->display( $row['comment_text'] );
|
||||
|
||||
/* Can moderate? */
|
||||
if ( $this->can( 'moderate', array( 'comment_parent_id' => $parent['parent_id'] ) ) )
|
||||
@@ -525,9 +542,12 @@ abstract class classes_comments_renderer
|
||||
{
|
||||
$row['pp_reputation_points'] = $row['pp_reputation_points'] ? $row['pp_reputation_points'] : 0;
|
||||
$row['has_given_rep'] = $row['has_given_rep'] ? $row['has_given_rep'] : 0;
|
||||
$row['rep_points'] = $row['rep_points'] ? $row['rep_points'] : 0;
|
||||
$row['rep_points'] = $this->registry->repCache->getRepPoints( array( 'app' => $app, 'type' => $_remap['comment_id'], 'type_id' => $row['comment_id'], 'rep_points' => $row['rep_points'] ) );
|
||||
}
|
||||
|
||||
/* View */
|
||||
$row['_canView'] = ( $this->can('view', $row) === true ) ? 1 : 0;
|
||||
|
||||
/* Edit button */
|
||||
$row['_canEdit'] = ( $this->can('edit', $row) === true ) ? 1 : 0;
|
||||
|
||||
@@ -835,20 +855,18 @@ abstract class classes_comments_renderer
|
||||
{
|
||||
throw new Exception( 'NO_PERMISSION' );
|
||||
}
|
||||
|
||||
/* Format comment */
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = $this->bbcodeSection();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$editor = new $classToLoad();
|
||||
$editor->setBbcodeSection( $this->bbcodeSection() );
|
||||
$editor->setLegacyMode(false);
|
||||
|
||||
$comment = $editor->process( $post );
|
||||
|
||||
if ( !trim( $comment ) )
|
||||
{
|
||||
throw new Exception( 'NO_COMMENT' );
|
||||
}
|
||||
|
||||
$comment = IPSText::getTextClass( 'bbcode' )->preDbParse( $comment );
|
||||
|
||||
/* Build insert data */
|
||||
$array = array( 'comment_author_id' => intval( $memberData['member_id'] ),
|
||||
@@ -972,18 +990,15 @@ abstract class classes_comments_renderer
|
||||
throw new Exception( $can );
|
||||
}
|
||||
|
||||
/* Format post */
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = $this->bbcodeSection();
|
||||
/* Set up parser */
|
||||
$this->parser->set( array( 'parseArea' => $this->bbcodeSection() ) );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$editor = new $classToLoad();
|
||||
$editor->setBbcodeSection( $this->bbcodeSection() );
|
||||
$editor->setLegacyMode(false);
|
||||
|
||||
$comment = $editor->process( $post );
|
||||
$comment = IPSText::getTextClass( 'bbcode' )->preDbParse( $comment );
|
||||
|
||||
/* Update array */
|
||||
$array = array( 'comment_edit_date' => time(),
|
||||
@@ -1008,17 +1023,8 @@ abstract class classes_comments_renderer
|
||||
{
|
||||
$editor->removeAutoSavedContent( array( 'member_id' => $this->memberData['member_id'], 'autoSaveKey' => 'comment-' . $this->table() . '-c' . $commentId ) );
|
||||
}
|
||||
|
||||
/* Format and return */
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = $this->bbcodeSection();
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $this->memberData['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->memberData['mgroup_others'];
|
||||
|
||||
return IPSText::getTextClass('bbcode')->preDisplayParse( $comment );
|
||||
return $this->parser->display( $comment );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1074,7 +1080,7 @@ abstract class classes_comments_renderer
|
||||
else if ( is_array( $commentId ) )
|
||||
{
|
||||
/* Permission test */
|
||||
$can = $this->can('moderate', array( 'comment_parent_id' => $parentId ) );
|
||||
$can = $this->can('delete', array( 'comment_parent_id' => $parentId ) );
|
||||
|
||||
if ( $can !== true )
|
||||
{
|
||||
@@ -1263,11 +1269,11 @@ abstract class classes_comments_renderer
|
||||
|
||||
if ( $this->settings['strip_quotes'] )
|
||||
{
|
||||
$comment['comment']['comment_text'] = IPSText::getTextClass( 'bbcode' )->stripQuotes( $comment['comment']['_db_comment'] );
|
||||
$comment['comment']['comment_text'] = $this->parser->stripQuotes( $comment['comment']['_db_comment'] );
|
||||
}
|
||||
|
||||
$reply = "[quote name='" . IPSText::getTextClass('bbcode')->makeQuoteSafe( $comment['author']['members_display_name'] ) . "' timestamp='" . $comment['comment']['comment_date'] . "']<br />{$comment['comment']['comment_text']}<br />[/quote]<br /><br />";
|
||||
|
||||
$reply = $this->parser->buildQuoteTag( $comment['comment']['comment_text'], $comment['author']['members_display_name'], $comment['comment']['comment_date'] );
|
||||
|
||||
/* Throw, fetch and wag tail */
|
||||
return $reply;
|
||||
}
|
||||
@@ -1317,11 +1323,8 @@ abstract class classes_comments_renderer
|
||||
throw new Exception( $can );
|
||||
}
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_html = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = $this->bbcodeSection();
|
||||
/* Set up parser */
|
||||
$this->parser->set( array( 'parseArea' => $this->bbcodeSection() ) );
|
||||
|
||||
/* Ayjacks? */
|
||||
if ( $type == 'ajax' )
|
||||
|
||||
Reference in new issue
Block a user