Version 3.4.6
This commit is contained in:
1 parent
e4478369d8
commit
b45ea0dffb
1568 files changed
+155104
-161665
No files matched your search
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Ajax Functions For Topics
|
||||
* Last Updated: $Date: 2013-05-28 21:40:33 -0400 (Tue, 28 May 2013) $
|
||||
* Last Updated: $Date: 2013-10-16 19:11:24 -0400 (Wed, 16 Oct 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: rashbrook $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 12274 $
|
||||
* @version $Revision: 12381 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -30,7 +30,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
* @param object Registry reference
|
||||
* @return @e void [Outputs for the ajax handler]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load topic class */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
@@ -104,7 +104,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
|
||||
/**
|
||||
* The pop-up modal yodal
|
||||
*
|
||||
*
|
||||
*/
|
||||
protected function _postShareModal()
|
||||
{
|
||||
@@ -139,7 +139,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
return $this->returnHtml( $this->lang->words['no_permission'] );
|
||||
}
|
||||
|
||||
$url = $this->registry->output->buildSEOUrl( 'showtopic=' . $tid . '&p=' . $pid, 'public', $topic['title_seo'], 'showtopic' );
|
||||
$url = $this->registry->output->buildSEOUrl( 'showtopic=' . $tid . '&p=' . $pid, 'public', $topic['title_seo'], 'showtopic' );
|
||||
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
|
||||
@@ -237,7 +237,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$this->returnJsonArray( array( 'count' => 0 ) );
|
||||
}
|
||||
|
||||
/* Get posts */
|
||||
/* Get posts */
|
||||
$posts = $this->_getPosts( $topicId, $topPid, $this->registry->getClass('topics')->getTopicData('forum_id') );
|
||||
|
||||
/* Got anything sailor? */
|
||||
@@ -268,7 +268,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$this->returnHtml( '' );
|
||||
}
|
||||
|
||||
/* Get posts */
|
||||
/* Get posts */
|
||||
$posts = $this->_getPosts( $topicId, $topPid, $this->registry->getClass('topics')->getTopicData('forum_id') );
|
||||
|
||||
/* Got anything sailor? */
|
||||
@@ -366,7 +366,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_object( $this->class_attach ) )
|
||||
{
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
}
|
||||
@@ -556,10 +556,10 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
if ( $_lastPost['topic_id'] == $tid )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['topic_duplicate_post'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Regular group flood check */
|
||||
/* Regular group flood check */
|
||||
if ( $this->settings['flood_control'] > 0 && $this->memberData['g_avoid_flood'] != 1 )
|
||||
{
|
||||
if ( ( time() - $this->memberData['last_post'] < $this->settings['flood_control'] ) OR time() < $this->memberData['last_post'] )
|
||||
@@ -636,7 +636,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$topic = $this->registry->getClass('topics')->setUpTopic( $this->registry->getClass('topics')->getTopicData() );
|
||||
$topic['_canReport'] = $reports->canReport( 'post' );
|
||||
|
||||
/* Get posts */
|
||||
/* Get posts */
|
||||
$posts = $this->_getPosts( $tid, $topPid, $this->registry->getClass('topics')->getTopicData('forum_id') );
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'Found ' . count($posts) . ' posts...' ) );
|
||||
@@ -670,6 +670,8 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
( $data['queued'] == 2 and $this->memberData['forumsModeratorData'][ $forumData['id'] ]['bw_mod_un_soft_delete'] )
|
||||
or
|
||||
( $data['queued'] == 0 and $this->memberData['forumsModeratorData'][ $forumData['id'] ]['bw_mod_soft_delete'] )
|
||||
or
|
||||
$this->memberData['forumsModeratorData'][ $forumData['id'] ]['split_merge']
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -689,7 +691,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
{
|
||||
$this->returnHtml( $html );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( Exception $error )
|
||||
{
|
||||
@@ -838,7 +840,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
|
||||
|
||||
|
||||
foreach( $_posts as $pid => $r )
|
||||
foreach( $_posts as $postid => $r )
|
||||
{
|
||||
$r['tid'] = $topic['tid'];
|
||||
$r['title_seo'] = $topic['title_seo'];
|
||||
@@ -875,23 +877,22 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
'postId' => array( $pid ),
|
||||
'archiveToNative' => true,
|
||||
'isArchivedTopic' => $this->registry->topics->isArchived( $topic ) ) );
|
||||
|
||||
$posts['search'] = array_pop( $_posts );
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
|
||||
$parser = new $classToLoad();
|
||||
|
||||
/* Set up some settings */
|
||||
$parser->set( array( 'parseArea' => 'topics',
|
||||
'memberData' => $this->memberData,
|
||||
'parseBBCode' => $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_ibc'],
|
||||
'parseHtml' => ( $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_html'] and $this->caches['group_cache'][ $data['member_group_id'] ]['g_dohtml'] and $data['post_htmlstate'] ) ? 1 : 0,
|
||||
'parseEmoticons' => $data['use_emo'] ) );
|
||||
|
||||
/* Still here? */
|
||||
foreach( $posts as $k => $data )
|
||||
{
|
||||
/* Set up settings for this post */
|
||||
$parser->set( array( 'parseArea' => 'topics',
|
||||
'memberData' => $this->memberData,
|
||||
'parseBBCode' => $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_ibc'],
|
||||
'parseHtml' => ( $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_html'] and $this->caches['group_cache'][ $data['member_group_id'] ]['g_dohtml'] and $data['post_htmlstate'] ) ? 1 : 0,
|
||||
'parseEmoticons' => $data['use_emo'] ) );
|
||||
|
||||
$data = IPSMember::buildDisplayData( $data );
|
||||
|
||||
$data['post'] = $parser->stripQuotes( $data['post'] );
|
||||
@@ -977,7 +978,6 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
/* INIT */
|
||||
$topic_id = intval( $this->request['t'] );
|
||||
$rating_id = intval( $this->request['rating'] );
|
||||
$vote_cast = array();
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'The topic rating request has been received...' ) );
|
||||
|
||||
@@ -996,7 +996,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
IPSDebug::fireBug( 'error', array( 'The topic is not open' ) );
|
||||
|
||||
$this->returnJsonArray( array( 'error_key' => 'topic_rate_locked', 'error_code' => 10348 ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* Query Forum */
|
||||
$forum_data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'forums', 'where' => "id={$topic_data['forum_id']}" ) );
|
||||
@@ -1012,7 +1012,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Sneaky members rating topic more than 5? */
|
||||
/* Sneaky members rating topic more than 5? */
|
||||
if( $rating_id > 5 )
|
||||
{
|
||||
$rating_id = 5;
|
||||
@@ -1060,22 +1060,22 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
/* NEW RATING! */
|
||||
else
|
||||
{
|
||||
$this->DB->insert( 'topic_ratings', array(
|
||||
$this->DB->insert( 'topic_ratings', array(
|
||||
'rating_tid' => $topic_data['tid'],
|
||||
'rating_member_id' => $this->memberData['member_id'],
|
||||
'rating_value' => $rating_id,
|
||||
'rating_ip_address' => $this->member->ip_address
|
||||
)
|
||||
'rating_ip_address' => $this->member->ip_address
|
||||
)
|
||||
);
|
||||
|
||||
$this->DB->update( 'topics', array(
|
||||
$this->DB->update( 'topics', array(
|
||||
'topic_rating_hits' => intval( $topic_data['topic_rating_hits'] ) + 1,
|
||||
'topic_rating_total' => intval( $topic_data['topic_rating_total'] ) + $rating_id
|
||||
'topic_rating_total' => intval( $topic_data['topic_rating_total'] ) + $rating_id
|
||||
), 'tid='.$topic_data['tid'] );
|
||||
|
||||
IPSDebug::fireBug( 'info', array( 'The rating was inserted' ) );
|
||||
|
||||
$this->returnJsonArray( array(
|
||||
$this->returnJsonArray( array(
|
||||
'rated' => 'new',
|
||||
'message' => $this->lang->words['topic_rating_done'],
|
||||
'topic_rating_total' => intval( $topic_data['topic_rating_total'] ) + $rating_id ,
|
||||
@@ -1083,7 +1083,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
'_rate_int' => round( (intval( $topic_data['topic_rating_total'] ) + $rating_id) / (intval( $topic_data['topic_rating_hits'] ) + 1) )
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a ajax topic title edit
|
||||
@@ -1099,7 +1099,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
|
||||
/* Check ID */
|
||||
if( ! $tid )
|
||||
{
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_no_topic_id'] );
|
||||
}
|
||||
|
||||
@@ -1107,7 +1107,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid=' . $tid ) );
|
||||
|
||||
if( ! $topic['tid'] )
|
||||
{
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['ajax_topic_not_found'] );
|
||||
}
|
||||
|
||||
@@ -1135,7 +1135,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
}
|
||||
|
||||
/* Clean */
|
||||
if( $this->settings['etfilter_shout'] && mb_strtoupper($this->_topicTitle) == $this->_topicTitle )
|
||||
if( $this->settings['etfilter_shout'] )
|
||||
{
|
||||
if( function_exists('mb_convert_case') )
|
||||
{
|
||||
@@ -1145,12 +1145,12 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = ucwords( mb_strtolower($name) );
|
||||
$name = ucwords( strtolower($name) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = ucwords( mb_strtolower($name) );
|
||||
$name = ucwords( strtolower($name) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1173,7 +1173,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
'topic_title' => $name,
|
||||
'action' => sprintf( $this->lang->words['ajax_topictitle'], $topic['title'], $name),
|
||||
'query_string' => htmlspecialchars( my_getenv('QUERY_STRING') ),
|
||||
) );
|
||||
) );
|
||||
|
||||
/* Update the last topic title? */
|
||||
if ( $topic['tid'] == $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['last_id'] )
|
||||
@@ -1184,7 +1184,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
if ( $topic['tid'] == $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['newest_id'] )
|
||||
{
|
||||
$this->DB->update( 'forums', array( 'newest_title' => $name ), 'id=' . $topic['forum_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* All Done */
|
||||
$this->returnJsonArray( array( 'title' => $name, 'url' => $this->registry->output->buildSEOUrl( 'showtopic=' . $tid, 'public', $title_seo, 'showtopic' ) ) );
|
||||
@@ -1200,7 +1200,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
{
|
||||
if( $this->settings['etfilter_punct'] )
|
||||
{
|
||||
$title = preg_replace( '/\?{1,}/' , "?" , $title );
|
||||
$title = preg_replace( '/\?{1,}/' , "?" , $title );
|
||||
$title = preg_replace( '/(!){1,}/' , "!", $title );
|
||||
}
|
||||
|
||||
@@ -1216,7 +1216,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$title = trim( $title );
|
||||
|
||||
return $title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the post
|
||||
@@ -1282,15 +1282,15 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
$this->postClass->setForumID( $fid );
|
||||
$this->postClass->setPublished( 'reply' );
|
||||
|
||||
$this->postClass->setSettings( array( 'post_htmlstatus' => intval( $this->request['post_htmlstatus'] ) ) );
|
||||
$this->postClass->setSettings( array( 'post_htmlstatus' => intval( $this->request['post_htmlstatus'] ) ) );
|
||||
|
||||
/* Topic Data */
|
||||
$this->postClass->setTopicData( $this->DB->buildAndFetch( array(
|
||||
'select' => 't.*, p.poll_only',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
$this->postClass->setTopicData( $this->DB->buildAndFetch( array(
|
||||
'select' => 't.*, p.poll_only',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.forum_id={$fid} AND t.tid={$tid}",
|
||||
'add_join' => array(
|
||||
array(
|
||||
array(
|
||||
'type' => 'left',
|
||||
'from' => array( 'polls' => 'p' ),
|
||||
'where' => 'p.tid=t.tid'
|
||||
@@ -1342,7 +1342,7 @@ class public_forums_ajax_topics extends ipsAjaxCommand
|
||||
if ( IPSText::getTextClass( 'bbcode' )->error )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words[ IPSText::getTextClass( 'bbcode' )->error ] );
|
||||
}
|
||||
}
|
||||
|
||||
$edit_by = '';
|
||||
|
||||
|
||||
Reference in new issue
Block a user