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

@@ -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' ) )