Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Posting display formatting methods
|
||||
* Last Updated: $Date: 2011-09-29 22:09:09 -0400 (Thu, 29 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-07-09 12:56:26 -0400 (Mon, 09 Jul 2012) $
|
||||
* </pre>
|
||||
* File Created By: Matt Mecham
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 9570 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 11047 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -60,7 +60,7 @@ class classPostForms extends classPost
|
||||
// Set up
|
||||
//-----------------------------------------
|
||||
|
||||
$extraData = array();
|
||||
$extraData = array( 'isHtml' => 0 );
|
||||
$errors = '';
|
||||
|
||||
$this->setIsAjax( TRUE );
|
||||
@@ -164,7 +164,15 @@ class classPostForms extends classPost
|
||||
$extraData['_loadJs'] = true;
|
||||
$extraData['smilies'] = $this->editor->fetchEmoticons();
|
||||
}
|
||||
|
||||
|
||||
$extraData['htmlStatus'] = $this->_originalPost['post_htmlstate'];
|
||||
|
||||
/* Set HTML status */
|
||||
if ( $this->_canHtml( $this->getForumData('id') ) && $this->_originalPost['post_htmlstate'] )
|
||||
{
|
||||
$extraData['isHtml'] = true;
|
||||
}
|
||||
|
||||
$html = $this->registry->getClass('output')->getTemplate('editors')->ajaxEditBox( $postContent, $this->getPostID(), $errors, $extraData );
|
||||
|
||||
return $html;
|
||||
@@ -356,6 +364,12 @@ class classPostForms extends classPost
|
||||
|
||||
$postContent = $this->_checkMultiQuote( $postContent );
|
||||
|
||||
/* Set HTML status */
|
||||
if ( $this->_canHtml( $this->getForumData('id') ) && $this->_originalPost['post_htmlstate'] )
|
||||
{
|
||||
$this->editor->setIsHtml( true );
|
||||
}
|
||||
|
||||
/* Set content in editor */
|
||||
$this->editor->setContent( $postContent );
|
||||
|
||||
@@ -391,8 +405,26 @@ class classPostForms extends classPost
|
||||
$_statusMsg[] = $this->registry->getClass('class_forums')->ppdStatusMessage;
|
||||
}
|
||||
|
||||
$_statusMsg[] = $this->registry->getClass('class_forums')->fetchPostModerationStatusMessage( $this->getAuthor(), $this->getForumData(), $topic, $formType );
|
||||
|
||||
$modAll = FALSE;
|
||||
switch( intval( $this->getForumData('preview_posts') ) )
|
||||
{
|
||||
case 1:
|
||||
$modAll = TRUE;
|
||||
break;
|
||||
case 2:
|
||||
if ( $formType == 'new' )
|
||||
{
|
||||
$modAll = TRUE;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ( $formType == 'reply' )
|
||||
{
|
||||
$modAll = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Load attachments so we get some stats
|
||||
//-----------------------------------------
|
||||
@@ -411,7 +443,7 @@ class classPostForms extends classPost
|
||||
$output .= $this->registry->getClass('output')->getTemplate('post')->postFormTemplate( array( 'title' => $titleText,
|
||||
'captchaHTML' => $this->_generateGuestCaptchaHTML(),
|
||||
'checkBoxes' => $this->_generateCheckBoxes( $formType, isset( $topic['tid'] ) ? $topic['tid'] : 0, $this->getForumData('id') ),
|
||||
'editor' => $this->editor->show( 'Post', array( 'autoSaveKey' => $autoSaveKey, 'height' => 350 ) ),
|
||||
'editor' => $this->editor->show( 'Post', array( 'autoSaveKey' => $autoSaveKey, 'height' => 350, 'warnInfo' => 'full', 'modAll' => $modAll ) ),
|
||||
'buttonText' => $buttonText,
|
||||
'uploadForm' => ( $this->can_upload ) ? $this->registry->getClass('output')->getTemplate('post')->uploadForm( $this->post_key, 'post', $class_attach->attach_stats, $this->getPostID(), $this->getForumData('id') ) : "",
|
||||
'topicSummary' => $this->_generateTopicSummary( $topic['tid'] ),
|
||||
@@ -424,7 +456,8 @@ class classPostForms extends classPost
|
||||
'seoTopic' => $topic['title_seo'],
|
||||
'seoForum' => $this->getForumData('name_seo'),
|
||||
'statusMsg' => $_statusMsg,
|
||||
'tagBox' => $tagBox
|
||||
'tagBox' => $tagBox,
|
||||
'socialShareOff' => ( $formType != 'new' ) ? 1 : $this->getForumData('disable_sharelinks')
|
||||
),
|
||||
array( 'doCode' => $doCode,
|
||||
'p' => $this->getPostID(),
|
||||
@@ -519,7 +552,7 @@ class classPostForms extends classPost
|
||||
protected function _afterPostCompile( $postContent, $formType )
|
||||
{
|
||||
$postContent = $postContent ? $postContent : $this->_originalPost['post'];
|
||||
|
||||
|
||||
if ( $formType == 'edit' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
@@ -588,27 +621,27 @@ class classPostForms extends classPost
|
||||
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' );
|
||||
|
||||
$this->DB->build( array( 'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.topic_id=' . $topicID . ' AND ' . $_queued,
|
||||
'order' => 'pid DESC',
|
||||
'limit' => array( 0, 10 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.members_display_name, m.member_group_id, m.mgroup_others, m.member_id, m.members_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'f.use_ibc',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=t.forum_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.topic_id=' . $topicID . ' AND ' . $_queued,
|
||||
'order' => 'p.pid DESC',
|
||||
'limit' => array( 0, 10 ),
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.members_display_name, m.member_group_id, m.mgroup_others, m.member_id, m.members_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array( 'select' => 'f.use_ibc',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=t.forum_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
)
|
||||
) );
|
||||
|
||||
$post_query = $this->DB->execute();
|
||||
@@ -617,7 +650,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
$row['author'] = $row['members_display_name'] ? $row['members_display_name'] : $row['author_name'];
|
||||
|
||||
$row['date'] = $this->registry->getClass( 'class_localization')->getDate( $row['post_date'], 'LONG' );
|
||||
$row['date'] = $this->registry->getClass('class_localization')->getDate( $row['post_date'], 'LONG' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse the post
|
||||
@@ -631,21 +664,7 @@ class classPostForms extends classPost
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
|
||||
|
||||
$row['post'] = IPSText::truncate( IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] ), 1000 );
|
||||
|
||||
/* Bit crude */
|
||||
$od = substr_count( $row['post'], '<div' );
|
||||
$cd = substr_count( $row['post'], '</div>' );
|
||||
|
||||
if ( $od > $cd )
|
||||
{
|
||||
for( $i = 0 ; $i < $od ; $i++ )
|
||||
{
|
||||
$row['post'] .= "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
$posts[ $row['pid'] ] = $row;
|
||||
$row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['post'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Are we giving this bloke a good ignoring?
|
||||
@@ -657,14 +676,16 @@ class classPostForms extends classPost
|
||||
{
|
||||
if ( ! strstr( $this->settings['cannot_ignore_groups'], ','.$row['member_group_id'].',' ) )
|
||||
{
|
||||
$posts[ $row['pid'] ]['_ignored'] = 1;
|
||||
$row['_ignored'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$posts[ $row['pid'] ] = $row;
|
||||
|
||||
$attach_pids[] = $row['pid'];
|
||||
}
|
||||
|
||||
|
||||
$content = $this->registry->getClass('output')->getTemplate('post')->topicSummary( $posts );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -690,14 +711,15 @@ class classPostForms extends classPost
|
||||
$this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
$this->class_attach->attach_post_key = '';
|
||||
$this->class_attach->attach_post_key = '';
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $attach_pids );
|
||||
}
|
||||
|
||||
return $content;
|
||||
// We need 0 and html values to avoid string offest errors
|
||||
return is_array($content) ? $content : array( 0 => array( 'html' => $content ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -719,8 +741,8 @@ class classPostForms extends classPost
|
||||
$return = array(
|
||||
'sig' => 'checked="checked"',
|
||||
'emo' => 'checked="checked"',
|
||||
'html' => array(),
|
||||
'tra' => ( $this->getAuthor('auto_track') OR $this->getSettings('enableTracker') ) ? 'checked="checked"' : ''
|
||||
'html' => null,
|
||||
'tra' => ( ( $this->getAuthor('auto_track') and !$topicID ) OR $this->getSettings('enableTracker') ) ? 'checked="checked"' : ''
|
||||
);
|
||||
|
||||
if ( ! $this->getSettings('enableSignature') )
|
||||
@@ -733,11 +755,9 @@ class classPostForms extends classPost
|
||||
$return['emo'] = "";
|
||||
}
|
||||
|
||||
if ( $this->registry->class_forums->forum_by_id[ $forumID ]['use_html'] and $this->getAuthor('g_dohtml') )
|
||||
if ( $this->_canHtml( $forumID ) )
|
||||
{
|
||||
$options_array[ $this->getSettings('post_htmlstatus') ] = ' selected="selected"';
|
||||
|
||||
$return['html'] = $options_array;
|
||||
$return['html'] = ( $this->getSettings('post_htmlstatus') ) ? ' checked="checked"' : '';
|
||||
}
|
||||
|
||||
if ( $type == 'reply' )
|
||||
@@ -758,10 +778,19 @@ class classPostForms extends classPost
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if user can HTML
|
||||
* @param int $forumId
|
||||
*/
|
||||
protected function _canHtml( $forumId )
|
||||
{
|
||||
return ( $this->registry->class_forums->forum_by_id[ $forumId ]['use_html'] and $this->getAuthor('g_dohtml') );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates mod options dropdown
|
||||
*
|
||||
@@ -796,7 +825,7 @@ class classPostForms extends classPost
|
||||
}
|
||||
else if ( $this->getAuthor('member_id') != 0 )
|
||||
{
|
||||
if ( $this->moderator['mid'] != "" )
|
||||
if ( isset($this->moderator['mid']) && $this->moderator['mid'] != "" )
|
||||
{
|
||||
if ($this->moderator['close_topic'])
|
||||
{
|
||||
@@ -823,7 +852,9 @@ class classPostForms extends classPost
|
||||
else
|
||||
{
|
||||
// Guest
|
||||
return "";
|
||||
return array( 'dropDownOptions' => $html,
|
||||
'canSetOpenTime' => 0,
|
||||
'canSetCloseTime' => 0 );
|
||||
}
|
||||
|
||||
if ( !($can_pin == 0 and $can_close == 0 and $can_move == 0) )
|
||||
@@ -920,7 +951,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
# Bug 23258 - add on TZ as we take this off when saving time
|
||||
$date = IPSTime::unixstamp_to_human( $topic['topic_open_time'] + $this->registry->class_localization->getTimeOffset() );
|
||||
$mytimes['open_date'] = sprintf("%02d.%02d.%04d", $date['day'], $date['month'], $date['year'] );
|
||||
$mytimes['open_date'] = sprintf("%02d/%02d/%04d", $date['month'], $date['day'], $date['year'] );
|
||||
$mytimes['open_time'] = sprintf("%02d:%02d" , $date['hour'] , $date['minute'] );
|
||||
}
|
||||
}
|
||||
@@ -931,7 +962,7 @@ class classPostForms extends classPost
|
||||
{
|
||||
# Bug 23258 - add on TZ as we take this off when saving time
|
||||
$date = IPSTime::unixstamp_to_human( $topic['topic_close_time'] + $this->registry->class_localization->getTimeOffset() );
|
||||
$mytimes['close_date'] = sprintf("%02d.%02d.%04d", $date['day'], $date['month'], $date['year'] );
|
||||
$mytimes['close_date'] = sprintf("%02d/%02d/%04d", $date['month'], $date['day'], $date['year'] );
|
||||
$mytimes['close_time'] = sprintf("%02d:%02d" , $date['hour'] , $date['minute'] );
|
||||
}
|
||||
}
|
||||
@@ -959,7 +990,7 @@ class classPostForms extends classPost
|
||||
*/
|
||||
protected function _generateGuestCaptchaHTML()
|
||||
{
|
||||
if ( ! $this->getAuthor('member_id') AND $this->settings['guest_captcha'] )
|
||||
if ( ! $this->getAuthor('member_id') AND $this->settings['guest_captcha'] AND $this->settings['bot_antispam_type'] != 'none' )
|
||||
{
|
||||
$captchaHTML = $this->registry->getClass('class_captcha')->getTemplate();
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user