Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -3,11 +3,11 @@
|
||||
* @file group_form.php Forums group editing form
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-03-03 13:09:09 -0500 (Thu, 03 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 7948 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,127 +1,127 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2011-04-19 12:42:57 -0400 (Tue, 19 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8391 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 admin_member_form__forums implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
|
||||
|
||||
$array = array();
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deleteposts',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deletesubscriptions',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array(), $tabsUsed=5 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
return array( 'tabs' => $this->html->acp_member_form_tabs( $member, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_member_form_main( $member, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
$return = array( 'core' => array(), 'extendedProfile' => array() );
|
||||
|
||||
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
|
||||
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
|
||||
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
|
||||
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Member property updater (AJAX)
|
||||
* 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
|
||||
* @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 admin_member_form__forums implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
|
||||
|
||||
$array = array();
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deleteposts',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deletesubscriptions',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array(), $tabsUsed=5 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
return array( 'tabs' => $this->html->acp_member_form_tabs( $member, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_member_form_main( $member, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
$return = array( 'core' => array(), 'extendedProfile' => array() );
|
||||
|
||||
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
|
||||
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
|
||||
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
|
||||
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Show a poll widget
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Content
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 9350 $
|
||||
* @since 1st March 2009
|
||||
*/
|
||||
|
||||
class plugin_site_poll implements pluginBlockInterface
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
protected $registry;
|
||||
protected $request;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $registry->DB();
|
||||
$this->settings = $registry->fetchSettings();
|
||||
$this->member = $registry->member();
|
||||
$this->memberData =& $registry->member()->fetchMemberData();
|
||||
$this->cache = $registry->cache();
|
||||
$this->caches =& $registry->cache()->fetchCaches();
|
||||
$this->request = $registry->fetchRequest();
|
||||
$this->lang = $registry->class_localization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tag help for this block type
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return array(
|
||||
$this->lang->words['block_plugin__generic'] => array(
|
||||
array( '$title', $this->lang->words['block_custom__title'] ) ,
|
||||
array( '$content', $this->lang->words['block_plugin_sp_content'] ) ,
|
||||
array( '$tid', $this->lang->words['block_plugin_sp_tid'] ) ,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the plugin meta data
|
||||
*
|
||||
* @access public
|
||||
* @return array Plugin data (name, description, hasConfig)
|
||||
*/
|
||||
public function returnPluginInfo()
|
||||
{
|
||||
return array(
|
||||
'key' => 'site_poll',
|
||||
'name' => $this->lang->words['plugin_name__site_poll'],
|
||||
'description' => $this->lang->words['plugin_description__site_poll'],
|
||||
'hasConfig' => true,
|
||||
'templateBit' => 'block__site_poll',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plugin configuration data. Returns form elements and data
|
||||
*
|
||||
* @access public
|
||||
* @param array Session data
|
||||
* @return array Form data
|
||||
*/
|
||||
public function returnPluginConfig( $session )
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
'label' => $this->lang->words['plugin__poll_label1'],
|
||||
'description' => $this->lang->words['plugin__poll_desc1'],
|
||||
'field' => $this->registry->output->formInput( 'plugin__poll', $session['config_data']['custom_config']['poll'] ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the plugin config data
|
||||
*
|
||||
* @access public
|
||||
* @param array Submitted plugin data to check (usually $this->request)
|
||||
* @return array Array( (bool) Ok or not, (array) Plugin data to use )
|
||||
*/
|
||||
public function validatePluginConfig( $data )
|
||||
{
|
||||
return array( $data['plugin__poll'] ? true : false, array( 'poll' => $data['plugin__poll'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the plugin and return the HTML to show on the page.
|
||||
* Can be called from ACP or front end, so the plugin needs to setup any appropriate lang files, skin files, etc.
|
||||
*
|
||||
* @access public
|
||||
* @param array Block data
|
||||
* @return string Block HTML to display or cache
|
||||
*/
|
||||
public function executePlugin( $block )
|
||||
{
|
||||
$config = unserialize($block['block_config']);
|
||||
|
||||
if( !$config['custom']['poll'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Friendly URL */
|
||||
if( $this->settings['use_friendly_urls'] )
|
||||
{
|
||||
preg_match( "#/topic/(\d+)(.*?)/#", $config['custom']['poll'], $match );
|
||||
$tid = intval( trim( $match[1] ) );
|
||||
}
|
||||
/* Normal URL */
|
||||
else
|
||||
{
|
||||
preg_match( "/(\?|&)(t|showtopic)=(\d+)($|&)/", $config['custom']['poll'], $match );
|
||||
$tid = intval( trim( $match[3] ) );
|
||||
}
|
||||
|
||||
if( !$tid )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$poll = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'polls', 'where' => 'tid=' . $tid ) );
|
||||
|
||||
if( !$poll['pid'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_boards', 'public_topic' ), 'forums' );
|
||||
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", "class_forums", 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/topics.php', "public_forums_forums_topics", 'forums' );
|
||||
$topic = new $classToLoad( $this->registry );
|
||||
$topic->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
ipsRegistry::$request['t'] = $poll['tid'];
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
/* Load up the data dudes */
|
||||
$this->registry->getClass('topics')->autoPopulate();
|
||||
}
|
||||
catch( Exception $crowdCheers )
|
||||
{}
|
||||
|
||||
$topic->forumClass = $this->registry->getClass('class_forums');
|
||||
|
||||
$topic->topicSetUp( $this->registry->getClass('topics')->getTopicData() );
|
||||
|
||||
if ( $this->registry->getClass('topics')->getTopicData('poll_state') )
|
||||
{
|
||||
$pluginConfig = $this->returnPluginInfo();
|
||||
$templateBit = $pluginConfig['templateBit'] . '_' . $block['block_id'];
|
||||
$pollOutput = $topic->_generatePollOutput();
|
||||
|
||||
ob_start();
|
||||
$_return = $this->registry->output->getTemplate('ccs')->$templateBit( $block['block_name'], $pollOutput['html'], $tid );
|
||||
ob_end_clean();
|
||||
return $_return;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Core variables extensions
|
||||
* Defines the reset array, which caches to load, how to recache those caches, and the bitwise array
|
||||
* Last Updated: $Date: 2011-06-27 06:48:51 -0400 (Mon, 27 Jun 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9090 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -154,11 +154,7 @@ $_BITWISE = array( 'moderators' => array( 'bw_flag_spammers',
|
||||
'bw_mod_soft_delete',
|
||||
'bw_mod_un_soft_delete',
|
||||
'bw_mod_soft_delete_see',
|
||||
'bw_mod_soft_delete_topic',
|
||||
'bw_mod_un_soft_delete_topic',
|
||||
'bw_mod_soft_delete_topic_see',
|
||||
'bw_mod_soft_delete_reason',
|
||||
'bw_mod_soft_delete_see_post' ),
|
||||
),
|
||||
'forums' => array( 'bw_disable_tagging',
|
||||
'bw_disable_prefixes' ),
|
||||
'posts' => array( 'bw_post_from_mobile') );
|
||||
'posts' => array( 'bw_post_from_mobile' ) );
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Define data hook locations (Forums)
|
||||
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8812 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
$dataHookLocations = array(
|
||||
@@ -28,8 +28,8 @@ $dataHookLocations = array(
|
||||
array( 'postAddTopicPoll', 'New Topic: Poll' ),
|
||||
array( 'editPostAddPoll', 'Edit Post: Added Poll' ),
|
||||
array( 'editPostUpdatePoll', 'Edit Post: Updated Poll' ),
|
||||
array( 'editPostUpdateTopicTitle', 'Edit Post: Update Topic Title'),
|
||||
array( 'editPostData', 'Edit Post: Post Data' ),
|
||||
array( 'editPostTopicData', 'Edit Post: Update Topic'),
|
||||
array( 'updateForumLastPostData', 'Forum last post update data' ),
|
||||
array( 'incrementUsersPostCount', 'Increment users post count' ),
|
||||
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* 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) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
|
||||
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
|
||||
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
|
||||
*
|
||||
* @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: 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();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
|
||||
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
|
||||
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
|
||||
);
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.1
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2009-03-04 15:08:31 +0000 (Wed, 04 Mar 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package Invision Power Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4136 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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=(.+?)((?:&|&)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,
|
||||
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1/$2' ),
|
||||
'in' => array( 'regex' => "#/forum/(\d+)/?#i",
|
||||
'matches' => array( array( 'showforum', '$1' ) ) ) ),
|
||||
|
||||
'showtopic' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1/$2' ),
|
||||
'in' => array( 'regex' => "#/topic/(\d+)/?#i",
|
||||
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
|
||||
|
||||
'act=idx' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#act=idx(&|$)#i', 'index' ),
|
||||
'in' => array( 'regex' => "#/index$#i",
|
||||
'matches' => array( array( 'act', 'idx' ) ) ) ),
|
||||
);
|
||||
|
||||
@@ -1,206 +1,205 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
*/
|
||||
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
|
||||
* @example furlRedirect_forums::setKey( 'topic', 12 );
|
||||
*
|
||||
* @param string Type
|
||||
* @param mixed Value
|
||||
*/
|
||||
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 void
|
||||
*/
|
||||
public function setKeyByUri( $uri )
|
||||
{
|
||||
$uri = str_replace( '&', '&', $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 string The SEO friendly name
|
||||
*/
|
||||
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 string The SEO friendly name
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
if ( IPB_USE_ONLY_ID_FURL ) return $topic['tid'];
|
||||
|
||||
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for a forum
|
||||
*
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
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 string The SEO friendly name
|
||||
*/
|
||||
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.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( '&', '&', $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.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
|
||||
* 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 This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 9351 $
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@ $_SEOTEMPLATES = array(
|
||||
|
||||
'showtopic' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
|
||||
'out' => array( '#showtopic=(.+?)(\#|&|$)#i', 'topic/$1-#{__title__}/$2' ),
|
||||
'in' => array( 'regex' => '#^/topic/(\d+?)-#i',
|
||||
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,329 +1,347 @@
|
||||
<?php
|
||||
/**
|
||||
* @file forums.php Forums like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since 15th Feb 2011
|
||||
* $LastChangedDate: 2011-09-30 05:21:05 -0400 (Fri, 30 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9571 $
|
||||
*/
|
||||
|
||||
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 like_forums_forums_composite
|
||||
* @brief Forums like class (forums application)
|
||||
*/
|
||||
class like_forums_forums_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'forum';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'forums', $this->lang->words['follow_notify_forums'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_f';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $metaData['like_rel_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$forum = array_merge( $data, $this->registry->permissions->parse( $data ) );
|
||||
$fFurl = $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $forum['id'], 'publicNoSession', $forum['name_seo'], 'showforum' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $forum['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bndf'][ $forum['id'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$topics = $this->registry->getClass('topics')->getTopics( array( 'forumId' => $forum['id'],
|
||||
'topicType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'getFirstPost' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $topics as $pid => $topic )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $topic['starter_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $this->lang->words['topic_langbit'] . ": " . $topic['title'] . " ( ". $topic['starter_name'] . " -- " . ipsRegistry::getClass('class_localization')->getDate( $topic['start_date'], 'SHORT' ) . ")<br />"
|
||||
. $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' )
|
||||
. "<br />............................................<br />"
|
||||
. $topic['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output = $this->lang->words['forum_langbit'] . ":" . $forum['name'] . ")<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bndf'][ $forum['id'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bndf'][ $forum['id'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_forums_digest',
|
||||
'notification_url' => $fFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_forum_daily' : 'digest_forum_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_forum_daily'] : $this->lang->words['subject__digest_forum_weekly'],
|
||||
'build_message_array' => array( 'URL' => $fFurl,
|
||||
'TITLE' => $forum['name'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'FORUM_NAME' => $forum['name'],
|
||||
'FORUM_ID' => $forum['id'],
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 'f.*', 'from' => array( 'forums' => 'f'), 'where' => 'f.id=' . $field, 'type' => 'left' ),
|
||||
array( 'select' => 'p.*', 'from' => array( 'permission_index' => 'p'), 'where' => "p.perm_type_id=f.id AND p.app='forums' AND p.perm_type='forum'", 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'p.id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=f.parent_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.title'] = $row['name'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showforum=" . $row['id'], "public", $row['name_seo'], "showforum" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.type'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentType'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file forums.php Forums like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 15th Feb 2011
|
||||
* $LastChangedDate: 2012-06-20 06:37:39 -0400 (Wed, 20 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10955 $
|
||||
*/
|
||||
|
||||
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 like_forums_forums_composite
|
||||
* @brief Forums like class (forums application)
|
||||
*/
|
||||
class like_forums_forums_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'forum';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'forums', $this->lang->words['follow_notify_forums'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_f';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
$group = $this->caches['group_cache'][ $metaData['member_group_id'] ];
|
||||
|
||||
/* Can only see own topics? */
|
||||
if ( ! $group['g_other_topics'] )
|
||||
{
|
||||
/* Send nothing because we can only see our topics and we never get notification of our own content */
|
||||
return false;
|
||||
}
|
||||
|
||||
$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 );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$forum = array_merge( $data, $this->registry->permissions->parse( $data ) );
|
||||
$fFurl = $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $forum['id'], 'publicNoSession', $forum['name_seo'], 'showforum' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $forum['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bndf'][ $forum['id'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$topics = $this->registry->getClass('topics')->getTopics( array( 'forumId' => $forum['id'],
|
||||
'topicType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'getFirstPost' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'asc',
|
||||
'limit' => 50 ) );
|
||||
|
||||
foreach( $topics as $pid => $topic )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $topic['starter_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $this->lang->words['follow_topic'] . ": " . $topic['title'] . " ( ". $topic['starter_name'] . " -- " . ipsRegistry::getClass('class_localization')->getDate( $topic['start_date'], 'SHORT' ) . ")<br />"
|
||||
. $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' )
|
||||
. "<br />............................................<br />"
|
||||
. $topic['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output = $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bndf'][ $forum['id'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bndf'][ $forum['id'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_forums_digest',
|
||||
'notification_url' => $fFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_forum_daily' : 'digest_forum_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_forum_daily'] : $this->lang->words['subject__digest_forum_weekly'],
|
||||
'build_message_array' => array( 'URL' => $fFurl,
|
||||
'TITLE' => $forum['name'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'FORUM_NAME' => $forum['name'],
|
||||
'FORUM_ID' => $forum['id'],
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 'f.*', 'from' => array( 'forums' => 'f'), 'where' => 'f.id=' . $field, 'type' => 'left' ),
|
||||
array( 'select' => 'p.*', 'from' => array( 'permission_index' => 'p'), 'where' => "p.perm_type_id=f.id AND p.app='forums' AND p.perm_type='forum'", 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'p.id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=f.parent_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.title'] = $row['name'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showforum=" . $row['id'], "public", $row['name_seo'], "showforum" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.type'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentType'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'extraWhere' => $this->DB->buildWherePermission( $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] ), 'l.like_rel_id', FALSE ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,359 +1,361 @@
|
||||
<?php
|
||||
/**
|
||||
* @file topics.php Topics like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* $LastChangedDate: 2011-10-05 16:14:58 -0400 (Wed, 05 Oct 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9584 $
|
||||
*/
|
||||
|
||||
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 like_forums_topics_composite
|
||||
* @brief Topics like class (forums application)
|
||||
*/
|
||||
class like_forums_topics_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'topic';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'topics', $this->lang->words['follow_notify_topics'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_t';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
/* Digests are checked in buildNotificationData */
|
||||
$topic = $this->registry->getClass('topics')->getTopicById( $metaData['like_rel_id'] );
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $metaData );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to let plugins determine if a notification should not be sent. Return false to send notification, or true to skip sending it.
|
||||
*
|
||||
* @param array Notification data
|
||||
* @return @e bool
|
||||
*/
|
||||
public function excludeNotification( $row )
|
||||
{
|
||||
if ( $row['like_notify_freq'] == 'offline' AND $row['last_activity'] < $row['like_notify_sent'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$topic = $data;
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
$flag = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
$tFurl = $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $topic['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Unapproved or deleted */
|
||||
if ( $flag != 'visible' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bnd'][ $topic['tid'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$posts = $this->registry->getClass('topics')->getPosts( array( 'topicId' => $topic['tid'],
|
||||
'postType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'sortField' => 'pid',
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $posts as $pid => $post )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $post['author_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $post['author_name'] . " -- " . ipsRegistry::getClass( 'class_localization')->getDate( $post['post_date'], 'SHORT' ) . "<br />" . $post['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output .= $this->lang->words['topic_langbit'] . ": " . $topic['title'] . " (" . $this->lang->words['forum_langbit'] . ":" . $forum['name'] . ")<br />"
|
||||
. $tFurl . "<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bnd'][ $topic['tid'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bnd'][ $topic['tid'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_topics_digest',
|
||||
'notification_url' => $tFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_topic_daily' : 'digest_topic_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_topic_daily'] : $this->lang->words['subject__digest_topic_weekly'],
|
||||
'build_message_array' => array( 'URL' => $tFurl,
|
||||
'TITLE' => $topic['title'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 't.*', 'from' => array( 'topics' => 't'), 'where' => 't.tid=' . $field, 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=t.forum_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.title'] = $row['title'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showtopic=" . $row['tid'], "public", $row['title_seo'], "showtopic" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.type'] = $this->lang->words['follow_topic'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentType'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => 'l.like_rel_id=t.tid',
|
||||
'order' => 't.last_post' );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file topics.php Topics like class (forums application)
|
||||
*~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 $
|
||||
*/
|
||||
|
||||
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 like_forums_topics_composite
|
||||
* @brief Topics like class (forums application)
|
||||
*/
|
||||
class like_forums_topics_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'topic';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'topics', $this->lang->words['follow_notify_topics'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_t';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
/* Digests are checked in buildNotificationData */
|
||||
$topic = $this->registry->getClass('topics')->getTopicById( $metaData['like_rel_id'] );
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $metaData );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to let plugins determine if a notification should not be sent. Return false to send notification, or true to skip sending it.
|
||||
*
|
||||
* @param array Notification data
|
||||
* @return @e bool
|
||||
*/
|
||||
public function excludeNotification( $row )
|
||||
{
|
||||
if ( $row['like_notify_freq'] == 'offline' AND $row['last_activity'] < $row['like_notify_sent'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$topic = $data;
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
$flag = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
$tFurl = $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $topic['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Unapproved or deleted */
|
||||
if ( $flag != 'visible' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bnd'][ $topic['tid'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$posts = $this->registry->getClass('topics')->getPosts( array( 'topicId' => $topic['tid'],
|
||||
'postType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'sortField' => 'pid',
|
||||
'limit' => 50,
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $posts as $pid => $post )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $post['author_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $post['author_name'] . " -- " . ipsRegistry::getClass( 'class_localization')->getDate( $post['post_date'], 'SHORT' ) . "<br />" . $post['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output .= $this->lang->words['follow_topic'] . ": " . $topic['title'] . " (" . $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
|
||||
. $tFurl . "<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bnd'][ $topic['tid'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bnd'][ $topic['tid'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_topics_digest',
|
||||
'notification_url' => $tFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_topic_daily' : 'digest_topic_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_topic_daily'] : $this->lang->words['subject__digest_topic_weekly'],
|
||||
'build_message_array' => array( 'URL' => $tFurl,
|
||||
'TITLE' => $topic['title'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 't.*, t.last_post as topic_last_post', 'from' => array( 'topics' => 't' ), 'where' => 't.tid=' . $field, 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=t.forum_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.title'] = $row['title'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showtopic=" . $row['tid'], "public", $row['title_seo'], "showtopic" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.type'] = $this->lang->words['follow_topic'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentType'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => 'l.like_rel_id=t.tid',
|
||||
'order' => 't.last_post',
|
||||
'extraWhere' => $this->DB->buildWherePermission( $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] ), 't.forum_id', FALSE ) );
|
||||
}
|
||||
}
|
||||
@@ -1,206 +1,206 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Synchronization extensions
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
class forumsMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a new account is created
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onCreateAccount( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when the register form is displayed to a user
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function onRegisterForm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is ren when a user successfully logs in
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogin( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member's account has been merged into another member's account
|
||||
*
|
||||
* @param array $member Member account being kept
|
||||
* @param array $member2 Member account being removed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users email address is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_email New email address
|
||||
* @param string $old_email Old email address
|
||||
* @return void
|
||||
*/
|
||||
public function onEmailChange( $id, $new_email, $old_email )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users password is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_plain_text_pass The new password
|
||||
* @return @e void
|
||||
*/
|
||||
public function onPassChange( $id, $new_plain_text_pass )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users profile is successfully updated
|
||||
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
|
||||
* IPSMember::save().
|
||||
*
|
||||
* @param array $member Array of values that were changed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onProfileUpdate( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users group is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param integer $new_group New Group ID
|
||||
* @param integer $old_group Old Group ID
|
||||
* @return @e void
|
||||
*/
|
||||
public function onGroupChange( $id, $new_group, $old_group )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users display name is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_name New display name
|
||||
* @return @e void
|
||||
*/
|
||||
public function onNameChange( $id, $new_name )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user logs out
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogOut( $member )
|
||||
{
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @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 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Synchronization extensions
|
||||
*
|
||||
* @author $author$
|
||||
* @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 $
|
||||
*/
|
||||
class forumsMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a new account is created
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onCreateAccount( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when the register form is displayed to a user
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function onRegisterForm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user successfully logs in
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogin( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member's account has been merged into another member's account
|
||||
*
|
||||
* @param array $member Member account being kept
|
||||
* @param array $member2 Member account being removed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users email address is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_email New email address
|
||||
* @param string $old_email Old email address
|
||||
* @return void
|
||||
*/
|
||||
public function onEmailChange( $id, $new_email, $old_email )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users password is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_plain_text_pass The new password
|
||||
* @return @e void
|
||||
*/
|
||||
public function onPassChange( $id, $new_plain_text_pass )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users profile is successfully updated
|
||||
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
|
||||
* IPSMember::save().
|
||||
*
|
||||
* @param array $member Array of values that were changed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onProfileUpdate( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users group is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param integer $new_group New Group ID
|
||||
* @param integer $old_group Old Group ID
|
||||
* @return @e void
|
||||
*/
|
||||
public function onGroupChange( $id, $new_group, $old_group )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users display name is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_name New display name
|
||||
* @return @e void
|
||||
*/
|
||||
public function onNameChange( $id, $new_name )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user logs out
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogOut( $member )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_announcements.php Moderator control panel plugin: manage announcements
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/18/2011
|
||||
* $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9550 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -170,7 +170,7 @@ class plugin_forums_announcements
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['announce_seo_title'] = IPSText::makeSeoTitle( $r['announce_title'] );
|
||||
$r['announce_seo_title'] = $r['announce_seo_title'] ? $r['announce_seo_title'] : IPSText::makeSeoTitle( $r['announce_title'] );
|
||||
|
||||
if ( $r['announce_forum'] == '*' )
|
||||
{
|
||||
@@ -211,6 +211,12 @@ 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 );
|
||||
}
|
||||
|
||||
$announce_id = intval( $this->request['announce_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -268,7 +274,7 @@ class plugin_forums_announcements
|
||||
{
|
||||
if ( !empty($this->request[$bit]) )
|
||||
{
|
||||
$announce[ $bit ] = $this->request[ $bit ];
|
||||
$announce[ $bit ] = $bit == 'announce_post' ? $_POST[ $bit ] : $this->request[ $bit ];
|
||||
}
|
||||
else if( !isset($announce[ $bit] ) )
|
||||
{
|
||||
@@ -315,6 +321,12 @@ 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 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
@@ -419,7 +431,8 @@ class plugin_forums_announcements
|
||||
'announce_html_enabled' => $this->request['announce_html_enabled'] ? $this->request['announce_html_enabled'] : 0,
|
||||
'announce_nlbr_enabled' => $this->request['announce_nlbr_enabled'] ? $this->request['announce_nlbr_enabled'] : 0,
|
||||
'announce_start' => $start_date,
|
||||
'announce_end' => $end_date
|
||||
'announce_end' => $end_date,
|
||||
'announce_seo_title' => IPSText::makeSeoTitle( $this->request['announce_title'] ),
|
||||
);
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_deletedposts.php Moderator control panel plugin: show deleted posts
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ class plugin_forums_deletedposts
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=deletedposts",
|
||||
) );
|
||||
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->deletedPosts( $posts, $other_data, $pages );
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ class plugin_forums_deletedposts
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_post'] )
|
||||
if( $forum['bw_mod_soft_delete_see'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_deletedtopics.php Moderator control panel plugin: show deleted topics
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -246,23 +246,23 @@ class plugin_forums_deletedtopics
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_topic'] )
|
||||
if( $forum['bw_mod_soft_delete_see'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file plugin_unapprovedposts.php Moderator control panel plugin: show posts pending approval
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_unapprovedtopics.php Moderator control panel plugin: show topics pending approval
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ class plugin_forums_unapprovedtopics
|
||||
$topics = $this->registry->getClass('topics')->getTopics( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getTopicsCount();
|
||||
$final = array();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Format data
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
/**
|
||||
* @file generate.php Navigation plugin: attachments
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 3/8/2011
|
||||
* $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8229 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,51 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2011-03-29 08:39:51 -0400 (Tue, 29 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8208 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification types
|
||||
*/
|
||||
|
||||
class forums_notifications
|
||||
{
|
||||
public function getConfiguration()
|
||||
{
|
||||
/**
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'post_quoted', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_quoted' ),
|
||||
array( 'key' => 'new_likes', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
// This is defined in ACP forum settings as an email, so it's not mapped to a specific member
|
||||
//array( 'key' => 'new_topic_queue', 'default' => array( 'email' ), 'disabled' => array() ),
|
||||
);/*noLibHook*/
|
||||
return $_NOTIFY;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Define the core notification types
|
||||
* 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 20th February 2002
|
||||
* @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();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification types
|
||||
*/
|
||||
|
||||
class forums_notifications
|
||||
{
|
||||
public function getConfiguration()
|
||||
{
|
||||
/**
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'post_quoted', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_quoted' ),
|
||||
array( 'key' => 'new_likes', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_newreply', 'show_callback' => TRUE ),
|
||||
array( 'key' => 'followed_topics', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
// This is defined in ACP forum settings as an email, so it's not mapped to a specific member
|
||||
//array( 'key' => 'new_topic_queue', 'default' => array( 'email' ), 'disabled' => array() ),
|
||||
);/*noLibHook*/
|
||||
return $_NOTIFY;
|
||||
}
|
||||
|
||||
function new_likes()
|
||||
{
|
||||
return (bool) (
|
||||
ipsRegistry::$settings['reputation_enabled'] and
|
||||
!in_array( ipsRegistry::member()->getProperty('member_group_id'), explode( ',', ipsRegistry::$settings['reputation_protected_groups'] ) ) and
|
||||
ipsRegistry::$settings['reputation_point_types'] == 'like'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Config for posts plugin
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7442 $
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,4 +47,4 @@ $CONFIG['plugin_enabled'] = 1;
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 4;
|
||||
$CONFIG['plugin_order'] = 5;
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2011-07-27 10:14:00 -0400 (Wed, 27 Jul 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 9326 $
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Config for topics plugin
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7442 $
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,4 +47,4 @@ $CONFIG['plugin_enabled'] = 1;
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 3;
|
||||
$CONFIG['plugin_order'] = 4;
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2011-07-21 05:49:32 -0400 (Thu, 21 Jul 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 9298 $
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,49 +1,224 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Reputation configuration for application
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$rep_author_config = array(
|
||||
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
|
||||
);
|
||||
|
||||
/**
|
||||
* The following config items are for the log viewer in the ACP
|
||||
*/
|
||||
|
||||
$rep_log_joins = array(
|
||||
array(
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.title as repContentTitle, t.tid as repContentID',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
);
|
||||
|
||||
$rep_log_where = "p.author_id=%s";
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Reputation configuration for application
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @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 $
|
||||
*/
|
||||
|
||||
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 reputation_forums
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Init attachments */
|
||||
$classname = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classname( ipsRegistry::instance() );
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
$this->class_attach->getUploadFormSettings();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
|
||||
ipsRegistry::setClass( 'repCache', new $classToLoad() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Database Query to get results
|
||||
*
|
||||
* @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
|
||||
* @param array Member this applies to
|
||||
*
|
||||
* @return array Parameters to pass to ipsRegistry::DB()->build
|
||||
* Must return at least the data from reputation_index
|
||||
* limit and order will be applied automatically
|
||||
*/
|
||||
public function fetch( $type=NULL, $member=NULL )
|
||||
{
|
||||
$allowedForumIDs = ipsRegistry::getClass('class_forums')->fetchSearchableForumIds();
|
||||
|
||||
$userGiving = 'r';
|
||||
$extraWhere = '';
|
||||
$extraJoin = array();
|
||||
|
||||
if ( $type == 'most' )
|
||||
{
|
||||
return array( 'type' => 'pid',
|
||||
|
||||
/* Used in first query to fetch type_ids */
|
||||
'inner' => array( 'select' => 'p.pid',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
//'where' => '1=1',
|
||||
'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 ) ),
|
||||
'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 */
|
||||
'joins' => array( array( 'select' => 'rc.*',
|
||||
'from' => array( 'reputation_cache' => 'rc' ),
|
||||
'where' => "rc.app='forums' AND rc.type='pid' AND rc.type_id=r.type_id" ),
|
||||
array( 'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type_id=p.pid' ),
|
||||
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
|
||||
{
|
||||
if ( $type !== NULL )
|
||||
{
|
||||
$extraWhere = ( ( $type == 'given' ) ? "r.member_id={$member['member_id']}" : "p.author_id={$member['member_id']}" ) . ' AND ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$userGiving = 'r2';
|
||||
$extraJoin = array( array(
|
||||
'from' => array( 'reputation_index' => 'r2' ),
|
||||
'where' => "r2.app=r.app AND r2.type=r.type AND r2.type_id=r.type_id AND r2.member_id=" . ipsRegistry::member()->getProperty('member_id')
|
||||
) );
|
||||
}
|
||||
|
||||
return array(
|
||||
'select' => "r.*, rc.*, {$userGiving}.member_id as repUserGiving, p.*, t.*, t.title as topic_title", // we have to do aliases on some of them due to duplicate column names
|
||||
'from' => array( 'reputation_index' => 'r'),
|
||||
'add_join' => array_merge( $extraJoin, array(
|
||||
array(
|
||||
'from' => array( 'reputation_cache' => 'rc' ),
|
||||
'where' => "rc.app=r.app AND rc.type=r.type AND rc.type_id=r.type_id"
|
||||
),
|
||||
array(
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type_id=p.pid'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid'
|
||||
)
|
||||
) ),
|
||||
'where' => "r.app='forums' AND r.type='pid' AND " . // belongs to this app
|
||||
$extraWhere . // is for this member
|
||||
" 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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Results
|
||||
*
|
||||
* @param array Row from database using query specified in fetch()
|
||||
* @return array Same data with any additional processing necessary
|
||||
*/
|
||||
public function process( $row )
|
||||
{
|
||||
/* Build poster's display data */
|
||||
$member = $row['author_id'] ? IPSMember::load( $row['author_id'], 'profile_portal,pfields_content,sessions,groups', 'id' ) : IPSMember::setUpGuest();
|
||||
$row = array_merge( $row, IPSMember::buildDisplayData( $member, array( 'reputation' => 0, 'warn' => 0 ) ) );
|
||||
|
||||
/* Get forum data (damn HTML >.<) */
|
||||
$forumData = ipsRegistry::getClass('class_forums')->getForumById( $row['forum_id'] );
|
||||
|
||||
/* Parse BBCode */
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass('bbcode')->parse_html = ( $forumData['use_html'] and $member['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 = $member['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others'];
|
||||
$row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['post'] );
|
||||
|
||||
/* Parse attachments */
|
||||
$messageHTML = array( $row['pid'] => $row['post'] );
|
||||
$attachHTML = $this->class_attach->renderAttachments( $messageHTML, array( $row['pid'] ) );
|
||||
|
||||
if( is_array( $attachHTML ) AND count( $attachHTML ) )
|
||||
{
|
||||
/* Get rid of any lingering attachment tags */
|
||||
if ( stristr( $attachHTML[ $row['pid'] ]['html'], "[attachment=" ) )
|
||||
{
|
||||
$attachHTML[ $row['pid'] ]['html'] = IPSText::stripAttachTag( $attachHTML[ $row['pid'] ]['html'] );
|
||||
}
|
||||
$row['post'] = $attachHTML[ $row['pid'] ]['html'] . $attachHTML[ $row['pid'] ]['attachmentHtml'];
|
||||
}
|
||||
|
||||
/* Get rep buttons */
|
||||
if ( $row['repUserGiving'] == ipsRegistry::member()->getProperty('member_id') )
|
||||
{
|
||||
$row['has_given_rep'] = $row['rep_rating'];
|
||||
}
|
||||
|
||||
$row['rep_points'] = ipsRegistry::getClass('repCache')->getRepPoints( array( 'app' => 'forums', 'type' => 'pid', 'type_id' => $row['pid'], 'rep_points' => $row['rep_points'] ) );
|
||||
$row['repButtons'] = ipsRegistry::getClass('repCache')->getLikeFormatted( array( 'app' => 'forums', 'type' => 'pid', 'id' => $row['pid'], 'rep_like_cache' => $row['rep_like_cache'] ) );
|
||||
|
||||
/* Return */
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display Results
|
||||
*
|
||||
* @param array Results after being processed
|
||||
* @param string HTML
|
||||
*/
|
||||
public function display( $results )
|
||||
{
|
||||
return ipsRegistry::getClass('output')->getTemplate( 'profile' )->tabReputation_posts( $results );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$rep_author_config = array(
|
||||
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
|
||||
);
|
||||
|
||||
$rep_log_joins = array(
|
||||
array(
|
||||
'select' => 'p.*, p.author_id as repAuthorId, p.post as repContentToParse, p.pid as repPostId',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.*, t.title as repContentTitle, t.tid as repContentID',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
);
|
||||
|
||||
$rep_log_where = "p.author_id=%s";
|
||||
$rep_log_link = 'findpost=%d';
|
||||
@@ -1,133 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 8021 $
|
||||
*/
|
||||
|
||||
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 rss_output_forums
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @return array RSS links
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
|
||||
ipsRegistry::DB()->execute();
|
||||
|
||||
while( $r = ipsRegistry::DB()->fetch() )
|
||||
{
|
||||
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&module=global&section=rss&type=forums&id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_export_id = intval( ipsRegistry::$request['id'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
$this->expires = time();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'rss_export',
|
||||
'where' => 'rss_export_id=' . $rss_export_id ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Correct expires time
|
||||
//-----------------------------------------
|
||||
|
||||
$this->expires += $rss_data['rss_export_cache_time'] * 60;
|
||||
|
||||
//-----------------------------------------
|
||||
// Need to recache?
|
||||
//-----------------------------------------
|
||||
|
||||
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
|
||||
|
||||
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Yes
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php', 'admin_forums_rss_export' );
|
||||
$rss_export = new $classToLoad();
|
||||
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
|
||||
|
||||
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// No
|
||||
//-----------------------------------------
|
||||
|
||||
return $rss_data['rss_export_cache_content'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return $this->expires ? $this->expires : time();
|
||||
}
|
||||
<?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 rss_output_forums
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @return array RSS links
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
|
||||
ipsRegistry::DB()->execute();
|
||||
|
||||
while( $r = ipsRegistry::DB()->fetch() )
|
||||
{
|
||||
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&module=global&section=rss&type=forums&id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_export_id = intval( ipsRegistry::$request['id'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
$this->expires = time();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'rss_export',
|
||||
'where' => 'rss_export_id=' . $rss_export_id ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Correct expires time
|
||||
//-----------------------------------------
|
||||
|
||||
$this->expires += $rss_data['rss_export_cache_time'] * 60;
|
||||
|
||||
//-----------------------------------------
|
||||
// Need to recache?
|
||||
//-----------------------------------------
|
||||
|
||||
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
|
||||
|
||||
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Yes
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php', 'admin_forums_rss_export' );
|
||||
$rss_export = new $classToLoad();
|
||||
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
|
||||
|
||||
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// No
|
||||
//-----------------------------------------
|
||||
|
||||
return $rss_data['rss_export_cache_content'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return $this->expires ? $this->expires : time();
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Config file
|
||||
* Last Updated: $Date: 2011-04-18 21:34:01 -0400 (Mon, 18 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8370 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can further filter VNC by removing non-followed 'categories' */
|
||||
$CONFIG['can_vnc_filter_by_followed'] = 1;
|
||||
$CONFIG['can_vnc_unread_content'] = 1;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Can search tags */
|
||||
$CONFIG['can_searchTags'] = 1;
|
||||
|
||||
/* Content types for 'follow', default one first */
|
||||
$CONFIG['followContentTypes'] = array( 'topics', 'forums' );
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Config file
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @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 $
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can further filter VNC by removing non-followed 'categories' */
|
||||
$CONFIG['can_vnc_filter_by_followed'] = 1;
|
||||
$CONFIG['can_vnc_unread_content'] = 1;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Can search tags */
|
||||
$CONFIG['can_searchTags'] = 1;
|
||||
|
||||
/* Content types for 'follow', default one first */
|
||||
$CONFIG['followContentTypes'] = array( 'topics', 'forums' );
|
||||
|
||||
$CONFIG['can_moderate_results'] = 1;
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,80 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
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 search_form_forums
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
{
|
||||
$array = array( 'date' => $this->lang->words['s_search_type_0'],
|
||||
'title' => $this->lang->words['forum_sort_title'],
|
||||
'posts' => $this->lang->words['forum_sort_posts'],
|
||||
'views' => $this->lang->words['forum_sort_views'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the html for displaying the forum category filter on the advanced search page
|
||||
*
|
||||
* @return string Filter HTML
|
||||
*/
|
||||
public function getHtml()
|
||||
{
|
||||
/* Make sure class_forums is setup */
|
||||
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('class_forums')->strip_invisible = 1;
|
||||
ipsRegistry::getClass('class_forums')->forumsInit();
|
||||
|
||||
return array( 'title' => ipsRegistry::$applications['forums']['app_public_title'], 'html' => ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->forumAdvancedSearchFilters( ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1 ) ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @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 $
|
||||
*/
|
||||
|
||||
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 search_form_forums
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
{
|
||||
$array = array( 'date' => $this->lang->words['s_search_type_0'],
|
||||
'title' => $this->lang->words['forum_sort_title'],
|
||||
'posts' => $this->lang->words['forum_sort_posts'],
|
||||
'views' => $this->lang->words['forum_sort_views'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the html for displaying the forum category filter on the advanced search page
|
||||
*
|
||||
* @return string Filter HTML
|
||||
*/
|
||||
public function getHtml()
|
||||
{
|
||||
/* Make sure class_forums is setup */
|
||||
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('class_forums')->strip_invisible = 1;
|
||||
ipsRegistry::getClass('class_forums')->forumsInit();
|
||||
|
||||
/* Got any archived content? */
|
||||
$canSearchArchives = false;
|
||||
|
||||
if ( $this->settings['archive_on'] )
|
||||
{
|
||||
$canSearchArchives = true;
|
||||
|
||||
if ( ( $this->settings['search_method'] == 'traditional' || $this->settings['search_method'] == 'sql' ) && $this->settings['archive_remote_sql_database'] )
|
||||
{
|
||||
$canSearchArchives = false;
|
||||
}
|
||||
}
|
||||
|
||||
$topic = NULL;
|
||||
if ( $this->request['cType'] == 'topic' )
|
||||
{
|
||||
$this->request['cId'] = intval( $this->request['cId'] );
|
||||
$topic = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid={$this->request['cId']}" ) );
|
||||
}
|
||||
|
||||
return array(
|
||||
'title' => IPSLib::getAppTitle('forums'),
|
||||
'html' => ipsRegistry::getClass('output')->getTemplate('search')->forumAdvancedSearchFilters(
|
||||
ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1, 0, ( isset( $this->request['cId'] ) and $this->request['cType'] == 'forum' ) ? array( $this->request['cId'] ) : array() ),
|
||||
$canSearchArchives,
|
||||
$topic
|
||||
) );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2011-09-23 11:38:00 -0400 (Fri, 23 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9545 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
@@ -31,13 +31,15 @@ $appSphinxTemplate = <<<EOF
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_posts', (SELECT max(pid) FROM <!--SPHINX_DB_PREFIX-->posts), 0, UNIX_TIMESTAMP(), 0 )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
|
||||
t.tid, t.title, LOWER(t.title) as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, REPLACE( p.post, '-', '&\#8208') as post, p.topic_id, p.queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid )
|
||||
@@ -46,6 +48,7 @@ source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFI
|
||||
sql_attr_uint = queued
|
||||
sql_attr_uint = approved
|
||||
sql_attr_uint = soft_deleted
|
||||
sql_attr_uint = archive_status
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_uint = forum_id
|
||||
sql_attr_timestamp = post_date
|
||||
@@ -66,19 +69,21 @@ source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFI
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the delta source
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
|
||||
t.tid, t.title, LOWER(t.title) as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, REPLACE( p.post, '-', '&\#8208') as post, p.topic_id, p.queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid ) \
|
||||
WHERE p.pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
|
||||
sql_query_killlist = SELECT pid FROM !--SPHINX_DB_PREFIX-->posts WHERE pid > ( SELECT cs_value FROM !--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
sql_query_killlist = SELECT pid FROM <!--SPHINX_DB_PREFIX-->posts WHERE pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
@@ -90,7 +95,7 @@ index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = utf-8
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
#infix_fields = post, title
|
||||
#min_infix_len = 3
|
||||
@@ -103,5 +108,84 @@ index <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFI
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_posts_delta
|
||||
}
|
||||
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_archive_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_archives', (SELECT max(archive_id) FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts), 0, UNIX_TIMESTAMP(), 0 )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT p.archive_id, p.archive_id as search_id, p.archive_author_id as author_id, p.archive_content_date as post_date, REPLACE( p.archive_content, '-', '&\#8208') as archive_content, p.archive_topic_id, p.archive_queued as queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.archive_topic_id=t.tid )
|
||||
|
||||
# Fields
|
||||
sql_attr_uint = queued
|
||||
sql_attr_uint = approved
|
||||
sql_attr_uint = soft_deleted
|
||||
sql_attr_uint = archive_status
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_uint = forum_id
|
||||
sql_attr_timestamp = post_date
|
||||
sql_attr_timestamp = last_post
|
||||
sql_attr_timestamp = start_date
|
||||
sql_attr_uint = author_id
|
||||
sql_attr_uint = starter_id
|
||||
sql_attr_uint = tid
|
||||
sql_attr_uint = posts
|
||||
sql_attr_uint = views
|
||||
sql_attr_str2ordinal = tordinal
|
||||
sql_attr_bigint = last_post_group
|
||||
sql_attr_multi = uint tag_id from query; SELECT t.topic_firstpost, c.tag_id FROM <!--SPHINX_DB_PREFIX-->core_tags c LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON (t.tid=c.tag_meta_id) WHERE c.tag_meta_app='forums' AND c.tag_meta_area='topics'
|
||||
|
||||
sql_ranged_throttle = 0
|
||||
}
|
||||
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta : <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the delta source
|
||||
sql_query = SELECT p.archive_id, p.archive_id as search_id, p.archive_author_id as author_id, p.archive_content_date as post_date, REPLACE( p.archive_content, '-', '&\#8208') as archive_content, p.archive_topic_id, p.archive_queued as queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.archive_topic_id=t.tid ) \
|
||||
WHERE p.archive_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_archives' )
|
||||
|
||||
sql_query_killlist = SELECT archive_id FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts WHERE archive_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_archives' )
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
#infix_fields = archive_content, title
|
||||
#min_infix_len = 3
|
||||
#enable_star = 1
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta : <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_archive_delta
|
||||
}
|
||||
|
||||
EOF;
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,336 +1,360 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Tagging: Forums/Topics Class
|
||||
* Matt Mecham
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2011 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://hatynka.in
|
||||
* @since 25 Feb 2011
|
||||
* @version $Revision: 9483 $
|
||||
*
|
||||
*/
|
||||
|
||||
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 tags_forums_topics extends classes_tag_abstract
|
||||
{
|
||||
protected $topicCache = array();
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Little 'trick' to force preset tags
|
||||
*
|
||||
* @param string view to show
|
||||
* @param array Where data to show
|
||||
*/
|
||||
public function render( $what, $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $forum['tag_predefined'] ) )
|
||||
{
|
||||
/* Turn off open system */
|
||||
$this->settings['tags_open_system'] = false;
|
||||
}
|
||||
|
||||
return parent::render( $what, $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches parent ID
|
||||
* @param array Where Data
|
||||
* @return int Id of parent if one exists or 0
|
||||
*/
|
||||
public function getParentId( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
|
||||
return intval( $topic['forum_id'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches permission data
|
||||
* @param array Where Data
|
||||
* @return string Comma delimiter or *
|
||||
*/
|
||||
public function getPermissionData( $where )
|
||||
{
|
||||
if ( isset( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( isset( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
return $forum['perm_view'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic permission check
|
||||
* @param string $what (add/remove/edit/create/prefix) [ add = add new tags to items, create = create unique tags, use a tag as a prefix for an item ]
|
||||
* @param array $where data
|
||||
*/
|
||||
public function can( $what, $where )
|
||||
{
|
||||
$topic = array();
|
||||
$forum = array();
|
||||
|
||||
if ( ! empty( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
/* Check parent */
|
||||
$return = parent::can( $what, $where );
|
||||
|
||||
if ( $return === false )
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* Forum disabled */
|
||||
if ( $forum['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( $what )
|
||||
{
|
||||
case 'create':
|
||||
if ( ! $this->_isOpenSystem() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
break;
|
||||
case 'add':
|
||||
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
case 'remove':
|
||||
if ( $this->memberData['member_id'] == $topic['starter_id'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'prefix':
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DEFAULT: returns true and should be defined in your own class
|
||||
* @param array Where Data
|
||||
* @return int If meta item is visible (not unapproved, etc)
|
||||
*/
|
||||
public function getIsVisible( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$approved = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
|
||||
return ( $approved == 'visible' ) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for tags
|
||||
* @param mixed $tags Array or string
|
||||
* @param array $options Array( 'meta_id' (array), 'meta_parent_id' (array), 'olderThan' (int), 'youngerThan' (int), 'limit' (int), 'sortKey' (string) 'sortOrder' (string) )
|
||||
*/
|
||||
public function search( $tags, $options )
|
||||
{
|
||||
$ok = array();
|
||||
|
||||
/* Fix up forum IDs */
|
||||
if ( isset( $options['meta_parent_id'] ) )
|
||||
{
|
||||
if ( is_array( $options['meta_parent_id'] ) )
|
||||
{
|
||||
foreach( $options['meta_parent_id'] as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->_canSearchForum( $options['meta_parent_id'] ) === true )
|
||||
{
|
||||
$ok[] = $options['meta_parent_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fetch forum IDs */
|
||||
$ok = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
}
|
||||
|
||||
$options['meta_parent_id'] = $ok;
|
||||
|
||||
return parent::search( $tags, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a list of pre-defined tags
|
||||
*
|
||||
* @param array Where Data
|
||||
* @return Array of pre-defined tags or null
|
||||
*/
|
||||
protected function _getPreDefinedTags( $where=array() )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
$this->settings['tags_predefined'] = ( ! empty( $forum['tag_predefined'] ) ) ? $forum['tag_predefined'] : $this->settings['tags_predefined'];
|
||||
|
||||
return parent::_getPreDefinedTags( $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can set an item as a topic prefix
|
||||
*
|
||||
* @param array $where Where Data
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _prefixesEnabled( $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( $forum['bw_disable_prefixes'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::_prefixesEnabled( $where );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a forum for tag searching
|
||||
*
|
||||
* @param id $id Forum ID
|
||||
* @return @e boolean True if it can be searched
|
||||
*/
|
||||
protected function _canSearchForum( $id )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumById( $id );
|
||||
|
||||
if ( ! $this->registry->permissions->check( 'read', $data ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a topic
|
||||
*
|
||||
* @param integer $tid Topic ID
|
||||
* @return @e array Topic data
|
||||
*/
|
||||
protected function _getTopic( $tid )
|
||||
{
|
||||
if ( ! isset( $this->topicCache[ $tid ] ) )
|
||||
{
|
||||
$this->topicCache[ $tid ] = $this->registry->getClass('topics')->getTopicById( $tid );
|
||||
}
|
||||
|
||||
return $this->topicCache[ $tid ];
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Tagging: Forums/Topics Class
|
||||
* Matt Mecham
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2011 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 25 Feb 2011
|
||||
* @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 tags_forums_topics extends classes_tag_abstract
|
||||
{
|
||||
protected $topicCache = array();
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
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 ) );
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Little 'trick' to force preset tags
|
||||
*
|
||||
* @param string view to show
|
||||
* @param array Where data to show
|
||||
*/
|
||||
public function render( $what, $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $forum['tag_predefined'] ) )
|
||||
{
|
||||
/* Turn off open system */
|
||||
$this->settings['tags_open_system'] = false;
|
||||
}
|
||||
|
||||
return parent::render( $what, $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches parent ID
|
||||
* @param array Where Data
|
||||
* @return int Id of parent if one exists or 0
|
||||
*/
|
||||
public function getParentId( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
|
||||
return intval( $topic['forum_id'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches permission data
|
||||
* @param array Where Data
|
||||
* @return string Comma delimiter or *
|
||||
*/
|
||||
public function getPermissionData( $where )
|
||||
{
|
||||
if ( isset( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( isset( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
return $forum['perm_view'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic permission check
|
||||
* @param string $what (add/remove/edit/create/prefix) [ add = add new tags to items, create = create unique tags, use a tag as a prefix for an item ]
|
||||
* @param array $where data
|
||||
*/
|
||||
public function can( $what, $where )
|
||||
{
|
||||
/* Check parent */
|
||||
$return = parent::can( $what, $where );
|
||||
|
||||
if ( $return === false )
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* Init some vars */
|
||||
$topic = array();
|
||||
$forum = array();
|
||||
|
||||
if ( ! empty( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
/* Forum disabled */
|
||||
if ( $forum['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( $what )
|
||||
{
|
||||
case 'create':
|
||||
if ( ! $this->_isOpenSystem() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
break;
|
||||
case 'add':
|
||||
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( defined('IN_CONVERTER') AND IN_CONVERTER == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
case 'remove':
|
||||
if ( $this->memberData['member_id'] == $topic['starter_id'] or $this->memberData['g_is_supmod'] or ( $this->memberData['is_mod'] and isset( $this->memberData['forumsModeratorData'][ $forum['id'] ] ) and $this->memberData['forumsModeratorData'][ $forum['id'] ]['edit_post'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'prefix':
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( defined('IN_CONVERTER') AND IN_CONVERTER == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DEFAULT: returns true and should be defined in your own class
|
||||
* @param array Where Data
|
||||
* @return int If meta item is visible (not unapproved, etc)
|
||||
*/
|
||||
public function getIsVisible( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$approved = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
|
||||
return ( $approved == 'visible' ) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for tags
|
||||
* @param mixed $tags Array or string
|
||||
* @param array $options Array( 'meta_id' (array), 'meta_parent_id' (array), 'olderThan' (int), 'youngerThan' (int), 'limit' (int), 'sortKey' (string) 'sortOrder' (string) )
|
||||
*/
|
||||
public function search( $tags, $options )
|
||||
{
|
||||
$ok = array();
|
||||
|
||||
/* Fix up forum IDs */
|
||||
if ( isset( $options['meta_parent_id'] ) )
|
||||
{
|
||||
if ( is_array( $options['meta_parent_id'] ) )
|
||||
{
|
||||
foreach( $options['meta_parent_id'] as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->_canSearchForum( $options['meta_parent_id'] ) === true )
|
||||
{
|
||||
$ok[] = $options['meta_parent_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fetch forum IDs */
|
||||
$allForums = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
foreach( $allForums as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$options['meta_parent_id'] = $ok;
|
||||
|
||||
return parent::search( $tags, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a list of pre-defined tags
|
||||
*
|
||||
* @param array Where Data
|
||||
* @return Array of pre-defined tags or null
|
||||
*/
|
||||
protected function _getPreDefinedTags( $where=array() )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
$this->settings['tags_predefined'] = ( ! empty( $forum['tag_predefined'] ) ) ? $forum['tag_predefined'] : $this->settings['tags_predefined'];
|
||||
|
||||
return parent::_getPreDefinedTags( $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can set an item as a topic prefix
|
||||
*
|
||||
* @param array $where Where Data
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _prefixesEnabled( $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( $forum['bw_disable_prefixes'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::_prefixesEnabled( $where );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a forum for tag searching
|
||||
*
|
||||
* @param id $id Forum ID
|
||||
* @return @e boolean True if it can be searched
|
||||
*/
|
||||
protected function _canSearchForum( $id )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumById( $id );
|
||||
|
||||
if ( ! $this->registry->permissions->check( 'read', $data ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Tagging disabled */
|
||||
if ( $data['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch a topic
|
||||
*
|
||||
* @param integer $tid Topic ID
|
||||
* @return @e array Topic data
|
||||
*/
|
||||
protected function _getTopic( $tid )
|
||||
{
|
||||
if ( ! isset( $this->topicCache[ $tid ] ) )
|
||||
{
|
||||
$this->topicCache[ $tid ] = $this->registry->getClass('topics')->getTopicById( $tid );
|
||||
}
|
||||
|
||||
return $this->topicCache[ $tid ];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @file warnings.php Warnings extension for forums
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $ (Original: Mark)
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $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 warnings_forums
|
||||
* @brief Warnings Extension for forums
|
||||
*/
|
||||
class warnings_forums
|
||||
{
|
||||
/**
|
||||
* Get Content URL
|
||||
*
|
||||
* @param array $warning Row from members_warn_logs
|
||||
* @return @e array array( url => URL to the content the warning came from, title => Title )
|
||||
*/
|
||||
public function getContentUrl( $warning )
|
||||
{
|
||||
if ( is_numeric( $warning['wl_content_id1'] ) )
|
||||
{
|
||||
$post = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'posts', 'where' => "pid={$warning['wl_content_id1']}" ) );
|
||||
|
||||
if ( ! empty($post['topic_id']) )
|
||||
{
|
||||
$topic = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid={$post['topic_id']}" ) );
|
||||
|
||||
if ( ! empty($topic['tid']) )
|
||||
{
|
||||
return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showtopic={$topic['tid']}&findpost={$post['pid']}", 'public', $topic['title_seo'], 'showtopic' ), 'title' => $topic['title'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( $warning['wl_content_id1'] == 'announcement' )
|
||||
{
|
||||
$announcement = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'announcements', 'where' => "announce_id=" . intval( $warning['wl_content_id2'] ) ) );
|
||||
|
||||
if ( ! empty($announcement['announce_id']) )
|
||||
{
|
||||
return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showannouncement={$announcement['announce_id']}", 'public', IPSText::makeSeoTitle( $announcement['announce_title'] ), 'showannouncement' ), 'title' => $announcement['announce_title'] );
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user