Version 3.4.5

This commit is contained in:
Neo committed 2025-12-19 00:38:12 -08:00
1 parent fb6b5baabc
commit e4478369d8
1360 files changed
+228921 -179445

No files matched your search

@@ -1,198 +1,253 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Forums application initialization
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @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
* @since 14th May 2003
* @version $Rev: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class app_class_forums
{
/**#@+
* Registry Object Shortcuts
*
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor
*
* @param object ipsRegistry reference
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
if ( IN_ACP )
{
try
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 0;
}
catch( Exception $error )
{
IPS_exception_error( $error );
}
}
else
{
try
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 1;
}
catch( Exception $error )
{
IPS_exception_error( $error );
}
}
//---------------------------------------------------
// Grab and cache the topic now as we need the 'f' attr for
// the skins...
//---------------------------------------------------
if ( ! empty( $_GET['showtopic'] ) )
{
/* Load tagging stuff */
if ( ! $this->registry->isClassLoaded('tags') )
{
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
}
$this->request['t'] = intval( $_GET['showtopic'] );
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=' . $this->request['t'],
'add_join' => array( $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) ) ) ) );
$this->DB->execute();
$topic = $this->DB->fetch();
$this->registry->getClass('class_forums')->topic_cache = $topic;
$this->request['f'] = $topic['forum_id'];
/* Update query location */
$this->member->sessionClass()->addQueryKey( 'location_2_id', ipsRegistry::$request['f'] );
}
$this->registry->getClass('class_forums')->forumsInit();
//-----------------------------------------
// Set up moderators
//-----------------------------------------
$this->memberData = IPSMember::setUpModerator( $this->memberData );
/* Other set up for this app */
$this->settings['topic_title_max_len'] = ( $this->settings['topic_title_max_len'] > 2 ) ? $this->settings['topic_title_max_len'] : 2;
}
/**
* Do some set up after ipsRegistry::init()
*
* @return @e void
*/
public function afterOutputInit()
{
if ( !empty( $_GET['showtopic'] ) AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
{
$topic = $this->registry->getClass('class_forums')->topic_cache;
$topic['title_seo'] = ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
/* Check TOPIC permalink... */
$this->registry->getClass('output')->checkPermalink( $topic['title_seo'] );
/* Add canonical tag */
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showtopic=' . $topic['tid'] . '&st=' . $this->request['st'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' ) );
}
else if ( !empty( $_GET['showforum'] ) )
{
$_GET['showforum'] = intval($_GET['showforum']);
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['showforum']);
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
$data['name_seo'] = ( $data['name_seo'] ) ? $data['name_seo'] : IPSText::makeSeoTitle( $data['name'] );
/* Check FORUM permalink... */
$this->registry->getClass('output')->checkPermalink( $data['name_seo'] );
/* Add canonical tag */
if( $data['id'] )
{
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showforum=' . $data['id'] . '&st=' . $this->request['st'] : 'showforum=' . $data['id'], $data['name_seo'], 'showforum' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $data['id'], 'publicNoSession', $data['name_seo'], 'showforum' ) );
}
}
else if ( !empty( $_GET['showannouncement'] ) )
{
$announce = $this->caches['announcements'][ intval( $_GET['showannouncement'] ) ];
if ( $announce['announce_id'] )
{
$_seoTitle = $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
$this->registry->getClass('output')->checkPermalink( $_seoTitle );
/* Add canonical tag */
if( $announce['announce_id'] )
{
$this->registry->getClass('output')->addCanonicalTag( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), $_seoTitle, 'showannouncement' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), 'publicNoSession', $_seoTitle, 'showannouncement' ) );
}
}
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Forums application initialization
* Last Updated: $LastChangedDate: 2012-10-11 15:18:51 -0400 (Thu, 11 Oct 2012) $
* </pre>
*
* @author $Author: mmecham $
* @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
* @since 14th May 2003
* @version $Rev: 11444 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* @author matt
*
*/
class app_class_forums
{
/**#@+
* Registry Object Shortcuts
*
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor
*
* @param object ipsRegistry reference
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
/* Make object */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
if ( IN_ACP )
{
try
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 0;
}
catch( Exception $error )
{
IPS_exception_error( $error );
}
}
else
{
try
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->getClass('class_forums')->strip_invisible = 1;
}
catch( Exception $error )
{
IPS_exception_error( $error );
}
}
//---------------------------------------------------
// Grab and cache the topic now as we need the 'f' attr for
// the skins...
//---------------------------------------------------
if ( ! empty( $_GET['showtopic'] ) )
{
/* Load tagging stuff */
if ( ! $this->registry->isClassLoaded('tags') )
{
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
}
$this->request['t'] = intval( $_GET['showtopic'] );
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=' . $this->request['t'],
'add_join' => array( $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) ) ) ) );
$this->DB->execute();
$topic = $this->DB->fetch();
$this->registry->getClass('class_forums')->topic_cache = $topic;
$this->request['f'] = $topic['forum_id'];
/* Update query location */
$this->member->sessionClass()->addQueryKey( 'location_2_id', ipsRegistry::$request['f'] );
}
$this->registry->getClass('class_forums')->forumsInit();
//-----------------------------------------
// Set up moderators
//-----------------------------------------
$this->memberData = IPSMember::setUpModerator( $this->memberData );
/* Other set up for this app */
$this->settings['topic_title_max_len'] = ( $this->settings['topic_title_max_len'] > 2 ) ? $this->settings['topic_title_max_len'] : 2;
}
/**
* Call back to handle incorrect pages
* @param array $paginationData
*/
public function incorrectPageCallback( $paginationData )
{
/* Topics */
if ( $this->request['section'] == 'topics' && $this->request['t'] )
{
if ( ! $this->request['p'] )
{
/* Page ID higher than possible? */
if ( ( $paginationData['totalItems'] + $paginationData['itemsPerPage'] ) < ( $paginationData['currentStartValue'] + $paginationData['itemsPerPage'] ) )
{
/* Redirect to the last page */
$lastPage = ( $paginationData['totalItems'] > $paginationData['itemsPerPage'] ) ? ( ceil( $paginationData['totalItems'] / $paginationData['itemsPerPage'] ) ) : 1;
$pageParam = ( $lastPage > 1 ) ? '&page=' . $lastPage : '';
$url = $this->registry->output->buildSEOUrl( "showtopic=" . $this->request['t'] . "{$pageParam}", 'public', $this->registry->getClass('class_forums')->topic_cache['title_seo'], 'showtopic' );
$this->registry->getClass('output')->silentRedirect( $url, false, true );
}
else
{
/* Allow the JS to capture this request and check for #entry and redirect if missing (ips.topic.js init())*/
}
}
else
{
/* GO GO FIND POST */
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . "app=forums&amp;module=forums&amp;section=findpost&amp;pid=" . intval( $this->request['p'] ), false, 302 );
}
}
else
{
$this->registry->output->showError( 'page_doesnt_exist', 'acf-ipc-1', null, null, 404 );
}
}
/**
* Do some set up after ipsRegistry::init()
*
* @return @e void
*/
public function afterOutputInit()
{
/* Register a call back for an incorrect page */
$this->registry->getClass('output')->registerIncorrectPageCallback( array( $this, 'incorrectPageCallback' ) );
if ( !empty( $_GET['showtopic'] ) AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
{
$topic = $this->registry->getClass('class_forums')->topic_cache;
$topic['title_seo'] = ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
/* Check to see if we're using old ST params */
$this->registry->getClass('output')->checkStParamsAndRedirect( $this->settings['display_max_posts'] );
/* Check TOPIC permalink... */
$this->registry->getClass('output')->checkPermalink( $topic['title_seo'] );
/* Add canonical tag */
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['page'] ) ? 'showtopic=' . $topic['tid'] . '&page=' . $this->request['page'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' ) );
}
else if ( !empty( $_GET['showforum'] ) )
{
$_GET['showforum'] = intval($_GET['showforum']);
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['showforum']);
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
$data['name_seo'] = ( $data['name_seo'] ) ? $data['name_seo'] : IPSText::makeSeoTitle( $data['name'] );
/* Check to see if we're using old ST params */
$this->registry->getClass('output')->checkStParamsAndRedirect( $this->settings['display_max_topics'] );
/* Check FORUM permalink... */
$this->registry->getClass('output')->checkPermalink( $data['name_seo'] );
/* Add canonical tag */
if( $data['id'] )
{
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['page'] ) ? 'showforum=' . $data['id'] . '&page=' . $this->request['page'] : 'showforum=' . $data['id'], $data['name_seo'], 'showforum' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $data['id'], 'publicNoSession', $data['name_seo'], 'showforum' ) );
}
}
else if ( !empty( $_GET['showannouncement'] ) )
{
$announce = $this->caches['announcements'][ intval( $_GET['showannouncement'] ) ];
if ( $announce['announce_id'] )
{
$_seoTitle = $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
$this->registry->getClass('output')->checkPermalink( $_seoTitle );
/* Add canonical tag */
if( $announce['announce_id'] )
{
$this->registry->getClass('output')->addCanonicalTag( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), $_seoTitle, 'showannouncement' );
/* Store root doc URL */
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&amp;f=' . intval($_GET['f']) : '&amp;f=0' ), 'publicNoSession', $_seoTitle, 'showannouncement' ) );
}
}
}
}
}
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-03-03 13:09:09 -0500 (Thu, 03 Mar 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 7948 $
*/
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Member property updater (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* IP.Board post attachments plugin
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-12-06 17:57:19 -0500 (Thu, 06 Dec 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Core
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 10914 $
* @version $Revision: 11686 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -55,18 +55,18 @@ class plugin_post extends class_attach
IPS_exception_error( $error );
}
/* Load topic class */
if ( ! $this->registry->isClassLoaded('topics') )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
}
$this->registry->getClass('class_forums')->strip_invisible = 1;
$this->registry->getClass('class_forums')->forumsInit();
$this->memberData = IPSMember::setUpModerator( $this->memberData );
}
/* Load topic class */
if ( ! $this->registry->isClassLoaded('topics') )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
}
}
/**
@@ -0,0 +1,100 @@
<?php
/**
* @file bulkMailFilters.php Bulk Mail Filters - Forums App
*
* $Copyright: $
* $License: $
* $Author: mark $
* $LastChangedDate: 2012-02-13 05:07:16 -0500 (Mon, 13 Feb 2012) $
* $Revision: 10290 $
* @since 23rd August 2012
*/
/**
*
* @class bulkMailFilters_forums
* @brief Says what criteria is available for this application
*
*/
class bulkMailFilters_forums
{
public $filters = array( 'posts' );
}
/**
*
* @class bulkMailFilter_forums_posts
* @brief Filter: Post Count
*
*/
class bulkMailFilter_forums_posts extends bulkMailFilter
{
/**
* Get Setting Field
*
* @param mixed Value as returned by the save method
* @return string HTML to show in ACP when adding a reminder that will allow admins to set up a reminder
*/
public function getSettingField( $criteria )
{
$selectBox = ipsRegistry::getClass('output')->formDropdown( 'bmf_forums_posts_type', array(
array( '', $this->lang->words['bmf_ignore'] ),
array( 'l', $this->lang->words['bmf_less'] ),
array( 'e', $this->lang->words['bmf_exactly'] ),
array( 'g', $this->lang->words['bmf_more'] )
), isset( $criteria['type'] ) ? $criteria['type'] : $_POST['bmf_forums_posts_type'] );
$inputBox = ipsRegistry::getClass('output')->formSimpleInput( 'bmf_forums_posts_number', isset( $_POST['bmf_forums_posts_number'] ) ? $_POST['bmf_forums_posts_number'] : isset( $criteria['number'] ) ? $criteria['number'] : '' );
return "{$selectBox} {$inputBox}";
}
/**
* Save Setting Field
*
* @param array POST data from the form using the form elements provided in the getSettingField method
* @return mixed If this criteria should be ignored, return FALSE. Otherwise, return whatever data you will need in your
* getMembers method to fetch members that match the chosen criteria
* @throws Exception You can throw an Exception with the message being the error to display if the user has provided invalid data
*/
public function save( $post )
{
if ( !$post['bmf_forums_posts_type'] )
{
return false;
}
else
{
return array( 'type' => $post['bmf_forums_posts_type'], 'number' => $post['bmf_forums_posts_number'] );
}
}
/**
* Get Members
*
* @param mixed Whatever data was returned by save method
* @return array Array with two elements:
* 'joins' should be an array of any additional tables to join (as per ipsRegistry::DB()->build)
* 'where' should be an array of where clauses
* The table 'members' is already available with the prefix 'm'
*/
public function getMembers( $data )
{
$number = intval($data['number']);
switch ( $data['type'] )
{
case 'g':
return array( 'where' => array( "(m.posts>{$number})" ) );
break;
case 'e':
return array( 'where' => array( "(m.posts={$number})" ) );
break;
case 'l':
return array( 'where' => array( "(m.posts<{$number})" ) );
break;
}
}
}
@@ -1220,7 +1220,15 @@ class feed_forums implements feedBlockInterface
}
$attach_pids[ intval($r['pid']) ] = intval($r['pid']);
$memberIds[ intval($r['lastposter']) ] = intval($r['lastposter']);
if( $config['sortby'] == 'start_date' )
{
$memberIds[ intval($r['topic_starter_id']) ] = intval($r['topic_starter_id']);
}
else
{
$memberIds[ intval($r['lastposter']) ] = intval($r['lastposter']);
}
}
ksort($content);
@@ -1362,7 +1370,14 @@ class feed_forums implements feedBlockInterface
switch( $config['content'] )
{
case 'topics':
$memberRecord = IPSMember::buildDisplayData( $memberData[ $_content['lastposter'] ] );
if( $config['sortby'] == 'start_date' )
{
$memberRecord = IPSMember::buildDisplayData( $memberData[ $_content['topic_starter_id'] ] );
}
else
{
$memberRecord = IPSMember::buildDisplayData( $memberData[ $_content['lastposter'] ] );
}
break;
case 'replies':
@@ -1413,7 +1428,7 @@ class feed_forums implements feedBlockInterface
// Parse
//-----------------------------------------
$_return = $_classAttach->renderAttachments( $htmlToParse, $attach_pids );
$_return = $_classAttach->renderAttachments( $htmlToParse, $attach_pids, 'topic', false );
//-----------------------------------------
// Remerge...
@@ -126,6 +126,7 @@ class plugin_site_poll implements pluginBlockInterface
* @access public
* @param array Block data
* @return string Block HTML to display or cache
* @link http://community.invisionpower.com/resources/bugs.html/_/ip-content/article-comments-pagination-not-working-r38106
*/
public function executePlugin( $block )
{
@@ -161,6 +162,9 @@ class plugin_site_poll implements pluginBlockInterface
return '';
}
$_currentSt = $this->request['st'];
$this->request['st'] = 0;
$this->lang->loadLanguageFile( array( 'public_boards', 'public_topic' ), 'forums' );
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
@@ -198,6 +202,8 @@ class plugin_site_poll implements pluginBlockInterface
$pluginConfig = $this->returnPluginInfo();
$templateBit = $pluginConfig['templateBit'] . '_' . $block['block_id'];
$pollOutput = $topic->_generatePollOutput();
$this->request['st'] = $_currentSt;
ob_start();
$_return = $this->registry->output->getTemplate('ccs')->$templateBit( $block['block_name'], $pollOutput['html'], $tid );
@@ -206,6 +212,8 @@ class plugin_site_poll implements pluginBlockInterface
}
else
{
$this->request['st'] = $_currentSt;
return;
}
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum permissions mappings
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $author$
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -346,9 +346,9 @@ class forumsPermMappingForum
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Item Marking
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -357,7 +357,7 @@ class forumsPermMappingForum
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
class itemMarking__forums
@@ -493,9 +493,9 @@ class itemMarking__forums
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Fetch Skin
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -504,7 +504,7 @@ class itemMarking__forums
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
class fetchSkin__forums
@@ -597,9 +597,9 @@ class fetchSkin__forums
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Library: Handle public session data
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -609,7 +609,7 @@ class fetchSkin__forums
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 12th March 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*/
class publicSessions__forums
@@ -3,10 +3,10 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Core variables extensions
* Defines the reset array, which caches to load, how to recache those caches, and the bitwise array
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-09-12 11:58:11 -0400 (Wed, 12 Sep 2012) $
* </pre>
*
* @author $author$
@@ -15,7 +15,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 11333 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -74,6 +74,7 @@ if ( isset( $_GET['showtopic'] ) OR ( isset($_GET['module']) AND isset($_GET['se
$_LOAD['profilefields'] = 1;
$_LOAD['reputation_levels'] = 1;
$_LOAD['sharelinks'] = 1;
$_LOAD['ipseo_acronyms'] = 1;
}
# Forum
@@ -86,6 +87,7 @@ if ( isset( $_GET['showforum'] ) OR ( isset($_GET['module']) AND isset($_GET['se
$_LOAD['badwords'] = 1;
$_LOAD['emoticons'] = 1;
$_LOAD['bbcode'] = 1;
$_LOAD['ipseo_acronyms'] = 1;
}
# POST and RULES
@@ -96,6 +98,7 @@ if ( isset($_GET['module']) AND ( $_GET['module'] == 'post' OR $_GET['module'] =
$_LOAD['emoticons'] = 1;
$_LOAD['ranks'] = 1;
$_LOAD['reputation_levels'] = 1;
$_LOAD['ipseo_acronyms'] = 1;
}
# ANNOUNCEMENT
@@ -154,7 +157,11 @@ $_BITWISE = array( 'moderators' => array( 'bw_flag_spammers',
'bw_mod_soft_delete',
'bw_mod_un_soft_delete',
'bw_mod_soft_delete_see',
'bw_can_toggle_answered_post'
),
'forums' => array( 'bw_disable_tagging',
'bw_disable_prefixes' ),
'posts' => array( 'bw_post_from_mobile' ) );
'bw_disable_prefixes',
'bw_enable_answers',
'bw_enable_answers_member' ),
'posts' => array( 'bw_post_from_mobile', 'bw_post_answered' ) );
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Define data hook locations (Forums)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
$dataHookLocations = array(
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* BBCode Management : Determines if bbcode can be used in this section
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*
*/
@@ -0,0 +1,68 @@
<?php
/**
* @file emailLists.php Forums Email Lists Extension
*
* $Copyright: $
* $License: $
* $Author: mark $
* $LastChangedDate: 2012-06-20 05:50:23 -0400 (Wed, 20 Jun 2012) $
* $Revision: 10952 $
* @since 11th June 2012
*/
/**
*
* @class emailLists_forums
* @brief Forums Email Lists Extension
*
*/
class emailLists_forums
{
/**
* Get Form Data
*
* @return array
*/
public function getFormData( $current )
{
/* Return */
return array(
'posts' => array(
"Number of posts is",
ipsRegistry::getClass('output')->formDropdown( 'forums-posts_1', array( array( 'l', "Less Than" ), array( 'e', "Equal to" ), array( 'g', "Greater Than" ) ), ( empty( $current ) ) ? 'l' : $current['posts_1'] ) .
ipsRegistry::getClass('output')->formSimpleInput( 'forums-posts_2', ( empty( $current ) ) ? '' : $current['posts_2'] )
)
);
}
/**
* Get Query Data
*
* @param array Rules
* @return array Query Data
*/
public function getQueryData( $rules )
{
$return = array();
if ( $rules['posts_2'] !== '' )
{
switch ( $rules['posts_1'] )
{
case 'l':
$return['where'][] = "( members.posts<{$rules['posts_2']} )";
break;
case 'g':
$return['where'][] = "( members.posts>{$rules['posts_2']} )";
break;
case 'w':
$return['where'][] = "( members.posts={$rules['posts_2']} )";
break;
}
}
return $return;
}
}
@@ -1,205 +1,209 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* RSS output plugin :: posts
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @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
* @since 6/24/2008
* @version $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class furlRedirect_forums
{
/**
* Key type: Type of action (topic/forum)
*
* @var string
*/
protected $_type = '';
/**
* Key ID
*
* @var int
*/
protected $_id = 0;
/**
* Constructor
*
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings =& $registry->fetchSettings();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
/**
* Set the key ID
*
* @param string Type
* @param mixed Value
* @return @e void
*/
public function setKey( $name, $value )
{
$this->_type = $name;
$this->_id = $value;
}
/**
* Set up the key by URI
*
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
* @return @e boolean
*/
public function setKeyByUri( $uri )
{
$uri = str_replace( '&amp;', '&', $uri );
if ( strstr( $uri, '?' ) )
{
list( $_chaff, $uri ) = explode( '?', $uri );
}
foreach( explode( '&', $uri ) as $bits )
{
list( $k, $v ) = explode( '=', $bits );
if ( $k )
{
if ( $k == 'showtopic' )
{
$this->setKey( 'topic', intval( $v ) );
return TRUE;
}
else if( $k == 'act' AND $v == 'ST' )
{
$this->setKey( 'topic', intval( $_REQUEST['t'] ) );
return TRUE;
}
else if ( $k == 'showforum' )
{
$this->setKey( 'forum', intval( $v ) );
return TRUE;
}
else if( $k == 'showannouncement' )
{
$this->setKey( 'announcement', intval( $v ) );
return TRUE;
}
}
}
return FALSE;
}
/**
* Return the SEO title
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function fetchSeoTitle()
{
switch ( $this->_type )
{
default:
return FALSE;
break;
case 'topic':
return $this->_fetchSeoTitle_topic();
break;
case 'forum':
return $this->_fetchSeoTitle_forum();
break;
case 'announcement':
return $this->_fetchSeoTitle_announcement();
break;
}
}
/**
* Return the SEO title for a topic
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_topic()
{
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
'from' => 'topics',
'where' => 'tid=' . intval( $this->_id ) ) );
if ( $topic['tid'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
{
return FALSE;
}
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
}
return FALSE;
}
/**
* Return the SEO title for a forum
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_forum()
{
$forum = $this->registry->getClass('class_forums')->getForumById( intval( $this->_id ) );
if ( $forum['id'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
{
return FALSE;
}
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
}
return FALSE;
}
/**
* Return the SEO title for an announcement
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_announcement()
{
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
if ( $announce['announce_id'] )
{
return $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
}
return FALSE;
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* RSS output plugin :: posts
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
* @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
* @since 6/24/2008
* @version $Revision: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class furlRedirect_forums
{
/**
* Key type: Type of action (topic/forum)
*
* @var string
*/
protected $_type = '';
/**
* Key ID
*
* @var int
*/
protected $_id = 0;
/**
* Constructor
*
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
$this->registry = $registry;
$this->DB = $registry->DB();
$this->settings =& $registry->fetchSettings();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
}
/**
* Set the key ID
*
* @param string Type
* @param mixed Value
* @return @e void
*/
public function setKey( $name, $value )
{
$this->_type = $name;
$this->_id = $value;
}
/**
* Set up the key by URI
*
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
* @return @e boolean
*/
public function setKeyByUri( $uri )
{
$uri = str_replace( '&amp;', '&', $uri );
if ( strstr( $uri, '?' ) )
{
list( $_chaff, $uri ) = explode( '?', $uri );
}
foreach( explode( '&', $uri ) as $bits )
{
list( $k, $v ) = explode( '=', $bits );
if ( $k )
{
if ( $k == 'showtopic' )
{
$this->setKey( 'topic', intval( $v ) );
return TRUE;
}
else if( $k == 'act' AND $v == 'ST' )
{
$this->setKey( 'topic', intval( $_REQUEST['t'] ) );
return TRUE;
}
else if ( $k == 'showforum' )
{
$this->setKey( 'forum', intval( $v ) );
return TRUE;
}
else if( $k == 'showannouncement' )
{
$this->setKey( 'announcement', intval( $v ) );
return TRUE;
}
}
}
return FALSE;
}
/**
* Return the SEO title
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function fetchSeoTitle()
{
switch ( $this->_type )
{
default:
return FALSE;
break;
case 'topic':
return $this->_fetchSeoTitle_topic();
break;
case 'forum':
return $this->_fetchSeoTitle_forum();
break;
case 'announcement':
return $this->_fetchSeoTitle_announcement();
break;
}
}
/**
* Return the SEO title for a topic
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_topic()
{
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
'from' => 'topics',
'where' => 'tid=' . intval( $this->_id ) ) );
if ( $topic['tid'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
{
return FALSE;
}
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
}
return FALSE;
}
/**
* Return the SEO title for a forum
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_forum()
{
$forum = $this->registry->getClass('class_forums')->getForumById( intval( $this->_id ) );
if ( $forum['id'] )
{
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
{
return FALSE;
}
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
}
return FALSE;
}
/**
* Return the SEO title for an announcement
*
* @return @e mixed The SEO friendly name or boolean false
*/
public function _fetchSeoTitle_announcement()
{
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
if ( $announce['announce_id'] )
{
return $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
}
return FALSE;
}
}
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Sets up SEO templates
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-07-31 09:39:50 -0400 (Tue, 31 Jul 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @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
* @since 20th February 2002
* @version $Rev: 10914 $
* @version $Rev: 11159 $
*
*/
@@ -49,33 +49,22 @@ $_SEOTEMPLATES = array(
'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1-#{__title__}/$4' ),
'in' => array( 'regex' => '#/forum-(\d+?)?/announcement-(\d+?)-#i',
'in' => array( 'regex' => '#/forum-(\d+?)?/announcement-(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),
'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'isPagesMode' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/forum/(\d+?)-#i',
'in' => array( 'regex' => '#^/forum/(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showforum', '$1' ) ) ) ),
'showtopicunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnewpost(&|$)#i', 'topic/$1-#{__title__}/unread/$2' ),
'in' => array( 'regex' => '#^/topic/(\d+?)-([^/]+?)/unread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnewpost' ) ) ) ),
'showtopicnextunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnextunread(&|$)#i', 'topic/$1-#{__title__}/nextunread/$2' ),
'in' => array( 'regex' => '#^/topic/(\d+?)-([^/]+?)/nextunread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnextunread' ) ) ) ),
'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'isPagesMode' => 1,
'out' => array( '#showtopic=(.+?)(\#|&|$)#i', 'topic/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/topic/(\d+?)-#i',
'in' => array( 'regex' => '#^/topic/(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
'acteqst' => array( 'app' => 'forums',
@@ -0,0 +1,82 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Sets up SEO templates
* Last Updated: $Date: 2012-07-31 09:39:50 -0400 (Tue, 31 Jul 2012) $
* </pre>
*
* @author $Author: mmecham $
* @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
* @since 20th February 2002
* @version $Rev: 11159 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
/**
* SEO templates
*
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
*
* OUT FORMAT REGEX:
* First array element is a regex to run to see if we've a match for the URL
* The second array element is the template to use the results of the parenthesis capture
*
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
*
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
*
* IN FORMAT REGEX
*
* This allows the registry to piece back together a URL based on the template regex
* So, for example: "/user/(\d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
* of the parenthesis capture #1
*/
$_SEOTEMPLATES = array(
'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1/$4' ),
'in' => array( 'regex' => '#/forum-(\d+?)?/announcement-(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),
'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'isPagesMode' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1/$2' ),
'in' => array( 'regex' => '#^/forum/(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showforum', '$1' ) ) ) ),
'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'isPagesMode' => 1,
'out' => array( '#showtopic=(.+?)(\#|&|$)#i', 'topic/$1/$2' ),
'in' => array( 'regex' => '#^/topic/(\d+?)(?:-|/|$)#i',
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
'acteqst' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#act=ST(.*?)&t=(.+?)(&|$)#i', 'topic/$2/$3' ),
'in' => array( 'regex' => '#^notavalidrequest$#i',
'matches' => array( array( 'showtopic', '0' ) ) ) ),
'act=idx' => array( 'app' => 'forums',
'allowRedirect' => 0,
'out' => array( '#act=idx(&|$)#i', 'index$1' ),
'in' => array( 'regex' => '#^/index(/|$|\?)#i',
'matches' => array( array( 'act', 'idx' ) ) ) ),
);
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* $Author: mmecham $
* @since 15th Feb 2011
* $LastChangedDate: 2012-06-20 06:37:39 -0400 (Wed, 20 Jun 2012) $
* @version v3.3.4
* $Revision: 10955 $
* $LastChangedDate: 2013-03-26 11:49:49 -0400 (Tue, 26 Mar 2013) $
* @version v3.4.5
* $Revision: 12124 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -132,7 +132,7 @@ class like_forums_forums_composite extends classes_like_composite
public function notificationCanSend( $metaData )
{
$group = $this->caches['group_cache'][ $metaData['member_group_id'] ];
/* Can only see own topics? */
if ( ! $group['g_other_topics'] )
{
@@ -141,12 +141,22 @@ class like_forums_forums_composite extends classes_like_composite
}
$forum = $this->registry->getClass('class_forums')->getForumById( $metaData['like_rel_id'] );
/* Set member */
$this->registry->getClass('class_forums')->setMemberData( $metaData );
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
$_member = $this->registry->getClass('class_forums')->getMemberData();
/* Can only see own topics - forum override?
@link http://community.invisionpower.com/resources/bugs.html/_/ip-board/notifcations-can-view-others-topics-r39414 */
if ( ! $forum['can_view_others'] && ! ( $_member['g_is_supmod'] || isset( $_member['forumsModeratorData'][ $forum['id'] ] ) ) )
{
return false;
}
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
/* reset */
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
@@ -190,7 +200,7 @@ class like_forums_forums_composite extends classes_like_composite
{
return false;
}
/* build email unless cached */
if ( empty( $this->_cache['bndf'][ $forum['id'] ] ) )
{
@@ -225,7 +235,7 @@ class like_forums_forums_composite extends classes_like_composite
}
/* Process it */
$main_output = $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
$main_output = $this->lang->words['follow_forum'] . ": " . $forum['name'] . "<br />"
. "=====================================<br />"
. $post_output
. "<br />=====================================<br />";
@@ -4,10 +4,10 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* $LastChangedDate: 2012-06-20 06:37:39 -0400 (Wed, 20 Jun 2012) $
* @version v3.3.4
* $Revision: 10955 $
* $Author: bfarber $
* $LastChangedDate: 2012-12-04 18:13:22 -0500 (Tue, 04 Dec 2012) $
* @version v3.4.5
* $Revision: 11679 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -237,7 +237,7 @@ class like_forums_topics_composite extends classes_like_composite
}
/* Process it */
$main_output .= $this->lang->words['follow_topic'] . ": " . $topic['title'] . " (" . $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
$main_output .= $this->lang->words['follow_topic'] . ": " . $topic['title'] . " (" . $this->lang->words['follow_forum'] . ": " . $forum['name'] . ")<br />"
. $tFurl . "<br />"
. "=====================================<br />"
. $post_output
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum permissions mappings
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $author$
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -32,7 +32,7 @@ if ( ! defined( 'IN_IPB' ) )
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
class forumsMemberSync
{
@@ -6,9 +6,9 @@
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 2/18/2011
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
* $LastChangedDate: 2013-04-26 17:18:56 -0400 (Fri, 26 Apr 2013) $
* @version v3.4.5
* $Revision: 12203 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -212,9 +212,9 @@ class plugin_forums_announcements
protected function _delete()
{
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 10311902, null, null, 403 );
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 10311902, null, null, 403 );
}
$announce_id = intval( $this->request['announce_id'] );
@@ -322,9 +322,9 @@ class plugin_forums_announcements
protected function _save( $type='add' )
{
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 10311903, null, null, 403 );
if ( $this->request['secure_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 10311903, null, null, 403 );
}
//-----------------------------------------
@@ -408,6 +408,11 @@ class plugin_forums_announcements
$editor = new $classToLoad();
$editor->setAllowBbcode( true );
$editor->setAllowHtml( intval($this->request['announce_html_enabled']) );
if ( intval($this->request['announce_html_enabled']) )
{
$editor->setBypassHtmlPurify( true );
}
$announceContent = $editor->process( $_POST['announce_post'] );
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* $Author: ips_terabyte $
* @since 2/15/2011
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
* $LastChangedDate: 2012-05-22 13:10:11 -0400 (Tue, 22 May 2012) $
* @version v3.4.5
* $Revision: 10783 $
*/
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* $Author: ips_terabyte $
* @since 2/15/2011
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
* $LastChangedDate: 2012-05-22 13:10:11 -0400 (Tue, 22 May 2012) $
* @version v3.4.5
* $Revision: 10783 $
*/
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* $Author: mark $
* @since 2/15/2011
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
* @version v3.3.4
* $Revision: 8930 $
* $LastChangedDate: 2012-09-21 10:15:19 -0400 (Fri, 21 Sep 2012) $
* @version v3.4.5
* $Revision: 11360 $
*/
@@ -151,7 +151,9 @@ class plugin_forums_unapprovedposts
'sortOrder' => 'desc',
'parse' => true,
'limit' => 10,
'offset' => $st
'offset' => $st,
'onlyViewable' => true,
'skipForumCheck'=> false
) );
$this->registry->getClass('topics')->setPermissionData();
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* $Author: mark $
* @since 2/15/2011
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
* $LastChangedDate: 2012-09-21 10:15:19 -0400 (Fri, 21 Sep 2012) $
* @version v3.4.5
* $Revision: 11360 $
*/
@@ -161,14 +161,16 @@ class plugin_forums_unapprovedtopics
'sortField' => 'tid',
'sortOrder' => 'desc',
'limit' => 10,
'offset' => $st
'offset' => $st,
'onlyViewable' => true,
'skipForumCheck'=> false
) );
$this->registry->getClass('topics')->setPermissionData();
$topics = $this->registry->getClass('topics')->getTopics( $_filters );
$total = $this->registry->getClass('topics')->getTopicsCount();
$final = array();
//-----------------------------------------
// Format data
//-----------------------------------------
@@ -6,7 +6,7 @@
* $Author: ips_terabyte $
* @since 3/8/2011
* $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8229 $
*/
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Define the core notification types
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -15,7 +15,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Config for posts plugin
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Profile Plugin Library
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-10-08 13:24:39 -0400 (Mon, 08 Oct 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: AndyMillne $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 11421 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -111,89 +111,93 @@ class profile_posts extends profile_plugin_parent
if ( $this->settings['search_ucontent_days'] )
{
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND p.post_date > ' . $date_cut;
$_date_cut = ( $member['last_post'] ? $member['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND p.post_date > ' . $_date_cut;
}
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' );
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
$this->DB->build( array(
'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => $_queued . " AND " . $_approved . " AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 'p.pid DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins
) );
$o = $this->DB->execute();
while( $row = $this->DB->fetch( $o ) )
/* Let's just run this if the member has posted within the cutoff period */
if ( $member['last_post'] > $_date_cut )
{
$pids[ $row['pid'] ] = $row['pid'];
$this->DB->build( array(
'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => $_queued . " AND " . $_approved . " AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 'p.pid DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins
) );
$o = $this->DB->execute();
if( $row['topic_hasattach'] )
while( $row = $this->DB->fetch( $o ) )
{
$parseAttachments = true;
}
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$pids[ $row['pid'] ] = $row['pid'];
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
if( $row['topic_hasattach'] )
{
$parseAttachments = true;
}
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
}
else
{
$row['post'] = $row['cache_content'];
}
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&amp;view=findpost&amp;p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $this->lang->words['profile_in_topic'] . $row['title'] );
}
else
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ( $parseAttachments AND !is_object( $this->class_attach ) )
{
$row['post'] = $row['cache_content'];
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->type = 'post';
$this->class_attach->init();
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
//-----------------------------------------
// Macros...
//-----------------------------------------
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&amp;view=findpost&amp;p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $this->lang->words['profile_in_topic'] . $row['title'] );
$content = $this->registry->output->replaceMacros( $content );
}
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ( $parseAttachments AND !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 );
$this->class_attach->type = 'post';
$this->class_attach->init();
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
//-----------------------------------------
// Macros...
//-----------------------------------------
$content = $this->registry->output->replaceMacros( $content );
}
//-----------------------------------------
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Config for topics plugin
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Profile Plugin Library
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-10-08 13:24:39 -0400 (Mon, 08 Oct 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: AndyMillne $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 11421 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -110,94 +110,98 @@ class profile_topics extends profile_plugin_parent
if ( $this->settings['search_ucontent_days'] )
{
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND t.start_date > ' . $date_cut;
$_date_cut = ( $member['last_post'] ? $member['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
$date_cut = ' AND t.start_date > ' . $_date_cut;
}
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => "t.starter_id={$member['member_id']} AND {$_approved} AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 't.start_date DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins ) );
$o = $this->DB->execute();
/* Let's just run this if the member has posted within the cutoff period */
if ( $member['last_post'] > $_date_cut )
{
$this->DB->build( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => "t.starter_id={$member['member_id']} AND {$_approved} AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
'order' => 't.start_date DESC',
'limit' => array( 0, $last_x ),
'add_join' => $_post_joins ) );
$o = $this->DB->execute();
while( $row = $this->DB->fetch( $o ) )
{
while( $row = $this->DB->fetch( $o ) )
{
//-----------------------------------------
// Ghost topics... BOO
//-----------------------------------------
if( !$row['pid'] )
{
continue;
}
$pids[ $row['pid'] ] = $row['pid'];
if( $row['topic_hasattach'] )
{
$parseAttachments = true;
}
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
}
else
{
$row['post'] = $row['cache_content'];
}
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&amp;view=findpost&amp;p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $row['title'] );
}
//-----------------------------------------
// Ghost topics... BOO
// Attachments (but only if necessary)
//-----------------------------------------
if( !$row['pid'] )
if ( $parseAttachments AND !is_object( $this->class_attach ) )
{
continue;
}
$pids[ $row['pid'] ] = $row['pid'];
if( $row['topic_hasattach'] )
{
$parseAttachments = true;
}
if ( ! $row['cache_content'] )
{
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $row['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $row['mgroup_others'];
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
$this->class_attach = new $classToLoad( $this->registry );
$this->class_attach->type = 'post';
$this->class_attach->init();
$row['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
IPSContentCache::update( $row['pid'], 'post', $row['post'] );
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
else
{
$row['post'] = $row['cache_content'];
}
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
$row['_raw_date'] = $row['post_date'];
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
//-----------------------------------------
// Macros...
//-----------------------------------------
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&amp;view=findpost&amp;p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $row['title'] );
$content = $this->registry->output->replaceMacros( $content );
}
//-----------------------------------------
// Attachments (but only if necessary)
//-----------------------------------------
if ( $parseAttachments AND !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 );
$this->class_attach->type = 'post';
$this->class_attach->init();
if ( IPSMember::checkPermissions('download') === false )
{
$this->settings['show_img_upload'] = 0;
}
$content = $this->class_attach->renderAttachments( $content, $pids );
$content = $content[0]['html'];
}
//-----------------------------------------
// Macros...
//-----------------------------------------
$content = $this->registry->output->replaceMacros( $content );
}
//-----------------------------------------
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Report Center :: Posts plugin
* Last Updated: $LastChangedDate: 2012-06-26 07:24:43 -0400 (Tue, 26 Jun 2012) $
* Last Updated: $LastChangedDate: 2013-05-08 17:43:20 -0400 (Wed, 08 May 2013) $
* </pre>
*
* @author $Author: AndyMillne $
* @author $Author: bfarber $
* @author Based on original "Report Center" by Luke Scott
* @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 $Rev: 10987 $
* @version $Rev: 12240 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -155,6 +155,7 @@ class post_plugin
{
if( ( $this->memberData['g_is_supmod'] == 1 && ( ! isset($this->_extra['report_supermod']) || $this->_extra['report_supermod'] == 1 ) ) )
{
$to_return['exdat1'] = array_keys( $this->registry->class_forums->forum_by_id ); // Bug 38315
return true;
}
else
@@ -291,7 +292,7 @@ class post_plugin
}
$data = $this->DB->buildAndFetch( array(
'select' => 'p.post',
'select' => 'p.post, p.post_date, p.pid',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=' . $post_id,
'add_join' => array(
@@ -310,17 +311,19 @@ class post_plugin
)
) );
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 0;
IPSText::getTextClass('bbcode')->parsing_section = 'global';
/* Load parser */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$parser = new $classToLoad();
$message = "[quote name='" . IPSText::getTextClass('bbcode')->makeQuoteSafe( $data['members_display_name'] ) . "']";
$message .= IPSText::getTextClass('bbcode')->preEditParse( $data['post'] );
$message .= "[/quote]\n\n";
$message .= $this->request['message'];
$parser->set( array( 'parseArea' => 'reports',
'memberData' => $this->memberData,
'parseBBCode' => true,
'parseHtml' => false,
'parseEmoticons' => true ) );
$message = $this->registry->output->parseIPSTags( $parser->buildQuoteTag( $data['post'], $data['members_display_name'], $data['post_date'], 0, $data['pid'] ) );
$message .= $this->request['message'];
$this->DB->build( array( 'select' => 'id', 'from' => 'rc_reports_index', 'where' => "uid='{$uid}'" ) );
$this->DB->execute();
@@ -351,18 +354,18 @@ class post_plugin
{
$the_report = $this->DB->fetch();
$rid = $the_report['id'];
$this->DB->update( 'rc_reports_index', array( 'date_updated' => time(), 'status' => $status['new'], 'seoname' => $data['title_seo'], 'seotemplate' => 'showtopic' ), "id='{$rid}'" );
$this->DB->update( 'rc_reports_index', array( 'date_updated' => time(), 'status' => $status['new'], 'seoname' => $data['title_seo'], 'seotemplate' => 'showtopic', 'updated_by' => $this->memberData['member_id'] ), "id='{$rid}'" );
}
/* Load editor stuff */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
$editor = new $classToLoad();
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'reports';
$editor->setLegacyMode(false);
$build_report = array(
'rid' => $rid,
'report' => IPSText::getTextClass('bbcode')->preDbParse( $message ),
'report' => $editor->process( $message ),
'report_by' => $this->memberData['member_id'],
'date_reported' => time(),
);
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Reputation configuration for application
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-04 20:26:37 -0400 (Sat, 04 May 2013) $
* </pre>
*
* @author $author$
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12227 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -48,7 +48,7 @@ class reputation_forums
*
* @param string 'given' if we want to return items as user has liked
* 'received' if we want to fetch items a user has posted that others have liked
'most' if we want to fetch 'most' repped items
* 'most' if we want to fetch 'most' repped items
* @param array Member this applies to
*
* @return array Parameters to pass to ipsRegistry::DB()->build
@@ -74,7 +74,7 @@ class reputation_forums
'where' => 'p.queued=' . ipsRegistry::getClass('class_forums')->fetchPostHiddenFlag( 'visible' ),
'add_join' => array( array( 'select' => '',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id AND t.approved=' . ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'visible' ) . ' AND ' . ( empty( $allowedForumIDs ) ? '1=0' : ipsRegistry::DB()->buildWherePermission( $allowedForumIDs, 't.forum_id', FALSE ) ),
'where' => 't.tid=p.topic_id AND t.approved=' . ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'visible' ) . ' AND ' . ( empty( $allowedForumIDs ) ? '1=0' : "t.forum_id IN(" . implode( ',', $allowedForumIDs ) . ")" ),
'type' => 'inner' ) ) # join must be INNER to prevent loading ALL the post IDs without a matching topic row
),
/* Used in second query to fetch actual data */
@@ -87,10 +87,8 @@ class reputation_forums
array( 'select' => 't.*, t.title as topic_title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid' ),
array( 'select' => 'f.*',
'from' => array( 'forums' => 'f' ),
'where' => 'f.id=t.forum_id' ) )
);
)
);
}
else
{
@@ -129,7 +127,7 @@ class reputation_forums
" t.tid<>0 AND " . // is valid
"t.approved=" . ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'visible' ) . " AND " . // topic is visible
"p.queued=" . ipsRegistry::getClass('class_forums')->fetchPostHiddenFlag( 'visible' ) . " AND " . // post is visible
( empty( $allowedForumIDs ) ? '1=0' : ipsRegistry::DB()->buildWherePermission( $allowedForumIDs, 't.forum_id', FALSE ) ), // we have permission to view
( empty( $allowedForumIDs ) ? '1=0' : "t.forum_id IN(" . implode( ',', $allowedForumIDs ) . ")" ), // we have permission to view
);
}
}
@@ -194,7 +192,7 @@ class reputation_forums
*/
public function display( $results )
{
return ipsRegistry::getClass('output')->getTemplate( 'profile' )->tabReputation_posts( $results );
return ipsRegistry::getClass('output')->getTemplate('profile')->tabReputation_posts( $results );
}
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* RSS output plugin :: posts
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Config file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $author$
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Basic Forum Search
* Last Updated: $Date: 2012-06-29 18:12:03 -0400 (Fri, 29 Jun 2012) $
* Last Updated: $Date: 2013-04-29 20:59:30 -0400 (Mon, 29 Apr 2013) $
* </pre>
*
* @author $Author: AndyMillne $
* @author $Author: bfarber $
* @copyright © 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 $Rev: 11014 $
* @version $Rev: 12207 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -462,7 +462,7 @@ class search_engine_forums extends search_engine
}
}
return array( 'count' => count( $tids ), 'resultSet' => $tids );
return array( 'count' => count( $rows ), 'resultSet' => $tids );
}
}
}
@@ -613,10 +613,12 @@ class search_engine_forums extends search_engine
$this->sphinxClient->SetLimits( intval($start), intval($perPage) );
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );
$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );
if( $this->memberData['member_id'] != $member['member_id'] )
{
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );
$this->sphinxClient->SetFilter( 'forum_id', $forumIdsOk );
}
/* what we doing? */
if ( IPSSearchRegistry::get('in.userMode') != 'title' )
{
@@ -960,22 +962,29 @@ class search_engine_forums extends search_engine
return array( 'count' => 0, 'resultSet' => array() );
}
$this->DB->build( array( 'select' => 'topic_id',
'from' => 'posts',
'where' => 'pid IN(' . implode( ',', $data['resultSet'] ) . ')' ) );
$this->DB->execute();
$_tmpTids = array();
while( $row = $this->DB->fetch() )
if( IPSSearchRegistry::get('set.returnType') == 'pids' )
{
$_tmpTids[] = $row['topic_id'];
$this->DB->build( array( 'select' => 'topic_id',
'from' => 'posts',
'where' => 'pid IN(' . implode( ',', $data['resultSet'] ) . ')' ) );
$this->DB->execute();
$_tmpTids = array();
while( $row = $this->DB->fetch() )
{
$_tmpTids[] = $row['topic_id'];
}
if ( count( $_tmpTids ) )
{
$where[] = "( tid IN(" . implode( ',', $_tmpTids ) . ')' . $_ffWhere . ' )';
}
}
if ( count( $_tmpTids ) )
else
{
$where[] = "( tid IN(" . implode( ',', $_tmpTids ) . ')' . $_ffWhere . ' )';
$where[] = "( tid IN(" . implode( ',', $data['resultSet'] ) . ')' . $_ffWhere . ' )';
}
}
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Basic Forum Search
* Last Updated: $Date: 2012-07-05 11:04:28 -0400 (Thu, 05 Jul 2012) $
* Last Updated: $Date: 2013-05-21 20:51:17 -0400 (Tue, 21 May 2013) $
* </pre>
*
* @author $Author: mmecham $
* @author $Author: bfarber $
* @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 $Rev: 11035 $
* @version $Rev: 12263 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -48,7 +48,7 @@ class search_engine_forums extends search_engine
}
/* Get live or archive */
$this->searchArchives = ( ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive'] == 'archive' ) ? true : false;
$this->searchArchives = ( isset(ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive']) && ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive'] == 'archive' ) ? true : false;
if ( $this->searchArchives )
{
@@ -173,6 +173,7 @@ class search_engine_forums extends search_engine
'where' => $this->_buildWhereStatement( $search_term, IPSSearchRegistry::searchTitleOnly(), '', null, ( IPSSearchRegistry::get('opt.searchType') == 'content' || IPSSearchRegistry::get('in.search_author') ) ? false : true ),
'limit' => array(0, IPSSearchRegistry::get('set.hardLimit') + 1),
'order' => $sortKey . ' ' . $sort_order,
'group' => ( $this->settings['forum_search_groupby'] AND IPSSearchRegistry::get('opt.noPostPreview') ) ? "p.topic_id" : '',
'add_join' => array( array( 'select' => 't.title, t.posts, t.views',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.'.$this->table['topic_id'],
@@ -180,6 +181,8 @@ class search_engine_forums extends search_engine
}
else
{
IPSSearchRegistry::set('set.returnType', 'tids' );
/* Do the search */
$this->DB->build( array(
'select' => "t.tid as id, t.tid as topic_id, t.title, t.posts, t.views, t.last_post",
@@ -228,12 +231,12 @@ class search_engine_forums extends search_engine
$_tagIds[] = $data['tag_meta_id'];
}
$this->DB->build( array('select' => "t.tid as id, t.tid as topic_id, t.title, t.posts, t.views, t.last_post",
$this->DB->build( array('select' => "t.tid as id, t.tid as topic_id, t.title, t.posts, t.views, t.last_post, t.topic_firstpost",
'from' => array( 'topics' => 't' ),
'where' => 't.tid IN (' . implode( ",", $_tagIds ) . ')',
'where' => 't.tid IN (' . implode( ",", $_tagIds ) . ') AND ' . $this->_buildWhereStatement( $search_term, IPSSearchRegistry::searchTitleOnly() ),
'limit' => array(0, IPSSearchRegistry::get('set.hardLimit') + 1),
'order' => 't.'.str_replace( 'post_date', 'topic_firstpost', $sortKey ) . ' ' . $sort_order,
'add_join' => array( array( 'select' => 'p.'.$this->table['pid'],
'order' => 't.'.str_replace( 'post_date', 'last_post', $sortKey ) . ' ' . $sort_order,
'add_join' => array( array( 'select' => 'p.' . $this->table['post_date'] . ', p.'.$this->table['pid'],
'from' => array( $this->table['_table_'] => 'p' ),
'where' => 'p.'.$this->table['pid'].'=t.topic_firstpost',
'type' => 'left' ) ) ) );
@@ -268,14 +271,14 @@ class search_engine_forums extends search_engine
}
/* Set vars */
IPSSearch::$ask = $sortKey;
IPSSearch::$ask = ( IPSSearchRegistry::get('set.returnType') == 'tids' ) ? 'last_post' : $this->table['post_date'];
IPSSearch::$aso = strtolower( $sort_order );
IPSSearch::$ast = $sortType;
/* Sort */
if ( count( $_rows ) )
{
usort( $_rows, array("IPSSearch", "usort") );
//usort( $_rows, array("IPSSearch", "usort") ); See http://community.invisionpower.com/resources/bugs.html/_/ip-board/incorrect-search-order-of-topic-list-r40835
/* Build result array */
foreach( $_rows as $r )
@@ -310,9 +313,10 @@ class search_engine_forums extends search_engine
* @return nothin'
*/
public function viewUserContent( $member )
{
{
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$followedOnly = $this->memberData['member_id'] ? IPSSearchRegistry::get('in.vncFollowFilterOn' ) : false;
switch( IPSSearchRegistry::get('in.userMode') )
{
@@ -361,18 +365,60 @@ class search_engine_forums extends search_engine
$perPage = IPSSearchRegistry::get('opt.search_per_page');
/* Get list of good forum IDs */
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );
$forumIdsOk = array();
if( $this->memberData['member_id'] != $member['member_id'] )
{
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] );
}
/* Only show VNC results from specified forums? */
if( is_array(IPSSearchRegistry::get('forums.vncForumFilters')) AND count(IPSSearchRegistry::get('forums.vncForumFilters')) )
{
$_newIdsOk = array();
foreach( IPSSearchRegistry::get('forums.vncForumFilters') as $forumId )
{
if( in_array( $forumId, $forumIdsOk ) )
{
$_newIdsOk[] = $forumId;
}
}
$forumIdsOk = $_newIdsOk;
}
/* Fetch forum rel ids */
if ( $followedOnly )
{
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$like = classes_like::bootstrap( 'forums', 'topics' );
$followedTopics = $like->getDataByMemberIdAndArea( $this->memberData['member_id'] );
$followedTopics = ( $followedTopics === null ) ? array() : array_keys( $followedTopics );
if ( ! count( $followedTopics ) )
{
/* Return it */
return array( 'count' => 0, 'resultSet' => array() );
}
$topic_where[] = ( "t.tid IN (" . implode( ',', $followedTopics ) . ")" );
}
//-----------------------------------------
// No forums?
//-----------------------------------------
if( !count( $forumIdsOk ) )
{
return array( 'count' => 0, 'resultSet' => array() );
}
$topic_where[] = "t.forum_id IN (" . implode( ",", $forumIdsOk ) . ")";
if( $this->memberData['member_id'] != $member['member_id'] )
{
if( !count( $forumIdsOk ) )
{
return array( 'count' => 0, 'resultSet' => array() );
}
$topic_where[] = "t.forum_id IN (" . implode( ",", $forumIdsOk ) . ")";
}
if ( IPSSearchRegistry::get('in.userMode') != 'title' )
{
@@ -439,7 +485,13 @@ class search_engine_forums extends search_engine
/* Not archives */
$topic_where[] = $this->registry->class_forums->fetchTopicArchiveQuery( array('not', 'exclude' ), 't.' );
/* Searching by time period */
if ( IPSSearchRegistry::get('in.period_in_seconds') )
{
$topic_where[] = "t.last_post > " . ( IPS_UNIX_TIME_NOW - IPSSearchRegistry::get('in.period_in_seconds') );
}
/* Manual fetch if user content all */
if ( IPSSearchRegistry::get('in.userMode') == 'all' )
{
@@ -457,7 +509,7 @@ class search_engine_forums extends search_engine
{
$pids[ $t['tid'] ] = $t['last_post'];
}
$where = ( array_merge( (array) $where, (array) $topic_where ) );
$where = implode( " AND ", $where );
@@ -465,18 +517,20 @@ class search_engine_forums extends search_engine
$this->DB->build( array( 'select' => 'p.pid',
'from' => array('posts' => 'p' ),
'where' => $where,
'add_join' => array( array( 'select' => 't.tid, t.last_post, t.topic_firstpost',
'add_join' => array( array( 'select' => 't.tid, t.forum_id, t.last_post, t.topic_firstpost',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left' ) ),
'order' => 'p.pid DESC',
'limit' => array( 0, 1000 ) ) );
'order' => 'p.post_date DESC',
'limit' => array( 0, 5000 ) ) );
$this->DB->execute();
while( $t = $this->DB->fetch() )
{
$pids[ $t['tid'] ] = $t['last_post'];
$pids[ $t['tid'] ] = $t['last_post'];
$tidsForFilter[ $t['tid'] ] = array( 'tid' => $t['tid'], 'forum_id' => $t['forum_id'], 'last_post' => $t['last_post'] );
}
$count = array( 'count' => count( $pids ) );
@@ -502,7 +556,7 @@ class search_engine_forums extends search_engine
/* Fetch the count */
if ( $count['count'] )
{
$this->DB->build( array( 'select' => 'tid',
$this->DB->build( array( 'select' => 'tid, forum_id, last_post',
'from' => 'topics t',
'where' => $where,
'order' => $sortKey . ' ' . $sort_order,
@@ -513,6 +567,7 @@ class search_engine_forums extends search_engine
while( $row = $this->DB->fetch( $inner ) )
{
$tids[ $row['tid'] ] = $row['tid'];
$tidsForFilter[ $row['tid'] ] = array( 'tid' => $row['tid'], 'forum_id' => $row['forum_id'], 'last_post' => $row['last_post'] );
}
}
}
@@ -532,7 +587,7 @@ class search_engine_forums extends search_engine
/* Fetch the count */
if ( $count['count'] )
{
$this->DB->build( array( 'select' => 'tid',
$this->DB->build( array( 'select' => 'tid, forum_id, last_post',
'from' => array('topics' => 't' ),
'where' => $where,
'add_join' => array( array( 'select' => 'p.pid',
@@ -541,15 +596,24 @@ class search_engine_forums extends search_engine
'type' => 'left' ) ),
'order' => $sortKey . ' ' . $sort_order,
'limit' => array( $start, $perPage ) ) );
$inner = $this->DB->execute();
while( $row = $this->DB->fetch( $inner ) )
{
$tids[ $row['pid'] ] = $row['pid'];
$tidsForFilter[ $row['tid'] ] = array( 'tid' => $row['tid'], 'forum_id' => $row['forum_id'], 'last_post' => $row['last_post'] );
}
}
}
/* Unread only? */
if( IPSSearchRegistry::get('in.period') == 'unread' )
{
$filter = $this->registry->class_forums->postProcessVncTids( $tidsForFilter );
$count['count'] = $filter['count'];
$tids = $filter['tids'];
}
/* Fix to 1000 results max */
$count['count'] = ( $count['count'] > 1000 ) ? 1000 : $count['count'];
@@ -573,6 +637,7 @@ class search_engine_forums extends search_engine
$forumIdsOk = array();
$where = array();
$_tidsOnly = array();
$noLimit = FALSE;
/* Loop through the forums and build a list of forums we're allowed access to */
$bvnp = explode( ',', $this->settings['vnp_block_forums'] );
@@ -588,7 +653,7 @@ class search_engine_forums extends search_engine
IPSSearchRegistry::set('in.search_sort_order' , 'desc' );
IPSSearchRegistry::set('opt.searchType' , 'titles' );
IPSSearchRegistry::set('opt.noPostPreview' , true );
//-----------------------------------------
// Only content we have participated in?
//-----------------------------------------
@@ -596,7 +661,7 @@ class search_engine_forums extends search_engine
if( IPSSearchRegistry::get('in.userMode') )
{
$_tempResults = $this->viewUserContent( $this->memberData );
if( $_tempResults['count'] )
{
$_tidsOnly = array_merge( $_tidsOnly, $_tempResults['resultSet'] );
@@ -640,7 +705,7 @@ class search_engine_forums extends search_engine
$like = classes_like::bootstrap( 'forums', 'topics' );
$followedTopics = $like->getDataByMemberIdAndArea( $this->memberData['member_id'] );
$followedTopics = $like->getDataByMemberIdAndArea( $this->memberData['member_id'], 5000 );
$followedTopics = ( $followedTopics === null ) ? array() : array_keys( $followedTopics );
}
@@ -752,7 +817,7 @@ class search_engine_forums extends search_engine
}
$where[] = $this->registry->class_forums->fetchTopicArchiveQuery( array('not', 'exclude' ) );
/* add perm */
$where[] = $permWhere;
$_ffWhere = '';
@@ -787,30 +852,31 @@ class search_engine_forums extends search_engine
else if( count($_tidsOnly) )
{
$where[] = "( tid IN(" . implode( ',', $_tidsOnly ) . ')' . $_ffWhere . ' )';
$noLimit = TRUE; // If we're here, we've already limited in $this->viewUserContent()
}
else if( count($followedTopics) )
{
$where[] = "( tid IN(" . implode( ',', $followedTopics ) . ')' . $_ffWhere . ' )';
}
$where = implode( " AND ", $where );
/* Fetch the count */
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count',
'from' => 'topics',
'where' => $where ) );
/* Fetch the count */
if ( $count['count'] )
{
$limit = ( IPSSearchRegistry::get('in.period') != 'unread' ) ? array( $start, $perPage ) : array( 0, 1200 );
$limit = $noLimit ? NULL : ( IPSSearchRegistry::get('in.period') != 'unread' ) ? array( $start, $perPage ) : array( 0, 1200 );
$this->DB->build( array( 'select' => 'tid, forum_id, last_post',
'from' => 'topics',
'where' => $where,
'order' => 'last_post DESC',
'limit' => $limit ) );
$inner = $this->DB->execute();
while( $row = $this->DB->fetch( $inner ) )
@@ -830,9 +896,9 @@ class search_engine_forums extends search_engine
}
else
{
$data = array( 'count' => $count['count'], 'resultSet' => array_keys( $rtids) );
$data = array( 'count' => ( ( isset( $_tempResults['count'] ) and $_tempResults['count'] > $count['count'] ) ? $_tempResults['count'] : $count['count'] ), 'resultSet' => array_keys( $rtids) ); // For explaination of why we check $_tempResults, see bug report 38178
}
/* Return it */
return $data;
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Returns HTML for the form (optional class, not required)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $author$
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Formats forum search results
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-17 19:05:15 -0400 (Fri, 17 May 2013) $
* </pre>
*
* @author $author$
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12259 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -118,7 +118,7 @@ class search_format_forums extends search_format
foreach( $results as $result )
{
$forums[ $result ] = $this->registry->class_forums->forumsFormatLastinfo( $this->registry->class_forums->forumsCalcChildren( $result, $this->registry->class_forums->getForumById( $result ) ) );
if( $forums[ $result ]['last_poster_id'] )
{
$member_ids[ $result ] = $forums[ $result ]['last_poster_id'];
@@ -185,10 +185,10 @@ class search_format_forums extends search_format
$data['_last_post'] = $data['last_post'];
$data['_longTitle'] = $data['content_title'];
$data['_shortTitle'] = ( IPSText::mbstrlen( strip_tags( $data['content_title'] ) ) > 60 ) ? IPSText::truncate( $data['content_title'], 60 ) : $data['content_title'];
$data['last_poster'] = $data['last_poster_id'] ? IPSMember::makeProfileLink( $data['last_poster_name'], $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
$data['last_poster'] = $data['last_poster_id'] ? IPSMember::buildDisplayData( $data['last_poster_id'] ) : IPSMember::buildDisplayData( IPSMember::setUpGuest( $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'] ) );
$data['starter'] = $data['starter_id'] ? IPSMember::makeProfileLink( $data['starter_name'], $data['starter_id'], $data['seo_first_name'] ) : $this->settings['guest_name_pre'] . $data['starter_name'] . $this->settings['guest_name_suf'];
//$data['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $data['last_post'], 'SHORT' );
if ( isset( $data['post_date'] ) )
{
$data['_post_date'] = $data['post_date'];
@@ -340,7 +340,7 @@ class search_format_forums extends search_format
if ( ! $is_read )
{
$data['_unreadUrl'] = $this->registry->output->buildSEOUrl( 'showtopic=' . $data['tid'] . '&amp;view=getnewpost', 'public', $data['title_seo'], 'showtopicunread' );
$data['_unreadUrl'] = $this->registry->output->buildSEOUrl( 'showtopic=' . $data['tid'] . '&amp;view=getnewpost', 'public', $data['title_seo'], 'showtopic' );
}
/* Icon */
@@ -618,7 +618,7 @@ class search_format_forums extends search_format
$row['tags'] = $this->registry->tags->formatCacheJoinData( $row );
}
$results[ $row['pid'] ] = $this->genericizeResults( $row );
$results[ ( $k == 'tid' ) ? $row['tid'] : $row['pid'] ] = $this->genericizeResults( $row );
}
}
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Sphinx template file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
* @since 3.0.0
*
*/
@@ -95,7 +95,7 @@ index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
mlock = 0
morphology = none
min_word_len = 2
charset_type = sbcs
charset_type = utf-8
html_strip = 0
#infix_fields = post, title
#min_infix_len = 3
@@ -3,10 +3,10 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Tagging: Forums/Topics Class
* Matt Mecham
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -15,7 +15,7 @@
* @package IP.Board
* @link http://www.invisionpower.com
* @since 25 Feb 2011
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -4,11 +4,11 @@
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $ (Original: Mark)
* $Author: ips_terabyte $ (Original: Mark)
* @since -
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
* $LastChangedDate: 2012-04-05 12:35:31 -0400 (Thu, 05 Apr 2012) $
* @version v3.4.5
* $Revision: 10571 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -21,9 +21,34 @@ ACPForums = {
{
ACPForums.autoComplete = new ipb.Autocomplete( $('modUserName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
}
if ( jQuery('[data-form-type=forum]').length )
{
jQuery('[data-form-type=forum]').on( 'submit', ACPForums.formSubmit );
}
ipb.delegate.register(".toggle", ACPForums.toggleCat);
});
},
formSubmit: function()
{
var parent = jQuery('#parent_id').val();
var forumType = jQuery('input[name=forum_type]:checked').val();
if ( parent == '-1' && forumType == 'standard' )
{
jQuery('#parent_id').parents('tr').addClass('_red');
alert( ipb.lang['forum_not_root_and_standard'] );
return false;
}
return true;
},
toggleModOptions: function()
{
$$('.moddiv').each( function(div){
@@ -70,6 +95,40 @@ ACPForums = {
{
$('convert').value = 1;
$('adminform').submit();
},
/**
* Show/hide a category
*
* @var {event} e The event
*/
toggleCat: function(e, elem)
{
if( ACPForums.animating ){ return false; }
var remove = $A();
var catname = $( elem ).up('.parentCat');
var wrapper = $( catname ).down('.item_wrap');
$( wrapper ).identify(); // IE8 fix
ACPForums.animating = true;
Effect.toggle( wrapper, 'blind', {duration: 0.4, afterFinish: function(){ ACPForums.animating = false; } } );
Effect.toggle( wrapper, 'appear', {duration: 0.3});
if( catname.hasClassName('collapsed') )
{
catname.removeClassName('collapsed');
}
else
{
new Effect.Morph( $(catname), {style: 'collapsed', duration: 0.4, afterFinish: function(){
$( catname ).addClassName('collapsed');
ACPForums.animating = false;
} });
}
Event.stop( e );
}
};
@@ -2,7 +2,7 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Archive stuff (AJAX) - Matt Mecham
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
* </pre>
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Member property updater (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -1,395 +1,395 @@
<?php
/**
* @file archive.php Archive Action File
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ (Original: Matt)
* @since 11 Nov 2011
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
* @version v3.3.4
* $Revision: 477 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
/**
* @class admin_forums_archive_archive
* @brief Archive Action File
*/
class admin_forums_archive_archive extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_archive' );
$this->form_code = $this->html->form_code = 'module=archive&amp;section=archive&amp;';
$this->html->form_code_js = $this->html->form_code_js = 'module=archive&section=archive&';
$this->lang->loadLanguageFile( array( 'admin_archive' ) );
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
$this->archiveWriter = new $classToLoad();
$this->archiveWriter->setApp('forums');
/* Check for class_forums */
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->class_forums->forumsInit();
}
switch( $this->request['do'] )
{
case 'toggleArchiving':
$this->_archiveToggle();
break;
case 'rules':
$this->_archiveRules();
break;
case 'saveRules':
$this->_saveRules();
break;
case 'saveRestorePrefs':
$this->_saveRestorePrefs();
break;
case 'overview':
default:
$this->_archiveDash();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Archive Toggle
*
* @return @e void
*/
protected function _saveRestorePrefs()
{
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
$archiveRestore = new $classToLoad();
$archiveRestore->setApp('forums');
/* Show topics waiting unarchiving */
$restoreData = $archiveRestore->getRestoreData();
/* Update */
IPSLib::updateSettings( array( 'archive_restore_days' => intval( $this->request['restoreDays'] ) ) );
/* Fetch and store tids */
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->request['restoreDays'] ) );
$mouse = $this->DB->buildAndFetch( array( 'select' => 'min(archive_topic_id) as min, max(archive_topic_id) as max',
'from' => 'forums_archive_posts',
'where' => 'archive_content_date > ' . $date ) );
$restoreData['restore_min_tid'] = intval( $mouse['min'] );
$restoreData['restore_max_tid'] = intval( $mouse['max'] );
/* Save */
$archiveRestore->setRestoreData( $restoreData );
/* Done */
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
}
/**
* Archive Toggle
*
* @return @e void
*/
protected function _archiveToggle()
{
/* Update */
IPSLib::updateSettings( array( 'archive_on' => ( $this->settings['archive_on'] ? 0 : 1 ) ) );
/* Done */
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
}
/**
* Archive dashboard
*
* @return @e void
*/
protected function _archiveDash()
{
/* Init */
$archTopics = array();
$restoreTopics = array();
$restoreCount = 0;
$unArchiveCount = 0;
/* Test remote DB */
$connexTest = $this->_connectionTest();
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
$archiveRestore = new $classToLoad();
$archiveRestore->setApp('forums');
/* Load topic class */
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$topicClass = new $classToLoad( $this->registry );
/* Show topics waiting unarchiving */
$restoreData = $archiveRestore->getRestoreData();
/* Get pids and that */
if ( count( $restoreData['restore_manual_tids'] ) )
{
$restoreTopics = $topicClass->getTopics( array( 'topicId' => array_keys( $restoreData['restore_manual_tids'] ), 'limit' => 10, 'getCount' => true ) );
$restoreCount = $topicClass->getTopicsCount();
foreach( $restoreTopics as $tid => $data )
{
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
}
/* Get count of topics left to unarchive */
if ( $restoreData['restore_min_tid'] AND $restoreData['restore_max_tid'] )
{
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->settings['archive_restore_days'] ) );
$restoreCount += $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] -1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'getCountOnly' => true ) );
if ( count( $restoreCount ) < 10 )
{
$tmp = $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] - 1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'limit' => (10 - count( $restoreTopics ) ) ) );
}
foreach( $tmp as $tid => $data )
{
$restoreTopics[ $tid ] = $data;
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
}
/* Fetch latest archived topics */
$archTopics = $topicClass->getTopics( array( 'archiveState' => array( 'working', 'archived' ), 'topicType' => array( 'hidden', 'visible' ), 'limit' => 10, 'getCount' => true, 'sortField' => 'start_date', 'sortOrder' => 'desc' ) );
$archCount = $topicClass->getTopicsCount();
foreach( $archTopics as $tid => $data )
{
$archTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
$possibleCounts = $this->archiveWriter->getArchivePossibleCount();
/* Show dash */
$this->registry->output->html .= $this->html->archiveDashboard( $restoreTopics, $restoreCount, $archTopics, $archCount, $possibleCounts, $connexTest );
}
/**
* Archive Rules overview
*
* @return @e void
*/
protected function _archiveRules()
{
/* Get archive count so far */
$counts = $this->archiveWriter->getArchivePossibleCount();
$rules = $this->archiveWriter->getRulesFromDb();
if ( $counts['count'] < 1 )
{
$textString = $this->lang->words['archive_no_query'];
}
else
{
$textString = sprintf( $this->lang->words['archive_x_query'], $counts['percentage'], $this->lang->formatNumber( $counts['count'] ), $this->lang->formatNumber( $counts['total'] ) );
}
/* Post process */
foreach( array('archive', 'skip' ) as $type )
{
if ( ! empty( $rules[ $type ]['forum']['text'] ) )
{
$ids = IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) ? unserialize( $rules[ $type ]['forum']['text'] ) : array();
if ( count( $ids ) )
{
foreach( $ids as $fid )
{
$data = $this->registry->class_forums->getForumbyId( $fid );
if ( $data['id'] )
{
$rules[ $type ]['forum']['_parseData'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
}
}
}
}
if ( ! empty( $rules[ $type ]['member']['text'] ) )
{
$ids = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
if ( count( $ids ) )
{
$members = IPSMember::load( $ids, 'all' );
foreach( $members as $id => $data )
{
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
}
foreach( $ids as $fid )
{
$rules[ $type ]['member']['_parseData']['count'] = count( $members );
$rules[ $type ]['member']['_parseData']['data'] = $members;
}
}
}
}
/* Show rules page */
$this->registry->output->html .= $this->html->archiveRules( IPSText::jsonEncodeForTemplate( $rules ), $textString );
}
/**
* Save Rules
*
* @return @e void
*/
protected function _saveRules()
{
/* Get fields to save */
$archiveFields = $this->archiveWriter->getArchiveOnFields();
$skipFields = $this->archiveWriter->getArchiveSkipFields();
/* To save */
$archiveData = array();
$skipData = array();
/* Loop through and get archive data */
foreach( $archiveFields as $k )
{
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
{
$archiveData[ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
}
}
/* Loop through and get skup data */
foreach( $skipFields as $k )
{
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
{
$skipData[ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
}
}
/* Update rules */
foreach( $archiveData as $k => $data )
{
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_0' ),
'archive_app' => 'forums',
'archive_field' => $k,
'archive_value' => $data['value'],
'archive_text' => $data['text'],
'archive_unit' => $data['unit'],
'archive_skip' => 0 ), array( 'archive_key' ) );
}
/* Update rules */
foreach( $skipData as $k => $data )
{
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_1' ),
'archive_app' => 'forums',
'archive_field' => $k,
'archive_value' => $data['value'],
'archive_text' => $data['text'],
'archive_unit' => $data['unit'],
'archive_skip' => 1 ), array( 'archive_key' ) );
}
/* Done */
return $this->_archiveRules();
}
/**
* Test remote DB
*
* @return @e boolean
*/
protected function _connectionTest()
{
if ( ! empty( $this->settings['archive_remote_sql_database'] ) && ! empty( $this->settings['archive_remote_sql_user'] ) )
{
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
$archiveWriter = new $classToLoad();
$archiveWriter->setApp('forums');
/* Test */
$result = $archiveWriter->testConnection();
if ( is_string( $result ) && $result == 'NO_TABLE' )
{
/* Try and create table */
$archiveWriter->createTable();
$archiveWriter->flush();
/* Try test again */
return $archiveWriter->testConnection();
}
else
{
return $result;
}
}
return true;
}
<?php
/**
* @file archive.php Archive Action File
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $ (Original: Matt)
* @since 11 Nov 2011
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
* @version v3.4.5
* $Revision: 477 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
/**
* @class admin_forums_archive_archive
* @brief Archive Action File
*/
class admin_forums_archive_archive extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin and Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_archive' );
$this->form_code = $this->html->form_code = 'module=archive&amp;section=archive&amp;';
$this->html->form_code_js = $this->html->form_code_js = 'module=archive&section=archive&';
$this->lang->loadLanguageFile( array( 'admin_archive' ) );
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
$this->archiveWriter = new $classToLoad();
$this->archiveWriter->setApp('forums');
/* Check for class_forums */
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->class_forums->forumsInit();
}
switch( $this->request['do'] )
{
case 'toggleArchiving':
$this->_archiveToggle();
break;
case 'rules':
$this->_archiveRules();
break;
case 'saveRules':
$this->_saveRules();
break;
case 'saveRestorePrefs':
$this->_saveRestorePrefs();
break;
case 'overview':
default:
$this->_archiveDash();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Archive Toggle
*
* @return @e void
*/
protected function _saveRestorePrefs()
{
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
$archiveRestore = new $classToLoad();
$archiveRestore->setApp('forums');
/* Show topics waiting unarchiving */
$restoreData = $archiveRestore->getRestoreData();
/* Update */
IPSLib::updateSettings( array( 'archive_restore_days' => intval( $this->request['restoreDays'] ) ) );
/* Fetch and store tids */
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->request['restoreDays'] ) );
$mouse = $archiveRestore->engine->remoteDB->buildAndFetch( array( 'select' => 'min(archive_topic_id) as min, max(archive_topic_id) as max',
'from' => 'forums_archive_posts',
'where' => 'archive_content_date > ' . $date ) ); /* @todo - abstract this to the engine */
$restoreData['restore_min_tid'] = intval( $mouse['min'] );
$restoreData['restore_max_tid'] = intval( $mouse['max'] );
/* Save */
$archiveRestore->setRestoreData( $restoreData );
/* Done */
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
}
/**
* Archive Toggle
*
* @return @e void
*/
protected function _archiveToggle()
{
/* Update */
IPSLib::updateSettings( array( 'archive_on' => ( $this->settings['archive_on'] ? 0 : 1 ) ) );
/* Done */
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
}
/**
* Archive dashboard
*
* @return @e void
*/
protected function _archiveDash()
{
/* Init */
$archTopics = array();
$restoreTopics = array();
$restoreCount = 0;
$unArchiveCount = 0;
/* Test remote DB */
$connexTest = $this->_connectionTest();
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
$archiveRestore = new $classToLoad();
$archiveRestore->setApp('forums');
/* Load topic class */
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$topicClass = new $classToLoad( $this->registry );
/* Show topics waiting unarchiving */
$restoreData = $archiveRestore->getRestoreData();
/* Get pids and that */
if ( count( $restoreData['restore_manual_tids'] ) )
{
$restoreTopics = $topicClass->getTopics( array( 'topicId' => array_keys( $restoreData['restore_manual_tids'] ), 'limit' => 10, 'getCount' => true ) );
$restoreCount = $topicClass->getTopicsCount();
foreach( $restoreTopics as $tid => $data )
{
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
}
/* Get count of topics left to unarchive */
if ( $restoreData['restore_min_tid'] AND $restoreData['restore_max_tid'] )
{
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->settings['archive_restore_days'] ) );
$restoreCount += $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] -1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'getCountOnly' => true ) );
if ( count( $restoreCount ) < 10 )
{
$tmp = $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] - 1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] + 1 ), 'limit' => (10 - count( $restoreTopics ) ) ) );
}
foreach( $tmp as $tid => $data )
{
$restoreTopics[ $tid ] = $data;
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
}
/* Fetch latest archived topics */
$archTopics = $topicClass->getTopics( array( 'archiveState' => array( 'working', 'archived' ), 'topicType' => array( 'hidden', 'visible' ), 'limit' => 10, 'getCount' => true, 'sortField' => 'tid', 'sortOrder' => 'desc' ) );
$archCount = $topicClass->getTopicsCount();
foreach( $archTopics as $tid => $data )
{
$archTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
}
$possibleCounts = $this->archiveWriter->getArchivePossibleCount();
/* Show dash */
$this->registry->output->html .= $this->html->archiveDashboard( $restoreTopics, $restoreCount, $archTopics, $archCount, $possibleCounts, $connexTest );
}
/**
* Archive Rules overview
*
* @return @e void
*/
protected function _archiveRules()
{
/* Get archive count so far */
$counts = $this->archiveWriter->getArchivePossibleCount();
$rules = $this->archiveWriter->getRulesFromDb();
if ( $counts['count'] < 1 )
{
$textString = $this->lang->words['archive_no_query'];
}
else
{
$textString = sprintf( $this->lang->words['archive_x_query'], $counts['percentage'], $this->lang->formatNumber( $counts['count'] ), $this->lang->formatNumber( $counts['total'] ) );
}
/* Post process */
foreach( array('archive', 'skip' ) as $type )
{
if ( ! empty( $rules[ $type ]['forum']['text'] ) )
{
$ids = IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) ? unserialize( $rules[ $type ]['forum']['text'] ) : array();
if ( count( $ids ) )
{
foreach( $ids as $fid )
{
$data = $this->registry->class_forums->getForumbyId( $fid );
if ( $data['id'] )
{
$rules[ $type ]['forum']['_parseData'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
}
}
}
}
if ( ! empty( $rules[ $type ]['member']['text'] ) )
{
$ids = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
if ( count( $ids ) )
{
$members = IPSMember::load( $ids, 'all' );
foreach( $members as $id => $data )
{
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
}
foreach( $ids as $fid )
{
$rules[ $type ]['member']['_parseData']['count'] = count( $members );
$rules[ $type ]['member']['_parseData']['data'] = $members;
}
}
}
}
/* Show rules page */
$this->registry->output->html .= $this->html->archiveRules( IPSText::jsonEncodeForTemplate( $rules ), $textString );
}
/**
* Save Rules
*
* @return @e void
*/
protected function _saveRules()
{
/* Get fields to save */
$archiveFields = $this->archiveWriter->getArchiveOnFields();
$skipFields = $this->archiveWriter->getArchiveSkipFields();
/* To save */
$archiveData = array();
$skipData = array();
/* Loop through and get archive data */
foreach( $archiveFields as $k )
{
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
{
$archiveData[ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
}
}
/* Loop through and get skup data */
foreach( $skipFields as $k )
{
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
{
$skipData[ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
}
}
/* Update rules */
foreach( $archiveData as $k => $data )
{
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_0' ),
'archive_app' => 'forums',
'archive_field' => $k,
'archive_value' => $data['value'],
'archive_text' => $data['text'],
'archive_unit' => $data['unit'],
'archive_skip' => 0 ), array( 'archive_key' ) );
}
/* Update rules */
foreach( $skipData as $k => $data )
{
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_1' ),
'archive_app' => 'forums',
'archive_field' => $k,
'archive_value' => $data['value'],
'archive_text' => $data['text'],
'archive_unit' => $data['unit'],
'archive_skip' => 1 ), array( 'archive_key' ) );
}
/* Done */
return $this->_archiveRules();
}
/**
* Test remote DB
*
* @return @e boolean
*/
protected function _connectionTest()
{
if ( ! empty( $this->settings['archive_remote_sql_database'] ) && ! empty( $this->settings['archive_remote_sql_user'] ) )
{
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
$archiveWriter = new $classToLoad();
$archiveWriter->setApp('forums');
/* Test */
$result = $archiveWriter->testConnection();
if ( is_string( $result ) && $result == 'NO_TABLE' )
{
/* Try and create table */
$archiveWriter->createTable();
$archiveWriter->flush();
/* Try test again */
return $archiveWriter->testConnection();
}
else
{
return $result;
}
}
return true;
}
}
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since Tuesday 17th August 2004
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 477 $
*/
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Archiving</title>
<title>Архивация</title>
<subitems>
<subitem>
<subitemtitle>Archive Overview</subitemtitle>
<subitemtitle>Обзор Архивации</subitemtitle>
<subitemlang>archive_overview</subitemlang>
<subsection>archive</subsection>
<subitemurl>do=forums_overview</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>Archive Rules</title>
<title>Правила Архивации</title>
<subitems>
<subitem>
<subitemtitle>Archive Rules</subitemtitle>
` <subitemtitle>Правила Архивации</subitemtitle>
<subitemlang>archive_rules</subitemlang>
<subsection>archive</subsection>
<subitemurl>do=rules</subitemurl>
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Archiving</grouptitle>
<grouptitle>Архивирование</grouptitle>
<grouplang>forums_archive</grouplang>
<items>
<item>
<key>archive_overview</key>
<string>Может просматривать обзорную страницу архивации?</string>
</item>
<item>
<key>archive_rules</key>
<string>Can manage archiving rules?</string>
<string>Может управлять правилами архивации?</string>
</item>
</items>
</group>
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -1,355 +1,355 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Attachments: Search
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @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
* @since Mon 24th May 2004
* @version $Rev: 10914 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_forums_attachments_search extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load HTML and language bits
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=attachments&amp;section=search';
$this->form_code_js = $this->html->form_code_js = 'module=attachments&section=search';
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'attach_search_complete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchResults();
break;
case 'attach_bulk_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
$this->_bulkRemoveAttachments();
break;
case 'overview':
case 'search':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchForm();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Bulk remove attachments
*
* @return @e void [Outputs to screen]
*/
protected function _bulkRemoveAttachments()
{
foreach ( $_POST as $key => $value )
{
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
{
if ( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
$attach_tid = array();
if ( count( $ids ) )
{
//-----------------------------------------
// Get attach details?
//-----------------------------------------
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
'add_join' => array(
array(
'select' => 'p.pid, p.topic_id',
'from' => array( 'posts' => 'p' ),
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $killmeh = $this->DB->fetch() )
{
if ( $killmeh['attach_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
}
if ( $killmeh['attach_thumb_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
}
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
}
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
//-----------------------------------------
// Recount topic upload marker
//-----------------------------------------
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
$postlib = new $classToLoad( $this->registry );
foreach( $attach_tid as $tid )
{
if( $tid )
{
$postlib->recountTopicAttachments( $tid );
}
}
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
}
else
{
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
}
if ( $this->request['return'] == 'stats' )
{
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments&section=stats' );
}
else
{
if ( $_POST['url'] )
{
foreach( explode( '&', $_POST['url'] ) as $u )
{
list ( $k, $v ) = explode( '=', $u );
$this->request[ $k] = $v ;
}
}
$this->_searchResults();
}
}
/**
* Attachment search results
*
* @return @e void [Outputs to screen]
*/
protected function _searchResults()
{
$show = intval($this->request['show']);
$show = $show > 100 ? 100 : $show;
//-----------------------------------------
// Build URL
//-----------------------------------------
$url = "";
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
foreach( $url_components as $u )
{
$url .= $u . '=' . $this->request[ $u ] . '&';
}
//-----------------------------------------
// Build Query
//-----------------------------------------
$queryfinal = "";
$query = array();
if ( $this->request['extension'] )
{
$query[] = 'a.attach_ext="' . strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
}
if ( $this->request['filesize'] )
{
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
}
if ( $this->request['days'] )
{
$day_break = time() - intval( $this->request['days'] * 86400 );
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
$query[] = "a.attach_date {$gt} {$day_break}";
}
if ( $this->request['hits'] )
{
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
}
if ( $this->request['filename'] )
{
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . strtolower( $this->request['filename'] ) . '%"';
}
if ( $this->request['authorname'] )
{
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . strtolower( $this->request['authorname'] ) . '%"';
}
if ( $this->request['onlyimage'] )
{
$query[] = 'a.attach_is_image=1';
}
if ( count($query) )
{
$queryfinal = 'AND '. implode( " AND ", $query );
}
$rows = array();
$this->DB->build( array( 'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'".$queryfinal,
'add_join' => array(
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left' ),
1 => array( 'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left' ),
2 => array( 'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left' )
),
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
'limit' => array( 0, $show ) ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
$rows[] = $r;
}
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
}
/**
* Show attachment search form
*
* @return @e void [Outputs to screen]
*/
protected function _searchForm()
{
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
//-----------------------------------------
// FORM
//-----------------------------------------
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
2 => array( 'filesize', $this->lang->words['se_osize'] ),
3 => array( 'file' , $this->lang->words['se_oname'] ),
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
), isset($_POST['sort']) ? $_POST['sort'] : '' );
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* Attachments: Search
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
* @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
* @since Mon 24th May 2004
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_forums_attachments_search extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load HTML and language bits
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=attachments&amp;section=search';
$this->form_code_js = $this->html->form_code_js = 'module=attachments&section=search';
//-----------------------------------------
// StRT!
//-----------------------------------------
switch( $this->request['do'] )
{
case 'attach_search_complete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchResults();
break;
case 'attach_bulk_remove':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
$this->_bulkRemoveAttachments();
break;
case 'overview':
case 'search':
default:
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
$this->_searchForm();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Bulk remove attachments
*
* @return @e void [Outputs to screen]
*/
protected function _bulkRemoveAttachments()
{
foreach ( $_POST as $key => $value )
{
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
{
if ( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
$ids = IPSLib::cleanIntArray( $ids );
$attach_tid = array();
if ( count( $ids ) )
{
//-----------------------------------------
// Get attach details?
//-----------------------------------------
$this->DB->build( array(
'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
'add_join' => array(
array(
'select' => 'p.pid, p.topic_id',
'from' => array( 'posts' => 'p' ),
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
'type' => 'left',
),
)
) );
$this->DB->execute();
while ( $killmeh = $this->DB->fetch() )
{
if ( $killmeh['attach_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
}
if ( $killmeh['attach_thumb_location'] )
{
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
}
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
}
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
//-----------------------------------------
// Recount topic upload marker
//-----------------------------------------
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
$postlib = new $classToLoad( $this->registry );
foreach( $attach_tid as $tid )
{
if( $tid )
{
$postlib->recountTopicAttachments( $tid );
}
}
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
}
else
{
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
}
if ( $this->request['return'] == 'stats' )
{
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments&section=stats' );
}
else
{
if ( $_POST['url'] )
{
foreach( explode( '&', $_POST['url'] ) as $u )
{
list ( $k, $v ) = explode( '=', $u );
$this->request[ $k] = $v ;
}
}
$this->_searchResults();
}
}
/**
* Attachment search results
*
* @return @e void [Outputs to screen]
*/
protected function _searchResults()
{
$show = intval($this->request['show']);
$show = $show > 100 ? 100 : $show;
//-----------------------------------------
// Build URL
//-----------------------------------------
$url = "";
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
foreach( $url_components as $u )
{
$url .= $u . '=' . $this->request[ $u ] . '&';
}
//-----------------------------------------
// Build Query
//-----------------------------------------
$queryfinal = "";
$query = array();
if ( $this->request['extension'] )
{
$query[] = 'a.attach_ext="' . strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
}
if ( $this->request['filesize'] )
{
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
}
if ( $this->request['days'] )
{
$day_break = time() - intval( $this->request['days'] * 86400 );
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
$query[] = "a.attach_date {$gt} {$day_break}";
}
if ( $this->request['hits'] )
{
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
}
if ( $this->request['filename'] )
{
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . strtolower( $this->request['filename'] ) . '%"';
}
if ( $this->request['authorname'] )
{
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . mb_strtolower( $this->request['authorname'] ) . '%"';
}
if ( $this->request['onlyimage'] )
{
$query[] = 'a.attach_is_image=1';
}
if ( count($query) )
{
$queryfinal = 'AND '. implode( " AND ", $query );
}
$rows = array();
$this->DB->build( array( 'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "attach_rel_module='post'".$queryfinal,
'add_join' => array(
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=a.attach_rel_id',
'type' => 'left' ),
1 => array( 'select' => 't.tid, t.forum_id, t.title',
'from' => array( 'topics' => 't' ),
'where' => 'p.topic_id=t.tid',
'type' => 'left' ),
2 => array( 'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=a.attach_member_id',
'type' => 'left' )
),
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
'limit' => array( 0, $show ) ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
$rows[] = $r;
}
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
}
/**
* Show attachment search form
*
* @return @e void [Outputs to screen]
*/
protected function _searchForm()
{
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
//-----------------------------------------
// FORM
//-----------------------------------------
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
2 => array( 'filesize', $this->lang->words['se_osize'] ),
3 => array( 'file' , $this->lang->words['se_oname'] ),
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
), isset($_POST['sort']) ? $_POST['sort'] : '' );
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
}
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Attachments: Stats
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Attachments: Manage
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Mon 24th May 2004
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Attachment Types</title>
<title>Типы Вложений</title>
<subitems>
<subitem>
<subitemtitle>Attachment Types</subitemtitle>
<subitemtitle>Типы Вложений</subitemtitle>
<subitemlang>attachment_types</subitemlang>
<subsection>types</subsection>
<subitemurl>do=overview</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>Attachment Stats</title>
<title>Статистика Вложений</title>
<subitems>
<subitem>
<subitemtitle>Attachment Stats</subitemtitle>
<subitemtitle>Статистика Вложений</subitemtitle>
<subitemlang>attachment_stats</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=overview</subitemurl>
@@ -28,10 +28,10 @@
</subitems>
</item>
<item>
<title>Attachment Search</title>
<title>Поиск Вложений</title>
<subitems>
<subitem>
<subitemtitle>Attachment Search</subitemtitle>
<subitemtitle>Поиск Вложений</subitemtitle>
<subitemlang>attachment_search</subitemlang>
<subsection>search</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Manage Attachments</grouptitle>
<grouptitle>Управление прикрепленными файлами</grouptitle>
<grouplang>forums_attachments</grouplang>
<items>
<item>
<key>view_attachments</key>
<string>Can search and review attachments?</string>
<string>Может просматривать и искать файлы?</string>
</item>
<item>
<key>stats_attachments</key>
<string>Can view attachment stats?</string>
<string>Может просматривать статистику?</string>
</item>
<item>
<key>remove_attachments</key>
<string>Can remove attachments?</string>
<string>Может удалять?</string>
</item>
</items>
</group>
<group>
<grouptitle>Manage Attachments Mime-Types</grouptitle>
<grouptitle>Управление типами прикрепляемых файлов</grouptitle>
<grouplang>forums_mimes</grouplang>
<items>
<item>
<key>mime_view</key>
<string>Can view attachment types?</string>
<string>Может просматривать?</string>
</item>
<item>
<key>mime_add</key>
<string>Can add attachment types?</string>
<string>Может добавлять?</string>
</item>
<item>
<key>mime_edit</key>
<string>Can edit attachment types?</string>
<string>Может изменять?</string>
</item>
<item>
<key>mime_delete</key>
<string>Can remove attachment types?</string>
<string>Может удалять?</string>
</item>
<item>
<key>mime_import</key>
<string>Can import attachment types?</string>
<string>Может импортировать типы?</string>
</item>
<item>
<key>mime_export</key>
<string>Can export attachment types?</string>
<string>Может экспортировать типы?</string>
</item>
</items>
</group>
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since Tuesday 17th August 2004
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum management
* Last Updated: $Date: 2012-06-15 08:09:05 -0400 (Fri, 15 Jun 2012) $
* Last Updated: $Date: 2013-03-21 11:03:13 -0400 (Thu, 21 Mar 2013) $
* </pre>
*
* @author $Author: AndyMillne $
* @author $Author: mmecham $
* @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
* @since Tuesday 17th August 2004
* @version $Revision: 10929 $
* @version $Revision: 12100 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -262,7 +262,7 @@ class admin_forums_forums_forums extends ipsCommand
$this->registry->output->showError( $this->lang->words['for_noid'], 1134 );
}
$this->DB->build( array( 'select' => 'id, name, show_rules, rules_title, rules_text, rules_raw_html', 'from' => 'forums', 'where' => "id=".$this->request['f'] ) );
$this->DB->build( array( 'select' => 'id, name, show_rules, rules_title, rules_text', 'from' => 'forums', 'where' => "id=".$this->request['f'] ) );
$this->DB->execute();
//-----------------------------------------
@@ -284,7 +284,7 @@ class admin_forums_forums_forums extends ipsCommand
$_editor->setAllowSmilies( 1 );
$_editor->setContent( $forum['rules_text'], 'rules' );
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350, 'isHtml' => 1 ) );
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350, 'autoSaveKey' => "forums-admin-r{$forum['id']}" ) );
/* Form Fields */
$forum['_show_rules'] = $this->registry->output->formDropdown( "show_rules", array(
@@ -295,8 +295,6 @@ class admin_forums_forums_forums extends ipsCommand
$forum['_title'] = $this->registry->output->formInput( "title", IPSText::stripslashes( str_replace( "'", '&#039;', $forum['rules_title'] ) ) );
$forum['rules_raw_html'] = $this->registry->output->formCheckbox( 'rules_raw_html', $forum['rules_raw_html'] );
/* Output */
$this->registry->output->extra_nav[] = array( '', $this->lang->words['frm_rulessetup'] );
$this->registry->output->html .= $this->html->forumRulesForm( $forum['id'], $forum );
@@ -325,16 +323,12 @@ class admin_forums_forums_forums extends ipsCommand
$_editor->setAllowHtml( 1 );
$_editor->setAllowSmilies( 0 );
$_POST['body'] = $_editor->process( $_POST['body'] );
$text = $_editor->process( $_POST['body'] );
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
$_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse( $_POST['body'] );
$rules = array(
'rules_title' => IPSText::stripslashes( $_POST['title'] ),
'rules_text' => IPSText::stripslashes( $_POST['body'] ),
'rules_text' => $text,
'show_rules' => $this->request['show_rules'],
//'rules_raw_html' => intval($this->request['rules_raw_html']),
);
$this->DB->update( 'forums', $rules, 'id='.$this->request['f'] );
@@ -1023,16 +1017,40 @@ class admin_forums_forums_forums extends ipsCommand
//-----------------------------------------
# Main settings
$form['name'] = $this->registry->output->formInput( 'name' , IPSText::parseCleanValue( !empty( $_POST['name'] ) ? $_POST['name'] : $forum['name'] ) );
$form['name'] = $this->registry->output->formInput( 'name' , IPSText::parseCleanValue( !empty( $_POST['name'] ) ? $_POST['name'] : $forum['name'] ), null, null, null, "maxlength='128'" );
$form['description'] = $this->registry->output->formTextarea("description" , IPSText::br2nl( !empty( $_POST['description']) ? $_POST['description'] : $forum['description'] ) );
$form['parent_id'] = $this->registry->output->formDropdown("parent_id" , $forumlist, !empty($_POST['parent_id'] ) ? $_POST['parent_id'] : $forum['parent_id'] );
$form['sub_can_post'] = $this->registry->output->formYesNo( 'sub_can_post', !empty($_POST['sub_can_post']) ? $_POST['sub_can_post'] : ( $forum['sub_can_post'] == 1 ? 0 : 1 ) );
$form['ipseo_priority'] = $this->registry->getClass('output')->formDropdown(
'ipseo_priority',
array(
array( '1', '1' ),
array( '0.9', '0.9' ),
array( '0.8', '0.8' ),
array( '0.7', '0.7' ),
array( '0.6', '0.6' ),
array( '0.5', '0.5' ),
array( '0.4', '0.4' ),
array( '0.3', '0.3' ),
array( '0.2', '0.2' ),
array( '0.1', '0.1' ),
array( '0', $this->lang->words['sitemap_priority_ignore'] ),
array( '', $this->lang->words['sitemap_priority_inherit'] ),
),
( $forum['ipseo_priority'] === '' ) ? 0 : $forum['ipseo_priority']
);
$form['viglink'] = $this->registry->output->formYesNo( 'viglink', !empty($_POST['viglink']) ? $_POST['viglink'] : $forum['viglink'] );
# Redirect options
$form['redirect_url'] = $this->registry->output->formInput( 'redirect_url' , !empty($_POST['redirect_url']) ? $_POST['redirect_url'] : $forum['redirect_url'] );
$form['redirect_on'] = $this->registry->output->formYesNo('redirect_on' , !empty($_POST['redirect_on']) ? $_POST['redirect_on'] : $forum['redirect_on'] );
$form['redirect_hits'] = $this->registry->output->formInput( 'redirect_hits', !empty($_POST['redirect_hits']) ? $_POST['redirect_hits'] : $forum['redirect_hits'] );
# Answer system
$form['bw_enable_answers'] = $this->registry->output->formYesNo( 'bw_enable_answers' , !empty($_POST['bw_enable_answers']) ? $_POST['bw_enable_answers'] : $forum['bw_enable_answers'] );
# Permission settings
$form['permission_showtopic'] = $this->registry->output->formYesNo( 'permission_showtopic' , !empty($_POST['permission_showtopic']) ? $_POST['permission_showtopic'] : $forum['permission_showtopic'] );
$form['permission_custom_error'] = $this->registry->output->formTextarea("permission_custom_error", IPSText::br2nl( !empty($_POST['permission_custom_error']) ? $_POST['permission_custom_error'] : $forum['permission_custom_error'] ) );
@@ -1178,7 +1196,7 @@ class admin_forums_forums_forums extends ipsCommand
if( $this->request['name'] == "" )
{
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], strtolower( $forum_cat_lang ) );
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], mb_strtolower( $forum_cat_lang ) );
$this->forumForm( $type );
return;
}
@@ -1211,9 +1229,9 @@ class admin_forums_forums_forums extends ipsCommand
//-----------------------------------------
// Save array
//-----------------------------------------
$save = array( 'name' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['name'] ) ) ),
'name_seo' => IPSText::makeSeoTitle( $this->request['name'] ),
'name_seo' => IPSText::makeSeoTitle( strip_tags( IPSText::UNhtmlspecialchars( $this->request['name'] ) ) ),
'description' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['description'] ) ) ),
'use_ibc' => isset( $this->request['use_ibc'] ) ? intval($this->request['use_ibc']) : 1,
'use_html' => intval($this->request['use_html']),
@@ -1242,7 +1260,9 @@ class admin_forums_forums_forums extends ipsCommand
'disable_sharelinks' => intval( $this->request['disable_sharelinks'] ),
'tag_predefined' => $this->request['tag_predefined'],
'forums_bitoptions' => IPSBWOPtions::freeze( $this->request, 'forums', 'forums' ),
'permission_custom_error' => nl2br( IPSText::stripslashes($_POST['permission_custom_error']) ) );
'permission_custom_error' => nl2br( IPSText::stripslashes($_POST['permission_custom_error']) ),
'ipseo_priority' => $this->request['ipseo_priority'],
'viglink' => intval( $this->request['viglink'] ) );
/* Save data from application tabs */
IPSLib::loadInterface( 'admin/forum_form.php' );
@@ -1305,7 +1325,7 @@ class admin_forums_forums_forums extends ipsCommand
/* Done */
$this->registry->output->global_message = $forum_cat_lang . $this->lang->words['for__created'];
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . strtolower ( $this->lang->words['for__created'] ) );
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . mb_strtolower ( $this->lang->words['for__created'] ) );
}
else
{
@@ -1372,7 +1392,7 @@ class admin_forums_forums_forums extends ipsCommand
$this->registry->output->global_message = $forum_cat_lang.$this->lang->words['for__edited'];
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . strtolower ( $this->lang->words['for__edited'] ) );
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . mb_strtolower ( $this->lang->words['for__edited'] ) );
}
$this->request['f'] = '';
@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum moderator management
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-09-12 11:58:11 -0400 (Wed, 12 Sep 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @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
* @since Tuesday 17th August 2004
* @version $Revision: 10914 $
* @version $Revision: 11333 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -661,27 +661,28 @@ class admin_forums_forums_moderator extends ipsCommand
}
/* Form Fields */
$mod['edit_post'] = $this->registry->output->formYesNo( 'edit_post' , $mod['edit_post'] );
$mod['edit_topic'] = $this->registry->output->formYesNo( 'edit_topic' , $mod['edit_topic'] );
$mod['delete_post'] = $this->registry->output->formYesNo( 'delete_post' , $mod['delete_post'] );
$mod['delete_topic'] = $this->registry->output->formYesNo( 'delete_topic' , $mod['delete_topic'] );
$mod['view_ip'] = $this->registry->output->formYesNo( 'view_ip' , $mod['view_ip'] );
$mod['open_topic'] = $this->registry->output->formYesNo( 'open_topic' , $mod['open_topic'] );
$mod['close_topic'] = $this->registry->output->formYesNo( 'close_topic' , $mod['close_topic'] );
$mod['move_topic'] = $this->registry->output->formYesNo( 'move_topic' , $mod['move_topic'] );
$mod['pin_topic'] = $this->registry->output->formYesNo( 'pin_topic' , $mod['pin_topic'] );
$mod['unpin_topic'] = $this->registry->output->formYesNo( 'unpin_topic' , $mod['unpin_topic'] );
$mod['split_merge'] = $this->registry->output->formYesNo( 'split_merge' , $mod['split_merge'] );
$mod['mod_can_set_open_time'] = $this->registry->output->formYesNo( 'mod_can_set_open_time' , $mod['mod_can_set_open_time'] );
$mod['mod_can_set_close_time'] = $this->registry->output->formYesNo( 'mod_can_set_close_time', $mod['mod_can_set_close_time'] );
$mod['mass_move'] = $this->registry->output->formYesNo( 'mass_move' , $mod['mass_move'] );
$mod['mass_prune'] = $this->registry->output->formYesNo( 'mass_prune' , $mod['mass_prune'] );
$mod['topic_q'] = $this->registry->output->formYesNo( 'topic_q' , $mod['topic_q'] );
$mod['post_q'] = $this->registry->output->formYesNo( 'post_q' , $mod['post_q'] );
$mod['allow_warn'] = $this->registry->output->formYesNo( 'allow_warn' , $mod['allow_warn'] );
$mod['can_mm'] = $this->registry->output->formYesNo( 'can_mm' , $mod['can_mm'] );
$mod['bw_flag_spammers'] = $this->registry->output->formYesNo( 'bw_flag_spammers' , $mod['bw_flag_spammers'] );
$mod['forums'] = $this->registry->output->formMultiDropdown( 'forums[]' , $this->registry->getClass('class_forums')->adForumsForumList(1), $forum_id );
$mod['edit_post'] = $this->registry->output->formYesNo( 'edit_post' , $mod['edit_post'] );
$mod['edit_topic'] = $this->registry->output->formYesNo( 'edit_topic' , $mod['edit_topic'] );
$mod['delete_post'] = $this->registry->output->formYesNo( 'delete_post' , $mod['delete_post'] );
$mod['delete_topic'] = $this->registry->output->formYesNo( 'delete_topic' , $mod['delete_topic'] );
$mod['view_ip'] = $this->registry->output->formYesNo( 'view_ip' , $mod['view_ip'] );
$mod['open_topic'] = $this->registry->output->formYesNo( 'open_topic' , $mod['open_topic'] );
$mod['close_topic'] = $this->registry->output->formYesNo( 'close_topic' , $mod['close_topic'] );
$mod['move_topic'] = $this->registry->output->formYesNo( 'move_topic' , $mod['move_topic'] );
$mod['pin_topic'] = $this->registry->output->formYesNo( 'pin_topic' , $mod['pin_topic'] );
$mod['unpin_topic'] = $this->registry->output->formYesNo( 'unpin_topic' , $mod['unpin_topic'] );
$mod['split_merge'] = $this->registry->output->formYesNo( 'split_merge' , $mod['split_merge'] );
$mod['mod_can_set_open_time'] = $this->registry->output->formYesNo( 'mod_can_set_open_time' , $mod['mod_can_set_open_time'] );
$mod['mod_can_set_close_time'] = $this->registry->output->formYesNo( 'mod_can_set_close_time', $mod['mod_can_set_close_time'] );
$mod['mass_move'] = $this->registry->output->formYesNo( 'mass_move' , $mod['mass_move'] );
$mod['mass_prune'] = $this->registry->output->formYesNo( 'mass_prune' , $mod['mass_prune'] );
$mod['topic_q'] = $this->registry->output->formYesNo( 'topic_q' , $mod['topic_q'] );
$mod['post_q'] = $this->registry->output->formYesNo( 'post_q' , $mod['post_q'] );
$mod['allow_warn'] = $this->registry->output->formYesNo( 'allow_warn' , $mod['allow_warn'] );
$mod['can_mm'] = $this->registry->output->formYesNo( 'can_mm' , $mod['can_mm'] );
$mod['bw_flag_spammers'] = $this->registry->output->formYesNo( 'bw_flag_spammers' , $mod['bw_flag_spammers'] );
$mod['bw_can_toggle_answered_post'] = $this->registry->output->formYesNo( 'bw_can_toggle_answered_post', $mod['bw_can_toggle_answered_post'] );
$mod['forums'] = $this->registry->output->formMultiDropdown( 'forums[]' , $this->registry->getClass('class_forums')->adForumsForumList(1), $forum_id );
$mod['bw_mod_soft_delete'] = $this->registry->output->formYesNo( "bw_mod_soft_delete", $mod['bw_mod_soft_delete'] );
$mod['bw_mod_un_soft_delete'] = $this->registry->output->formYesNo( "bw_mod_un_soft_delete", $mod['bw_mod_un_soft_delete'] );
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Topic Multi-Moderation
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $LastChangedDate: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 14th May 2003
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Manage Forums</title>
<title>Управление Форумами</title>
<subitems>
<subitem>
<subitemtitle>Manage Forums</subitemtitle>
<subitemtitle>Управление Форумами</subitemtitle>
<subitemlang>forums</subitemlang>
<subsection>forums</subsection>
<subitemurl>do=forums_overview</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>Topic Multi-Moderation</title>
<title>Мульти-модерация Тем</title>
<subitems>
<subitem>
<subitemtitle>Topic Multi-Moderation</subitemtitle>
<subitemtitle>Мульти-модерация Тем</subitemtitle>
<subitemlang>multimod</subitemlang>
<subsection>multimods</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,84 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Manage Forums</grouptitle>
<grouptitle>Управление форумами</grouptitle>
<grouplang>forums_forums</grouplang>
<items>
<item>
<key>forums_add</key>
<string>Can add new forums?</string>
<string>Может добавлять форумы?</string>
</item>
<item>
<key>forums_edit</key>
<string>Can edit forums?</string>
<string>Может изменять форумы?</string>
</item>
<item>
<key>forums_delete</key>
<string>Can delete forums?</string>
<string>Может удалять форумы?</string>
</item>
<item>
<key>forums_reorder</key>
<string>Can reorder forums?</string>
<string>Может изменять порядок вывода форумов?</string>
</item>
<item>
<key>forums_permissions</key>
<string>Can edit permissions for forums?</string>
<string>Может редактировать права доступа к форумам?</string>
</item>
<item>
<key>forums_empty</key>
<string>Can empty forums?</string>
<string>Может очищать форумы?</string>
</item>
<item>
<key>forums_rules</key>
<string>Can edit forum rules?</string>
<string>Может редактировать правила форумов?</string>
</item>
<item>
<key>forums_skins</key>
<string>Can assign/unassign skins to forums?</string>
<string>Может изменять стиль конкретного форума?</string>
</item>
</items>
</group>
<group>
<grouptitle>Manage Forum Moderators</grouptitle>
<grouptitle>Управление модераторами</grouptitle>
<grouplang>forums_moderators</grouplang>
<items>
<item>
<key>mods_add</key>
<string>Can add new moderators?</string>
<string>Может добавлять модераторов?</string>
</item>
<item>
<key>mods_edit</key>
<string>Can edit moderators?</string>
<string>Может редактировать модераторов?</string>
</item>
<item>
<key>mods_delete</key>
<string>Can delete moderators?</string>
<string>Может удалять модераторов?</string>
</item>
<item>
<key>mods_view</key>
<string>Can list forum moderators?</string>
<string>Может просматривать модераторов?</string>
</item>
</items>
</group>
<group>
<grouptitle>Manage Multi-Moderation</grouptitle>
<grouptitle>Управление мульти-модерацией</grouptitle>
<grouplang>forums_multimods</grouplang>
<items>
<item>
<key>mmod_add</key>
<string>Can add new multi-moderation routines?</string>
<string>Может добавлять новые мульти-модерации?</string>
</item>
<item>
<key>mmod_edit</key>
<string>Can edit multi-moderation routines?</string>
<string>Может изменять существующие мульти-модерации?</string>
</item>
<item>
<key>mmod_delete</key>
<string>Can delete multi-moderation routines?</string>
<string>Может удалять мульти-модерации?</string>
</item>
<item>
<key>mmod_view</key>
<string>Can view multi-moderation routines?</string>
<string>Может просматривать мульти-модерации?</string>
</item>
</items>
</group>
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum RSS Export
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-02-21 08:36:30 -0500 (Thu, 21 Feb 2013) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @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 $Rev: 10914 $
* @version $Rev: 12010 $
*/
if ( ! defined( 'IN_ACP' ) )
@@ -347,7 +347,11 @@ class admin_forums_rss_export extends ipsCommand
/* Reset rss_export cache */
$this->cache->updateCacheWithoutSaving( 'rss_export', array() );
/* Grab the parser file */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$parser = new $classToLoad();
/* Go loopy */
$this->DB->build( array( 'select' => '*', 'from' => 'rss_export' ) );
$outer = $this->DB->execute();
@@ -433,13 +437,16 @@ class admin_forums_rss_export extends ipsCommand
// Parse the post
//-----------------------------------------
$this->settings['__noTruncateUrl'] = 1;
IPSText::getTextClass( 'bbcode' )->parse_smilies = $topic['use_emo'];
IPSText::getTextClass( 'bbcode' )->parse_html = ( $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_html'] and $topic['post_htmlstate'] ) ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $topic['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
$topic['post'] = IPSText::getTextClass('bbcode')->preDisplayParse( $topic['post'] );
/* set up parser */
$parser->set( array( 'memberData' => array( 'member_id' => 0, 'member_group_id' => $this->settings['guest_group'] ),
'parseBBCode' => 1,
'parseHtml' => ( $this->registry->class_forums->forum_by_id[ $topic['forum_id'] ]['use_html'] and $topic['post_htmlstate'] ) ? 1 : 0,
'parseEmoticons' => $topic['use_emo'],
'parseArea' => 'topics' ) );
$topic['post'] = $parser->display( $topic['post'] );
if( $row['rss_export_include_post'] AND $topic['topic_hasattach'] )
{
if ( ! is_object( $_attachments ) )
@@ -476,8 +483,8 @@ class admin_forums_rss_export extends ipsCommand
//$topic['post'] = preg_replace( "#\[attachment=(\d+?)\:(?:[^\]]+?)\]#is", "<a href='{$this->settings['board_url']}/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=\\1'>".$this->settings['board_url']."/index.php?app=forums&module=forums&section=attach&type=post&attach_id=\\1</a>", $topic['post'] );
/* Fix up relative URLs */
$topic['post'] = preg_replace( "#([^/])style_images/(<\#IMG_DIR\#>)#is", "\\1" . $this->settings['board_url'] . "/style_images/\\2" , $topic['post'] );
$topic['post'] = preg_replace( "#([\"'])style_emoticons/#is" , "\\1" . $this->settings['board_url'] . "/style_emoticons/", $topic['post'] );
$topic['post'] = preg_replace( '#([^/])style_images/(<\#IMG_DIR\#>)#is', "\\1" . $this->settings['board_url'] . "/style_images/\\2" , $topic['post'] );
$topic['post'] = preg_replace( '#(["\'])style_emoticons/#is' , "\\1" . $this->settings['board_url'] . "/style_emoticons/", $topic['post'] );
$topic['post'] = $this->registry->output->replaceMacros( $topic['post'] );
File diff suppressed because it is too large. Load diff
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>RSS Import</title>
<title>RSS Импорт</title>
<subitems>
<subitem>
<subitemtitle>RSS Import</subitemtitle>
<subitemtitle>RSS Импорт</subitemtitle>
<subitemlang>rssimports</subitemlang>
<subsection>import</subsection>
<subitemurl>do=overview</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>RSS Export</title>
<title>RSS Экспорт</title>
<subitems>
<subitem>
<subitemtitle>RSS Export</subitemtitle>
<subitemtitle>RSS Экспорт</subitemtitle>
<subitemlang>rssexports</subitemlang>
<subsection>export</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>RSS Management</grouptitle>
<grouptitle>Управление RSS</grouptitle>
<grouplang>forums_rss</grouplang>
<items>
<item>
<key>export_manage</key>
<string>Can manage forum RSS exports?</string>
<string>Может изменять/добавлять RSS экспорт?</string>
</item>
<item>
<key>export_delete</key>
<string>Can delete forum RSS exports?</string>
<string>Может удалять RSS экспорт?</string>
</item>
<item>
<key>import_manage</key>
<string>Can manage forum RSS imports?</string>
<string>Может изменять/добавлять RSS импорт?</string>
</item>
<item>
<key>import_delete</key>
<string>Can delete forum RSS imports?</string>
<string>Может удалять RSS импорт?</string>
</item>
<item>
<key>import_remove</key>
<string>Can remove topics previously imported via RSS?</string>
<string>Может удалять темы импортированные через RSS?</string>
</item>
</items>
</group>
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum Statistics
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-04-19 19:48:56 -0400 (Fri, 19 Apr 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12191 $
*/
@@ -306,7 +306,7 @@ class admin_forums_statistics_stats extends ipsCommand
$graph->options['height'] = 480;
$graph->options['style3D'] = 0;
$graph->options['charttype'] = 'Line';
$graph->options['font'] = IPS_PUBLIC_PATH . 'style_captcha/captcha_fonts/Sathu.ttf';
$graph->options['font'] = IPS_PUBLIC_PATH . 'style_captcha/captcha_fonts/DejaVuSans.ttf';
/* Build Graph */
$graph->addLabels( $labels );
@@ -518,20 +518,26 @@ class admin_forums_statistics_stats extends ipsCommand
{
case 'daily':
$sql_date = "%j %Y";
$php_date = "F jS - Y";
$php_date = "%B %e - %Y";
break;
case 'monthly':
$sql_date = "%m %Y";
$php_date = "F Y";
$php_date = "%B %Y";
break;
default:
// weekly
$sql_date = "%U %Y";
$php_date = "W [F Y]";
$php_date = "%U [%B %Y]";
break;
}
/* @link http://php.net/strftime */
if ( strtoupper( substr( PHP_OS, 0, 3 ) ) == 'WIN' )
{
$php_date = preg_replace( '#(?<!%)((?:%%)*)%e#', '\1%#d', $php_date );
}
/* Table Title */
$title = $this->lang->words[ 'timescale_' . $this->request['timescale'] ] ." {$table} ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} {$this->lang->words['stats_to']} {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})";
@@ -598,11 +604,11 @@ class admin_forums_statistics_stats extends ipsCommand
/* Format Date */
if( $this->request['timescale'] == 'weekly' )
{
$data['_name'] = $this->lang->words['stats_weekno'] . date( $php_date, $data['result_maxdate'] );
$data['_name'] = $this->lang->words['stats_weekno'] . strftime( $php_date, $data['result_maxdate'] );
}
else
{
$data['_name'] = date( $php_date, $data['result_maxdate'] );
$data['_name'] = strftime( $php_date, $data['result_maxdate'] );
}
$rows[] = $data;
@@ -730,7 +736,7 @@ class admin_forums_statistics_stats extends ipsCommand
/* Loop through the results */
$running_total = 0;
$max_result = 0;
$max_result = 1;
$results = array();
$running_total = 0;
@@ -754,7 +760,7 @@ class admin_forums_statistics_stats extends ipsCommand
/* Build the output rows */
$rows = array();
foreach( $results as $data )
{
$running_total += $row['result_count'];
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Registration Stats</title>
<title>Статистика Регистраций</title>
<subitems>
<subitem>
<subitemtitle>Registration Stats</subitemtitle>
<subitemtitle>Статистика Регистраций</subitemtitle>
<subitemlang>stats_reg</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=reg</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>New Topic Stats</title>
<title>Статистика Новых Тем</title>
<subitems>
<subitem>
<subitemtitle>New Topic Stats</subitemtitle>
<subitemtitle>Статистика Новых Тем</subitemtitle>
<subitemlang>stats_topics</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=topic</subitemurl>
@@ -28,10 +28,10 @@
</subitems>
</item>
<item>
<title>Post Stats</title>
<title>Статистика Сообщений</title>
<subitems>
<subitem>
<subitemtitle>Post Stats</subitemtitle>
<subitemtitle>Статистика Сообщений</subitemtitle>
<subitemlang>stats_posts</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=post</subitemurl>
@@ -41,10 +41,10 @@
</subitems>
</item>
<item>
<title>Personal Message</title>
<title>Личные Сообщения</title>
<subitems>
<subitem>
<subitemtitle>Personal Message</subitemtitle>
<subitemtitle>Личные Сообщения</subitemtitle>
<subitemlang>stats_pms</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=msg</subitemurl>
@@ -54,10 +54,10 @@
</subitems>
</item>
<item>
<title>Topic Views</title>
<title>Просмотры Тем</title>
<subitems>
<subitem>
<subitemtitle>Topic Views</subitemtitle>
<subitemtitle>Просмотры Тем</subitemtitle>
<subitemlang>stats_tviews</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=views</subitemurl>
@@ -67,10 +67,10 @@
</subitems>
</item>
<item>
<title>Spam Service</title>
<title>Служба Антиспам</title>
<subitems>
<subitem>
<subitemtitle>Spam Service</subitemtitle>
<subitemtitle>Служба Антиспам</subitemtitle>
<subitemlang>stats_spam</subitemlang>
<subsection>stats</subsection>
<subitemurl>do=spam</subitemurl>
@@ -1,29 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Manage Statistics</grouptitle>
<grouplang>forums_stats</grouplang>
<items>
<item>
<key>stats_topics</key>
<string>Can run reports on new topics?</string>
</item>
<item>
<key>stats_registration</key>
<string>Can run reports on new registrations?</string>
</item>
<item>
<key>stats_posts</key>
<string>Can run reports on new posts?</string>
</item>
<item>
<key>stats_msg</key>
<string>Can run reports on new messages?</string>
</item>
<item>
<key>stats_views</key>
<string>Can run reports on topic views?</string>
</item>
</items>
</group>
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление статистикой</grouptitle>
<grouplang>forums_stats</grouplang>
<items>
<item>
<key>stats_topics</key>
<string>Может просматривать отчет о новых темах?</string>
</item>
<item>
<key>stats_registration</key>
<string>Может просматривать отчет о новых регистрациях?</string>
</item>
<item>
<key>stats_posts</key>
<string>Может просматривать отчет о новых сообщениях?</string>
</item>
<item>
<key>stats_msg</key>
<string>Может просматривать отчет о новых личных сообщениях?</string>
</item>
<item>
<key>stats_views</key>
<string>Может просматривать отчет о просмотрах тем?</string>
</item>
</items>
</group>
</permissions>
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Member management
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -15,7 +15,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 1st march 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Forum Tools</grouptitle>
<grouptitle>Инструменты</grouptitle>
<grouplang>forums_tools</grouplang>
<items>
<item>
<key>ftools_deleteposts</key>
<string>Can delete all posts by a member?</string>
<string>Может удалять все сообщения пользователя?</string>
</item>
<item>
<key>ftools_deletesubscriptions</key>
<string>Can delete all of a member's email notification requests?</string>
<string>Может отменить все подписки пользователя на темы?</string>
</item>
<item>
<key>ftools_clearforumsubs</key>
<string>Can clear all of a forum's email notification requests?</string>
<string>Может отменить все подписки пользователя на форумы?</string>
</item>
</items>
</group>
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Grab attachments and return via AJAX (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Ourputs emoticon list via AJAX (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Fetch topics and other data from the forum
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-08-28 17:56:22 -0400 (Tue, 28 Aug 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
* @version $Revision: 11296 $
*
*/
@@ -96,10 +96,7 @@ class public_forums_ajax_forums extends ipsAjaxCommand
$html .= $this->registry->output->getTemplate('forum')->topic( $tdata, $data['other_data']['forum_data'], $data['other_data'], 1 );
}
}
$html = $this->cleanOutput( $this->parseAndCleanHooks( $html ) );
$pages = $this->parseAndCleanHooks( $data['other_data']['forum_data']['SHOW_PAGES'] );
$this->returnJsonArray( array( 'topics' => $html, 'pages' => $pages, 'hasMore' => $data['other_data']['hasMore'] ) );
$this->returnJsonArray( array( 'topics' => $html, 'pages' => $data['other_data']['forum_data']['SHOW_PAGES'], 'hasMore' => $data['other_data']['hasMore'] ), true );
}
}
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Ajax Functions For Topics
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Retrieve who posted stats
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,153 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.5
* QA system methods (Matt mecham)
* Last Updated: $Date: 2012-08-28 22:56:22 +0100 (Tue, 28 Aug 2012) $
* </pre>
*
* @author $Author: matt $
* @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
* @since 20th February 2002
* @version $Revision: 11296 $
*
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class public_forums_extras_answer extends ipsCommand
{
private $_topicData = array();
private $_postData = array();
private $_forumData = array();
/**
* Class entry point
*
* @param object Registry reference
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Security Check */
if ( $this->request['auth_key'] != $this->member->form_hash )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_001', null, null, 403 );
}
/* Init */
if ( ! $this->registry->isClassLoaded('topics') )
{
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
}
/* Language file */
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ) );
/* Get data */
$tid = intval( $this->request['t'] );
$pid = intval( $this->request['pid'] );
/* Quick check */
if ( ! $tid || ! $pid )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_002', null, null, 404 );
}
/* Get topic */
$this->_topicData = $this->registry->topics->getTopicById( $tid );
$this->_postData = $this->registry->topics->getPostById( $pid );
$this->_forumData = $this->registry->class_forums->getForumById( $this->_topicData['forum_id'] );
/* Another check */
if ( ! $this->_topicData['tid'] || ! $this->_postData['pid'] )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_003', null, null, 404 );
}
/* We being silly? */
if ( $this->_postData['topic_id'] != $tid )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_004', null, null, 403 );
}
/* Have permission to see this topic? */
if ( ! $this->registry->topics->canView( $this->_topicData ) )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_005', null, null, 403 );
}
/* Locked? */
if ( ! $this->memberData['g_is_supmod'] )
{
if ( $this->_topicData['state'] != 'open' )
{
$this->registry->output->showError( 'topic_locked', 'extra_answer_006', true, null, 403 );
}
}
/* What to do? */
switch( $this->request['do'] )
{
default:
case 'answer':
$this->_answer();
break;
case 'unanswer':
$this->_unanswer();
break;
}
}
/**
* Mark post as answered
*
* @return @e void
*/
protected function _unanswer()
{
/* Mark as read */
try
{
$this->registry->topics->unAnswerTopicSingle( $this->_postData, $this->_topicData );
}
catch( Exception $ex )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_unanswer_001', null, null, 403 );
}
$this->registry->output->silentRedirect( $this->settings['base_url'] . "showtopic=".$this->_topicData['tid'] . "&view=findpost&p=" . $this->_postData['pid'] );
}
/**
* Mark post as answered
*
* @return @e void
*/
protected function _answer()
{
/* Mark as read */
try
{
$this->registry->topics->answerTopicSingle( $this->_postData, $this->_topicData );
}
catch( Exception $ex )
{
$this->registry->output->showError( 'no_permission', 'extra_answer_answer_001', null, null, 403 );
}
$this->registry->output->silentRedirect( $this->settings['base_url'] . "showtopic=".$this->_topicData['tid'] . "&view=findpost&p=" . $this->_postData['pid'] );
}
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Board Rules
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-10-10 17:49:08 -0400 (Wed, 10 Oct 2012) $
* </pre>
*
* @author $Author $
@@ -14,7 +14,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 10914 $
* @version $Rev: 11440 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -31,19 +31,17 @@ class public_forums_extras_boardrules extends ipsCommand
* @return @e void [Outputs to screen/redirects]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load editor stuff */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
$editor = new $classToLoad();
{
/* Get board rule (not cached) */
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'core_sys_conf_settings', 'where' => "conf_key='gl_guidelines'" ) );
$editor->setAllowHtml( true );
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
$row['conf_value'] = $editor->switchContent( $row['conf_value'], 0 );
$row['conf_value'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( ( $row['conf_value'] ) ? $row['conf_value'] : $row['conf_default'] );
$this->registry->output->addNavigation( $this->settings['gl_title'], '' );
$this->registry->output->setTitle( $this->settings['gl_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
$this->registry->output->addContent( $this->registry->output->getTemplate('emails')->boardRules( $this->settings['gl_title'], IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['conf_value'] ) ) );
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forward a topic to someone
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-04-15 17:26:30 -0400 (Mon, 15 Apr 2013) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: AndyMillne $
* @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
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 12179 $
*
*/
@@ -58,6 +58,20 @@ class public_forums_extras_forward extends ipsCommand
*/
public function doExecute( ipsRegistry $registry )
{
/* Disabled? */
if ( ! $this->settings['sl_enable'] )
{
$this->registry->output->showError( 'forward_turned_off', 103240.1 );
}
/* Permission Check */
$cache = isset( $this->caches['sharelinks'] ) ? $this->caches['sharelinks'] : ipsRegistry::cache()->getCache('sharelinks');
if ( $cache[ 'email' ]['share_groups'] != '*' and !IPSMember::isInGroup( $this->memberData, explode( ',', $cache[ 'email' ]['share_groups'] ) ) )
{
$this->registry->output->showError( 'forward_turned_off', 103240.2 );
}
//-----------------------------------------
// Grab skin and lang stuff
//-----------------------------------------
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Emoticon and BBCode Legends
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-03-26 09:06:10 -0400 (Tue, 26 Mar 2013) $
* </pre>
*
* @author $Author $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12122 $
*
*/
@@ -161,8 +161,20 @@ class public_forums_extras_legends extends ipsCommand
}
$before = htmlspecialchars( $row['bbcode_example'] );
$t = IPSText::getTextClass( 'bbcode' )->preDisplayParse( IPSText::getTextClass( 'bbcode' )->preDbParse( $before ) );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$parser = new $classToLoad();
/* Set up some settings */
$parser->set( array( 'memberData' => $this->memberData,
'parseBBCode' => true,
'parseHtml' => false,
'parseEmoticons' => true ) );
/* img is hardcoded as the new style format was never available in the php bbcode parser and is handled via js library now */
$t = ( $row['bbcode_tag'] == 'img' ) ? "<img src='http://www.google.com/intl/en_ALL/images/logo.gif' />" : $t = $parser->display( $before );
$before = preg_replace( "#(\[".$row['bbcode_tag']."(?:[^\]]+)?\])#is", $this->registry->output->getTemplate('legends')->wrap_tag("\\1"), $before );
$before = preg_replace( "#(\[/".$row['bbcode_tag']."\])#is" , $this->registry->output->getTemplate('legends')->wrap_tag("\\1"), $before );
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Add rating fallback
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-03-19 10:12:37 -0400 (Tue, 19 Mar 2013) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @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
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 12086 $
*
*/
@@ -137,9 +137,9 @@ class public_forums_extras_rating extends ipsCommand
$rating_id = 5;
}
if( $rating_id < 0 )
if( $rating_id < 1 )
{
$rating_id = 0;
$rating_id = 1;
}
//-----------------------------------------
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Member stats functions
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-11-08 12:08:29 -0500 (Thu, 08 Nov 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: AndyMillne $
* @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
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 11578 $
*
*/
@@ -367,125 +367,128 @@ class public_forums_extras_stats extends ipsCommand
/* Get a count */
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as dracula', 'from' => array( 'members' => 'm' ), 'where' => implode( ' OR ', $whereClause ) ) );
/* Sort out pagination */
$pagination = $this->registry->output->generatePagination( array( 'totalItems' => $count['dracula'],
'itemsPerPage' => $perpage,
'currentStartValue' => $st,
'baseUrl' => "app=forums&module=extras&section=stats&do=leaders" ) );
/* Fetch the ones we want */
$this->DB->build( array(
'select' => 'm.*, m.member_id as my_member_id',
'from' => array( 'members' => 'm' ),
'add_join' => array(
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=m.member_id',
'type' => 'left',
if ( $count['dracula'] )
{
/* Sort out pagination */
$pagination = $this->registry->output->generatePagination( array( 'totalItems' => $count['dracula'],
'itemsPerPage' => $perpage,
'currentStartValue' => $st,
'baseUrl' => "app=forums&module=extras&section=stats&do=leaders" ) );
/* Fetch the ones we want */
$this->DB->build( array(
'select' => 'm.*, m.member_id as my_member_id',
'from' => array( 'members' => 'm' ),
'add_join' => array(
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'pp.pp_member_id=m.member_id',
'type' => 'left',
),
array(
'select' => 'pf.*',
'from' => array( 'pfields_content' => 'pf' ),
'where' => 'pf.member_id=m.member_id',
'type' => 'left',
),
),
array(
'select' => 'pf.*',
'from' => array( 'pfields_content' => 'pf' ),
'where' => 'pf.member_id=m.member_id',
'type' => 'left',
),
),
'where' => implode( ' OR ', $whereClause ),
'order' => 'm.members_display_name',
'limit' => array( $st, $perpage )
) );
$e = $this->DB->execute();
while( $r = $this->DB->fetch( $e ) )
{
/* Reset member ID just in case.. */
$r['member_id'] = $r['my_member_id'];
$members[ $r['member_id'] ] = IPSMember::buildDisplayData( $r );
}
/* Now fetch session data */
$this->DB->build( array( 'select' => '*',
'from' => 'sessions',
'where' => 'member_id IN (' . implode( ',', array_keys( $members ) ) . ')' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
if( ! $r['id'] or IPSMember::isLoggedInAnon( $members[ $r['member_id'] ] ) )
{
$location_info[ $r['member_id'] ] = '';
}
else
{
$location_info[ $r['member_id'] ] = IPSMember::getLocation( $r );
}
}
//-----------------------------------------
// Display
//-----------------------------------------
foreach( $members as $k => $member )
{
$forums = isset( $member_ids[ $member['member_id'] ] ) ? $member_ids[ $member['member_id'] ] : array();
if ( $forums == '*' )
{
$forums = $this->lang->words['leader_all_forums'];
}
else
{
$forums = array();
'where' => implode( ' OR ', $whereClause ),
'order' => 'm.members_display_name',
'limit' => array( $st, $perpage )
) );
foreach ( $group_ids as $gid => $fs )
$e = $this->DB->execute();
while( $r = $this->DB->fetch( $e ) )
{
/* Reset member ID just in case.. */
$r['member_id'] = $r['my_member_id'];
$members[ $r['member_id'] ] = IPSMember::buildDisplayData( $r );
}
/* Now fetch session data */
$this->DB->build( array( 'select' => '*',
'from' => 'sessions',
'where' => 'member_id IN (' . implode( ',', array_keys( $members ) ) . ')' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
if( ! $r['id'] or IPSMember::isLoggedInAnon( $members[ $r['member_id'] ] ) )
{
if ( IPSMember::isInGroup( $member, $gid ) )
$location_info[ $r['member_id'] ] = '';
}
else
{
$location_info[ $r['member_id'] ] = IPSMember::getLocation( $r );
}
}
//-----------------------------------------
// Display
//-----------------------------------------
foreach( $members as $k => $member )
{
$forums = isset( $member_ids[ $member['member_id'] ] ) ? $member_ids[ $member['member_id'] ] : array();
if ( $forums == '*' )
{
$forums = $this->lang->words['leader_all_forums'];
}
else
{
$forums = array();
foreach ( $group_ids as $gid => $fs )
{
if ( $fs == '*' )
if ( IPSMember::isInGroup( $member, $gid ) )
{
$forums = $this->lang->words['leader_all_forums'];
break;
}
else
{
foreach ( $fs as $f_id => $f_name )
if ( $fs == '*' )
{
if ( ! isset( $forums[ $f_id ] ) && $this->registry->getClass('class_forums')->forumsCheckAccess( $f_id, 0, 'forum', array(), true ) )
$forums = $this->lang->words['leader_all_forums'];
break;
}
else
{
foreach ( $fs as $f_id => $f_name )
{
$forums[ $f_id ] = $f_name;
if ( ! isset( $forums[ $f_id ] ) && $this->registry->getClass('class_forums')->forumsCheckAccess( $f_id, 0, 'forum', array(), true ) )
{
$forums[ $f_id ] = $f_name;
}
}
}
}
}
/* Now merge in member specific */
if ( ! is_string( $forums ) && ! empty( $forumsMembers[ $member['member_id'] ] ) )
{
foreach( $forumsMembers[ $member['member_id'] ] as $f_id => $f_name )
{
if ( ! isset( $forums[ $f_id ] ) && $this->registry->getClass('class_forums')->forumsCheckAccess( $f_id, 0, 'forum', array(), true ) )
{
$forums[ $f_id ] = $f_name;
}
}
}
}
/* Now merge in member specific */
if ( ! is_string( $forums ) && ! empty( $forumsMembers[ $member['member_id'] ] ) )
/* Do not list if the user cannot see the forums this mod is a mod of - Bug report 36929 */
if ( empty( $forums ) )
{
foreach( $forumsMembers[ $member['member_id'] ] as $f_id => $f_name )
{
if ( ! isset( $forums[ $f_id ] ) && $this->registry->getClass('class_forums')->forumsCheckAccess( $f_id, 0, 'forum', array(), true ) )
{
$forums[ $f_id ] = $f_name;
}
}
unset( $members[ $k ] );
continue;
}
$members[ $k ]['forums'] = $forums;
$members[ $k ]['online_extra'] = isset( $location_info[ $k ]['online_extra'] ) ? $location_info[ $k ]['online_extra'] : '';
$members[ $k ]['last_active'] = ( $members[ $k ]['member_id'] == $this->memberData['member_id'] ) ? IPS_UNIX_TIME_NOW : ( ( $members[ $k ]['online_extra'] ) ? $members[ $k ]['last_activity'] : $members[ $k ]['last_visit'] );
}
/* Do not list if the user cannot see the forums this mod is a mod of - Bug report 36929 */
if ( empty( $forums ) )
{
unset( $members[ $k ] );
continue;
}
$members[ $k ]['forums'] = $forums;
$members[ $k ]['online_extra'] = isset( $location_info[ $k ]['online_extra'] ) ? $location_info[ $k ]['online_extra'] : '';
$members[ $k ]['last_active'] = ( $members[ $k ]['member_id'] == $this->memberData['member_id'] ) ? IPS_UNIX_TIME_NOW : ( ( $members[ $k ]['online_extra'] ) ? $members[ $k ]['last_activity'] : $members[ $k ]['last_visit'] );
}
}
@@ -562,6 +565,8 @@ class public_forums_extras_stats extends ipsCommand
$this->DB->build( array('select' => 'post_author_id, COUNT(post_id) as tpost',
'from' => 'forums_recent_posts',
'where' => "post_date > {$time_low} AND post_forum_id IN(" . implode( ',', $fiddyCent ) . ')',
'order' => 'tpost DESC',
'limit' => array( 0, 20 ),
'group' => 'post_author_id' ) );
$this->DB->execute();
@@ -608,8 +613,6 @@ class public_forums_extras_stats extends ipsCommand
uasort( $rows, create_function( '$a,$b', 'return $a[\'today_pct\']<$b[\'today_pct\'];' ) );
$rows = array_slice( $rows, 0, 20 );
$this->output .= $this->registry->getClass('output')->getTemplate('stats')->top_posters( $rows );
$this->registry->output->setTitle( $this->lang->words['top_poster_title'] . ' - ' . ipsRegistry::$settings['board_name'] );
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Silly toggle function(?s{0,})
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -15,7 +15,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 10721 $
*
*/
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Poll voting
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-11-06 04:19:50 -0500 (Tue, 06 Nov 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: mmecham $
* @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
* @since 20th February 2002
* @version $Revision: 10914 $
* @version $Revision: 11558 $
*
*/
@@ -215,7 +215,7 @@ class public_forums_extras_vote extends ipsCommand
// Unparse the choices
//-----------------------------------------
$poll_answers = unserialize( stripslashes( $this->topic['choices'] ) );
$poll_answers = IPSLib::safeUnserialize( stripslashes( $this->topic['choices'] ) );
reset($poll_answers);
//-----------------------------------------
@@ -280,7 +280,7 @@ class public_forums_extras_vote extends ipsCommand
{
$this->topic['last_vote'] = time();
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'], 'last_post' => $this->topic['last_post'] ), 'tid=' . $this->topic['tid'] );
$this->DB->update( 'topics', array( 'last_vote' => $this->topic['last_vote'] ), 'tid=' . $this->topic['tid'] );
}
}
else
@@ -342,8 +342,8 @@ class public_forums_extras_vote extends ipsCommand
// Remove our votes
//-----------------------------------------
$myVotes = unserialize( $voter['member_choices'] );
$pollData = unserialize( stripslashes( $this->topic['choices'] ) );
$myVotes = IPSLib::safeUnserialize( $voter['member_choices'] );
$pollData = IPSLib::safeUnserialize( stripslashes( $this->topic['choices'] ) );
if ( is_array( $myVotes ) AND is_array( $pollData ) )
{
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Announcement View
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* View Topic Attachments
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 10721 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Board Index View
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-15 22:23:38 -0400 (Wed, 15 May 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12254 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -303,9 +303,19 @@ class public_forums_forums_boards extends ipsCommand
'member_group' => $this->memberData['member_group_id'] ) );
}
$this->DB->build( array('select' => 'id, member_id, member_name, seo_name, login_type, running_time, member_group, uagent_type',
'from' => 'sessions',
'where' => "running_time > {$time}" ) );
$this->DB->build( array('select' => 's.id, s.member_id, s.member_name, s.seo_name, s.login_type, s.running_time, s.member_group, s.uagent_type',
'from' => array( 'sessions' => 's' ),
'where' => "running_time > {$time}",
'add_join' => array(
array(
'select' => 'm.member_banned',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=s.member_id',
'type' => 'left',
)
)
) );
$this->DB->execute();
//-----------------------------------------
@@ -327,8 +337,15 @@ class public_forums_forums_boards extends ipsCommand
$cached = array();
foreach ( $rows as $result )
{
$last_date = $this->registry->getClass('class_localization')->getDate( $result['running_time'], 'TINY' );
{
//-----------------------------------------
// Skip Banned
//-----------------------------------------
if ( $result['member_banned'] )
{
continue;
}
//-----------------------------------------
// Bot?
@@ -389,7 +406,7 @@ class public_forums_forums_boards extends ipsCommand
{
if ( $this->memberData['g_access_cp'] || ( $this->memberData['member_id'] == $result['member_id'] ) )
{
$active['NAMES'][] = IPSMember::makeProfileLink( $result['member_name'], $result['member_id'], $result['seo_name'], '', $last_date ) . "*";
$active['NAMES'][] = IPSMember::makeProfileLink( $result['member_name'], $result['member_id'], $result['seo_name'] ) . "*";
$active['ANON']++;
}
else
@@ -400,7 +417,7 @@ class public_forums_forums_boards extends ipsCommand
else
{
$active['MEMBERS']++;
$active['NAMES'][] = IPSMember::makeProfileLink( $result['member_name'], $result['member_id'], $result['seo_name'], '', $last_date );
$active['NAMES'][] = IPSMember::makeProfileLink( $result['member_name'], $result['member_id'], $result['seo_name'] );
}
}
}
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Bounces a user to the right post
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-08 12:08:00 -0400 (Wed, 08 May 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12237 $
* @since 14th April 2004
*
* | > Interesting Fact: I've had iTunes playing every Radiohead tune
@@ -47,82 +47,65 @@ class public_forums_forums_findpost extends ipsCommand
// will do that for us. Woohoop
//-----------------------------------------
$pid = intval($this->request['pid']);
if ( ! $pid )
$pid = intval( str_replace( 'post', '', $this->request['pid'] ) );
if ( ! $pid && ! $this->request['t'])
{
$this->registry->getClass('output')->showError( 'findpost_missing_pid', 10331, null, null, 404 );
}
//-----------------------------------------
// Get topic...
//-----------------------------------------
$post = $this->DB->buildAndFetch( array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=' . $pid,
'add_join' => array( array( 'select' => 't.*',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
'type' => 'left' ) ) ) );
if ( ! $post['topic_id'] )
/* Init */
if ( ! $this->registry->isClassLoaded('topics') )
{
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332, null, null, 404 );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
}
//-----------------------------------------
// Get post...
// @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/old-findpostphp-methods-not-accounting-for-view-perms-r42027
// We have to get all posts and then verify if we can see them from here in order to account for moderator permissions properly
//-----------------------------------------
$post = $this->registry->topics->getPostById( $pid, true, array( 'postType' => array( 'visible', 'sdelete', 'hidden' ) ) );
if ( ! $post['pid'] OR
( !$this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( $post['forum_id'] ) && $this->registry->getClass('class_forums')->fetchHiddenType( $post ) == 'sdelete' ) OR
( $this->registry->getClass('class_forums')->canQueuePosts( $post['forum_id'] ) && $this->registry->getClass('class_forums')->fetchHiddenType( $post ) == 'hidden' )
)
{
/* Could not get the post (could be hidden, could be deleted, could be stolen by ninja aliens) */
if ( $this->request['t'] )
{
$topic = $this->registry->topics->getTopicById( $this->request['t'] );
if ( $topic['tid'] )
{
/* Got access? */
if ( $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
{
/* Redirect to page 1 of this topic */
$url = $this->registry->output->buildSEOUrl( "showtopic=" . $topic['tid'], 'public', $topic['title_seo'], 'showtopic' );
$this->registry->getClass('output')->silentRedirect( $url, false, 302 );
}
}
}
/* Nah, just dump it 'den */
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332, null, null, 404 );
}
/* Check permission */
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $post['forum_id'], 0, 'topic', $post, TRUE ) )
{
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332.1, null, null, 404 );
$this->registry->getClass('output')->showError( 'findpost_missing_topic', 10332.1, null, null, 403 );
}
$pageUrlParam = '&page=' . $this->registry->getClass('topics')->postToPage( $post );
$sort_field = ($this->settings['post_order_column'] == 'pid') ? 'pid' : 'post_date';
$sort_value = $sort_field == 'pid' ? $pid : $post['post_date'];
$url = $this->registry->output->buildSEOUrl( "showtopic=" . $post['topic_id'] . "{$pageUrlParam}" . "&#entry" . $pid, 'public', $post['title_seo'], 'showtopic' );
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery('visible');
/* Can we deal with hidden posts? */
if ( $this->registry->class_forums->canQueuePosts( $post['forum_id'] ) )
{
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'approved', 'sdeleted', 'hidden' ) );
}
else
{
/* Otherwise, see queued and approved */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ) );
}
}
else
{
/* We cannot see hidden posts */
if ( $this->permissions['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted') );
}
}
$cposts = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$post['topic_id']} AND {$sort_field} <=" . intval( $sort_value ) . $query ) );
if ( (($cposts['posts']) % $this->settings['display_max_posts']) == 0 )
{
$pages = ($cposts['posts']) / $this->settings['display_max_posts'];
}
else
{
$number = ( ($cposts['posts']) / $this->settings['display_max_posts'] );
$pages = ceil( $number);
}
$st = ($pages - 1) * $this->settings['display_max_posts'];
$hl = $this->request['hl'] ? '&hl=' . trim( $this->request['hl'] ) : '';
$url = $this->registry->output->buildSEOUrl( "showtopic=" . $post['topic_id'] . "&st={$st}&p={$pid}" . $hl . "&#entry" . $pid, 'public', $post['title_seo'], 'showtopic' );
$this->registry->getClass('output')->silentRedirect( $url );
$this->registry->getClass('output')->silentRedirect( $url, false, 302 );
}
}
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forum Viewing
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-05-06 14:16:05 -0400 (Mon, 06 May 2013) $
* </pre>
*
* @author $Author: bfarber $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
* @version $Rev: 12229 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -168,11 +168,17 @@ class public_forums_forums_forums extends ipsCommand
if( $this->forum['show_rules'] == 2)
{
IPSText::getTextClass( 'bbcode' )->parsing_section = 'rules';
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
/* Load parser */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$parser = new $classToLoad();
$this->forum['rules_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $this->forum['rules_text'] );
$parser->set( array( 'memberData' => array( 'member_group_id' => $this->settings['admin_group'] ),
'parseBBCode' => true,
'parseArea' => 'rules',
'parseHtml' => true,
'parseEmoticons' => true ) );
$this->forum['rules_text'] = $parser->display( $this->forum['rules_text'] );
/* @link http://community.invisionpower.com/tracker/issue-37441-forum-rules/ */
$this->forum['rules_text'] = str_replace( "<span rel='lightbox'>", "<span>", $this->forum['rules_text'] );
@@ -261,7 +267,7 @@ class public_forums_forums_forums extends ipsCommand
// st will always be defined across pages
//-----------------------------------------
if( !array_key_exists( 'st', $this->request ) AND !array_key_exists( 'prune_day', $this->request ) )
if( !array_key_exists( 'page', $this->request ) AND !array_key_exists( 'prune_day', $this->request ) )
{
IPSCookie::set('modtids', ',', 0);
$this->request['selectedtids'] = '';
@@ -484,7 +490,7 @@ class public_forums_forums_forums extends ipsCommand
// INIT
//-----------------------------------------
$this->request['st'] = $this->request['changefilters'] ? 0 : ( isset($this->request['st']) ? intval($this->request['st']) : 0 );
$this->request['page'] = $this->request['changefilters'] ? 0 : ( isset($this->request['page']) ? intval($this->request['page']) : 0 );
$announce_data = array();
$topic_data = array();
$other_data = array();
@@ -572,8 +578,8 @@ class public_forums_forums_forums extends ipsCommand
// Read topics
//-----------------------------------------
$First = intval($this->request['st']);
$First = $this->registry->class_forums->pageToSt( intval($this->request['page']) );
//-----------------------------------------
// Sort options
//-----------------------------------------
@@ -640,14 +646,14 @@ class public_forums_forums_forums extends ipsCommand
$Prune = $prune_value < 100 ? (time() - ($prune_value * 60 * 60 * 24)) : ( ( $prune_value == 200 AND $this->memberData['member_id'] ) ? $this->memberData['last_visit'] : 0 );
$sort_keys = array( 'last_post' => 'sort_by_date',
'last_poster_name' => 'sort_by_last_poster',
'title' => 'sort_by_topic',
'starter_name' => 'sort_by_poster',
'start_date' => 'sort_by_start',
'topic_hasattach' => 'sort_by_attach',
'posts' => 'sort_by_replies',
'views' => 'sort_by_views',
$sort_keys = array( 'last_post' => 'sort_by_date',
'last_poster_name' => 'sort_by_last_poster',
'title' => 'sort_by_topic',
'starter_name' => 'sort_by_poster',
'start_date' => 'sort_by_start',
'topic_hasattach' => 'sort_by_attach',
'posts' => 'sort_by_replies',
'views' => 'sort_by_views',
);
@@ -687,7 +693,7 @@ class public_forums_forums_forums extends ipsCommand
// check for any form funny business by wanna-be hackers
//-----------------------------------------
if( ( ! isset( $filter_keys[$topicfilter] ) ) or ( ! isset( $sort_keys[$sort_key] ) ) or ( ! isset( $prune_by_day[$prune_value] ) ) or ( ! isset( $sort_by_keys[$sort_by] ) ) )
if( ( ! isset( $filter_keys[$topicfilter] ) ) or ( ! isset( $sort_keys[$sort_key] ) ) or ( ! isset( $prune_by_day[$prune_value] ) ) or ( ! isset( $sort_by_keys[ strtoupper($sort_by) ] ) ) )
{
$this->registry->getClass('output')->showError( 'forums_bad_filter', 10339 );
}
@@ -740,6 +746,19 @@ class public_forums_forums_forums extends ipsCommand
$add_query_array[] = "t.starter_id='".$this->memberData['member_id']."'";
}
/* Answered / unanswered */
if ( isset( $this->request['answered'] ) && $this->registry->class_forums->answerTopicsEnabled( $this->forum['id'] ) )
{
if ( $this->request['answered'] == 'true' )
{
$add_query_array[] = 't.topic_answered_pid != 0';
}
else if ( $this->request['answered'] == 'false' )
{
$add_query_array[] = 't.topic_answered_pid = 0';
}
}
$_SQL_EXTRA = '';
$_SQL_APPROVED = '';
$_SQL_AGE_PRUNE = '';
@@ -748,55 +767,60 @@ class public_forums_forums_forums extends ipsCommand
{
$_SQL_EXTRA = ' AND '. implode( ' AND ', $add_query_array );
}
//-----------------------------------------
// Moderator?
//-----------------------------------------
$this->request['modfilter'] = isset( $this->request['modfilter'] ) ? $this->request['modfilter'] : '';
$modFilter = '';
if ( $this->memberData['is_mod'] )
{
{
if ( $this->request['modfilter'] == 'unapproved' )
{
$_SQL_APPROVED = ' AND (' . $this->registry->class_forums->fetchTopicHiddenQuery(array('hidden'), 't.') . ' OR t.topic_queuedposts )';
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('hidden'), 't.') . ' OR t.topic_queuedposts';
}
elseif ( $this->permissions['TopicSoftDeleteSee'] )
{
if ( $this->request['modfilter'] == 'hidden' )
{
$_SQL_APPROVED = ' AND (' . $this->registry->class_forums->fetchTopicHiddenQuery(array('sdeleted'), 't.') . ' OR t.topic_deleted_posts )';
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('sdeleted'), 't.') . ' OR t.topic_deleted_posts';
}
else
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden', 'sdeleted'), 't.');
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden', 'sdeleted'), 't.');
}
}
else
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden'), 't.');
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'hidden'), 't.');
}
}
else
{
if ( $this->permissions['TopicSoftDeleteSee'] )
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'sdeleted'), 't.');
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('visible', 'sdeleted'), 't.');
}
else
{
$_SQL_APPROVED = ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery(array('visible'), 't.');
$modFilter = $this->registry->class_forums->fetchTopicHiddenQuery(array('visible'), 't.');
}
}
if ( $Prune )
if ( $modFilter )
{
$_SQL_APPROVED = ' AND (' . $modFilter . ')';
}
if ( $Prune )
{
if ( $prune_value == 200 )
{
/* Just new content, don't show pinned, please */
if( $this->memberData['is_mod'] AND $this->request['modfilter'] )
if( $modFilter )
{
$_SQL_AGE_PRUNE = " AND (t.last_post > {$Prune} OR t.approved=0)";
$_SQL_AGE_PRUNE = " AND (t.last_post > {$Prune} AND ( {$modFilter} ) )";
}
else
{
@@ -805,9 +829,9 @@ class public_forums_forums_forums extends ipsCommand
}
else
{
if( $this->memberData['is_mod'] AND $this->request['modfilter'] )
if( $modFilter )
{
$_SQL_AGE_PRUNE = " AND (t.pinned=1 or t.last_post > {$Prune} OR t.approved=0)";
$_SQL_AGE_PRUNE = " AND (t.pinned=1 or t.last_post > {$Prune} AND ( {$modFilter} ) )";
}
else
{
@@ -861,16 +885,22 @@ class public_forums_forums_forums extends ipsCommand
// Generate the forum page span links
//-----------------------------------------
$_extraStuff = '';
$_extraStuff = '';
if( $this->request['modfilter'] )
if ( $this->request['modfilter'] )
{
$_extraStuff .= "&amp;modfilter=" . $this->request['modfilter'];
$_extraStuff .= "&amp;modfilter=" . $this->request['modfilter'];
}
if ( isset( $this->request['answered'] ) && $this->registry->class_forums->answerTopicsEnabled( $this->forum['id'] ) )
{
$_extraStuff .= "&amp;answered=" . $this->request['answered'];
}
$this->forum['SHOW_PAGES'] = $this->registry->getClass('output')->generatePagination( array( 'totalItems' => $total_possible['max'],
'itemsPerPage' => $this->settings['display_max_topics'],
'currentStartValue' => $this->request['st'],
'currentStartValue' => intval( $this->request['page'] ),
'isPagesMode' => true,
'seoTitle' => $this->forum['name_seo'],
'disableSinglePage' => false,
'baseUrl' => "showforum=".$this->forum['id']."&amp;prune_day={$prune_value}&amp;sort_by={$sort_by}&amp;sort_key={$sort_key_chk}&amp;topicfilter={$topicfilter}{$_extraStuff}" ) );
@@ -880,7 +910,7 @@ class public_forums_forums_forums extends ipsCommand
//-----------------------------------------
$other_data = array( 'forum_data' => $this->forum,
'hasMore' => ( $this->request['st'] + $this->settings['display_max_topics'] > $total_possible['max'] ) ? false : true,
'hasMore' => ( $this->registry->class_forums->pageToSt( $this->request['page'] ) + $this->settings['display_max_topics'] > $total_possible['max'] ) ? false : true,
'can_edit_topics' => $this->can_edit_topics,
'can_open_topics' => $this->can_open_topics,
'can_close_topics' => $this->can_close_topics,
@@ -900,6 +930,8 @@ class public_forums_forums_forums extends ipsCommand
// Cut off?
//-----------------------------------------
$modAll = ( $this->memberData['g_is_supmod'] or ( isset( $this->memberData['forumsModeratorData'][ $this->forum['id'] ] ) and ( $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['delete_topic'] or $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['move_topic'] or $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['split_merge'] ) ) );
$parse_dots = 1;
if( $topicfilter == 'ireplied' )
@@ -938,11 +970,37 @@ class public_forums_forums_forums extends ipsCommand
'limit' => array( intval($First), $this->settings['display_max_topics'] ),
'add_join' => ( $this->settings['tags_enabled'] AND !$this->forum['bw_disable_tagging'] ) ? array( $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) ) ) : array()
) );
$this->DB->execute();
}
while( $t = $this->DB->fetch() )
{
/* Should we display the moderate checkbox for this post? */
$t['moddable'] = FALSE;
if
(
$modAll
or
(
isset( $this->memberData['forumsModeratorData'][ $this->forum['id'] ] )
and
(
( $t['pinned'] == 0 and $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['pin_topic'] )
or
( $t['pinned'] == 1 and $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['unpin_topic'] )
or
( $t['state'] == 'open' and $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['close_topic'] )
or
( $t['state'] == 'closed' and $this->memberData['forumsModeratorData'][ $this->forum['id'] ]['open_topic'] )
)
)
)
{
$t['moddable'] = TRUE;
}
/* Add to array */
$topic_array[ $t['tid'] ] = $t;
$topic_ids[ $t['tid'] ] = $t['tid'];
@@ -956,7 +1014,7 @@ class public_forums_forums_forums extends ipsCommand
$member_ids[ $t['starter_id'] ] = $t['starter_id'];
}
}
ksort( $topic_ids );
//-----------------------------------------
@@ -967,7 +1025,7 @@ class public_forums_forums_forums extends ipsCommand
{
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), '' );
$this->DB->build( array( 'select' => 'author_id, topic_id',
$this->DB->build( array( 'select' => $this->DB->buildDistinct( 'topic_id' ),
'from' => 'posts',
'where' => $_queued . ' AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topic_ids ) . ')' ) );
@@ -977,7 +1035,7 @@ class public_forums_forums_forums extends ipsCommand
{
if ( is_array( $topic_array[ $p['topic_id'] ] ) )
{
$topic_array[ $p['topic_id'] ]['author_id'] = $p['author_id'];
$topic_array[ $p['topic_id'] ]['author_id'] = $this->memberData['member_id'];
}
}
}
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Forums -> Mark As Read command class
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2013-01-29 18:38:34 -0500 (Tue, 29 Jan 2013) $
* </pre>
*
* @author Matt Mecham
@@ -15,7 +15,7 @@
* @subpackage Forums
* @link http://www.invisionpower.com
* @since Tuesday 1st March 2005 (11:52)
* @version $Rev: 10914 $
* @version $Rev: 11914 $
*
*/
@@ -49,7 +49,7 @@ class public_forums_forums_markasread extends ipsCommand
return $this->markBoardAsRead();
break;
case 'app':
return $this->markBoardAsRead( trim( $this->request['markApp'] ) );
return $this->markBoardAsRead( is_string( $this->request['markApp'] ) ? trim( $this->request['markApp'] ) : "" );
break;
}
}
@@ -80,7 +80,7 @@ class public_forums_forums_markasread extends ipsCommand
# Bug fix 21223 - reset all markers with one cookie save
$this->registry->classItemMarking->markAppAsRead( $app );
if( $app && !in_array( $app, array('core','forums') ) )
if( $app && $app != 'core' )
{
$this->registry->getClass('output')->silentRedirect( $this->settings['base_url'] . 'app=' . $app, 'false' );
}
@@ -3,18 +3,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Show forum rules
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* Last Updated: $Date: 2012-12-13 08:29:08 -0500 (Thu, 13 Dec 2012) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: AndyMillne $
* @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 $Rev: 10914 $
* @version $Rev: 11713 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -110,13 +110,18 @@ class public_forums_forums_rules extends ipsCommand
$rules['body'] = $tmp['rules_text'];
$rules['fid'] = $this->forum['id'];
$rules['fseo'] = $this->forum['name_seo'];
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
IPSText::getTextClass( 'bbcode' )->parse_html = 1;
IPSText::getTextClass( 'bbcode' )->parse_nl2br = 1;
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
IPSText::getTextClass( 'bbcode' )->parsing_section = 'rules';
$rules['body'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $rules['body'] );
/* Load parser */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$parser = new $classToLoad();
$parser->set( array( 'memberData' => array( 'member_group_id' => $this->settings['admin_group'] ),
'parseBBCode' => true,
'parseArea' => 'rules',
'parseHtml' => true,
'parseEmoticons' => true ) );
$rules['body'] = $parser->display( $rules['body'] );
/* @link http://community.invisionpower.com/tracker/issue-37441-forum-rules/ */
$rules['body'] = str_replace( "<span rel='lightbox'>", "<span>", $rules['body'] );
@@ -2,9 +2,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Topic View
* Last Updated: $Date: 2012-07-02 16:40:12 -0400 (Mon, 02 Jul 2012) $
* Last Updated: $Date: 2013-05-02 11:20:01 -0400 (Thu, 02 May 2013) $
* </pre>
*
* @author $Author: AndyMillne $
@@ -13,7 +13,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 11021 $
* @version $Rev: 12213 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -97,6 +97,12 @@ class public_forums_forums_topics extends ipsCommand
*/
protected $_maxPostDate = 0;
/**
* Parser object
*
*/
protected $_textParser = '';
/**
* Mod actions
*
@@ -166,13 +172,19 @@ class public_forums_forums_topics extends ipsCommand
$topicData = $this->registry->getClass('topics')->getTopicData();
$forumData = $this->forumClass->getForumById( $topicData['forum_id'] );
/* VigLink */
if ( !$forumData['viglink'] )
{
$this->settings['viglink_enabled'] = FALSE;
}
/* Rating */
$this->can_rate = $this->memberData['member_id'] ? intval( $this->memberData['g_topic_rate_setting'] ) : 0;
/* Set up topic */
$topicData = $this->topicSetUp( $topicData );
/* Specific view? */
$this->_doViewCheck();
@@ -187,12 +199,12 @@ class public_forums_forums_topics extends ipsCommand
$this->archiveReader->setApp('forums');
$postData = $this->archiveReader->get( array( 'parentData' => $topicData,
'goNative' => true,
'offset' => intval( $this->request['st'] ),
'limit' => intval( $this->settings['display_max_posts'] ),
'sortKey' => $this->settings['post_order_column'],
'sortOrder' => $this->settings['post_order_sort'] ) );
$postData = $this->archiveReader->get( array( 'parentData' => $topicData,
'goNative' => true,
'offset' => intval( $this->registry->getClass('topics')->pageToSt( $this->request['page'] ) ),
'limit' => intval( $this->settings['display_max_posts'] ),
'sortKey' => $this->settings['post_order_column'],
'sortOrder' => $this->settings['post_order_sort'] ) );
}
else
{
@@ -208,6 +220,15 @@ class public_forums_forums_topics extends ipsCommand
}
}
/* Do we have a P parameter, and if so, is it actually in this set of results? */
if ( ! $this->request['view'] && ( $this->request['p'] && ! in_array( $this->request['p'], array_keys( $postData ) ) ) )
{
/* Go find it */
$this->request['view'] = 'findpost';
$this->_doViewCheck();
/* Exits above */
}
unset( $this->cached_members );
/* Status? */
@@ -251,6 +272,12 @@ class public_forums_forums_topics extends ipsCommand
}
}
/* add meta update time */
if ( $this->_maxPostDate )
{
$this->registry->output->addMetaTag( 'og:updated_time', $this->_maxPostDate, false );
}
/* Set has unread flag */
$forumData['_hasUnreadTopics'] = $this->registry->getClass('class_forums')->getHasUnread( $forumData['id'] );
@@ -268,22 +295,23 @@ class public_forums_forums_topics extends ipsCommand
$poll_data = ( $topicData['poll_state'] ) ? $this->_generatePollOutput() : array( 'html' => '', 'poll' => '' );
$displayData = array( 'fast_reply' => $this->_getFastReplyData(),
'multi_mod' => $this->registry->getClass('topics')->getMultiModerationData(),
'reply_button' => $this->_getReplyButtonData(),
'active_users' => $this->_getActiveUserData(),
'mod_links' => ( $this->registry->getClass('topics')->isArchived( $topicData ) ) ? '' : $this->_generateModerationPanel(),
'follow_data' => ( $this->registry->getClass('topics')->isArchived( $topicData ) or $topicData['_isDeleted'] ) ? '' : $this->_like->render( 'summary', $topicData['tid'] ),
'same_tagged' => ( $this->registry->getClass('topics')->isArchived( $topicData ) ) ? '' : $this->_getSameTaggedData(),
'poll_data' => $poll_data,
'load_editor_js' => ( $this->_getFastReplyData() && $topicData['_isDeleted'] ) ? true : false,
'smilies' => '' );
$displayData = array( 'fast_reply' => $this->_getFastReplyData(),
'multi_mod' => $this->registry->getClass('topics')->getMultiModerationData(),
'reply_button' => $this->_getReplyButtonData(),
'active_users' => $this->_getActiveUserData(),
'mod_links' => ( $this->registry->getClass('topics')->isArchived( $topicData ) ) ? '' : $this->_generateModerationPanel(),
'follow_data' => ( $this->registry->getClass('topics')->isArchived( $topicData ) or $topicData['_isDeleted'] ) ? '' : $this->_like->render( 'summary', $topicData['tid'] ),
'same_tagged' => ( $this->registry->getClass('topics')->isArchived( $topicData ) ) ? '' : $this->_getSameTaggedData(),
'poll_data' => $poll_data,
'load_editor_js' => ( $this->_getFastReplyData() && $topicData['_isDeleted'] ) ? true : false,
'smilies' => '',
'best_answer_post_data' => $this->_getBestAnswerFeature( $postData, $topicData ) );
//-----------------------------------------
// If we can edit, but not reply, load JS still
//-----------------------------------------
if( !$displayData['fast_reply'] AND $this->_canEditAPost )
if( !( $displayData['fast_reply'] and $displayData['reply_button']['url'] ) AND $this->_canEditAPost )
{
$displayData['load_editor_js'] = true;
@@ -291,7 +319,7 @@ class public_forums_forums_topics extends ipsCommand
$editor = new $classToLoad();
$displayData['smilies'] = $editor->fetchEmoticons();
}
$postData = $this->_parseAttachments( $postData );
/* Rules */
@@ -305,10 +333,7 @@ class public_forums_forums_topics extends ipsCommand
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->memberData['mgroup_others'];
if( ! $forumData['rules_raw_html'] )
{
$forumData['rules_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $forumData['rules_text'] );
}
$forumData['rules_text'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $forumData['rules_text'] );
}
/* Got soft delete pids? */
@@ -336,7 +361,12 @@ class public_forums_forums_topics extends ipsCommand
$reports = new $classToLoad( $this->registry );
$topicData['_canReport'] = $reports->canReport( 'post' );
/* No likey no lighty */
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$_like = classes_like::bootstrap( 'forums','topics' );
$topicData['_isLiked'] = ( $this->memberData['member_id'] ) ? $_like->isLiked( $topicData['tid'], $this->memberData['member_id'] ) : false;
$template = $this->registry->output->getTemplate('topic')->topicViewTemplate( $forumData, $topicData, $postData, $displayData );
//-----------------------------------------
@@ -364,14 +394,14 @@ class public_forums_forums_topics extends ipsCommand
if ( $this->_firstPostContent )
{
/* Strip tags on title to ensure multi-mod added code isn't displayed */
$this->registry->output->addMetaTag( 'keywords', strip_tags( $topicData['title'] ) . ' ' . str_replace( "\n", " ", str_replace( "\r", "", strip_tags( $this->_firstPostContent ) ) ), TRUE );
$this->registry->output->addMetaTag( 'keywords', strip_tags( trim( $topicData['title'] ) . ' ' . str_replace( "\n", " ", str_replace( "\r", "", strip_tags( $this->_firstPostContent ) ) ) ), TRUE );
}
$pageData = $this->registry->output->getPaginationProcessedData();
$pageMeta = ( $pageData['pages'] > 1 ) ? sprintf( $this->lang->words['topic_meta_pages'], $pageData['current_page'], $pageData['pages'] ) .' ' : '';
# Trim to 155 chars based on Dan's recommendation
$this->registry->output->addMetaTag( 'description', $pageMeta . sprintf( $this->lang->words['topic_meta_description'], strip_tags( $topicData['title'] ), $forumData['name'], str_replace( "\r", "", $this->_firstPostContent ) ), FALSE );
$this->registry->output->addMetaTag( 'description', trim( $pageMeta . sprintf( $this->lang->words['topic_meta_description'], strip_tags( $topicData['title'] ), $forumData['name'], str_replace( "\r", "", $this->_firstPostContent ) ) ), FALSE );
/* Set Ad code for the board index */
if( $this->registry->getClass('IPSAdCode')->userCanViewAds() )
@@ -415,7 +445,7 @@ class public_forums_forums_topics extends ipsCommand
{
$this->_firstPostContent = $parsed['post']['post'];
}
else if( $this->request['st'] AND ! $this->_firstPostContent )
else if( $this->request['page'] AND ! $this->_firstPostContent )
{
$this->_firstPostContent = $parsed['post']['post'];
}
@@ -452,7 +482,7 @@ class public_forums_forums_topics extends ipsCommand
/* Post number */
$this->post_count++;
$parsed['post']['post_count'] = intval($this->request['st']) + $this->post_count;
$parsed['post']['post_count'] = ( $this->request['page'] > 1 ) ? ( intval($this->request['page'] - 1) * $this->settings['display_max_posts'] ) + $this->post_count : $this->post_count;
if ( $parsed['post']['_isDeleted'] )
{
@@ -540,7 +570,7 @@ class public_forums_forums_topics extends ipsCommand
$st = (ceil(($topicData['posts']/$this->settings['display_max_posts'])) - $pages) * $this->settings['display_max_posts'];
}
$stUrlParam = ( $st ) ? "&st={$st}" : '';
$stUrlParam = ( $st ) ? '&page=' . $this->registry->getClass('topics')->stToPage( $st ) : '';
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid'].$stUrlParam.$pid, $topicData['title_seo'], 302, 'showtopic' );
}
@@ -629,7 +659,7 @@ class public_forums_forums_topics extends ipsCommand
$post = $this->DB->fetch();
$stUrlParam = ( $st ) ? "&st={$st}" : '';
$stUrlParam = ( $st ) ? '&page=' . $this->registry->getClass('topics')->stToPage( $st ) : '';
$this->registry->output->silentRedirect($this->settings['base_url']."showtopic=".$topicData['tid']. $stUrlParam ."#entry".$post['pid'], $topicData['title_seo'], 302, 'showtopic' );
}
@@ -811,16 +841,16 @@ class public_forums_forums_topics extends ipsCommand
}
/* Member choices */
if ( $poll['poll_view_voters'] AND $voter['member_choices'] AND $this->settings['poll_allow_public'] )
if ( $voter['member_choices'] AND ( ( $poll['poll_view_voters'] AND $this->settings['poll_allow_public'] ) OR $voter['member_id'] == $this->memberData['member_id'] ) )
{
$_choices = unserialize( $voter['member_choices'] );
$_choices = IPSLib::safeUnserialize( $voter['member_choices'] );
if ( is_array( $_choices ) AND count( $_choices ) )
{
$memberData = array( 'member_id' => $voter['member_id'],
'members_seo_name' => $voter['members_seo_name'],
'members_display_name' => $voter['members_display_name'],
'members_colored_name' => str_replace( '"', '\"', IPSMember::makeNameFormatted( $voter['members_display_name'], $voter['member_group_id'] ) ),
'members_seo_name' => ( $voter['member_id'] == $this->memberData['member_id'] ) ? $this->memberData['members_seo_name'] : $voter['members_seo_name'],
'members_display_name' => ( $voter['member_id'] == $this->memberData['member_id'] ) ? $this->memberData['members_display_name'] : $voter['members_display_name'],
'members_colored_name' => str_replace( '"', '\"', ( $voter['member_id'] == $this->memberData['member_id'] ) ? IPSMember::makeNameFormatted( $this->memberData['members_display_name'], $this->memberData['member_group_id'] ) : IPSMember::makeNameFormatted( $voter['members_display_name'], $voter['member_group_id'] ) ),
'_last' => 0 );
foreach( $_choices as $_questionID => $data )
@@ -833,7 +863,7 @@ class public_forums_forums_topics extends ipsCommand
}
}
}
//-----------------------------------------
// Already Voted
//-----------------------------------------
@@ -891,11 +921,11 @@ class public_forums_forums_topics extends ipsCommand
// Parse it
//-----------------------------------------
$poll_answers = unserialize(stripslashes($poll['choices']));
$poll_answers = IPSLib::safeUnserialize(stripslashes($poll['choices']));
if( !is_array($poll_answers) OR !count($poll_answers) )
{
$poll_answers = unserialize( preg_replace( '!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", stripslashes( $poll['choices'] ) ) );
$poll_answers = IPSLib::safeUnserialize( preg_replace( '!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", stripslashes( $poll['choices'] ) ) );
}
if( !is_array($poll_answers) OR !count($poll_answers) )
{
@@ -946,7 +976,17 @@ class public_forums_forums_topics extends ipsCommand
continue;
}
$choice = IPSText::getTextClass( 'bbcode' )->parsePollTags($choice);
if ( stristr( $choice, '[img' ) || stristr( $choice, '[url' ) || stristr( $text, '[sharedmedia' ) )
{
if ( ! is_object( $this->_textParser ) )
{
/* Load parser */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
$this->_textParser = new $classToLoad();
}
$choice = $this->_textParser->parsePollTags( $choice );
}
if ( $showResults )
{
@@ -955,7 +995,7 @@ class public_forums_forums_topics extends ipsCommand
$width = $percent > 0 ? intval($percent * 2) : 0;
/* Voters */
if ( $poll['poll_view_voters'] AND $memberChoices[ $id ][ $choice_id ] )
if ( $memberChoices[ $id ][ $choice_id ] )
{
$voters = $memberChoices[ $id ][ $choice_id ];
$_tmp = $voters;
@@ -979,7 +1019,7 @@ class public_forums_forums_topics extends ipsCommand
}
}
}
$_editPoll = $this->registry->getClass('topics')->canEditPost( array( 'member_id' => $topicData['starter_id'], 'post_date' => $topicData['start_date'] ) );
$html = $this->registry->output->getTemplate('topic')->pollDisplay( $poll, $topicData, $forumData, $pollData, $showResults, $_editPoll );
@@ -1064,7 +1104,7 @@ class public_forums_forums_topics extends ipsCommand
{
$this->topic = $this->DB->fetch();
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid'], $topicData['title_seo'], true, 'showtopic' );
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid'], $topicData['title_seo'], 302, 'showtopic' );
}
else
{
@@ -1091,7 +1131,7 @@ class public_forums_forums_topics extends ipsCommand
{
$this->topic = $this->DB->fetch();
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid'], $topicData['title_seo'], true, 'showtopic' );
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid'], $topicData['title_seo'], 302, 'showtopic' );
}
else
{
@@ -1112,86 +1152,86 @@ class public_forums_forums_topics extends ipsCommand
}
else if ($this->request['view'] == 'findpost')
{
//-----------------------------------------
// Find a post
//-----------------------------------------
// Find a post
//-----------------------------------------
$pid = intval($this->request['p']);
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery('visible');
/* Can we deal with hidden posts? */
if ( $this->registry->class_forums->canQueuePosts( $topicData['forum_id'] ) )
{
if ( $permissionData['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'approved', 'sdeleted', 'hidden' ) );
}
else
{
/* Otherwise, see queued and approved */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ) );
}
$search_hl = '';
if ( ! empty( $this->request['hl'] ) )
{
$search_hl .= "&amp;hl=" . urlencode( $this->request['hl'] );
}
/* Can we deal with hidden posts? */
$_perms = array( 'visible' );
if ( $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( false ) )
{
$_perms[] = 'sdelete';
}
if ( $this->registry->getClass('class_forums')->canQueuePosts( false ) )
{
$_perms[] = 'hidden';
}
if ( $this->registry->getClass('topics')->isArchived( $topicData ) && $this->registry->class_forums->fetchArchiveTopicType( $topicData ) != 'working' )
{
$cposts['posts'] = $this->archiveReader->getPostCount( $topicData['tid'], $_perms );
}
else
{
/* We cannot see hidden posts */
if ( $permissionData['softDeleteSee'] )
{
/* See queued and soft deleted */
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted') );
}
}
if ( $pid > 0 )
{
$sort_value = $pid;
$sort_field = ($this->settings['post_order_column'] == 'pid') ? 'pid' : 'post_date';
$query = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery('visible');
if($sort_field == 'post_date')
{
$date = $this->DB->buildAndFetch( array( 'select' => 'post_date', 'from' => 'posts', 'where' => 'pid=' . $pid ) );
$sort_value = $date['post_date'];
}
$this->DB->build( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$topicData['tid']} AND {$sort_field} <=" . intval( $sort_value ) . $query ) );
$this->DB->execute();
$query = $this->registry->class_forums->fetchPostHiddenQuery( $_perms );
$cposts = $this->DB->fetch();
if ( (($cposts['posts']) % $this->settings['display_max_posts']) == 0 )
if ( $pid > 0 )
{
$pages = ($cposts['posts']) / $this->settings['display_max_posts'];
$sort_value = $pid;
$sort_field = ($this->settings['post_order_column'] == 'pid') ? 'pid' : 'post_date';
if($sort_field == 'post_date')
{
$date = $this->DB->buildAndFetch( array( 'select' => 'post_date', 'from' => 'posts', 'where' => 'pid=' . $pid ) );
$sort_value = $date['post_date'];
}
$this->DB->build( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id={$topicData['tid']} AND {$sort_field} <=" . intval( $sort_value ) . ' AND ' . $query ) );
$this->DB->execute();
$cposts = $this->DB->fetch();
}
else
{
$number = ( ($cposts['posts']) / $this->settings['display_max_posts'] );
$pages = ceil($number);
$this->returnLastPost();
}
$st = ($pages - 1) * $this->settings['display_max_posts'];
if( $this->settings['post_order_sort'] == 'desc' )
{
$st = (ceil(($topicData['posts']/$this->settings['display_max_posts'])) - $pages) * $this->settings['display_max_posts'];
}
$search_hl = '';
if( !empty( $this->request['hl'] ) )
{
$search_hl .= "&amp;hl={$this->request['hl']}";
}
$stUrlParam = ( $st ) ? "&st={$st}" : '';
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid']."{$stUrlParam}{$search_hl}"."#entry".$pid, $topicData['title_seo'], 302, 'showtopic' );
}
else
{
$this->returnLastPost();
}
if ( (($cposts['posts']) % $this->settings['display_max_posts']) == 0 )
{
$pages = ($cposts['posts']) / $this->settings['display_max_posts'];
}
else
{
$number = ( ($cposts['posts']) / $this->settings['display_max_posts'] );
$pages = ceil($number);
}
$st = ($pages - 1) * $this->settings['display_max_posts'];
if( $this->settings['post_order_sort'] == 'desc' )
{
$st = (ceil(($topicData['posts']/$this->settings['display_max_posts'])) - $pages) * $this->settings['display_max_posts'];
}
$stUrlParam = ( $st ) ? '&page=' . $this->registry->getClass('topics')->stToPage( $st ) : '';
$this->registry->output->silentRedirect( $this->settings['base_url']."showtopic=".$topicData['tid']."{$stUrlParam}{$search_hl}"."#entry".$pid, $topicData['title_seo'], 302, 'showtopic' );
}
}
}
@@ -1225,7 +1265,7 @@ class public_forums_forums_topics extends ipsCommand
}
/* Limit to 5 unique topics */
if ( count( $results ) )
if ( is_array( $results ) AND count( $results ) )
{
$_tmp = $results;
$results = array();
@@ -1241,18 +1281,24 @@ class public_forums_forums_topics extends ipsCommand
continue;
}
if( $_data['starter_id'] )
if ( ! $this->registry->permissions->check( 'view', $this->registry->class_forums->forum_by_id[ $_data['forum_id'] ] ) )
{
$loadIds[ $_data['starter_id'] ] = $_data['starter_id'];
continue;
}
$results[ $_data['tid'] ] = $_data;
if ( ! $this->registry->class_forums->forumsCheckAccess( $_data['forum_id'], 0, 'forum', array(), true ) )
{
continue;
}
if( $_data['starter_id'] ) {
$loadIds[ $_data['starter_id'] ] = $_data['starter_id']; }
$results[ $_data['tid'] ] = $_data;
/* Alreay got our 5 results? */
if ( count( $results ) == 5 )
{
break;
}
break; }
}
}
@@ -1319,7 +1365,7 @@ class public_forums_forums_topics extends ipsCommand
/* Hang on, can we post? */
if ( $this->memberData['member_id'] )
{
if ( $this->memberData['unacknowledged_warnings'] )
if ( $this->memberData['unacknowledged_warnings'] AND !$this->memberData['restrict_post'] )
{
//return false;
}
@@ -1564,10 +1610,10 @@ class public_forums_forums_topics extends ipsCommand
$topicData = $this->registry->getClass('topics')->getTopicData();
$forumData = $this->forumClass->getForumById( $topicData['forum_id'] );
$permissionData = $this->registry->getClass('topics')->getPermissionData();
$first = intval($this->request['st']) >=0 ? intval($this->request['st']) : 0;
$first = $this->registry->getClass('topics')->pageToSt( $this->request['page'] );
/* Default - just see all visible posts */
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'visible', 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'visible', '' );
/* Can we deal with hidden posts? */
if ( $this->registry->class_forums->canQueuePosts($topicData['forum_id']) )
@@ -1575,18 +1621,18 @@ class public_forums_forums_topics extends ipsCommand
if ( $permissionData['softDeleteSee'] )
{
/* See queued and soft deleted */
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden', 'sdeleted' ), 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden', 'sdeleted' ), '' );
}
else
{
/* Otherwise, see queued and approved */
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ), 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible', 'hidden' ), '' );
}
/* Specifically requesting to see queued posts only */
if ( $this->request['modfilter'] AND $this->request['modfilter'] == 'invisible_posts' )
{
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'hidden', 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'hidden', '' );
}
}
else
@@ -1595,14 +1641,14 @@ class public_forums_forums_topics extends ipsCommand
if ( $permissionData['softDeleteSee'] )
{
/* See queued and soft deleted */
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted'), 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( array('approved', 'sdeleted'), '' );
}
}
/* Did we specifically want to see soft deleted posts? */
if ( $this->request['modfilter'] == 'deleted_posts' AND $permissionData['softDeleteSee'] )
{
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'sdeleted', 'p.' );
$queued_query_bit = ' AND ' . $this->registry->class_forums->fetchPostHiddenQuery( 'sdeleted', '' );
}
/* Data Hook Location */
@@ -1615,14 +1661,25 @@ class public_forums_forums_topics extends ipsCommand
$_extraMember = ( is_array($dataHook['members']) && count($dataHook['members']) ) ? ',m.'.implode(',m.', $dataHook['members']) : '';
$_post_joins = array( array( 'select' => 'm.member_id as mid,m.name,m.member_group_id,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title as member_title, m.warn_level, m.warn_lastwarn, m.members_display_name, m.members_seo_name, m.member_banned, m.has_gallery, m.has_blog, m.members_bitoptions,m.mgroup_others'.$_extraMember,
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left' ),
array( 'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'm.member_id=pp.pp_member_id',
'type' => 'left' ) );
$_post_joins = array(
array(
'select' => '',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid=z.pid'
),
array(
'select' => 'm.member_id as mid,m.name,m.member_group_id,m.email,m.joined,m.posts, m.last_visit, m.last_activity,m.login_anonymous,m.title as member_title, m.warn_level, m.warn_lastwarn, m.members_display_name, m.members_seo_name, m.member_banned, m.has_gallery, m.has_blog, m.members_bitoptions,m.mgroup_others'.$_extraMember,
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=p.author_id',
'type' => 'left'
),
array(
'select' => 'pp.*',
'from' => array( 'profile_portal' => 'pp' ),
'where' => 'm.member_id=pp.pp_member_id',
'type' => 'left'
)
);
/* Warn system enabled? */
if( $this->settings['warn_on'] == 1 )
@@ -1687,17 +1744,35 @@ class public_forums_forums_topics extends ipsCommand
//-----------------------------------------
// Get posts
// See http://community.invisionpower.com/resources/bugs.html/_/ip-board/big-topics-i-mean-big-topics-r36577 for an explanation why this a bit odd
//-----------------------------------------
$this->DB->build( array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 'p.topic_id='.$topicData['tid']. $queued_query_bit,
'order' => 'p.'.$this->settings['post_order_column'].' '.$this->settings['post_order_sort'],
'limit' => array( $first, $this->settings['display_max_posts'] ),
'add_join' => $_post_joins ) );
$oq = $this->DB->execute();
$this->DB->build( array(
'select' => 'p.*',
'from' => array( '( ****FROM**** )' => 'z' ),
'add_join' => $_post_joins
) );
$query = $this->DB->fetchSqlString();
$this->DB->flushQuery();
$this->DB->build( array(
'select' => 'pid, post_date',
'from' => 'posts',
'where' => 'topic_id='.$topicData['tid']. $queued_query_bit,
'order' => $this->settings['post_order_column'].' '.$this->settings['post_order_sort'],
'limit' => array( $first, $this->settings['display_max_posts'] )
) );
$query = str_replace( '****FROM****', $this->DB->fetchSqlString(), $query ) . " ORDER BY z." . $this->settings['post_order_column'] . " " . $this->settings['post_order_sort'];
$query = str_replace( $this->settings['sql_tbl_prefix'] . '(', '(', $query );
$this->DB->flushQuery();
$this->DB->allow_sub_select = TRUE;
$oq = $this->DB->query( $query );
if ( ! $this->DB->getTotalRows() )
{
if ( $first >= $this->settings['display_max_posts'] )
@@ -1726,8 +1801,9 @@ class public_forums_forums_topics extends ipsCommand
$this->DB->update( 'topics', array( 'posts' => $pcount['pcount'] ), "tid=".$topicData['tid'] );
}
$this->registry->output->silentRedirect($this->settings['base_url']."showtopic={$topicData['tid']}&view=getlastpost");
// This is now handled in app_class_forums::incorrectPageCallback to redirect to correct post */
//$this->registry->output->silentRedirect($this->settings['base_url']."showtopic={$topicData['tid']}&view=getlastpost");
}
}
@@ -1741,12 +1817,38 @@ class public_forums_forums_topics extends ipsCommand
// Format and print out the topic list
//-----------------------------------------
$modAll = ( $this->memberData['g_is_supmod'] or ( isset( $this->memberData['forumsModeratorData'][ $forumData['id'] ] ) and ( $this->memberData['forumsModeratorData'][ $forumData['id'] ]['delete_post'] or $this->memberData['forumsModeratorData'][ $forumData['id'] ]['split_move'] ) ) );
$this->registry->getClass('topics')->setTopicData('adCodeSet' , false );
$this->registry->getClass('topics')->setTopicData('ignoredUsers', $ignored_users );
$posts = array();
$this->DB->allow_sub_select = TRUE;
while ( $row = $this->DB->fetch( $oq ) )
{
/* Should we display the moderate checkbox for this post? */
$row['moddable'] = FALSE;
if
(
$modAll
or
(
isset( $this->memberData['forumsModeratorData'][ $forumData['id'] ] )
and
(
( $row['approved'] == 0 and $this->memberData['forumsModeratorData'][ $forumData['id'] ]['post_q'] )
or
( $row['queued'] == 2 and $this->memberData['forumsModeratorData'][ $forumData['id'] ]['bw_mod_un_soft_delete'] )
or
( $row['queued'] == 0 and $this->memberData['forumsModeratorData'][ $forumData['id'] ]['bw_mod_soft_delete'] )
)
)
)
{
$row['moddable'] = TRUE;
}
/* Add to array */
$row['member_id'] = $row['mid'];
$posts[ $row['pid'] ] = $row;
}
@@ -1755,6 +1857,44 @@ class public_forums_forums_topics extends ipsCommand
return $posts;
}
/**
* Returns the data for the best answer
* @param array $postData
*/
protected function _getBestAnswerFeature( array $postData, $topicData )
{
if ( $this->registry->class_forums->answerTopicsEnabled( $topicData['forum_id'] ) !== true )
{
return false;
}
if ( empty( $topicData['topic_answered_pid'] ) )
{
return false;
}
if ( in_array( $topicData['topic_answered_pid'], array_keys( $postData ) ) )
{
$postData[ $topicData['topic_answered_pid'] ]['post']['post'] = IPSText::stripAttachTag( $postData[ $topicData['topic_answered_pid'] ]['post']['post'] );
return $postData[ $topicData['topic_answered_pid'] ];
}
else
{
$result = $this->registry->topics->parsePost( $this->registry->topics->getPostById( $topicData['topic_answered_pid'] ) );
/* Hasn't been deleted has it? */
if ( ! $result['post']['pid'] )
{
$result = array();
}
$result[ $topicData['topic_answered_pid'] ]['post']['post'] = IPSText::stripAttachTag( $result[ $topicData['topic_answered_pid'] ]['post']['post'] );
return $result;
}
}
/**
* Topic set up ya'll
*
@@ -1778,7 +1918,7 @@ class public_forums_forums_topics extends ipsCommand
//-----------------------------------------
$this->request['start'] = ! empty( $this->request['start'] ) ? intval( $this->request['start'] ) : '';
$this->request['st'] = ! empty( $this->request['st'] ) ? intval( $this->request['st'] ) : '';
$this->request['page'] = ! empty( $this->request['page'] ) ? intval( $this->request['page'] ) : '';
$this->settings['post_order_column'] = ( $this->settings['post_order_column'] != 'post_date' ) ? 'pid' : 'post_date';
$this->settings['post_order_sort'] = ( $this->settings['post_order_sort'] != 'desc' ) ? 'asc' : 'desc';
@@ -1816,7 +1956,7 @@ class public_forums_forums_topics extends ipsCommand
}
$this->settings['_base_url'] = $this->settings['base_url'];
$this->first = intval( $this->request['st'] ) > 0 ? intval( $this->request['st'] ) : 0;
$this->first = $this->registry->getClass('topics')->pageToSt( $this->request['page'] );
$this->request['view'] = ! empty( $this->request['view'] ) ? $this->request['view'] : NULL ;
//-----------------------------------------
@@ -2014,12 +2154,12 @@ class public_forums_forums_topics extends ipsCommand
}
$topicData['SHOW_PAGES']
= $this->registry->output->generatePagination( array(
'totalItems' => ($topicData['posts']+1),
= $this->registry->output->generatePagination( array( 'totalItems' => ($topicData['posts']+1),
'itemsPerPage' => $this->settings['display_max_posts'],
'currentStartValue' => $this->first,
'currentPage' => intval( $this->request['page'] ),
'seoTitle' => $topicData['title_seo'],
'realTitle' => $topicData['title'],
'isPagesMode' => true,
'seoTemplate' => 'showtopic',
'baseUrl' => "showtopic=".$topicData['tid'].$hl ) );
@@ -2041,10 +2181,10 @@ class public_forums_forums_topics extends ipsCommand
//-----------------------------------------
// Multi PIDS?
//-----------------------------------------
$this->request['selectedpids'] = ! empty( $this->request['selectedpids'] ) ? $this->request['selectedpids'] : IPSCookie::get('modpids');
$this->request['selectedpidcount'] = 0 ;
IPSCookie::set('modpids', '', 0);
IPSDebug::setMemoryDebugFlag( "TOPIC: topics.php::topicSetUp", $_before );
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Moderator actions
* Last Updated: $Date: 2012-07-03 11:43:57 -0400 (Tue, 03 Jul 2012) $
* Last Updated: $Date: 2013-05-01 17:35:09 -0400 (Wed, 01 May 2013) $
* </pre>
*
* @author $Author: AndyMillne $
* @author $Author: bfarber $
* @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: 11027 $
* @version $Revision: 12211 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -113,7 +113,7 @@ class public_forums_moderate_moderate extends ipsCommand
//-----------------------------------------
// Convert the code ID's into something
// use mere mortals can understand....
// us mere mortals can understand....
//-----------------------------------------
switch ( $this->request['do'] )
@@ -283,7 +283,7 @@ class public_forums_moderate_moderate extends ipsCommand
$archiveRestore->setManualUnarchive( $this->topic['tid'] );
/* Back to topic, then? */
$this->registry->output->silentRedirect( $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&st=' . intval( $this->request['st'] ), $this->topic['title_seo'], "showtopic" );
$this->registry->output->silentRedirect( $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&page=' . intval( $this->request['page'] ), $this->topic['title_seo'], "showtopic" );
}
/**
@@ -374,7 +374,7 @@ class public_forums_moderate_moderate extends ipsCommand
}
/* Done */
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&amp;st=' . intval($this->request['st']), $this->topic['title_seo'], 'showtopic' );
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&amp;page=' . intval( $this->request['page'] ), $this->topic['title_seo'], 'showtopic' );
}
}
@@ -529,7 +529,7 @@ class public_forums_moderate_moderate extends ipsCommand
/* Done */
$url = "showforum=" . $this->forum['id'];
$url = ( $this->request['st'] ) ? "showforum=" . $this->forum['id'] . '&amp;st=' . $this->request['st'] : $url;
$url = ( $this->request['st'] ) ? "showforum=" . $this->forum['id'] . '&amp;page=' . $this->request['page'] : $url;
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_topics'], $this->settings['base_url'] . $url, $this->forum['name_seo'], 'showforum' );
}
@@ -588,8 +588,15 @@ class public_forums_moderate_moderate extends ipsCommand
$this->registry->output->redirectScreen( $this->lang->words['redirect_modified'], $this->settings['base_url'] . "app=core&amp;module=modcp&amp;fromapp=forums&amp;tab=" . $_bits[1] . 'topics' );
}
}
$this->registry->output->redirectScreen( $this->lang->words['redirect_modified'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&amp;st=" . intval($this->request['st']), $this->topic['title_seo'], 'showtopic' );
$url = "showtopic=".$this->topic['tid']."&amp;page=".intval($this->request['page']);
if( $this->request['from'] == 'forum' )
{
$url = "showforum=".$this->topic['forum_id']."&amp;page=".intval($this->request['page']);
}
$this->registry->output->redirectScreen( $this->lang->words['redirect_modified'], $this->settings['base_url'] . $url, $this->request['from'] == 'forum' ? $this->forum['name_seo'] : $this->topic['title_seo'], $this->request['from'] == 'forum' ? 'showforum' : 'showtopic' );
}
/**
@@ -633,11 +640,11 @@ class public_forums_moderate_moderate extends ipsCommand
$words = $this->lang->words['p_unpinned'];
}
$url = "showtopic=".$this->topic['tid']."&amp;st=".intval($this->request['st']);
$url = "showtopic=".$this->topic['tid']."&amp;page=".intval($this->request['page']);
if( $this->request['from'] == 'forum' )
{
$url = "showforum=".$this->topic['forum_id']."&amp;st=".intval($this->request['st']);
$url = "showforum=".$this->topic['forum_id']."&amp;page=".intval($this->request['page']);
}
$this->registry->output->redirectScreen( $words, $this->settings['base_url'] . $url, $this->request['from'] == 'forum' ? $this->forum['name_seo'] : $this->topic['title_seo'], $this->request['from'] == 'forum' ? 'showforum' : 'showtopic' );
@@ -733,16 +740,35 @@ class public_forums_moderate_moderate extends ipsCommand
{
if ( $this->request['nr'] )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . "findpost=" . $this->request['pid'] );
$this->registry->output->silentRedirect( $this->settings['base_url'] . "findpost=" . $this->request['pid'] . '&amp;t=' . $this->request['t'] );
}
else
{
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "findpost=" . $this->request['pid'] );
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "findpost=" . $this->request['pid'] . '&amp;t=' . $this->request['t'] );
}
}
else if ( $this->request['postdate'] )
{
if ( $this->request['nr'] )
{
$this->registry->output->silentRedirect( $this->settings['base_url'] . "findpost=" . $this->request['postdate'] . '&amp;t=' . $this->request['t'] );
}
else
{
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "findpost=" . $this->request['postdate'] . '&amp;t=' . $this->request['t'] );
}
}
else if ( $this->topic['tid'] )
{
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&amp;st=' . intval($this->request['st']), $this->topic['title_seo'], 'showtopic' );
{
try
{
$this->registry->getClass('topics')->autoPopulate( null, false );
}
catch( Exception $e )
{
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "showforum=" . $this->topic['forum_id'], $this->forum['name_seo'], "showforum" );
}
$this->registry->output->redirectScreen( $this->lang->words['cp_redirect_posts'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . '&amp;page=' . intval($this->request['page']), $this->topic['title_seo'], 'showtopic' );
}
}
@@ -788,7 +814,8 @@ class public_forums_moderate_moderate extends ipsCommand
while( $row = $this->DB->fetch( $post_query ) )
{
$row['post'] = IPSText::truncate( $row['post'], 800 );
// This causes HTML to get cut off sometimes
//$row['post'] = IPSText::truncate( $row['post'], 800 );
$row['date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'LONG' );
/* Parse the post */
@@ -844,6 +871,12 @@ class public_forums_moderate_moderate extends ipsCommand
$this->_multiMovePost( $this->lang->words['cmp_notopic'] );
}
if( in_array( $move_to_topic['topic_archive_status'], array( $this->registry->class_forums->fetchTopicArchiveFlag( 'working' ), $this->registry->class_forums->fetchTopicArchiveFlag( 'archived' ), $this->registry->class_forums->fetchTopicArchiveFlag( 'restore' ) ) ) )
{
$this->request[ 'checked'] = 0 ;
$this->_multiMovePost( $this->lang->words['cmp_archived_topic'] );
}
$affected_ids = count( $this->pids );
//-----------------------------------------
@@ -1316,7 +1349,7 @@ class public_forums_moderate_moderate extends ipsCommand
if( $first_post['queued'] )
{
$topic_approved = 0;
$topic_approved = ( $first_post['queued'] == ipsRegistry::getClass('class_forums')->fetchPostHiddenFlag( 'hidden' ) ) ? ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'queued' ) : ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'sdeleted' );
$this->DB->update( 'posts', array( 'queued' => 0 ), 'pid=' . $first_post['pid'] );
}
@@ -1329,7 +1362,7 @@ class public_forums_moderate_moderate extends ipsCommand
{
if( function_exists('mb_convert_case') )
{
if( in_array( strtolower( $this->settings['gb_char_set'] ), array_map( 'strtolower', mb_list_encodings() ) ) )
if( in_array( mb_strtolower( $this->settings['gb_char_set'] ), array_map( 'mb_strtolower', mb_list_encodings() ) ) )
{
$this->request['title'] = mb_convert_case( $this->request['title'], MB_CASE_TITLE, $this->settings['gb_char_set'] );
}
@@ -1364,6 +1397,14 @@ class public_forums_moderate_moderate extends ipsCommand
) );
$new_topic_id = $this->DB->getInsertId();
//-----------------------------------------
// Add to delete log if we've hidden the new topic
//-----------------------------------------
if ( $topic_approved == ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'sdeleted' ) ) {
IPSDeleteLog::addEntry( $new_topic_id, 'topic', '', $this->memberData );
}
//-----------------------------------------
// Move the posts
@@ -1425,7 +1466,7 @@ class public_forums_moderate_moderate extends ipsCommand
{
$this->_resetModerator( $this->topic['forum_id'] );
$this->_genericPermissionCheck( 'delete_post' );
$this->_genericPermissionCheck( 'split_merge' );
if ( count( $this->pids ) < 2 )
{
@@ -1688,6 +1729,15 @@ class public_forums_moderate_moderate extends ipsCommand
$this->DB->delete( 'posts', 'pid IN(' . implode( ",", $post_to_delete ) . ')' );
IPSDeleteLog::removeEntries( $post_to_delete, 'post', TRUE );
/* Handle Rep */
$this->DB->delete( 'reputation_cache' , "app='forums' AND type='pid' AND type_id IN(" . implode( ",", $post_to_delete ) . ")" );
$this->DB->delete( 'reputation_index' , "app='forums' AND type='pid' AND type_id IN(" . implode( ",", $post_to_delete ) . ")" );
foreach( $post_to_delete as $post )
{
$this->DB->delete( 'reputation_totals', "rt_key=MD5('forums;pid;" . $post . "') AND rt_type_id=" . $post );
}
}
foreach( $topics as $t )
@@ -1766,7 +1816,7 @@ class public_forums_moderate_moderate extends ipsCommand
$this->_addModeratorLog( $this->lang->words['acp_locked_topic'] );
$this->registry->output->redirectScreen( $this->lang->words['p_closed'], $this->settings['base_url'] . "showforum=".$this->forum['id'] . ( $this->request['_from'] == 'forum' ? '&st=' . intval( $this->request['st'] ) : '' ), $this->forum['name_seo'], "showforum" );
$this->registry->output->redirectScreen( $this->lang->words['p_closed'], $this->settings['base_url'] . "showforum=".$this->forum['id'] . ( $this->request['_from'] == 'forum' ? '&page=' . intval( $this->request['page'] ) : '' ), $this->forum['name_seo'], "showforum" );
}
/**
@@ -1797,7 +1847,7 @@ class public_forums_moderate_moderate extends ipsCommand
$this->modLibrary->topicToggleSoftDelete( array( $this->topic['tid'] ), $delete, $reason );
$this->registry->output->redirectScreen( $this->lang->words[ $lang ], $this->settings['base_url'] . "showforum=" . $this->forum['id'] . '&st=' . intval( $this->request['st'] ), $this->forum['name_seo'], 'showforum' );
$this->registry->output->redirectScreen( $this->lang->words[ $lang ], $this->settings['base_url'] . "showforum=" . $this->forum['id'] . '&page=' . intval( $this->request['page'] ), $this->forum['name_seo'], 'showforum' );
}
/**
@@ -1843,7 +1893,7 @@ class public_forums_moderate_moderate extends ipsCommand
}
}
$this->registry->output->redirectScreen( $this->lang->words['p_deleted'], $this->settings['base_url'] . "showforum=" . $this->forum['id'] . '&st=' . intval( $this->request['st'] ), $this->forum['name_seo'], 'showforum' );
$this->registry->output->redirectScreen( $this->lang->words['p_deleted'], $this->settings['base_url'] . "showforum=" . $this->forum['id'], $this->forum['name_seo'], 'showforum' );
}
/**
@@ -1889,7 +1939,7 @@ class public_forums_moderate_moderate extends ipsCommand
}
}
$this->registry->output->redirectScreen( $this->lang->words['p_deleted'], $this->settings['base_url'] . "showforum=" . $this->forum['id'] . '&st=' . intval( $this->request['st'] ), $this->forum['name_seo'], 'showforum' );
$this->registry->output->redirectScreen( $this->lang->words['p_deleted'], $this->settings['base_url'] . "showforum=" . $this->forum['id'] . '&page=' . intval( $this->request['page'] ), $this->forum['name_seo'], 'showforum' );
}
/**
@@ -2109,7 +2159,7 @@ class public_forums_moderate_moderate extends ipsCommand
$_like = classes_like::bootstrap( 'forums', 'topics' );
$_like->remove( $this->topic['tid'] );
$this->registry->output->redirectScreen( $this->lang->words['ts_redirect'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&amp;st=" . intval($this->request['st']), $this->topic['title_seo'], 'showtopic' );
$this->registry->output->redirectScreen( $this->lang->words['ts_redirect'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&amp;page=" . intval($this->request['page']), $this->topic['title_seo'], 'showtopic' );
}
/**
@@ -2306,23 +2356,19 @@ class public_forums_moderate_moderate extends ipsCommand
$this->DB->update( 'attachments', array( 'attach_parent_id' => $this->topic['tid'] ), "attach_rel_module='post' AND attach_parent_id=" . $old_topic['tid'] );
//-----------------------------------------
// Get like class
// Update followers
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$_like = classes_like::bootstrap( 'forums', 'topics' );
$_like->remove( $old_topic['tid'] );
$_like = classes_like::bootstrap( 'forums', 'topics' );
$_like->merge( $old_topic['tid'], $this->topic['tid'] );
//-----------------------------------------
// Tags
//-----------------------------------------
$this->registry->tags->moveTagsByMetaId( $old_topic['tid'], $this->topic['tid'] );
// Resync to remove duplicate tags - see bug report 34475
$tags = $this->registry->tags->getTagsByMetaId( $this->topic['tid'] );
$this->registry->tags->replace( $tags['tags'], array( 'meta_id' => $this->topic['tid'] ) );
//-----------------------------------------
// Update the newly merged topic
//-----------------------------------------
@@ -2566,8 +2612,27 @@ class public_forums_moderate_moderate extends ipsCommand
$this->registry->output->redirectScreen( $this->lang->words['post_deleted'], $this->settings['base_url'] . "app=core&amp;module=modcp&amp;fromapp=forums&amp;tab=" . $_bits[1] . 'posts' );
}
}
//-----------------------------------------
// Where are we going?
//-----------------------------------------
$this->registry->output->redirectScreen( $this->lang->words['post_deleted'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&amp;st=" . intval($this->request['st']), $this->topic['title_seo'], 'showtopic' );
$posts = $this->registry->getClass('topics')->getPosts( array( 'topicId' => $this->topic['tid'],
'limit' => 1,
'skipForumCheck' => true,
'dateIsLess' => $post['post_date'],
'onlyViewable' => true,
'onlyVisible' => true,
'notIgnored' => true,
'parse' => false,
'getCount' => false,
'sortField' => 'date',
'sortOrder' => 'desc' ) );
$redirectPost = array_keys($posts);
$redirectPage = $this->registry->getClass('topics')->postToPage( $redirectPost[0] );
$this->registry->output->redirectScreen( $this->lang->words['post_deleted'], $this->settings['base_url'] . "showtopic=" . $this->topic['tid'] . "&amp;page=" . intval($redirectPage) . '#entry' . $redirectPost[0], $this->topic['title_seo'], 'showtopic' );
}
/**
@@ -2620,23 +2685,23 @@ class public_forums_moderate_moderate extends ipsCommand
$this->request['TopicTitle'] = $_postClass->cleanTopicTitle( $this->request['TopicTitle'] );
$this->request['TopicTitle'] = trim( IPSText::getTextClass( 'bbcode' )->stripBadWords( $this->request['TopicTitle'] ) );
if( $this->settings['etfilter_shout'] )
{
if( function_exists('mb_convert_case') )
{
if( in_array( strtolower( $this->settings['gb_char_set'] ), array_map( 'strtolower', mb_list_encodings() ) ) )
{
$this->request['TopicTitle'] = mb_convert_case( $this->request['TopicTitle'], MB_CASE_TITLE, $this->settings['gb_char_set'] );
}
else
{
$this->request['TopicTitle'] = ucwords( strtolower( $this->request['TopicTitle'] ) );
}
}
else
{
$this->request['TopicTitle'] = ucwords( strtolower( $this->request['TopicTitle'] ) );
}
if( $this->settings['etfilter_shout'] )
{
if( function_exists('mb_convert_case') )
{
if( in_array( strtolower( $this->settings['gb_char_set'] ), array_map( 'strtolower', mb_list_encodings() ) ) )
{
$this->request['TopicTitle'] = mb_convert_case( $this->request['TopicTitle'], MB_CASE_TITLE, $this->settings['gb_char_set'] );
}
else
{
$this->request['TopicTitle'] = ucwords( strtolower( $this->request['TopicTitle'] ) );
}
}
else
{
$this->request['TopicTitle'] = ucwords( strtolower( $this->request['TopicTitle'] ) );
}
}
$this->request['TopicDesc'] = trim( IPSText::getTextClass( 'bbcode' )->stripBadWords( $this->request['TopicDesc'] ) );
@@ -2679,7 +2744,7 @@ class public_forums_moderate_moderate extends ipsCommand
$this->_addModeratorLog( $this->lang->words['acp_opened_topic'] );
$_st = '&st=' . intval( $this->request['st'] );
$_st = '&page=' . intval( $this->request['page'] );
if( $this->request['_fromTopic'] )
{
@@ -3189,7 +3254,7 @@ class public_forums_moderate_moderate extends ipsCommand
else if ( $this->forum['id'] )
{
$url = "showforum=" . $this->forum['id'];
$url = ( $this->request['st'] ) ? "showforum=" . $this->forum['id'] . '&amp;st=' . $this->request['st'] : $url;
$url = ( $this->request['st'] ) ? "showforum=" . $this->forum['id'] . '&amp;page=' . $this->request['page'] : $url;
if ( $this->request['nr'] )
{
@@ -3382,18 +3447,31 @@ class public_forums_moderate_moderate extends ipsCommand
$this->DB->update( 'posts', array( 'queued' => 1 ), 'topic_id IN (' . implode( ",", $unapproved ) . ")" );
}
$this->DB->update( 'posts', array( 'topic_id' => $main_topic_id ), 'topic_id IN (' . implode( ",", $merge_ids ) . ")" );
$this->DB->update( 'posts', array( 'topic_id' => $main_topic_id, 'new_topic' => 0 ), 'topic_id IN (' . implode( ",", $merge_ids ) . ")" );
$this->DB->update( 'topics', array( 'views' => $newViews ), 'tid=' . $main_topic_id );
/* @Link http://community.invisionpower.com/resources/bugs.html/_/ip-board/merging-topics-does-not-update-attach-parent-id-for-attachments-r41886 */
$this->DB->update( 'attachments', array( 'attach_parent_id' => $main_topic_id ), 'attach_parent_id IN(' . implode( ",", $merge_ids ) . ") AND attach_rel_module='post'" );
$this->DB->delete( 'voters', "tid IN (" . implode( ",", $merge_ids ) . ")" );
$this->DB->delete( 'topics', "tid IN (" . implode( ",", $merge_ids ) . ")" );
/* Bug #38221: Set the new first post in topic */
$first_post = $this->DB->buildAndFetch( array( 'select' => 'pid', 'from' => 'posts', 'where' => "topic_id={$main_topic_id}", 'order' => "pid ASC", 'limit' => array(0,1) ) );
$this->DB->update( 'posts', array( 'new_topic' => 1 ), 'pid = ' . $first_post['pid'] );
//-----------------------------------------
// Get like class
// Update followers
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
$_like = classes_like::bootstrap( 'forums', 'topics' );
$_like->remove( $merge_ids );
$_like = classes_like::bootstrap( 'forums', 'topics' );
foreach ( $merge_ids as $mid )
{
$_like->merge( $mid, $main_topic_id );
}
//-----------------------------------------
// Remove from delete log
@@ -3414,9 +3492,6 @@ class public_forums_moderate_moderate extends ipsCommand
/* Tags */
$this->registry->tags->moveTagsByMetaId( $tids, $main_topic_id );
/* Make read */
$this->registry->getClass('classItemMarking')->markRead( array( 'forumID' => $first_topic['forum_id'], 'itemID' => $main_topic_id, 'markDate' => time(), 'containerLastActivityDate' => $this->registry->class_forums->allForums[ $first_topic['forum_id'] ]['last_post'] ) );
/* Run Sync */
foreach ( $merge_ids as $mid )
{
@@ -3860,6 +3935,14 @@ class public_forums_moderate_moderate extends ipsCommand
) ),
"tid IN(" . implode( ',', $this->tids ) . ")", false, true
);
//-----------------------------------------
// Rebuild topic for SEO title
//-----------------------------------------
foreach( $this->tids as $tid )
{
$this->modLibrary->rebuildTopic( $tid );
}
}
//-----------------------------------------
@@ -3,9 +3,9 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* IP.Board v3.4.5
* Moderator actions
* Last Updated: $Date: 2012-06-13 12:05:06 -0400 (Wed, 13 Jun 2012) $
* Last Updated: $Date: 2013-01-17 15:51:17 -0500 (Thu, 17 Jan 2013) $
* </pre>
*
* @author $Author: AndyMillne $
@@ -14,7 +14,7 @@
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Revision: 10916 $
* @version $Revision: 11859 $
*
*/
@@ -284,9 +284,9 @@ class public_forums_moderate_multimod extends ipsCommand
IPSText::getTextClass('bbcode')->parse_html = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'topics';
$this->modLibrary->topicAddReply(
$this->mm_data['topic_reply_content']
IPSText::getTextClass('bbcode')->preDbParse( str_replace( array( "\n", "\r" ), '', nl2br( $this->mm_data['topic_reply_content'] ) ) )
, array( 0 => array( $this->topic['tid'], $this->forum['id'] ) )
, $this->mm_data['topic_reply_postcount']
);
@@ -7,7 +7,7 @@
* $Author: ips_terabyte $
* @since 14th May 2003
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.3.4
* @version v3.4.5
* $Revision: 8655 $
*/
Loaded 100 of 1360 files, more files were not shown because too many files have changed in this diff. Show more