Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,51 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Group property updater (Forums)
|
||||
* Last Updated: $Date: 2010-09-29 20:23:38 -0400 (Wed, 29 Sep 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6925 $
|
||||
*
|
||||
* @file group_form.php Forums group editing form
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-03-03 13:09:09 -0500 (Thu, 03 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7948 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @interface admin_group_form__forums
|
||||
* @brief Forums group editing form
|
||||
*
|
||||
*/
|
||||
class admin_group_form__forums implements admin_group_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string Tab name
|
||||
*/
|
||||
* Tab name (leave it blank to use the default application title)
|
||||
*
|
||||
* @var $tab_name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @param array Group data
|
||||
* @param integer Number of tabs used so far
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
* Returns HTML tabs content for the page
|
||||
*
|
||||
* @param array $group Group data
|
||||
* @param integer $tabsUsed Number of tabs used so far (your ids should be this +1)
|
||||
* @return @e array Array of 'tabs' (HTML for the tabs), 'content' (HTML for the content), 'tabsUsed' (number of tabs you have used)
|
||||
*/
|
||||
public function getDisplayContent( $group=array(), $tabsUsed = 2 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
@@ -68,12 +61,10 @@ class admin_group_form__forums implements admin_group_form
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Array of keys => values for saving
|
||||
*/
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @return @e array Array of keys => values for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
$return = array(
|
||||
@@ -102,6 +93,4 @@ class admin_group_form__forums implements admin_group_form
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2010-03-22 22:39:27 -0400 (Mon, 22 Mar 2010) $
|
||||
* Last Updated: $Date: 2011-04-19 12:42:57 -0400 (Tue, 19 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 5986 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8391 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @access public
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
@@ -50,7 +49,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
@@ -81,7 +79,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
@@ -100,13 +97,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member data
|
||||
//-----------------------------------------
|
||||
|
||||
// $member = IPSMember::load( $member['member_id'], 'extendedProfile' );
|
||||
$member['_avatar'] = str_replace( '<img ', '<img id="MF__avatar" ', IPSMember::buildAvatar( $member ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
@@ -118,7 +108,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
@@ -127,8 +116,6 @@ class admin_member_form__forums implements admin_member_form
|
||||
$return = array( 'core' => array(), 'extendedProfile' => array() );
|
||||
|
||||
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
|
||||
$return['core']['view_avs'] = intval(ipsRegistry::$request['view_avs']);
|
||||
$return['core']['view_img'] = intval(ipsRegistry::$request['view_img']);
|
||||
$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'] ) . ',' : '';
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board post attachments plugin
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-20 21:18:18 -0400 (Tue, 20 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 9520 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -36,7 +36,7 @@ class plugin_post extends class_attach
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class plugin_post extends class_attach
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! isset( $attach['pid'] ) OR empty( $attach['pid'] ) )
|
||||
if ( empty( $attach['pid'] ) )
|
||||
{
|
||||
if( $attach['attach_member_id'] != $this->memberData['member_id'] )
|
||||
{
|
||||
@@ -319,10 +319,7 @@ class plugin_post extends class_attach
|
||||
}
|
||||
|
||||
|
||||
$this->DB->build( array( "select" => 'COUNT(*) as cnt', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}'" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$cnt = $this->DB->fetch();
|
||||
$cnt = $this->DB->buildAndFetch( array( "select" => 'COUNT(*) as cnt', 'from' => 'attachments', 'where' => "attach_post_key='{$post_key}'" ) );
|
||||
|
||||
if ( $cnt['cnt'] )
|
||||
{
|
||||
@@ -390,14 +387,11 @@ class plugin_post extends class_attach
|
||||
|
||||
if ( count( $pids ) )
|
||||
{
|
||||
$this->DB->build( array(
|
||||
'select' => 'count(*) as cnt',
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN(" . implode( ',', $pids ) . ")") );
|
||||
$this->DB->execute();
|
||||
|
||||
$cnt = $this->DB->fetch();
|
||||
|
||||
$cnt = $this->DB->buildAndFetch( array(
|
||||
'select' => 'count(*) as cnt',
|
||||
'from' => 'attachments',
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN(" . implode( ',', $pids ) . ")") );
|
||||
|
||||
$count = intval( $cnt['cnt'] );
|
||||
}
|
||||
|
||||
@@ -487,7 +481,7 @@ class plugin_post extends class_attach
|
||||
|
||||
if ( isset( $topic['forum_id'] ) )
|
||||
{
|
||||
if ( isset($_moderator[ $topic['forum_id'] ]['edit_post']) and $_moderator[ $topic['forum_id'] ]['edit_post'] )
|
||||
if ( !empty($_moderator[ $topic['forum_id'] ]['edit_post']) )
|
||||
{
|
||||
$ok_to_remove = TRUE;
|
||||
}
|
||||
@@ -574,7 +568,7 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_post_key='{$post_key}'"
|
||||
) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -588,7 +582,7 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
|
||||
) );
|
||||
|
||||
$space_used = intval( $_space_used['figure'] );
|
||||
$space_used = $_space_used['figure'] ? $_space_used['figure'] : 0;
|
||||
}
|
||||
|
||||
if ( $this->memberData['g_attach_max'] > 0 )
|
||||
@@ -601,9 +595,9 @@ class plugin_post extends class_attach
|
||||
'where' => "attach_member_id={$member_id} AND attach_rel_module IN( 'post', 'msg' )"
|
||||
) );
|
||||
|
||||
$g_space_used = intval( $_g_space_used['figure'] );
|
||||
$g_space_used = $_g_space_used['figure'] ? $_g_space_used['figure'] : 0;
|
||||
|
||||
if( intval( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used ) < 0 )
|
||||
if( ( $this->memberData['g_attach_max'] * 1024 ) - $g_space_used < 0 )
|
||||
{
|
||||
$space_used = $g_space_used;
|
||||
$total_space_allowed = $this->memberData['g_attach_max'] * 1024;
|
||||
@@ -666,7 +660,7 @@ class plugin_post extends class_attach
|
||||
IPSDebug::fireBug( 'info', array( 'Max single file size: ' . $max_single_upload ) );
|
||||
|
||||
$return = array( 'space_used' => $space_used, 'space_left' => $space_left, 'space_allowed' => $space_allowed, 'max_single_upload' => $max_single_upload, 'total_space_allowed' => $total_space_allowed );
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7003 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9483 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -27,7 +27,20 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*/
|
||||
class forumsShareLinks
|
||||
{
|
||||
function __construct()
|
||||
/**
|
||||
* Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->DB = ipsRegistry::DB();
|
||||
$this->registry = ipsRegistry::instance();
|
||||
@@ -227,7 +240,7 @@ class forumsPermMappingForum
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $mapping = array(
|
||||
protected $mapping = array(
|
||||
'view' => 'perm_view',
|
||||
'read' => 'perm_2',
|
||||
'reply' => 'perm_3',
|
||||
@@ -241,7 +254,7 @@ class forumsPermMappingForum
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $perm_names = array(
|
||||
protected $perm_names = array(
|
||||
'view' => 'Show Forum',
|
||||
'read' => 'Read Topics',
|
||||
'reply' => 'Reply Topics',
|
||||
@@ -255,7 +268,7 @@ class forumsPermMappingForum
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $perm_colors = array(
|
||||
protected $perm_colors = array(
|
||||
'view' => '#fff0f2',
|
||||
'read' => '#effff6',
|
||||
'reply' => '#edfaff',
|
||||
@@ -301,7 +314,7 @@ class forumsPermMappingForum
|
||||
*/
|
||||
public function getPermItems()
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
|
||||
$forumfunc = new $classToLoad( ipsRegistry::instance() );
|
||||
@@ -333,18 +346,18 @@ class forumsPermMappingForum
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Item Marking
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7003 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9483 $
|
||||
*/
|
||||
|
||||
class itemMarking__forums
|
||||
@@ -356,7 +369,7 @@ class itemMarking__forums
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_convertData = array( 'forumID' => 'item_app_key_1' );
|
||||
protected $_convertData = array( 'forumID' => 'item_app_key_1' );
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
@@ -378,7 +391,7 @@ class itemMarking__forums
|
||||
* I'm a constructor, twisted constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -439,16 +452,14 @@ class itemMarking__forums
|
||||
{
|
||||
$count = 0;
|
||||
$lastItem = 0;
|
||||
$approved = $this->memberData['is_mod'] ? ' AND approved IN (0,1) ' : ' AND approved=1 ';
|
||||
$approved = $this->memberData['is_mod'] ? ' AND ' . $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible', 'hidden' ), '' ) . ' ' : ' AND ' . $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), '' ) . ' ';
|
||||
$readItems = is_array( $readItems ) ? $readItems : array( 0 );
|
||||
|
||||
if ( $data['forumID'] )
|
||||
{
|
||||
$_count = $this->DB->buildAndFetch( array(
|
||||
'select' => 'COUNT(*) as cnt, MIN(last_post) as lastItem',
|
||||
'from' => 'topics',
|
||||
'where' => "forum_id=" . intval( $data['forumID'] ) . " {$approved} AND tid NOT IN(".implode(",",array_keys($readItems)).") AND last_post > ".intval($lastReset) . " AND state != 'link'"
|
||||
) );
|
||||
$_count = $this->DB->buildAndFetch( array( 'select' => 'COUNT(*) as cnt, MIN(last_post) as lastItem',
|
||||
'from' => 'topics',
|
||||
'where' => "forum_id=" . intval( $data['forumID'] ) . " {$approved} AND tid NOT IN(".implode(",",array_keys($readItems)).") AND last_post > ".intval($lastReset) . " AND state != 'link'" ) );
|
||||
|
||||
$count = intval( $_count['cnt'] );
|
||||
$lastItem = intval( $_count['lastItem'] );
|
||||
@@ -462,18 +473,18 @@ class itemMarking__forums
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Fetch Skin
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7003 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9483 $
|
||||
*/
|
||||
|
||||
class fetchSkin__forums
|
||||
@@ -497,9 +508,8 @@ class fetchSkin__forums
|
||||
/**
|
||||
* I'm a constructor, twisted constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -526,7 +536,6 @@ class fetchSkin__forums
|
||||
/**
|
||||
* Returns a skin ID or FALSE
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @return mixed INT or FALSE if no skin found / required
|
||||
*/
|
||||
@@ -554,7 +563,7 @@ class fetchSkin__forums
|
||||
|
||||
if ( $eff )
|
||||
{
|
||||
if ( isset( $cache[ $eff ]['skin_id'] ) && $cache[ $eff ]['skin_id'] )
|
||||
if ( !empty( $cache[ $eff ]['skin_id'] ) )
|
||||
{
|
||||
$useSkinID = $cache[ $eff ]['skin_id'];
|
||||
}
|
||||
@@ -568,19 +577,19 @@ class fetchSkin__forums
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Library: Handle public session data
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 12th March 2002
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 9483 $
|
||||
*/
|
||||
|
||||
class publicSessions__forums
|
||||
@@ -591,7 +600,6 @@ class publicSessions__forums
|
||||
* current_appcomponent, current_module and current_section are automatically
|
||||
* stored. This function allows you to add specific variables in.
|
||||
*
|
||||
* @access public
|
||||
* @author Matt Mecham
|
||||
* @return array
|
||||
*/
|
||||
@@ -610,7 +618,7 @@ class publicSessions__forums
|
||||
// FORUM
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ipsRegistry::$request['module'] == 'forums' AND ( isset( ipsRegistry::$request['f'] ) AND ipsRegistry::$request['f'] ) )
|
||||
if ( ipsRegistry::$request['module'] == 'forums' AND !empty( ipsRegistry::$request['f'] ) )
|
||||
{
|
||||
$array = array(
|
||||
'location_2_type' => 'forum',
|
||||
@@ -621,7 +629,7 @@ class publicSessions__forums
|
||||
// TOPIC
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( ipsRegistry::$request['module'] == 'forums' AND ipsRegistry::$request['section'] == 'topics' AND ( isset( ipsRegistry::$request['t'] ) AND ipsRegistry::$request['t'] ) )
|
||||
else if ( ipsRegistry::$request['module'] == 'forums' AND ipsRegistry::$request['section'] == 'topics' AND !empty( ipsRegistry::$request['t'] ) )
|
||||
{
|
||||
$array = array(
|
||||
'location_1_type' => 'topic',
|
||||
@@ -634,7 +642,7 @@ class publicSessions__forums
|
||||
// POST
|
||||
//-----------------------------------------
|
||||
|
||||
else if ( ipsRegistry::$request['module'] == 'post' AND ( isset( ipsRegistry::$request['f'] ) AND ipsRegistry::$request['f'] ) )
|
||||
else if ( ipsRegistry::$request['module'] == 'post' AND !empty( ipsRegistry::$request['f'] ) )
|
||||
{
|
||||
$array = array(
|
||||
'location_1_type' => 'topic',
|
||||
@@ -650,7 +658,6 @@ class publicSessions__forums
|
||||
/**
|
||||
* Parse/format the online list data for the records
|
||||
*
|
||||
* @access public
|
||||
* @author Brandon Farber
|
||||
* @param array Online list rows to check against
|
||||
* @return array Online list rows parsed
|
||||
@@ -704,21 +711,17 @@ class publicSessions__forums
|
||||
// Get the forums, if you dare
|
||||
//-----------------------------------------
|
||||
|
||||
if( !class_exists('app_class_forums') OR !ipsRegistry::getClass('class_forums') )
|
||||
ipsRegistry::getAppClass('forums');
|
||||
|
||||
if( count($forums_raw) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$app_class_forums = new $classToLoad( ipsRegistry::instance() );
|
||||
|
||||
if( count($forums_raw) )
|
||||
foreach( ipsRegistry::getClass('class_forums')->forum_by_id as $fid => $forum )
|
||||
{
|
||||
foreach( ipsRegistry::getClass('class_forums')->forum_by_id as $fid => $forum )
|
||||
if( isset($forums_raw[$fid]) )
|
||||
{
|
||||
if( isset($forums_raw[$fid]) )
|
||||
if( ipsRegistry::getClass( 'permissions' )->check( 'view', $forum ) !== false )
|
||||
{
|
||||
if( ipsRegistry::getClass( 'permissions' )->check( 'view', $forum ) !== false )
|
||||
{
|
||||
$forums[ $fid ] = $forum['name'];
|
||||
}
|
||||
$forums[ $fid ] = $forum['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -730,9 +733,11 @@ class publicSessions__forums
|
||||
|
||||
if( count($topics_raw) )
|
||||
{
|
||||
ipsRegistry::DB()->build( array( 'select' => 't.tid, t.title, t.forum_id',
|
||||
$_approved = ipsRegistry::getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
|
||||
|
||||
ipsRegistry::DB()->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.approved=1 AND t.tid IN(' . implode( ',', $topics_raw ) . ') AND ' . ipsRegistry::getClass('permissions')->buildPermQuery('p'),
|
||||
'where' => $_approved . ' AND t.tid IN(' . implode( ',', $topics_raw ) . ') AND ' . ipsRegistry::getClass('permissions')->buildPermQuery('p'),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'permission_index' => 'p' ),
|
||||
@@ -745,9 +750,11 @@ class publicSessions__forums
|
||||
|
||||
while( $r = ipsRegistry::DB()->fetch($tr) )
|
||||
{
|
||||
if( count( ipsRegistry::getClass('class_forums')->forum_by_id[ $r['forum_id'] ] ) )
|
||||
$_forum = ipsRegistry::getClass('class_forums')->getForumByid( $r['forum_id'] );
|
||||
|
||||
if( count( $_forum ) AND ipsRegistry::getClass('class_forums')->forumsCheckAccess( $_forum['id'], false, 'topic', $r, true ) )
|
||||
{
|
||||
if( ipsRegistry::getClass( 'permissions' )->check( 'read', ipsRegistry::getClass('class_forums')->forum_by_id[ $r['forum_id'] ] ) !== false )
|
||||
if( ipsRegistry::getClass( 'permissions' )->check( 'read', $_forum ) !== false )
|
||||
{
|
||||
$topics[ $r['tid'] ] = $r['title'];
|
||||
}
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Core variables extensions
|
||||
* Defines the reset array, which caches to load, how to recache those caches, and the bitwise array
|
||||
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
|
||||
* Last Updated: $Date: 2011-06-27 06:48:51 -0400 (Mon, 27 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6882 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9090 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -27,7 +27,7 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
$_RESET = array();
|
||||
|
||||
# ALL
|
||||
if ( ( isset( $_REQUEST['CODE'] ) AND $_REQUEST['CODE'] ) or ( isset( $_REQUEST['code'] ) AND $_REQUEST['code'] ) )
|
||||
if ( !empty( $_REQUEST['CODE'] ) or !empty( $_REQUEST['code'] ) )
|
||||
{
|
||||
$_RESET['do'] = ( $_REQUEST['CODE'] ) ? $_REQUEST['CODE'] : $_REQUEST['code'];
|
||||
}
|
||||
@@ -39,14 +39,28 @@ if ( ( isset( $_REQUEST['CODE'] ) AND $_REQUEST['CODE'] ) or ( isset( $_REQUEST[
|
||||
$_LOAD = array();
|
||||
|
||||
# BOARD INDEX
|
||||
if ( ( ( !isset($_GET['section']) OR ! $_GET['section'] ) AND ( !isset($_GET['module']) OR ! $_GET['module'] ) ) OR ( $_GET['module'] == 'forums' AND $_GET['section'] == 'boards' ) )
|
||||
if ( ( empty($_GET['section']) AND empty($_GET['module']) ) OR ( $_GET['module'] == 'forums' AND $_GET['section'] == 'boards' ) )
|
||||
{
|
||||
$_LOAD['chatting'] = 1;
|
||||
$_LOAD['birthdays'] = 1;
|
||||
$_LOAD['calendar'] = 1;
|
||||
$_LOAD['calendars'] = 1;
|
||||
$_LOAD['ranks'] = 1;
|
||||
$_LOAD['reputation_levels'] = 1;
|
||||
|
||||
# The following are IPS app caches that are used for board index hooks.
|
||||
# We need a better way to abstract these and only load them if the hooks are actually enabled and app is installed.
|
||||
$_LOAD['chatting'] = 1; // This is only for the who's chatting hook, chat tab count has a global cache
|
||||
$_LOAD['birthdays'] = 1;
|
||||
$_LOAD['calendar_events'] = 1;
|
||||
$_LOAD['calendars'] = 1;
|
||||
|
||||
$_LOAD['support_staff'] = 1;
|
||||
$_LOAD['support_departments'] = 1;
|
||||
$_LOAD['support_statuses'] = 1;
|
||||
$_LOAD['donation_goals'] = 1;
|
||||
|
||||
$_LOAD['blog_stats'] = 1;
|
||||
$_LOAD['blogmods'] = 1;
|
||||
|
||||
$_LOAD['idm_cats'] = 1;
|
||||
$_LOAD['idm_mods'] = 1;
|
||||
}
|
||||
|
||||
# TOPIC
|
||||
@@ -144,4 +158,7 @@ $_BITWISE = array( 'moderators' => array( 'bw_flag_spammers',
|
||||
'bw_mod_un_soft_delete_topic',
|
||||
'bw_mod_soft_delete_topic_see',
|
||||
'bw_mod_soft_delete_reason',
|
||||
'bw_mod_soft_delete_see_post' ) );
|
||||
'bw_mod_soft_delete_see_post' ),
|
||||
'forums' => array( 'bw_disable_tagging',
|
||||
'bw_disable_prefixes' ),
|
||||
'posts' => array( 'bw_post_from_mobile') );
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Define data hook locations (Forums)
|
||||
* Last Updated: $Date: 2010-10-21 09:25:51 -0400 (Thu, 21 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7009 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8812 $
|
||||
*/
|
||||
|
||||
$dataHookLocations = array(
|
||||
@@ -34,13 +34,6 @@ $dataHookLocations = array(
|
||||
array( 'incrementUsersPostCount', 'Increment users post count' ),
|
||||
|
||||
/* OUTPUT ARRAYS */
|
||||
array( 'boardIndexCategories', 'Board Index Output: Categories' ),
|
||||
array( 'boardIndexOnlineUsers', 'Board Index Output: Active users' ),
|
||||
array( 'forumViewData', 'Forum View Output' ),
|
||||
array( 'topicViewQuery', 'Topic View Query: Members Table and Joins' ),
|
||||
array( 'topicViewPostData', 'Topic View Output: Posts Data' ),
|
||||
array( 'topicViewForumData', 'Topic View Output: Forum Data' ),
|
||||
array( 'topicViewTopicData', 'Topic View Output: Topic Data' ),
|
||||
array( 'topicViewDisplayData', 'Topic View Output: Other Data' ),
|
||||
|
||||
);
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package Invision Power Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4136 $
|
||||
*
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2010-07-10 01:01:06 -0400 (Sat, 10 Jul 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 6628 $
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -29,18 +29,16 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Key type: Type of action (topic/forum)
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_type = '';
|
||||
protected $_type = '';
|
||||
|
||||
/**
|
||||
* Key ID
|
||||
*
|
||||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_id = 0;
|
||||
protected $_id = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -59,7 +57,6 @@ class furlRedirect_forums
|
||||
* Set the key ID
|
||||
* @example furlRedirect_forums::setKey( 'topic', 12 );
|
||||
*
|
||||
* @access public
|
||||
* @param string Type
|
||||
* @param mixed Value
|
||||
*/
|
||||
@@ -72,14 +69,13 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Set up the key by URI
|
||||
*
|
||||
* @access public
|
||||
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function setKeyByUri( $uri )
|
||||
{
|
||||
$uri = str_replace( '&', '&', $uri );
|
||||
|
||||
|
||||
if ( strstr( $uri, '?' ) )
|
||||
{
|
||||
list( $_chaff, $uri ) = explode( '?', $uri );
|
||||
@@ -96,6 +92,11 @@ class furlRedirect_forums
|
||||
$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 ) );
|
||||
@@ -115,7 +116,6 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Return the SEO title
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function fetchSeoTitle()
|
||||
@@ -140,7 +140,6 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Return the SEO title for a topic
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_topic()
|
||||
@@ -168,14 +167,11 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Return the SEO title for a forum
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_forum()
|
||||
{
|
||||
$forum = $this->DB->buildAndFetch( array( 'select' => 'id, name_seo, name',
|
||||
'from' => 'forums',
|
||||
'where' => 'id=' . intval( $this->_id ) ) );
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( intval( $this->_id ) );
|
||||
|
||||
if ( $forum['id'] )
|
||||
{
|
||||
@@ -194,14 +190,10 @@ class furlRedirect_forums
|
||||
/**
|
||||
* Return the SEO title for an announcement
|
||||
*
|
||||
* @access public
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_announcement()
|
||||
{
|
||||
//$announce = $this->DB->buildAndFetch( array( 'select' => 'announce_id, announce_title',
|
||||
// 'from' => 'announcements',
|
||||
// 'where' => 'announce_id=' . intval( $this->_id ) ) );
|
||||
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
|
||||
|
||||
if ( $announce['announce_id'] )
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2010-10-27 14:13:29 -0400 (Wed, 27 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 7057 $
|
||||
* @version $Rev: 9351 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -57,12 +57,32 @@ $_SEOTEMPLATES = array(
|
||||
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
|
||||
'in' => array( 'regex' => '#^/forum/(\d+?)-#i',
|
||||
'matches' => array( array( 'showforum', '$1' ) ) ) ),
|
||||
|
||||
|
||||
'showtopicunread'=> array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(?:&|&)view=getnewpost(&|$)#i', 'topic/$1-#{__title__}/unread/$2' ),
|
||||
'in' => array( 'regex' => '#^/topic/(\d+?)-([^/]+?)/unread(/|$)#i',
|
||||
'matches' => array( array( 'showtopic', '$1' ),
|
||||
array( 'view', 'getnewpost' ) ) ) ),
|
||||
|
||||
'showtopicnextunread'=> array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(?:&|&)view=getnextunread(&|$)#i', 'topic/$1-#{__title__}/nextunread/$2' ),
|
||||
'in' => array( 'regex' => '#^/topic/(\d+?)-([^/]+?)/nextunread(/|$)#i',
|
||||
'matches' => array( array( 'showtopic', '$1' ),
|
||||
array( 'view', 'getnextunread' ) ) ) ),
|
||||
|
||||
'showtopic' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
|
||||
'in' => array( 'regex' => '#^/topic/(\d+?)-#i',
|
||||
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
|
||||
|
||||
'acteqst' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#act=ST(.*?)&t=(.+?)(&|$)#i', 'topic/$2-#{__title__}/$3' ),
|
||||
'in' => array( 'regex' => '#^notavalidrequest$#i',
|
||||
'matches' => array( array( 'showtopic', '0' ) ) ) ),
|
||||
|
||||
'act=idx' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 0,
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,329 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,359 @@
|
||||
<?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' );
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2010-04-26 14:40:44 -0400 (Mon, 26 Apr 2010) $
|
||||
* 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 http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6179 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -28,18 +28,17 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6179 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
class forumsMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
@@ -47,9 +46,8 @@ class forumsMemberSync
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
@@ -58,10 +56,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
@@ -70,10 +67,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
@@ -82,10 +78,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run when a new account is created
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onCreateAccount( $member )
|
||||
{
|
||||
|
||||
@@ -94,9 +89,8 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run when the register form is displayed to a user
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onRegisterForm()
|
||||
{
|
||||
|
||||
@@ -105,10 +99,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is ren when a user successfully logs in
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogin( $member )
|
||||
{
|
||||
|
||||
@@ -117,10 +110,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @access public
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
|
||||
@@ -129,11 +121,10 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is called after a member's account has been merged into another member's account
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Member account being kept
|
||||
* @param array $member2 Member account being removed
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
|
||||
@@ -146,7 +137,7 @@ class forumsMemberSync
|
||||
* @param string $new_email New email address
|
||||
* @param string $old_email Old email address
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function onEmailChange( $id, $new_email, $old_email )
|
||||
{
|
||||
|
||||
@@ -155,11 +146,10 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run after a users password is successfully changed
|
||||
*
|
||||
* @access public
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_plain_text_pass The new password
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onPassChange( $id, $new_plain_text_pass )
|
||||
{
|
||||
|
||||
@@ -170,10 +160,9 @@ class forumsMemberSync
|
||||
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
|
||||
* IPSMember::save().
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of values that were changed
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onProfileUpdate( $member )
|
||||
{
|
||||
|
||||
@@ -182,12 +171,11 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run after a users group is successfully changed
|
||||
*
|
||||
* @access public
|
||||
* @param integer $id Member ID
|
||||
* @param integer $new_group New Group ID
|
||||
* @param integer $old_group Old Group ID
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onGroupChange( $id, $new_group, $old_group )
|
||||
{
|
||||
|
||||
@@ -196,11 +184,10 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run after a users display name is successfully changed
|
||||
*
|
||||
* @access public
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_name New display name
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onNameChange( $id, $new_name )
|
||||
{
|
||||
|
||||
@@ -209,10 +196,9 @@ class forumsMemberSync
|
||||
/**
|
||||
* This method is run when a user logs out
|
||||
*
|
||||
* @access public
|
||||
* @param array $member Array of member data
|
||||
* @return void
|
||||
**/
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogOut( $member )
|
||||
{
|
||||
|
||||
|
||||
@@ -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,451 @@
|
||||
<?php
|
||||
/**
|
||||
* @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 $
|
||||
* @since 2/18/2011
|
||||
* $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9550 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_forums_announcements
|
||||
* @brief Moderator control panel plugin: manage announcements
|
||||
*
|
||||
*/
|
||||
class plugin_forums_announcements
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'announcements';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'announcements';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Doing something else?
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['_do'] )
|
||||
{
|
||||
case 'delete':
|
||||
return $this->_delete();
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
case 'edit':
|
||||
return $this->_form( $this->request['_do'] );
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
return $this->_save( $this->request['type'] );
|
||||
break;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$announcements = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get announcements
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'announcements' => 'a' ),
|
||||
'order' => 'a.announce_end DESC',
|
||||
'add_join' => array(
|
||||
array( 'select' => 'm.member_id, m.members_display_name, m.member_group_id, m.members_seo_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.announce_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['announce_seo_title'] = IPSText::makeSeoTitle( $r['announce_title'] );
|
||||
|
||||
if ( $r['announce_forum'] == '*' )
|
||||
{
|
||||
$r['announce_forum_show'] = $this->lang->words['announce_page_allforums'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp_forums = explode(",",$r['announce_forum']);
|
||||
|
||||
if ( is_array( $tmp_forums ) and count($tmp_forums) )
|
||||
{
|
||||
if ( count($tmp_forums) > 5 )
|
||||
{
|
||||
$r['announce_forum_show'] = count($tmp_forums) . ' ' . $this->lang->words['announce_page_numforums'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_forums'] = array();
|
||||
|
||||
foreach( $tmp_forums as $id )
|
||||
{
|
||||
$r['_forums'][] = array( $id, $this->registry->getClass('class_forums')->forum_by_id[ $id ]['name'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$announcements[] = $r;
|
||||
}
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->modAnnouncements( $announcements );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete announcement
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
$announce_id = intval( $this->request['announce_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->delete( 'announcements', 'announce_id=' . $announce_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Update cache and redirect
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->cache()->rebuildCache( 'announcements', 'forums' );
|
||||
|
||||
$this->registry->getClass('output')->redirectScreen( $this->lang->words['announcement_deleted'], $this->settings['base_url']."app=core&module=modcp&tab=announcements&fromapp=forums" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show announcement form
|
||||
*
|
||||
* @param string $type Add or edit
|
||||
* @param string $msg Message to show
|
||||
* @return @e string
|
||||
*/
|
||||
protected function _form( $type='add', $msg='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT the editor/bbcode classes
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'announcement';
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$announce = array( 'announce_active' => 1, 'announce_id' => 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$announce_id = intval( $this->request['announce_id'] );
|
||||
$announce = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'announcements', 'where' => 'announce_id='.$announce_id ) );
|
||||
$announce['announce_forum'] = explode( ",", $announce['announce_forum'] );
|
||||
$announce['announce_start'] = $announce['announce_start'] ? strftime( '%m-%d-%Y', $announce['announce_start'] ) : '';
|
||||
$announce['announce_end'] = $announce['announce_end'] ? strftime( '%m-%d-%Y', $announce['announce_end'] ) : '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Do we have _POST?
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( array( 'announce_html_enabled', 'announce_title', 'announce_post', 'announce_start', 'announce_end', 'announce_forum', 'announce_active' ) as $bit )
|
||||
{
|
||||
if ( !empty($this->request[$bit]) )
|
||||
{
|
||||
$announce[ $bit ] = $this->request[ $bit ];
|
||||
}
|
||||
else if( !isset($announce[ $bit] ) )
|
||||
{
|
||||
$announce[ $bit ] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$editor = new $classToLoad();
|
||||
$editor->setAllowHtml( $announce['announce_html_enabled'] );
|
||||
|
||||
$_editor = $editor->show( 'announce_post', array( 'type' => 'full' ), $announce['announce_post'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Forums
|
||||
//-----------------------------------------
|
||||
|
||||
$forum_html = "<option value='*'>" . $this->lang->words['announce_form_allforums'] . "</option>" . $this->registry->getClass('class_forums')->forumsForumJump( false, true, true );
|
||||
|
||||
//-----------------------------------------
|
||||
// Save forums?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $announce['announce_forum'] ) and count( $announce['announce_forum'] ) )
|
||||
{
|
||||
foreach( $announce['announce_forum'] as $f )
|
||||
{
|
||||
$forum_html = preg_replace( "#option\s+value=[\"'](".preg_quote($f,'#').")[\"']#i", "option value='\\1' selected='selected'", $forum_html );
|
||||
}
|
||||
}
|
||||
|
||||
$announce['announce_active_checked'] = $announce['announce_active'] ? 'checked="checked"' : '';
|
||||
$announce['html_checkbox'] = $announce['announce_html_enabled'] ? "checked='checked' " : '';
|
||||
$announce['nlbr_checkbox'] = $announce['announce_nlbr_enabled'] ? "checked='checked' " : '';
|
||||
|
||||
return $this->registry->getClass('output')->getTemplate('modcp')->modAnnounceForm( $announce, $forum_html, $type, $_editor, $msg );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update an announcement
|
||||
*
|
||||
* @param string $type add|edit
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _save( $type='add' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$forums_to_save = "";
|
||||
$start_date = 0;
|
||||
$end_date = 0;
|
||||
$announce_id = intval( $this->request['announce_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// check...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->request['announce_title'] or ! $this->request['announce_post'] )
|
||||
{
|
||||
return $this->_form( $type, $this->lang->words['announce_error_title'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forums to add announce in
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $this->request['announce_forum'] ) and count( $this->request['announce_forum'] ) )
|
||||
{
|
||||
if ( in_array( '*', $this->request['announce_forum'] ) )
|
||||
{
|
||||
$forums_to_save = '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
$forums_to_save = implode( ",", $this->request['announce_forum'] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $forums_to_save )
|
||||
{
|
||||
return $this->_form( $type, $this->lang->words['announce_error_forums'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check Dates
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strstr( $this->request['announce_start'], '-' ) )
|
||||
{
|
||||
$start_array = explode( '-', $this->request['announce_start'] );
|
||||
|
||||
if ( $start_array[0] and $start_array[1] and $start_array[2] )
|
||||
{
|
||||
if ( ! checkdate( $start_array[0], $start_array[1], $start_array[2] ) )
|
||||
{
|
||||
return $this->_form( $type, $this->lang->words['announce_error_date'] );
|
||||
}
|
||||
}
|
||||
|
||||
$start_date = mktime( 12, 0, 0, $start_array[0], $start_array[1], $start_array[2] );
|
||||
}
|
||||
|
||||
if ( strstr( $this->request['announce_end'], '-' ) )
|
||||
{
|
||||
$end_array = explode( '-', $this->request['announce_end'] );
|
||||
|
||||
if ( $end_array[0] and $end_array[1] and $end_array[2] )
|
||||
{
|
||||
if ( ! checkdate( $end_array[0], $end_array[1], $end_array[2] ) )
|
||||
{
|
||||
return $this->_form( $type, $this->lang->words['announce_error_date'] );
|
||||
}
|
||||
}
|
||||
|
||||
$end_date = mktime( 12, 0, 0, $end_array[0], $end_array[1], $end_array[2] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out the content
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$editor = new $classToLoad();
|
||||
$editor->setAllowBbcode( true );
|
||||
$editor->setAllowHtml( intval($this->request['announce_html_enabled']) );
|
||||
|
||||
$announceContent = $editor->process( $_POST['announce_post'] );
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->bypass_badwords = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = intval($this->request['announce_html_enabled']);
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $this->request['announce_html_enabled'] ? $this->request['announce_nlbr_enabled'] : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'announcement';
|
||||
|
||||
$announceContent = IPSText::getTextClass( 'bbcode' )->preDbParse( $announceContent );
|
||||
|
||||
//-----------------------------------------
|
||||
// Build save array
|
||||
//-----------------------------------------
|
||||
|
||||
$save_array = array( 'announce_title' => $this->request['announce_title'],
|
||||
'announce_post' => $announceContent,
|
||||
'announce_active' => $this->request['announce_active'] ? $this->request['announce_active'] : 0,
|
||||
'announce_forum' => $forums_to_save,
|
||||
'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
|
||||
);
|
||||
|
||||
//-----------------------------------------
|
||||
// Save..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$save_array['announce_member_id'] = $this->memberData['member_id'];
|
||||
|
||||
$this->DB->insert( 'announcements', $save_array );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $announce_id )
|
||||
{
|
||||
$this->DB->update( 'announcements', $save_array, 'announce_id=' . $announce_id );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Update cache
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->cache()->rebuildCache( 'announcements', 'forums' );
|
||||
|
||||
$this->registry->getClass('output')->redirectScreen( $this->lang->words['announcement_saved'], $this->settings['base_url'] . "app=core&module=modcp&tab=announcements&fromapp=forums" );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* @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!
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_forums_deletedposts
|
||||
* @brief Moderator control panel plugin: show deleted posts
|
||||
*
|
||||
*/
|
||||
class plugin_forums_deletedposts
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'deleted_content';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'deletedposts';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get results
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$_filters = $this->_getFilters();
|
||||
$_filters = array_merge( $_filters, array(
|
||||
'postType' => array( 'sdelete', 'pdelete', 'oktoremove' ),
|
||||
'getCount' => true,
|
||||
'sortField' => 'pid',
|
||||
'sortOrder' => 'desc',
|
||||
'parse' => true,
|
||||
'limit' => 10,
|
||||
'offset' => $st
|
||||
) );
|
||||
|
||||
$this->registry->getClass('topics')->setPermissionData();
|
||||
$posts = $this->registry->getClass('topics')->getPosts( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getPostsCount();
|
||||
|
||||
/* Got soft delete pids? */
|
||||
$other_data = array();
|
||||
|
||||
if ( is_array( $posts ) AND count( $posts ) )
|
||||
{
|
||||
$other_data = IPSDeleteLog::fetchEntries( array_keys($posts), 'post', false );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total,
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=deletedposts",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->deletedPosts( $posts, $other_data, $pages );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve forum ids we can moderate in for getTopics() call
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_post'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $_return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
/**
|
||||
* @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!
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_forums_deletedtopics
|
||||
* @brief Moderator control panel plugin: show deleted topics
|
||||
*
|
||||
*/
|
||||
class plugin_forums_deletedtopics
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Forums library object
|
||||
*
|
||||
* @var $forums
|
||||
*/
|
||||
protected $forums;
|
||||
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_forums' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'deleted_content';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'deletedtopics';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/forums/forums.php', 'public_forums_forums_forums' );
|
||||
$this->forums = new $classToLoad( $this->registry );
|
||||
$this->forums->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$_filters = $this->_getFilters();
|
||||
$_filters = array_merge( $_filters, array(
|
||||
'topicType' => array( 'sdelete', 'pdelete', 'oktoremove' ),
|
||||
'getCount' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'desc',
|
||||
'limit' => 10,
|
||||
'offset' => $st
|
||||
) );
|
||||
|
||||
$this->registry->getClass('topics')->setPermissionData();
|
||||
$topics = $this->registry->getClass('topics')->getTopics( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getTopicsCount();
|
||||
$final = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Format data
|
||||
//-----------------------------------------
|
||||
|
||||
if( count( $topics ) )
|
||||
{
|
||||
foreach( $topics as $tid => $topic )
|
||||
{
|
||||
/* Have to preserve original forum id for linked topics */
|
||||
if( $topic['state'] == 'link' )
|
||||
{
|
||||
$_originalForum = $topic['forum_id'];
|
||||
}
|
||||
|
||||
$topic = $this->_checkPermissions( $topic );
|
||||
$topic = $this->forums->renderEntry( $topic );
|
||||
$topic['forum'] = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
|
||||
if( $topic['state'] == 'link' )
|
||||
{
|
||||
$topic['_toForum'] = $this->registry->class_forums->getForumById( $_originalForum );
|
||||
}
|
||||
|
||||
$final[ $tid ] = $topic;
|
||||
}
|
||||
}
|
||||
|
||||
$other_data = array();
|
||||
|
||||
if ( is_array( $topics ) AND count( $topics ) )
|
||||
{
|
||||
$other_data = IPSDeleteLog::fetchEntries( array_keys($topics), 'topic', false );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total,
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=deletedtopics",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->deletedTopics( $final, $other_data, $pages );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add permissions to the array
|
||||
*
|
||||
* @param array $row Array of topic data
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _checkPermissions( $row )
|
||||
{
|
||||
$row['permissions'] = array();
|
||||
|
||||
$row['permissions']['PostSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeletePosts( $row['forum_id'], array() );
|
||||
$row['permissions']['PostSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeletePosts( $row['forum_id'] );
|
||||
$row['permissions']['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( $row['forum_id'] );
|
||||
$row['permissions']['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( $row['forum_id'] );
|
||||
$row['permissions']['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( $row['forum_id'] );
|
||||
$row['permissions']['TopicSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeleteTopics( $row['forum_id'], array() );
|
||||
$row['permissions']['TopicSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeleteTopics( $row['forum_id'] );
|
||||
$row['permissions']['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( $row['forum_id'] );
|
||||
$row['permissions']['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( $row['forum_id'] );
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve forum ids we can moderate in for getTopics() call
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_topic'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $_return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
/**
|
||||
* @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!
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_forums_unapprovedposts
|
||||
* @brief Moderator control panel plugin: show posts pending approval
|
||||
*
|
||||
*/
|
||||
class plugin_forums_unapprovedposts
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'unapproved_content';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'unapprovedposts';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get results
|
||||
//-----------------------------------------
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$_filters = $this->_getFilters();
|
||||
$_filters = array_merge( $_filters, array(
|
||||
'postType' => array( 'hidden' ),
|
||||
'getCount' => true,
|
||||
'sortField' => 'pid',
|
||||
'sortOrder' => 'desc',
|
||||
'parse' => true,
|
||||
'limit' => 10,
|
||||
'offset' => $st
|
||||
) );
|
||||
|
||||
$this->registry->getClass('topics')->setPermissionData();
|
||||
$posts = $this->registry->getClass('topics')->getPosts( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getPostsCount();
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total,
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=unapprovedposts",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->unapprovedPosts( $posts, $pages );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve forum ids we can moderate in for getTopics() call
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['post_q'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $_return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
/**
|
||||
* @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!
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_forums_unapprovedtopics
|
||||
* @brief Moderator control panel plugin: show topics pending approval
|
||||
*
|
||||
*/
|
||||
class plugin_forums_unapprovedtopics
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Forums library object
|
||||
*
|
||||
* @var $forums
|
||||
*/
|
||||
protected $forums;
|
||||
|
||||
/**
|
||||
* Execute selected method
|
||||
*
|
||||
* @param object Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
/* Load language strings.. */
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_forums' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getPrimaryTab()
|
||||
{
|
||||
return 'unapproved_content';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the secondary tab key for the navigation bar
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getSecondaryTab()
|
||||
{
|
||||
return 'unapprovedtopics';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if we can view tab
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e bool
|
||||
*/
|
||||
public function canView( $permissions )
|
||||
{
|
||||
if( $this->memberData['g_is_supmod'] OR $this->memberData['is_mod'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute plugin
|
||||
*
|
||||
* @param array $permissions Moderator permissions
|
||||
* @return @e string
|
||||
*/
|
||||
public function executePlugin( $permissions )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check permissions
|
||||
//-----------------------------------------
|
||||
|
||||
if( !$this->canView( $permissions ) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get forum class
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir('forums') . '/modules_public/forums/forums.php', 'public_forums_forums_forums' );
|
||||
$this->forums = new $classToLoad( $this->registry );
|
||||
$this->forums->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$st = intval($this->request['st']);
|
||||
$_filters = $this->_getFilters();
|
||||
$_filters = array_merge( $_filters, array(
|
||||
'topicType' => array( 'hidden' ),
|
||||
'getCount' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'desc',
|
||||
'limit' => 10,
|
||||
'offset' => $st
|
||||
) );
|
||||
|
||||
$this->registry->getClass('topics')->setPermissionData();
|
||||
$topics = $this->registry->getClass('topics')->getTopics( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getTopicsCount();
|
||||
$final = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Format data
|
||||
//-----------------------------------------
|
||||
|
||||
if( count( $topics ) )
|
||||
{
|
||||
foreach( $topics as $tid => $topic )
|
||||
{
|
||||
$topic = $this->_checkPermissions( $topic );
|
||||
$topic = $this->forums->renderEntry( $topic );
|
||||
$topic['forum'] = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
$final[ $tid ] = $topic;
|
||||
}
|
||||
}
|
||||
|
||||
$other_data = array();
|
||||
|
||||
if ( is_array( $topics ) AND count( $topics ) )
|
||||
{
|
||||
$other_data = IPSDeleteLog::fetchEntries( array_keys($topics), 'topic', false );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Page links
|
||||
//-----------------------------------------
|
||||
|
||||
$pages = $this->registry->output->generatePagination( array( 'totalItems' => $total,
|
||||
'itemsPerPage' => 10,
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=unapprovedtopics",
|
||||
) );
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->unapprovedTopics( $final, $pages );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add permissions to the array
|
||||
*
|
||||
* @param array $row Array of topic data
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _checkPermissions( $row )
|
||||
{
|
||||
$row['permissions'] = array();
|
||||
|
||||
$row['permissions']['PostSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeletePosts( $row['forum_id'], array() );
|
||||
$row['permissions']['PostSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeletePosts( $row['forum_id'] );
|
||||
$row['permissions']['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( $row['forum_id'] );
|
||||
$row['permissions']['SoftDeleteReason'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteReason( $row['forum_id'] );
|
||||
$row['permissions']['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( $row['forum_id'] );
|
||||
$row['permissions']['TopicSoftDelete'] = $this->registry->getClass('class_forums')->canSoftDeleteTopics( $row['forum_id'], array() );
|
||||
$row['permissions']['TopicSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeleteTopics( $row['forum_id'] );
|
||||
$row['permissions']['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( $row['forum_id'] );
|
||||
$row['permissions']['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( $row['forum_id'] );
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve forum ids we can moderate in for getTopics() call
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['topic_q'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $_return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
/**
|
||||
* @file generate.php Navigation plugin: attachments
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 3/8/2011
|
||||
* $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8229 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class plugin_core_attachments
|
||||
* @brief Provide ability to share attachments via editor
|
||||
*/
|
||||
class navigation_forums
|
||||
{
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
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')->strip_invisible = 1;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tab title
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getTabName()
|
||||
{
|
||||
return IPSLib::getAppTitle( 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns navigation data
|
||||
* @return array array( array( 0 => array( 'title' => 'x', 'url' => 'x' ) ) );
|
||||
*/
|
||||
public function getNavigationData()
|
||||
{
|
||||
$blocks = array();
|
||||
$links = $this->_getData();
|
||||
|
||||
/* Add to blocks */
|
||||
$blocks[] = array( 'title' => '', 'links' => $links );
|
||||
|
||||
return $blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches forum jump data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getData()
|
||||
{
|
||||
$depth_guide = 0;
|
||||
$links = array();
|
||||
|
||||
if( is_array($this->registry->class_forums->forum_cache['root'] ) AND count($this->registry->class_forums->forum_cache['root'] ) )
|
||||
{
|
||||
foreach($this->registry->class_forums->forum_cache['root'] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['sub_can_post'] or ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) AND count($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) ) )
|
||||
{
|
||||
$forum_data['redirect_on'] = isset( $forum_data['redirect_on'] ) ? $forum_data['redirect_on'] : 0;
|
||||
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'important' => true, 'depth' => $depth_guide, 'title' => $forum_data['name'], 'url' => $this->registry->output->buildSEOUrl( 'showforum=' . $forum_data['id'], 'public', $forum_data['name_seo'], 'showforum' ) );
|
||||
|
||||
if ( isset($this->registry->class_forums->forum_cache[ $forum_data['id'] ]) AND is_array($this->registry->class_forums->forum_cache[ $forum_data['id'] ] ) )
|
||||
{
|
||||
$depth_guide++;
|
||||
|
||||
foreach($this->registry->class_forums->forum_cache[ $forum_data['id'] ] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'url' => $this->registry->output->buildSEOUrl( 'showforum=' . $forum_data['id'], 'public', $forum_data['name_seo'], 'showforum' ) );
|
||||
|
||||
$links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide );
|
||||
}
|
||||
|
||||
$depth_guide--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal helper function for forumsForumJump
|
||||
*
|
||||
* @param integer $root_id
|
||||
* @param array $links
|
||||
* @param string $depth_guide
|
||||
* @return string
|
||||
*/
|
||||
private function _getDataRecursively( $root_id, $links=array(), $depth_guide=0 )
|
||||
{
|
||||
if ( isset( $this->registry->class_forums->forum_cache[ $root_id ] ) AND is_array($this->registry->class_forums->forum_cache[ $root_id ] ) )
|
||||
{
|
||||
$depth_guide++;
|
||||
|
||||
foreach($this->registry->class_forums->forum_cache[ $root_id ] as $forum_data )
|
||||
{
|
||||
if ( $forum_data['redirect_on'] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$links[] = array( 'depth' => $depth_guide, 'title' => $forum_data['name'], 'url' => $this->registry->output->buildSEOUrl( 'showforum=' . $forum_data['id'], 'public', $forum_data['name_seo'], 'showforum' ) );
|
||||
|
||||
$links = $this->_getDataRecursively( $forum_data['id'], $links, $depth_guide );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2010-04-08 16:37:04 -0400 (Thu, 08 Apr 2010) $
|
||||
* Last Updated: $Date: 2011-03-29 08:39:51 -0400 (Tue, 29 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 6088 $
|
||||
* @version $Rev: 8208 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -37,12 +37,15 @@ class forums_notifications
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'new_topic', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newtopic' ),
|
||||
array( 'key' => 'new_reply', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: poll
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$PORTAL_CONFIG = array();
|
||||
|
||||
/**
|
||||
* Main plug in title
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_title'] = 'Опрос';
|
||||
|
||||
/**
|
||||
* Plug in mini description
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_desc'] = "Выводит блок опроса";
|
||||
|
||||
/**
|
||||
* Keyword for settings. This is the keyword
|
||||
* entered into ibf_conf_settings_titles -> conf_title_keyword
|
||||
* Can be left blank.
|
||||
* PLEASE stick to the naming convention when entering a setting
|
||||
* keyword: portal_{file_name_minus_php} This will prevent
|
||||
* other keyword clashes. Likewise, when creating settings, choose
|
||||
* NOT to cache them (they will be loaded at run time) and always
|
||||
* prefix with {file_name_minus_php}_setting_key - for example
|
||||
* If you had a setting called "export_forums" then please name it
|
||||
* "recent_topics_export_forums". This will be available in
|
||||
* $this->settings['recent_topics_export_forums'] in the
|
||||
* main module.
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_settings_keyword'] = "portal_poll";
|
||||
|
||||
/**
|
||||
* Exportable tags key must be in the naming format of:
|
||||
* {file_name_minus_php}-tag. The value *MUST* be the function
|
||||
* which it corresponds to. For example:
|
||||
* 'recent_topics_last_x' => 'recent_topics_last_x'
|
||||
* The portal will look for function 'recent_topics_last_x' in
|
||||
* module "sources/portal_plugins/recent_topics.php" when it parses
|
||||
* the tag <!--::recent_topics_last_x::-->
|
||||
*
|
||||
* @param array[ TAG ] = array( FUNCTION NAME, DESCRIPTION );
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_exportable_tags']['poll_show_poll'] = array( 'poll_show_poll', 'Shows the request poll' );
|
||||
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: poll
|
||||
* Last Updated: $Date: 2010-10-22 06:13:38 -0400 (Fri, 22 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 7016 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class ppi_poll extends public_portal_portal_portal
|
||||
{
|
||||
/**
|
||||
* Initialize module
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a poll
|
||||
*
|
||||
* @return string HTML content to replace tag with
|
||||
* @todo We need to update the code below to load the furlTemplates file and check against it, then add a fallback on the normal url as a default.
|
||||
*/
|
||||
public function poll_show_poll()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$extra = "";
|
||||
$sql = "";
|
||||
$check = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a poll?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $this->settings['poll_poll_url'] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the topic ID of the entered URL
|
||||
//-----------------------------------------
|
||||
|
||||
/* Friendly URL */
|
||||
if( $this->settings['use_friendly_urls'] )
|
||||
{
|
||||
preg_match( "#/topic/(\d+)(.*?)/#", $this->settings['poll_poll_url'], $match );
|
||||
$tid = intval( trim( $match[1] ) );
|
||||
}
|
||||
/* Normal URL */
|
||||
else
|
||||
{
|
||||
preg_match( "/(\?|&)(t|showtopic)=(\d+)($|&)/", $this->settings['poll_poll_url'], $match );
|
||||
$tid = intval( trim( $match[3] ) );
|
||||
}
|
||||
|
||||
if ( !$tid )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get topic...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_boards', 'public_topic' ), 'forums' );
|
||||
$this->registry->class_localization->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
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')->strip_invisible = 1;
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums', 'forums' ) . '/topics.php', 'public_forums_forums_topics', 'forums' );
|
||||
$topic = new $classToLoad();
|
||||
$topic->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$topic->topic = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid=" . $tid ) );
|
||||
$topic->forum = ipsRegistry::getClass('class_forums')->forum_by_id[ $topic->topic['forum_id'] ];
|
||||
|
||||
$this->request['f'] = $topic->forum['id'] ;
|
||||
$this->request['t'] = $tid ;
|
||||
|
||||
if ( $topic->topic['poll_state'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('portal')->pollWrapper( $topic->_generatePollOutput(), $tid );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: recent topics
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 5713 $
|
||||
*
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
$PORTAL_CONFIG = array();
|
||||
|
||||
/**
|
||||
* Main plug in title
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_title'] = 'Последние темы';
|
||||
|
||||
/**
|
||||
* Plug in mini description
|
||||
*
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_desc'] = "Выводит блок последних тем";
|
||||
|
||||
/**
|
||||
* Keyword for settings. This is the keyword
|
||||
* entered into ibf_conf_settings_titles -> conf_title_keyword
|
||||
* Can be left blank.
|
||||
* PLEASE stick to the naming convention when entering a setting
|
||||
* keyword: portal_{file_name_minus_php} This will prevent
|
||||
* other keyword clashes. Likewise, when creating settings, choose
|
||||
* NOT to cache them (they will be loaded at run time) and always
|
||||
* prefix with {file_name_minus_php}_setting_key - for example
|
||||
* If you had a setting called "export_forums" then please name it
|
||||
* "recent_topics_export_forums". This will be available in
|
||||
* $this->settings['recent_topics_export_forums'] in the
|
||||
* main module.
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_settings_keyword'] = "portal_recent_topics";
|
||||
|
||||
/**
|
||||
* Exportable tags key must be in the naming format of:
|
||||
* {file_name_minus_php}-tag. The value *MUST* be the function
|
||||
* which it corresponds to. For example:
|
||||
* 'recent_topics_last_x' => 'recent_topics_last_x'
|
||||
* The portal will look for function 'recent_topics_last_x' in
|
||||
* module "sources/portal_plugins/recent_topics.php" when it parses
|
||||
* the tag <!--::recent_topics_last_x::-->
|
||||
*
|
||||
* @param array[ TAG ] = array( FUNCTION NAME, DESCRIPTION );
|
||||
*/
|
||||
$PORTAL_CONFIG['pc_exportable_tags']['recent_topics_last_x'] = array( 'recent_topics_last_x' , 'Shows the last X topics with full post from the selected forums' );
|
||||
$PORTAL_CONFIG['pc_exportable_tags']['recent_topics_discussions_last_x'] = array( 'recent_topics_discussions_last_x', 'Shows the last X topic titles from ALL viewable forums' );
|
||||
@@ -1,377 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Portal plugin: recent topics
|
||||
* Last Updated: $Date: 2010-11-04 13:30:54 -0400 (Thu, 04 Nov 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 7093 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class ppi_recent_topics extends public_portal_portal_portal
|
||||
{
|
||||
/**
|
||||
* Initialize module
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->settings['csite_article_date'] = $this->settings['csite_article_date'] ? $this->settings['csite_article_date'] : '%c';
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the recently started topic titles
|
||||
*
|
||||
* @return string HTML content to replace tag with
|
||||
*/
|
||||
public function recent_topics_discussions_last_x()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
$results = array();
|
||||
$limit = $this->settings['recent_topics_discuss_number'] ? $this->settings['recent_topics_discuss_number'] : 5;
|
||||
|
||||
$results = $this->registry->class_forums->hooks_recentTopics( $limit, false );
|
||||
|
||||
return count($results) ? $this->registry->getClass('output')->getTemplate('portal')->latestPosts( $results ) : '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the "news" articles
|
||||
*
|
||||
* @return string HTML content to replace tag with
|
||||
*/
|
||||
public function recent_topics_last_x()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$attach_pids = array();
|
||||
$attach_posts = array();
|
||||
$forums = array();
|
||||
$rows = array();
|
||||
$output = array();
|
||||
$where_clause = array();
|
||||
$limit = $this->settings['recent_topics_article_max'] ? $this->settings['recent_topics_article_max'] : 5;
|
||||
$posts = intval($this->memberData['posts']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab articles new/recent in 1 bad ass query
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( explode( ',', $this->settings['recent_topics_article_forum'] ) as $forum_id )
|
||||
{
|
||||
if( !$forum_id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$forums[] = intval($forum_id);
|
||||
}
|
||||
|
||||
if( !count($forums) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Loop through the forums and build a list of forums we're allowed access to */
|
||||
$forumIdsOk = array();
|
||||
|
||||
foreach( $this->registry->class_forums->forum_by_id as $id => $data )
|
||||
{
|
||||
/* Allowing this forum? */
|
||||
if ( ! in_array( $id, $forums ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Can we read? */
|
||||
if ( ! $this->registry->permissions->check( 'read', $data ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $data['can_view_others'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $data['min_posts_view'] > $posts )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$forumIdsOk[] = $id;
|
||||
}
|
||||
|
||||
if( !count($forumIdsOk) )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Add allowed forums */
|
||||
$where_clause[] = "t.forum_id IN (" . implode( ",", $forumIdsOk ) . ")";
|
||||
|
||||
//-----------------------------------------
|
||||
// Will we need to parse attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
$parseAttachments = false;
|
||||
|
||||
//-----------------------------------------
|
||||
// Run query
|
||||
//-----------------------------------------
|
||||
|
||||
$pinned = array();
|
||||
$unpinned = array();
|
||||
$all = array();
|
||||
$data = array();
|
||||
$count = 0;
|
||||
|
||||
if( !$this->settings['portal_exclude_pinned'] )
|
||||
{
|
||||
/* Fetch all pinned topics to avoid filesort */
|
||||
$this->DB->build( array( 'select' => 't.tid, t.start_date',
|
||||
'from' => 'topics t',
|
||||
'where' => "t.pinned=1 AND t.approved=1 AND t.state != 'link' AND " . implode( ' AND ', $where_clause ),
|
||||
//'order' => 't.tid DESC',
|
||||
'limit' => array ( $limit ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$pinned[ $row['start_date'] ] = $row['tid'];
|
||||
$all[ $row['start_date'] ] = $row['tid'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Still need more? */
|
||||
|
||||
if ( count( $pinned ) < $limit )
|
||||
{
|
||||
$pinnedWhere = $this->settings['portal_exclude_pinned'] ? "" : "t.pinned=0 AND ";
|
||||
|
||||
$this->DB->build( array( 'select' => 't.tid, t.start_date',
|
||||
'from' => 'topics t',
|
||||
'where' => $pinnedWhere . "t.approved=1 AND t.state != 'link' AND " . implode( ' AND ', $where_clause ),
|
||||
'order' => 'tid DESC',
|
||||
'limit' => array ( $limit - count( $pinned ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$unpinned[ $row['start_date'] ] = $row['tid'];
|
||||
$all[ $row['start_date'] ] = $row['tid'];
|
||||
}
|
||||
}
|
||||
|
||||
/* got anything? */
|
||||
if ( ! count( $all ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.tid IN (" . implode( ",", array_values( $all ) ) . ")",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=t.topic_firstpost',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'f.use_html',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => "f.id=t.forum_id",
|
||||
'type' => 'left',
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_id, m.members_display_name, m.member_group_id, m.members_seo_name, m.mgroup_others, m.login_anonymous, m.last_visit, m.last_activity',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'pp.*',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'where' => 'pp.pp_member_id=m.member_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
|
||||
)
|
||||
) );
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Loop through..
|
||||
//-----------------------------------------
|
||||
|
||||
while( $row = $this->DB->fetch($outer) )
|
||||
{
|
||||
$data[ $row['tid'] ] = $row;
|
||||
}
|
||||
|
||||
krsort( $unpinned );
|
||||
krsort( $pinned );
|
||||
|
||||
foreach( $unpinned as $date => $tid )
|
||||
{
|
||||
if ( count( $pinned ) < $limit )
|
||||
{
|
||||
$pinned[ $date ] = $tid;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
/* Now put it altogether */
|
||||
foreach( $pinned as $date => $tid )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$entry = $data[ $tid ];
|
||||
$bottom_string = "";
|
||||
$read_more = "";
|
||||
$top_string = "";
|
||||
$got_these_attach = 0;
|
||||
|
||||
if( $entry['topic_hasattach'] )
|
||||
{
|
||||
$parseAttachments = true;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse the post
|
||||
//-----------------------------------------
|
||||
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $entry['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $entry['use_html'] and $entry['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $entry['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $entry['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $entry['mgroup_others'];
|
||||
$entry['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $entry['post'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// BASIC INFO
|
||||
//-----------------------------------------
|
||||
|
||||
$real_posts = $entry['posts'];
|
||||
$entry['posts'] = ipsRegistry::getClass('class_localization')->formatNumber(intval($entry['posts']));
|
||||
|
||||
if( !$entry['author_id'] )
|
||||
{
|
||||
$entry['members_display_name'] = $this->settings['guest_name_pre'] . $entry['author_name'] . $this->settings['guest_name_suf'];
|
||||
$entry['member_id'] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$entry = IPSMember::buildDisplayData( $entry );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get Date
|
||||
//-----------------------------------------
|
||||
|
||||
$entry['date'] = $this->registry->class_localization->getDate( $entry['post_date'], "manual{" . $this->settings['csite_article_date'] . "}" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $entry['pid'] )
|
||||
{
|
||||
$attach_pids[ $entry['pid'] ] = $entry['pid'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Avatar
|
||||
//-----------------------------------------
|
||||
|
||||
$entry['avatar'] = IPSMember::buildAvatar( $entry );
|
||||
|
||||
if ( IPSMember::checkPermissions('download', $entry['forum_id'] ) === FALSE )
|
||||
{
|
||||
$this->settings[ 'show_img_upload'] = 0 ;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// View image...
|
||||
//-----------------------------------------
|
||||
|
||||
$entry['post'] = IPSText::getTextClass( 'bbcode' )->memberViewImages( $entry['post'] );
|
||||
|
||||
$rows[] = $entry;
|
||||
}
|
||||
|
||||
$output = $this->registry->getClass('output')->getTemplate('portal')->articles( $rows );
|
||||
|
||||
//-----------------------------------------
|
||||
// Process Attachments
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND count( $attach_pids ) )
|
||||
{
|
||||
if ( ! is_object( $this->class_attach ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Grab render attach class
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
|
||||
$this->class_attach->attach_post_key = '';
|
||||
|
||||
ipsRegistry::getClass( 'class_localization' )->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
$this->class_attach->attach_post_key = '';
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
$output = $this->class_attach->renderAttachments( $output, $attach_pids );
|
||||
$output = $output[0]['html'];
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config for posts plugin
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2010-10-23 08:40:34 -0400 (Sat, 23 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-07-27 10:14:00 -0400 (Wed, 27 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7023 $
|
||||
* @version $Revision: 9326 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -73,63 +73,56 @@ class profile_posts extends profile_plugin_parent
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
}
|
||||
|
||||
$pids = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// And limit by post count...
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = intval($this->memberData['posts']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Will we need to parse attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND p.post_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last X posts
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_array($forumIdsOk) AND count($forumIdsOk) )
|
||||
{
|
||||
/* Init vars */
|
||||
$pids = array();
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND p.post_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), 'p.' );
|
||||
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.queued=0 AND t.approved=1 AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'order' => 'p.post_date DESC',
|
||||
'where' => $_queued . " AND " . $_approved . " AND p.author_id={$member['member_id']} AND p.new_topic=0 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'order' => 'p.pid DESC',
|
||||
'limit' => array( 0, $last_x ),
|
||||
'add_join' => $_post_joins
|
||||
) );
|
||||
@@ -148,7 +141,7 @@ class profile_posts extends profile_plugin_parent
|
||||
if ( ! $row['cache_content'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
@@ -164,45 +157,45 @@ class profile_posts extends profile_plugin_parent
|
||||
$row['post'] = $row['cache_content'];
|
||||
}
|
||||
|
||||
$row['post'] = IPSLib::memberViewImages( $row['post'] );
|
||||
|
||||
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
$row['_raw_date'] = $row['post_date'];
|
||||
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
|
||||
|
||||
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&module=forums&section=findpost&pid='.$row['pid'], $this->lang->words['profile_in_topic'] . $row['title'] );
|
||||
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&view=findpost&p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $this->lang->words['profile_in_topic'] . $row['title'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
}
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config for topics plugin
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 5713 $
|
||||
* @version $Revision: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-07-21 05:49:32 -0400 (Thu, 21 Jul 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 9298 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -69,62 +69,56 @@ class profile_topics extends profile_plugin_parent
|
||||
|
||||
if( !$this->memberData['g_other_topics'] AND $this->memberData['member_id'] != $member['member_id'] )
|
||||
{
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_topics_to_show' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// And limit by post count...
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = intval($this->memberData['posts']);
|
||||
|
||||
//-----------------------------------------
|
||||
// Will we need to parse attachments?
|
||||
//-----------------------------------------
|
||||
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 't.topic_firstpost=p.pid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND t.start_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get last X posts
|
||||
//-----------------------------------------
|
||||
|
||||
if( is_array($forumIdsOk) AND count($forumIdsOk) )
|
||||
{
|
||||
/* Init vars */
|
||||
$pids = array();
|
||||
$parseAttachments = false;
|
||||
|
||||
/* Set up joins */
|
||||
$_post_joins = array( array(
|
||||
'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 't.topic_firstpost=p.pid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=p.author_id',
|
||||
'type' => 'left'
|
||||
) );
|
||||
|
||||
/* Cache? */
|
||||
if ( IPSContentCache::isEnabled() )
|
||||
{
|
||||
if ( IPSContentCache::fetchSettingValue('post') )
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'post', 'p.pid' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->settings['search_ucontent_days'] )
|
||||
{
|
||||
$date_cut = ( $this->memberData['last_post'] ? $this->memberData['last_post'] : time() ) - 86400 * intval( $this->settings['search_ucontent_days'] );
|
||||
$date_cut = ' AND t.start_date > ' . $date_cut;
|
||||
}
|
||||
|
||||
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.starter_id={$member['member_id']} AND t.approved=1 AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'where' => "t.starter_id={$member['member_id']} AND {$_approved} AND t.forum_id IN (" . implode( ",", $forumIdsOk ) . ") " . $date_cut,
|
||||
'order' => 't.start_date DESC',
|
||||
'limit' => array( 0, $last_x ),
|
||||
'add_join' => $_post_joins ) );
|
||||
@@ -151,7 +145,7 @@ class profile_topics extends profile_plugin_parent
|
||||
if ( ! $row['cache_content'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $row['use_html'] and $this->caches['group_cache'][ $row['member_group_id'] ]['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
@@ -166,50 +160,50 @@ class profile_topics extends profile_plugin_parent
|
||||
{
|
||||
$row['post'] = $row['cache_content'];
|
||||
}
|
||||
|
||||
$row['post'] = IPSLib::memberViewImages( $row['post'] );
|
||||
|
||||
$row['_post_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
|
||||
$row['_post_date'] = ipsRegistry::getClass('class_localization')->getDate( $row['post_date'], 'SHORT' );
|
||||
$row['_raw_date'] = $row['post_date'];
|
||||
$row['_date_array'] = IPSTime::date_getgmdate( $row['post_date'] + ipsRegistry::getClass( 'class_localization')->getTimeOffset() );
|
||||
|
||||
$row['post'] .= "\n<!--IBF.ATTACHMENT_". $row['pid']. "-->";
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $this->settings['base_url'].'app=forums&module=forums&section=findpost&pid='.$row['pid'], $row['title'] );
|
||||
$url = $this->registry->output->buildSEOUrl( "showtopic={$row['topic_id']}&view=findpost&p={$row['pid']}", 'public', $row['title_seo'], 'showtopic' );
|
||||
|
||||
$content .= $this->registry->getClass('output')->getTemplate('profile')->tabSingleColumn( $row, $this->lang->words['profile_read_topic'], $url, $row['title'] );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
//-----------------------------------------
|
||||
// Attachments (but only if necessary)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $parseAttachments AND !is_object( $this->class_attach ) )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classToLoad( $this->registry );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
|
||||
if ( IPSMember::checkPermissions('download') === false )
|
||||
{
|
||||
$this->settings['show_img_upload'] = 0;
|
||||
}
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->class_attach->renderAttachments( $content, $pids );
|
||||
$content = $content[0]['html'];
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Macros...
|
||||
//-----------------------------------------
|
||||
|
||||
$content = $this->registry->output->replaceMacros( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return content..
|
||||
//-----------------------------------------
|
||||
|
||||
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabTopics( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_posts_to_show' );
|
||||
return $content ? $this->registry->getClass('output')->getTemplate('profile')->tabTopics( $content ) : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent( 'err_no_topics_to_show' );
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Report Center :: Posts plugin
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author Based on original "Report Center" by Luke Scott
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -25,11 +25,19 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class post_plugin
|
||||
{
|
||||
/**#@+
|
||||
* Registry objects
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
@@ -39,7 +47,6 @@ class post_plugin
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Holds extra data for the plugin
|
||||
@@ -51,8 +58,8 @@ class post_plugin
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object Registry object
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -70,8 +77,7 @@ class post_plugin
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->class_localization;
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$app_class_forums = new $classToLoad( $this->registry );
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +168,7 @@ class post_plugin
|
||||
|
||||
foreach( $this->caches['moderators'] as $mod )
|
||||
{
|
||||
if( $mod['member_id'] == $this->memberData['member_id'] )
|
||||
if( $this->memberData['member_id'] AND $mod['member_id'] == $this->memberData['member_id'] )
|
||||
{
|
||||
$these_forums = explode( ',', IPSText::cleanPermString( $mod['forum_id'] ) );
|
||||
|
||||
@@ -379,11 +385,30 @@ class post_plugin
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts an array of data from rc_reports_index and returns an array formatted nearly identical to processReport()
|
||||
*
|
||||
* @param array Report data
|
||||
* @return array Formatted report data
|
||||
*/
|
||||
public function formatReportData( $report_data )
|
||||
{
|
||||
return array(
|
||||
'REDIRECT_URL' => $report_data['url'],
|
||||
'FORUM_ID' => $report_data['exdat1'],
|
||||
'REPORT_INDEX' => $report_data['id'],
|
||||
'SAVED_URL' => str_replace( '&', '&', $report_data['url'] ),
|
||||
'REPORT' => '',
|
||||
'SEOTITLE' => $report_data['seoname'],
|
||||
'TEMPLATE' => 'showtopic',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Where to send user after report is submitted
|
||||
*
|
||||
* @param array Report data
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function reportRedirect( $report_data )
|
||||
{
|
||||
@@ -414,26 +439,26 @@ class post_plugin
|
||||
}
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => "(m.member_group_id IN(" . $group_ids . ") " . ( count($secondaryWhere) ? "OR " . implode( ' OR ', $secondaryWhere ) : '' ) . ") AND (g.g_is_supmod=1 OR g.g_access_cp=1 OR moderator.forum_id LIKE '%,{$report_data['FORUM_ID']},%')",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.member_id as real_member_id, m.members_display_name as name, m.language, m.members_disable_pm, m.email, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=noti.mem_id',
|
||||
),
|
||||
array(
|
||||
'select' => 'moderator.member_id, moderator.group_id',
|
||||
'from' => array( 'moderators' => 'moderator' ),
|
||||
'where' => 'moderator.member_id=m.member_id OR moderator.group_id=m.member_group_id',
|
||||
),
|
||||
array(
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
'select' => 'm.member_id as real_member_id, m.members_display_name as name, m.language, m.members_disable_pm, m.email, m.member_group_id',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "(m.member_group_id IN(" . $group_ids . ") " . ( count($secondaryWhere) ? "OR " . implode( ' OR ', $secondaryWhere ) : '' ) . ") AND (g.g_is_supmod=1 OR g.g_access_cp=1 OR moderator.forum_id LIKE '%,{$report_data['FORUM_ID']},%')",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'noti.*',
|
||||
'from' => array( 'rc_modpref' => 'noti' ),
|
||||
'where' => 'm.member_id=noti.mem_id',
|
||||
),
|
||||
array(
|
||||
'select' => 'moderator.member_id, moderator.group_id',
|
||||
'from' => array( 'moderators' => 'moderator' ),
|
||||
'where' => 'moderator.member_id=m.member_id OR moderator.group_id=m.member_group_id',
|
||||
),
|
||||
array(
|
||||
'from' => array( 'groups' => 'g' ),
|
||||
'where' => 'g.g_id=m.member_group_id',
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
@@ -456,9 +481,9 @@ class post_plugin
|
||||
* Check access to report the topic
|
||||
*
|
||||
* @param integer Topic id
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _checkAccess( $tid )
|
||||
protected function _checkAccess( $tid )
|
||||
{
|
||||
if ( ! $this->memberData['member_id'] )
|
||||
{
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Reputation configuration for application
|
||||
* Last Updated: $Date: 2010-10-21 07:08:38 -0400 (Thu, 21 Oct 2010) $
|
||||
* 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 http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7007 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 7003 $
|
||||
* @version $Revision: 8021 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -30,7 +30,7 @@ class rss_output_forums
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
private $expires = 0;
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
@@ -102,14 +102,12 @@ class rss_output_forums
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$app_class_forums = new $classToLoad( ipsRegistry::instance() );
|
||||
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
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Config file
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* 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 http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
**/
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8370 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
@@ -23,13 +23,20 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can fetch active content with this app */
|
||||
$CONFIG['can_activeContent'] = 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;
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Can search tags */
|
||||
$CONFIG['can_searchTags'] = 1;
|
||||
|
||||
/* Content types for 'follow', default one first */
|
||||
$CONFIG['followContentTypes'] = array( 'topics', 'forums' );
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Basic Forum Search
|
||||
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-10-04 16:35:02 -0400 (Tue, 04 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @author $Author: bfarber $
|
||||
* @copyright © 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5861 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9580 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,10 +24,17 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
class search_engine_forums extends search_engine
|
||||
{
|
||||
/**
|
||||
* Forum ids to search - set in secondary methods
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchForumIds = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -39,6 +46,7 @@ class search_engine_forums extends search_engine
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
@@ -61,8 +69,8 @@ class search_engine_forums extends search_engine
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
|
||||
$post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$search_type = IPSSearchRegistry::get('opt.searchType');
|
||||
$search_tags = IPSSearchRegistry::get('in.raw_search_tags');
|
||||
$search_ids = array();
|
||||
$groupby = false;
|
||||
$cType = IPSSearchRegistry::get('contextual.type');
|
||||
@@ -71,16 +79,21 @@ class search_engine_forums extends search_engine
|
||||
/* Contextual search */
|
||||
if ( $cType == 'topic' )
|
||||
{
|
||||
$content_title_only = false;
|
||||
$post_search_only = true;
|
||||
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', false);
|
||||
IPSSearchRegistry::set('opt.onlySearchPosts', true);
|
||||
IPSSearchRegistry::set('display.onlyTitles', false);
|
||||
$search_type = 'content';
|
||||
IPSSearchRegistry::set('opt.searchType', 'content');
|
||||
IPSSearchRegistry::set('opt.noPostPreview', false);
|
||||
}
|
||||
|
||||
/* If searching tags, we don't show a preview */
|
||||
if( $search_tags )
|
||||
{
|
||||
IPSSearchRegistry::set('opt.noPostPreview', true);
|
||||
IPSSearchRegistry::set('opt.searchType', 'titles');
|
||||
$search_type = 'titles';
|
||||
}
|
||||
|
||||
/* Permissions */
|
||||
$permissions = array();
|
||||
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
|
||||
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
|
||||
$permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( 0 );
|
||||
@@ -107,81 +120,86 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
|
||||
/* Limit Results */
|
||||
$this->sphinxClient->SetLimits( intval($start), intval($perPage) );
|
||||
$this->sphinxClient->SetLimits( intval($start), $perPage );
|
||||
|
||||
/* Loop through the forums and build a list of forums we're allowed access to */
|
||||
$forumIdsOk = array();
|
||||
$forumIdsBad = array();
|
||||
|
||||
if ( ! empty( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) AND count( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
|
||||
if( is_array($this->searchForumIds) AND count($this->searchForumIds) )
|
||||
{
|
||||
foreach( ipsRegistry::$request['search_app_filters']['forums']['forums'] as $forum_id )
|
||||
$forumIdsOk = $this->searchForumIds;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forumIdsOk = array();
|
||||
$forumIdsBad = array();
|
||||
|
||||
if ( ! empty( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) AND count( ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
|
||||
{
|
||||
if( $forum_id )
|
||||
foreach( ipsRegistry::$request['search_app_filters']['forums']['forums'] as $forum_id )
|
||||
{
|
||||
$data = $this->registry->class_forums->forum_by_id[ $forum_id ];
|
||||
|
||||
/* Check for sub forums */
|
||||
$children = ipsRegistry::getClass( 'class_forums' )->forumsGetChildren( $forum_id );
|
||||
|
||||
foreach( $children as $kid )
|
||||
if( $forum_id )
|
||||
{
|
||||
if( ! in_array( $kid, ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
|
||||
$data = $this->registry->class_forums->forum_by_id[ $forum_id ];
|
||||
|
||||
/* Check for sub forums */
|
||||
$children = ipsRegistry::getClass( 'class_forums' )->forumsGetChildren( $forum_id );
|
||||
|
||||
foreach( $children as $kid )
|
||||
{
|
||||
if( ! $this->registry->permissions->check( 'read', $this->registry->class_forums->forum_by_id[ $kid ] ) )
|
||||
if( ! in_array( $kid, ipsRegistry::$request['search_app_filters']['forums']['forums'] ) )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
if( ! $this->registry->permissions->check( 'read', $this->registry->class_forums->forum_by_id[ $kid ] ) )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $kid, 0, 'forum', array(), true ) )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $this->registry->class_forums->forum_by_id[ $kid ]['sub_can_post'] OR ! $this->registry->class_forums->forum_by_id[ $kid ]['can_view_others'] )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
}
|
||||
|
||||
$forumIdsOk[] = $kid;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $kid, 0, 'forum', array(), true ) )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $this->registry->class_forums->forum_by_id[ $kid ]['sub_can_post'] OR ! $this->registry->class_forums->forum_by_id[ $kid ]['can_view_others'] )
|
||||
{
|
||||
$forumIdsBad[] = $kid;
|
||||
continue;
|
||||
}
|
||||
|
||||
$forumIdsOk[] = $kid;
|
||||
}
|
||||
|
||||
/* Can we read? */
|
||||
if ( ! $this->registry->permissions->check( 'view', $data ) )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $forum_id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] AND !$this->memberData['g_access_cp'] )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
$forumIdsOk[] = $forum_id;
|
||||
}
|
||||
|
||||
/* Can we read? */
|
||||
if ( ! $this->registry->permissions->check( 'view', $data ) )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $forum_id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] AND !$this->memberData['g_access_cp'] )
|
||||
{
|
||||
$forumIdsBad[] = $forum_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
$forumIdsOk[] = $forum_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! count($forumIdsOk) )
|
||||
{
|
||||
$allowTrashCan = ( $cType == 'forum' ) ? true : false;
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( null, array(), $allowTrashCan );
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
}
|
||||
|
||||
/* Add allowed forums */
|
||||
@@ -204,7 +222,7 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
|
||||
/* Exclude some items */
|
||||
if ( ! $content_title_only )
|
||||
if ( $search_type != 'titles' )
|
||||
{
|
||||
if ( $permissions['SoftDeleteContent'] AND $permissions['PostSoftDeleteSee'] AND $permissions['canQueue'] )
|
||||
{
|
||||
@@ -265,7 +283,7 @@ class search_engine_forums extends search_engine
|
||||
$this->search_end_timestamp = time() + 100;
|
||||
}
|
||||
|
||||
if ( $content_title_only )
|
||||
if ( $search_type == 'titles' )
|
||||
{
|
||||
$this->sphinxClient->SetFilterRange( 'start_date', $this->search_begin_timestamp, $this->search_end_timestamp );
|
||||
}
|
||||
@@ -275,70 +293,117 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
}
|
||||
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') )
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') OR $search_type == 'titles' )
|
||||
{
|
||||
$groupby = true;
|
||||
}
|
||||
|
||||
if ( $content_title_only )
|
||||
|
||||
/* Check tags */
|
||||
$_tag = '';
|
||||
$tagIds = array();
|
||||
|
||||
if ( $search_tags && $this->settings['tags_enabled'] )
|
||||
{
|
||||
if ( $sort_order == 'asc' )
|
||||
$search_tags = explode( ",", $search_tags );
|
||||
|
||||
$this->DB->build( array( 'select' => 'tag_id',
|
||||
'from' => 'core_tags',
|
||||
'where' => 'tag_meta_app=\'forums\' AND tag_meta_area=\'topics\' AND (' . $this->DB->buildLikeChain( 'tag_text', $search_tags, false ) . ')',
|
||||
'limit' => array( 0, 500 ) ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKey );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKey );
|
||||
$tagIds[] = $row['tag_id'];
|
||||
}
|
||||
|
||||
if ( $groupby )
|
||||
if ( count( $tagIds ) )
|
||||
{
|
||||
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group ' . $sort_order );
|
||||
$this->sphinxClient->SetFilter( 'tag_id', $tagIds );
|
||||
}
|
||||
|
||||
$_s = ( $search_term ) ? '@title ' . $search_term : '';
|
||||
|
||||
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
|
||||
|
||||
$this->logSphinxWarnings();
|
||||
}
|
||||
|
||||
/* Set sort order */
|
||||
if ( $sort_order == 'asc' )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKey );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $groupby )
|
||||
{
|
||||
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group DESC');
|
||||
}
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKey );
|
||||
}
|
||||
|
||||
/* Generate sphinx search query */
|
||||
switch( $search_type )
|
||||
{
|
||||
case 'titles':
|
||||
/* Group by */
|
||||
if ( $groupby )
|
||||
{
|
||||
/* @link http://community.invisionpower.com/topic/335036-sphinx-vncactive-content-sorting/ */
|
||||
$this->sphinxClient->SetGroupDistinct ( "tid" );
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, '@group ' . $sort_order );
|
||||
}
|
||||
|
||||
$_s = ( $search_term ) ? '@title ' . $search_term : '';
|
||||
break;
|
||||
|
||||
if ( $sort_order == 'asc' )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKeyPost );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKeyPost );
|
||||
}
|
||||
case 'content':
|
||||
/* Group by */
|
||||
if ( $groupby )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_EXTENDED, $sortKeyPost . ' DESC' );
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, 'last_post ' . $sort_order );
|
||||
|
||||
IPSSearchRegistry::set('set.searchResultType', 'both' );
|
||||
}
|
||||
|
||||
|
||||
if ( $post_search_only )
|
||||
{
|
||||
$_s = ( $search_term ) ? '@post ' . $search_term : '';
|
||||
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_s = ( $search_term AND strstr( $search_term, '"' ) ) ? '@post ' . $search_term . ' | @title ' . $search_term : ( $search_term ? '@(post,title) ' . $search_term : '' );
|
||||
$result = $this->sphinxClient->Query( $_s, 'forums_search_posts_main,forums_search_posts_delta' );
|
||||
}
|
||||
break;
|
||||
|
||||
$this->logSphinxWarnings();
|
||||
case 'both':
|
||||
default:
|
||||
/* Group by */
|
||||
if ( $groupby )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_EXTENDED, $sortKeyPost . ' DESC' );
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, 'last_post ' . $sort_order );
|
||||
}
|
||||
|
||||
IPSSearchRegistry::set('set.searchResultType', 'both' );
|
||||
|
||||
$_s = ( $search_term AND strstr( $search_term, '"' ) ) ? '@post ' . $search_term . ' | @title ' . $search_term : ( $search_term ? '@(post,title) ' . $search_term : '' );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Perform search */
|
||||
$result = $this->sphinxClient->Query( $_s . $_tag, $this->settings['sphinx_prefix'] . 'forums_search_posts_main, ' . $this->settings['sphinx_prefix'] . 'forums_search_posts_delta' );
|
||||
|
||||
/* Log errors */
|
||||
$this->logSphinxWarnings();
|
||||
|
||||
/* Get result ids */
|
||||
if ( is_array( $result['matches'] ) && count( $result['matches'] ) )
|
||||
{
|
||||
$c = 0;
|
||||
|
||||
foreach( $result['matches'] as $res )
|
||||
{
|
||||
$search_ids[] = ( $content_title_only ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
|
||||
$search_ids[] = ( $search_type == 'titles' && IPSSearchRegistry::get('set.searchResultType') != 'both' ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Set return type */
|
||||
if ( $search_type == 'titles' )
|
||||
{
|
||||
IPSSearchRegistry::set('set.returnType', 'tids' );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSSearchRegistry::set('set.returnType', 'pids' );
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
return array( 'count' => intval( $result['total_found'] ) > 1000 ? 1000 : $result['total_found'], 'resultSet' => $search_ids );
|
||||
@@ -352,38 +417,53 @@ class search_engine_forums extends search_engine
|
||||
*/
|
||||
public function viewUserContent( $member )
|
||||
{
|
||||
/* Ensure we limit by date */
|
||||
$this->settings['search_ucontent_days'] = ( $this->settings['search_ucontent_days'] ) ? $this->settings['search_ucontent_days'] : 365;
|
||||
|
||||
/* Bit of init */
|
||||
$time = time() - ( 86400 * intval( $this->settings['search_ucontent_days'] ) );
|
||||
$time = ( $member['last_post'] ? $member['last_post'] : time() ) - ( 86400 * intval( $this->settings['search_ucontent_days'] ) );
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
|
||||
switch( IPSSearchRegistry::get('in.userMode') )
|
||||
{
|
||||
default:
|
||||
case 'all':
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', false );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , true );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , false );
|
||||
IPSSearchRegistry::set('opt.searchType', 'both');
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , true );
|
||||
break;
|
||||
case 'title':
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', true );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , true );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , false );
|
||||
IPSSearchRegistry::set('opt.searchType', 'titles');
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , true );
|
||||
break;
|
||||
case 'content':
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', false );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , false );
|
||||
IPSSearchRegistry::set('opt.searchType', 'content');
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , false );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Sorting */
|
||||
switch( $sort_by )
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = 'last_post';
|
||||
$sortKeyPost = 'post_date';
|
||||
break;
|
||||
case 'title':
|
||||
$sortKeyPost = $sortKey = 'tordinal';
|
||||
break;
|
||||
case 'posts':
|
||||
$sortKeyPost = $sortKey = 'posts';
|
||||
break;
|
||||
case 'views':
|
||||
$sortKeyPost = $sortKey = 'views';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Init */
|
||||
$start = IPSSearchRegistry::get('in.start');
|
||||
$perPage = IPSSearchRegistry::get('opt.search_per_page');
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
|
||||
//IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
//IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
|
||||
/* Limit Results */
|
||||
$this->sphinxClient->SetLimits( intval($start), intval($perPage) );
|
||||
@@ -409,6 +489,7 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
|
||||
/* Set up perms */
|
||||
$permissions = array();
|
||||
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
|
||||
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
|
||||
$permissions['PostSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( 0 );
|
||||
@@ -459,42 +540,72 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
}
|
||||
|
||||
if ( IPSSearchRegistry::get('in.userMode') == 'title' )
|
||||
/* Perform 'search' */
|
||||
/* We have to sort by topic last post date for 'both' otherwise the topics will appear in random order. Even though it's correctly ordering by YOUR post
|
||||
date, the user just sees the list of topics with random last post date ordering. In a future version it would be nice to change the last post column
|
||||
on 'view user content' to show something like "you last posted on x date" instead of showing the topic last poster and last post date.
|
||||
@link http://community.invisionpower.com/tracker/issue-33692-my-content-second-page */
|
||||
if ( IPSSearchRegistry::get('in.userMode') == 'title' OR IPSSearchRegistry::get('in.userMode') == 'all' )
|
||||
{
|
||||
/* Set return type */
|
||||
IPSSearchRegistry::set('set.returnType', 'tids' );
|
||||
|
||||
$this->sphinxClient->SetGroupDistinct ( "tid" );
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, '@group DESC' );
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, $sortKey . ' ' . $sort_order );
|
||||
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'last_post' );
|
||||
|
||||
$result = $this->sphinxClient->Query( '', 'forums_search_posts_main,forums_search_posts_delta' );
|
||||
|
||||
$this->logSphinxWarnings();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IPSSearchRegistry::get('in.userMode') == 'content' )
|
||||
if ( $sort_order == 'asc' )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'post_date' );
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKey );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, 'post_date' );
|
||||
$this->sphinxClient->SetGroupBy( 'last_post_group', SPH_GROUPBY_ATTR, '@group desc' );
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKey );
|
||||
}
|
||||
|
||||
$result = $this->sphinxClient->Query( '', 'forums_search_posts_main,forums_search_posts_delta' );
|
||||
|
||||
$this->logSphinxWarnings();
|
||||
$result = $this->sphinxClient->Query( '', $this->settings['sphinx_prefix'] . 'forums_search_posts_main,' . $this->settings['sphinx_prefix'] . 'forums_search_posts_delta' );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set return type */
|
||||
if( IPSSearchRegistry::get('in.userMode') == 'all' )
|
||||
{
|
||||
IPSSearchRegistry::set('set.returnType', 'tids' );
|
||||
}
|
||||
else
|
||||
{
|
||||
IPSSearchRegistry::set('set.returnType', 'pids' );
|
||||
}
|
||||
|
||||
if ( $sort_order == 'asc' )
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_ASC, $sortKeyPost );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sphinxClient->SetSortMode( SPH_SORT_ATTR_DESC, $sortKeyPost );
|
||||
}
|
||||
|
||||
if ( IPSSearchRegistry::get('in.userMode') != 'content' )
|
||||
{
|
||||
$this->sphinxClient->SetGroupBy( 'tid', SPH_GROUPBY_ATTR, $sortKeyPost . ' ' . $sort_order );
|
||||
}
|
||||
|
||||
$result = $this->sphinxClient->Query( '', $this->settings['sphinx_prefix'] . 'forums_search_posts_main,' . $this->settings['sphinx_prefix'] . 'forums_search_posts_delta' );
|
||||
}
|
||||
|
||||
/* Log warnings */
|
||||
$this->logSphinxWarnings();
|
||||
|
||||
/* Get result ids */
|
||||
if ( is_array( $result['matches'] ) && count( $result['matches'] ) )
|
||||
{
|
||||
foreach( $result['matches'] as $res )
|
||||
{
|
||||
$search_ids[] = ( IPSSearchRegistry::get('opt.searchTitleOnly') ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
|
||||
$search_ids[] = ( IPSSearchRegistry::get('set.returnType') == 'tids' ) ? $res['attrs']['tid'] : $res['attrs']['search_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Return results */
|
||||
return array( 'count' => intval( $result['total_found'] ) > 1000 ? 1000 : $result['total_found'], 'resultSet' => $search_ids );
|
||||
}
|
||||
|
||||
@@ -507,50 +618,102 @@ class search_engine_forums extends search_engine
|
||||
*/
|
||||
public function viewNewContent()
|
||||
{
|
||||
$tids = $this->registry->getClass('classItemMarking')->fetchCookieData( 'forums', 'items' );
|
||||
$oldStamp = $this->registry->getClass('classItemMarking')->fetchOldestUnreadTimestamp( array(), 'forums' );
|
||||
$check = IPS_UNIX_TIME_NOW - ( 86400 * 90 );
|
||||
$forumIdsOk = array();
|
||||
$oldStamp = $this->registry->getClass('classItemMarking')->fetchOldestUnreadTimestamp( array(), 'forums' );
|
||||
$check = IPS_UNIX_TIME_NOW - ( 86400 * $this->settings['topic_marking_keep_days'] );
|
||||
$forumIdsOk = array();
|
||||
$start = IPSSearchRegistry::get('in.start');
|
||||
$perPage = IPSSearchRegistry::get('opt.search_per_page');
|
||||
$seconds = IPSSearchRegistry::get('in.period_in_seconds');
|
||||
$followedOnly = $this->memberData['member_id'] ? IPSSearchRegistry::get('in.vncFollowFilterOn' ) : false;
|
||||
$permissions = array();
|
||||
|
||||
/* Loop through the forums and build a list of forums we're allowed access to */
|
||||
$bvnp = explode( ',', $this->settings['vnp_block_forums'] );
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly' , true );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , true );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , true );
|
||||
IPSSearchRegistry::set('opt.searchType' , 'titles' );
|
||||
|
||||
$followedForums = array();
|
||||
$followedTopics = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Only content we have participated in?
|
||||
//-----------------------------------------
|
||||
|
||||
if( IPSSearchRegistry::get('in.userMode') )
|
||||
{
|
||||
$_tempResults = $this->viewUserContent( $this->memberData );
|
||||
|
||||
if( $_tempResults['count'] )
|
||||
{
|
||||
$this->sphinxClient->SetFilter( 'tid', $_tempResults['resultSet'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return array( 'count' => 0, 'resultSet' => array() );
|
||||
}
|
||||
|
||||
switch( IPSSearchRegistry::get('in.userMode') )
|
||||
{
|
||||
default:
|
||||
case 'all':
|
||||
case 'content':
|
||||
IPSSearchRegistry::set('opt.searchType', 'both' );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , true );
|
||||
break;
|
||||
case 'title':
|
||||
IPSSearchRegistry::set('opt.searchType', 'titles' );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set return type */
|
||||
IPSSearchRegistry::set('set.returnType', 'tids' );
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$_forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'], $bvnp );
|
||||
|
||||
if ( ! $this->memberData['bw_vnc_type'] )
|
||||
$_forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'], ( $followedOnly ) ? array() : $bvnp );
|
||||
|
||||
/* Fetch forum rel ids */
|
||||
if ( $followedOnly )
|
||||
{
|
||||
$oldStamp = IPSLib::fetchHighestNumber( array( intval( $this->memberData['_cache']['gb_mark__forums'] ), intval( $this->memberData['last_visit'] ) ) );
|
||||
$tids = array();
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
|
||||
|
||||
$forumIdsOk = $_forumIdsOk;
|
||||
/* @link http://community.invisionpower.com/tracker/issue-33284-view-new-content-just-items-i-follow */
|
||||
//$like = classes_like::bootstrap( 'forums', 'forums' );
|
||||
|
||||
//$followedForums = $like->getDataByMemberIdAndArea( $this->memberData['member_id'] );
|
||||
$followedForums = array(); //( $followedForums === null ) ? array() : array_keys( $followedForums );
|
||||
|
||||
$like = classes_like::bootstrap( 'forums', 'topics' );
|
||||
|
||||
$followedTopics = $like->getDataByMemberIdAndArea( $this->memberData['member_id'] );
|
||||
$followedTopics = ( $followedTopics === null ) ? array() : array_keys( $followedTopics );
|
||||
}
|
||||
|
||||
/* What type of date restriction? */
|
||||
if ( IPSSearchRegistry::get('in.period_in_seconds') !== false )
|
||||
{
|
||||
$oldStamp = ( time() - $seconds );
|
||||
$forumIdsOk = $_forumIdsOk;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $_forumIdsOk as $id )
|
||||
{
|
||||
if ( $followedOnly && ! in_array( $id, $followedForums ) )
|
||||
{
|
||||
// We don't want to skip followed topics just because we don't follow the forum
|
||||
//continue;
|
||||
}
|
||||
|
||||
$lMarked = $this->registry->getClass('classItemMarking')->fetchTimeLastMarked( array( 'forumID' => $id ), 'forums' );
|
||||
$fData = $this->registry->getClass('class_forums')->forumsFetchData( $id );
|
||||
|
||||
if ( $fData['last_post'] > $lMarked )
|
||||
{
|
||||
/* Add to tids */
|
||||
$_tids = $this->registry->getClass('classItemMarking')->fetchReadIds( array( 'forumID' => $id ), 'forums', false );
|
||||
|
||||
if ( is_array( $_tids ) )
|
||||
{
|
||||
foreach( $_tids as $k => $v )
|
||||
{
|
||||
$tids[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$forumIdsOk[ $id ] = $id;
|
||||
}
|
||||
}
|
||||
@@ -580,86 +743,137 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
}
|
||||
|
||||
/* Only show VNC results from specified forums? */
|
||||
if ( is_array(IPSSearchRegistry::get('forums.vncForumFilters')) AND count(IPSSearchRegistry::get('forums.vncForumFilters')) )
|
||||
{
|
||||
$_newIdsOk = array();
|
||||
|
||||
foreach( IPSSearchRegistry::get('forums.vncForumFilters') as $forumId )
|
||||
{
|
||||
if( in_array( $forumId, $forumIdsOk ) )
|
||||
{
|
||||
$_newIdsOk[] = $forumId;
|
||||
}
|
||||
}
|
||||
|
||||
$forumIdsOk = $_newIdsOk;
|
||||
}
|
||||
|
||||
/* Set the timestamps */
|
||||
$this->sphinxClient->SetFilterRange( 'last_post', $oldStamp, time() );
|
||||
$this->setDateRange( 0, 0 );
|
||||
|
||||
/* Force it into filter so that search can pick it up */
|
||||
ipsRegistry::$request['search_app_filters']['forums']['forums'] = $forumIdsOk;
|
||||
|
||||
/* Try and limit the TIDS */
|
||||
if ( is_array( $tids ) AND count( $tids ) )
|
||||
{
|
||||
if ( count( $tids ) > 300 )
|
||||
{
|
||||
/* Sort by last read date */
|
||||
arsort( $tids, SORT_NUMERIC );
|
||||
$tids = array_slice( $tids, 0, 300 );
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'tid, last_post',
|
||||
'from' => 'topics',
|
||||
'where' => "tid IN (" . implode( ",", array_keys( $tids ) ) . ')' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Posted in since last read? */
|
||||
if ( $row['last_post'] > $tids[ $row['tid'] ] )
|
||||
{
|
||||
unset( $tids[ $row['tid'] ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $tids ) )
|
||||
{
|
||||
$tids = array_keys( $tids );
|
||||
}
|
||||
}
|
||||
|
||||
/* Set read tids */
|
||||
if ( count( $tids ) )
|
||||
{
|
||||
$this->sphinxClient->SetFilter( 'tid', $tids, TRUE );
|
||||
}
|
||||
$this->searchForumIds = $forumIdsOk;
|
||||
|
||||
/* Set up some vars */
|
||||
IPSSearchRegistry::set('set.resultCutToDate', $oldStamp );
|
||||
|
||||
return $this->search();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the search
|
||||
* Populates $this->_count and $this->_results
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function viewActiveContent()
|
||||
{
|
||||
$seconds = IPSSearchRegistry::get('in.period_in_seconds');
|
||||
/* Fetch first 300 results */
|
||||
IPSSearchRegistry::set('opt.search_per_page', 300);
|
||||
IPSSearchRegistry::set('in.start', 0);
|
||||
|
||||
/* Run search */
|
||||
$data = $this->search();
|
||||
|
||||
/* Loop through the forums and build a list of forums we're allowed access to */
|
||||
$bvnp = explode( ',', $this->settings['vnp_block_forums'] );
|
||||
/* Reset for display function */
|
||||
IPSSearchRegistry::set('in.start', $start);
|
||||
IPSSearchRegistry::set('opt.search_per_page', $perPage);
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly' , true );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , true );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , true );
|
||||
$_ffWhere = '';
|
||||
|
||||
/* Get list of good forum IDs */
|
||||
$forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'], $bvnp );
|
||||
/* Followed topics only */
|
||||
if ( $followedOnly )
|
||||
{
|
||||
if ( ! count( $followedTopics ) && ! count( $followedForums ) )
|
||||
{
|
||||
return array( 'count' => 0, 'resultSet' => array() );
|
||||
}
|
||||
|
||||
if ( count( $followedForums ) )
|
||||
{
|
||||
/* @link http://community.invisionpower.com/tracker/issue-33284-view-new-content-just-items-i-follow */
|
||||
//$_ffWhere = ' OR forum_id IN (' . implode( ',', $followedForums ) . ') ';
|
||||
}
|
||||
}
|
||||
|
||||
/* This method allows us to have just one "tid IN()" clause, instead of two, depending on scenario */
|
||||
if ( count($followedTopics) )
|
||||
{
|
||||
$where[] = "( tid IN(" . implode( ',', $followedTopics ) . ')' . $_ffWhere . ' )';
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !count($data['resultSet']) )
|
||||
{
|
||||
return array( 'count' => 0, 'resultSet' => array() );
|
||||
}
|
||||
|
||||
/* Force it into filter so that search can pick it up */
|
||||
ipsRegistry::$request['search_app_filters']['forums']['forums'] = $forumIdsOk;
|
||||
$where[] = "( tid IN(" . implode( ',', $data['resultSet'] ) . ')' . $_ffWhere . ' )';
|
||||
}
|
||||
|
||||
/* Set the timestamps */
|
||||
$this->sphinxClient->SetFilterRange( 'last_post', intval( time() - $seconds ), time() );
|
||||
$this->setDateRange( 0, 0 );
|
||||
$permissions['TopicSoftDeleteSee'] = $this->registry->getClass('class_forums')->canSeeSoftDeletedTopics( 0 );
|
||||
$permissions['canQueue'] = $this->registry->getClass('class_forums')->canQueuePosts( 0 );
|
||||
|
||||
return $this->search();
|
||||
if ( $permissions['TopicSoftDeleteSee'] AND $permissions['canQueue'] )
|
||||
{
|
||||
$where[] = $this->registry->class_forums->fetchTopicHiddenQuery( array( 'visible', 'hidden', 'sdeleted' ) );
|
||||
}
|
||||
else if ( $permissions['TopicSoftDeleteSee'] )
|
||||
{
|
||||
$where[] = $this->registry->class_forums->fetchTopicHiddenQuery( array( 'visible', 'sdeleted' ) );
|
||||
}
|
||||
else if ( $permissions['canQueue'] )
|
||||
{
|
||||
$where[] = $this->registry->class_forums->fetchTopicHiddenQuery( array( 'visible', 'hidden' ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = $this->registry->class_forums->fetchTopicHiddenQuery( array( 'visible' ) );
|
||||
}
|
||||
|
||||
$where = implode( " AND ", $where );
|
||||
|
||||
/* Fetch the count */
|
||||
$count = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count',
|
||||
'from' => 'topics',
|
||||
'where' => $where ) );
|
||||
|
||||
/* Fetch the count */
|
||||
if ( $count['count'] )
|
||||
{
|
||||
$limit = ( IPSSearchRegistry::get('in.period') != 'unread' ) ? array( $start, $perPage ) : array( 0, 1200 );
|
||||
|
||||
$this->DB->build( array( 'select' => 'tid, forum_id, last_post',
|
||||
'from' => 'topics',
|
||||
'where' => $where,
|
||||
'order' => 'last_post DESC',
|
||||
'limit' => $limit ) );
|
||||
|
||||
$inner = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $inner ) )
|
||||
{
|
||||
$rtids[ $row['tid'] ] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up some vars */
|
||||
IPSSearchRegistry::set('set.resultCutToDate', $oldStamp );
|
||||
|
||||
if ( IPSSearchRegistry::get('in.period') == 'unread' )
|
||||
{
|
||||
$filter = $this->registry->class_forums->postProcessVncTids( $rtids, array( $start, $perPage ) );
|
||||
$data['count'] = $filter['count'];
|
||||
$data['resultSet'] = $filter['tids'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array( 'count' => $count['count'], 'resultSet' => array_keys( $rtids) );
|
||||
}
|
||||
|
||||
/* Return it */
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -667,7 +881,7 @@ class search_engine_forums extends search_engine
|
||||
*
|
||||
* @param string $column sql table column for this condition
|
||||
* @return string column
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function remapColumn( $column )
|
||||
{
|
||||
@@ -681,7 +895,7 @@ class search_engine_forums extends search_engine
|
||||
/**
|
||||
* Returns an array used in the searchplugin's setCondition method
|
||||
*
|
||||
* @param array $data Array of forums to view
|
||||
* @param array $data Array of filters to apply
|
||||
* @return array Array with column, operator, and value keys, for use in the setCondition call
|
||||
*/
|
||||
public function buildFilterSQL( $data )
|
||||
@@ -691,7 +905,11 @@ class search_engine_forums extends search_engine
|
||||
|
||||
/* Set up some defaults */
|
||||
IPSSearchRegistry::set( 'opt.noPostPreview' , true );
|
||||
IPSSearchRegistry::set( 'opt.onlySearchPosts', false );
|
||||
|
||||
if ( ! IPSSearchRegistry::get('opt.searchType' ) )
|
||||
{
|
||||
IPSSearchRegistry::set( 'opt.searchType', 'both' );
|
||||
}
|
||||
|
||||
if( isset( $data ) && is_array( $data ) && count( $data ) )
|
||||
{
|
||||
@@ -703,12 +921,6 @@ class search_engine_forums extends search_engine
|
||||
IPSSearchRegistry::set( 'opt.noPostPreview', false );
|
||||
}
|
||||
|
||||
/* CONTENT ONLY */
|
||||
if ( $field == 'contentOnly' AND $_data['contentOnly'] == 1 )
|
||||
{
|
||||
IPSSearchRegistry::set( 'opt.onlySearchPosts', true );
|
||||
}
|
||||
|
||||
/* POST COUNT */
|
||||
if ( $field == 'pCount' AND intval( $_data['pCount'] ) > 0 )
|
||||
{
|
||||
@@ -726,7 +938,7 @@ class search_engine_forums extends search_engine
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* 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 http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -27,7 +27,7 @@ class search_form_forums
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Formats forum search results
|
||||
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-10-17 10:49:01 -0400 (Mon, 17 Oct 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5855 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9629 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -27,7 +27,7 @@ class search_format_forums extends search_format
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -36,15 +36,85 @@ class search_format_forums extends search_format
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
/* Load tagging stuff */
|
||||
if ( ! $registry->isClassLoaded('tags') )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
parent::__construct( $registry );
|
||||
|
||||
/* Set up wrapper */
|
||||
$this->templates = array( 'group' => 'search', 'template' => 'searchResultsAsForum' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the output for the followed content results
|
||||
*
|
||||
* @param array $results Array of results to show
|
||||
* @param array $followData Meta data from follow/like system
|
||||
* @return @e string
|
||||
*/
|
||||
public function parseFollowedContentOutput( $results, $followData )
|
||||
{
|
||||
/* Topics? */
|
||||
if( IPSSearchRegistry::get('in.followContentType') == 'topics' )
|
||||
{
|
||||
return $this->registry->output->getTemplate('search')->followedContentForumsWrapper( $this->parseAndFetchHtmlBlocks( $this->processFollowedResults( $results, $followData ) ) );
|
||||
}
|
||||
/* Or forums? */
|
||||
else
|
||||
{
|
||||
$forums = array();
|
||||
$member_ids = array();
|
||||
|
||||
if( count($results) )
|
||||
{
|
||||
/* Get forum data */
|
||||
foreach( $results as $result )
|
||||
{
|
||||
$forums[ $result ] = $this->registry->class_forums->forumsFormatLastinfo( $this->registry->class_forums->forumsCalcChildren( $result, $this->registry->class_forums->getForumById( $result ) ) );
|
||||
|
||||
if( $forums[ $result ]['last_poster_id'] )
|
||||
{
|
||||
$member_ids[ $result ] = $forums[ $result ]['last_poster_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Merge in follow data */
|
||||
foreach( $followData as $_follow )
|
||||
{
|
||||
$forums[ $_follow['like_rel_id'] ]['_followData'] = $_follow;
|
||||
}
|
||||
|
||||
/* And get latest member info */
|
||||
if( count($member_ids) )
|
||||
{
|
||||
$_members = IPSMember::load( array_unique($member_ids), 'members,profile_portal' );
|
||||
|
||||
foreach( $member_ids as $forumId => $memberId )
|
||||
{
|
||||
$_member = $_members[ $memberId ];
|
||||
|
||||
if( $_member['member_id'] )
|
||||
{
|
||||
$_member = IPSMember::buildDisplayData( $_member, array( 'reputation' => 0, 'warn' => 0 ) );
|
||||
|
||||
$forums[ $forumId ] = array_merge( $_member, $forums[ $forumId ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->registry->output->getTemplate('search')->followedContentForumsWrapperForums( $forums );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse search results
|
||||
*
|
||||
@@ -57,13 +127,10 @@ class search_format_forums extends search_format
|
||||
$sub = false;
|
||||
$isVnc = false;
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$onlyTitles = IPSSearchRegistry::get('display.onlyTitles');
|
||||
$noPostPreview = IPSSearchRegistry::get('opt.noPostPreview');
|
||||
$results = array();
|
||||
$attachPids = array();
|
||||
$results = array();
|
||||
|
||||
|
||||
/* loop and process */
|
||||
foreach( $rows as $id => $data )
|
||||
{
|
||||
@@ -79,20 +146,25 @@ class search_format_forums extends search_format
|
||||
$data['_last_post'] = $data['last_post'];
|
||||
$data['_longTitle'] = $data['content_title'];
|
||||
$data['_shortTitle'] = IPSText::truncate( $data['content_title'], 60 );
|
||||
$data['last_poster'] = $data['last_poster_id'] ? IPSLib::makeProfileLink( $data['last_poster_name'], $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
|
||||
$data['starter'] = $data['starter_id'] ? IPSLib::makeProfileLink( $data['starter_name'], $data['starter_id'], $data['seo_first_name'] ) : $this->settings['guest_name_pre'] . $data['starter_name'] . $this->settings['guest_name_suf'];
|
||||
$data['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $data['last_post'], 'SHORT' );
|
||||
$data['last_poster'] = $data['last_poster_id'] ? IPSMember::makeProfileLink( $data['last_poster_name'], $data['last_poster_id'], $data['seo_last_name'] ) : $this->settings['guest_name_pre'] . $data['last_poster_name'] . $this->settings['guest_name_suf'];
|
||||
$data['starter'] = $data['starter_id'] ? IPSMember::makeProfileLink( $data['starter_name'], $data['starter_id'], $data['seo_first_name'] ) : $this->settings['guest_name_pre'] . $data['starter_name'] . $this->settings['guest_name_suf'];
|
||||
//$data['last_post'] = $this->registry->getClass( 'class_localization')->getDate( $data['last_post'], 'SHORT' );
|
||||
|
||||
if ( isset( $data['post_date'] ) )
|
||||
{
|
||||
$data['_post_date'] = $data['post_date'];
|
||||
$data['post_date'] = $this->registry->getClass( 'class_localization')->getDate( $data['post_date'], 'SHORT' );
|
||||
//$data['post_date'] = $this->registry->getClass( 'class_localization')->getDate( $data['post_date'], 'SHORT' );
|
||||
}
|
||||
|
||||
if ( $this->memberData['is_mod'] )
|
||||
|
||||
if ( $this->registry->getClass('class_forums')->canQueuePosts( $forum['id'] ) )
|
||||
{
|
||||
$data['posts'] += intval($data['topic_queuedposts']);
|
||||
}
|
||||
|
||||
if( $this->registry->getClass('class_forums')->canSeeSoftDeletedPosts( $forum['id'] ) )
|
||||
{
|
||||
$data['posts'] += intval($data['topic_deleted_posts']);
|
||||
}
|
||||
|
||||
if ( $data['posts'])
|
||||
{
|
||||
@@ -118,36 +190,43 @@ class search_format_forums extends search_format
|
||||
{
|
||||
$data['pages'][] = array( 'last' => 1,
|
||||
'st' => ($pages - 1) * $this->settings['display_max_posts'],
|
||||
'page' => $pages );
|
||||
'page' => $pages,
|
||||
'total' => $pages);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['pages'][] = array( 'last' => 0,
|
||||
'st' => $real_no,
|
||||
'page' => $page_no );
|
||||
'page' => $page_no,
|
||||
'total' => $pages );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* For-matt some stuffs */
|
||||
if ( ! $data['cache_content'] )
|
||||
if ( IPSSearchRegistry::get('opt.noPostPreview') != true )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $data['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $forum['use_html'] and $this->caches['group_cache'][ $data['member_group_id'] ]['g_dohtml'] and $data['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $data['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $forum['use_ibc'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $data['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $data['mgroup_others'];
|
||||
if ( ! $data['cache_content'] )
|
||||
{
|
||||
IPSText::getTextClass( 'bbcode' )->parse_smilies = $data['use_emo'];
|
||||
IPSText::getTextClass( 'bbcode' )->parse_html = ( $forum['use_html'] and $this->caches['group_cache'][ $data['member_group_id'] ]['g_dohtml'] and $data['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_nl2br = $data['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass( 'bbcode' )->parse_bbcode = $forum['use_ibc'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $data['member_group_id'];
|
||||
IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $data['mgroup_others'];
|
||||
|
||||
$data['post'] = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $data['post'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['post'] = '<!--cached-' . gmdate( 'r', $data['cache_updated'] ) . '-->' . $data['cache_content'];
|
||||
}
|
||||
|
||||
$data['post'] = IPSText::searchHighlight( $data['post'], $search_term );
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['post'] = '<!--cached-' . gmdate( 'r', $data['cache_updated'] ) . '-->' . $data['cache_content'];
|
||||
}
|
||||
|
||||
$data['post'] = IPSText::searchHighlight( IPSText::getTextClass( 'bbcode' )->preDisplayParse( $data['post'] ), $search_term );
|
||||
|
||||
|
||||
/* Has attachments */
|
||||
if ( $data['topic_hasattach'] )
|
||||
{
|
||||
@@ -156,9 +235,9 @@ class search_format_forums extends search_format
|
||||
|
||||
$rows[ $id ] = $data;
|
||||
}
|
||||
|
||||
|
||||
/* Attachments */
|
||||
if ( count( $attachPids ) )
|
||||
if ( count( $attachPids ) AND IPSSearchRegistry::get('set.returnType') != 'tids' )
|
||||
{
|
||||
/* Load attachments class */
|
||||
if ( ! is_object( $this->class_attach ) )
|
||||
@@ -169,8 +248,8 @@ class search_format_forums extends search_format
|
||||
$this->class_attach->init();
|
||||
}
|
||||
|
||||
$attachHTML = $this->class_attach->renderAttachments( array( $data['pid'] => $data['post'] ), array_keys( $attachPids ) );
|
||||
|
||||
$attachHTML = $this->class_attach->renderAttachments( $attachPids, array_keys( $attachPids ) );
|
||||
|
||||
/* Now parse back in the rendered posts */
|
||||
if( is_array($attachHTML) AND count($attachHTML) )
|
||||
{
|
||||
@@ -181,7 +260,7 @@ class search_format_forums extends search_format
|
||||
{
|
||||
$_data['html'] = IPSText::stripAttachTag( $_data['html'] );
|
||||
}
|
||||
|
||||
|
||||
$rows[ $id ]['post'] = $_data['html'];
|
||||
$rows[ $id ]['attachmentHtml'] = $_data['attachmentHtml'];
|
||||
}
|
||||
@@ -194,7 +273,7 @@ class search_format_forums extends search_format
|
||||
/* Format content */
|
||||
list( $html, $sub ) = $this->formatContent( $data );
|
||||
|
||||
$results[ $id ] = array( 'html' => $html, 'app' => $data['app'], 'type' => $data['type'], 'sub' => $sub );
|
||||
$results[ $id ] = array( 'html' => $html, 'app' => $data['app'], 'type' => $data['type'], 'sub' => $sub, '_followData' => !empty($data['_followData']) ? $data['_followData'] : array() );
|
||||
}
|
||||
|
||||
return $results;
|
||||
@@ -208,8 +287,7 @@ class search_format_forums extends search_format
|
||||
*/
|
||||
public function formatContent( $data )
|
||||
{
|
||||
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$onlyTitles = IPSSearchRegistry::get('display.onlyTitles');
|
||||
$onlyTitles = IPSSearchRegistry::searchTitleOnly();
|
||||
$noPostPreview = IPSSearchRegistry::get('opt.noPostPreview');
|
||||
|
||||
/* Forum Breadcrum */
|
||||
@@ -221,10 +299,15 @@ class search_format_forums extends search_format
|
||||
/* Has posted dot */
|
||||
$show_dots = ( $this->settings['show_user_posted'] AND $this->memberData['member_id'] AND $data['_hasPosted'] ) ? 1 : 0;
|
||||
|
||||
if ( ! $is_read )
|
||||
{
|
||||
$data['_unreadUrl'] = $this->registry->output->buildSEOUrl( 'showtopic=' . $data['tid'] . '&view=getnewpost', 'public', $data['title_seo'], 'showtopicunread' );
|
||||
}
|
||||
|
||||
/* Icon */
|
||||
$data['_icon'] = $this->registry->getClass( 'class_forums' )->fetchTopicFolderIcon( $data, $show_dots, $is_read );
|
||||
$data['_isRead'] = $is_read;
|
||||
|
||||
|
||||
/* Display type */
|
||||
return array( $this->registry->getClass( 'output' )->getTemplate( 'search' )->topicPostSearchResultAsForum( $data, ( $onlyTitles || $noPostPreview ) ? 1 : 0 ), 0 );
|
||||
}
|
||||
@@ -233,17 +316,37 @@ class search_format_forums extends search_format
|
||||
* Formats / grabs extra data for results
|
||||
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
|
||||
*
|
||||
* @param array $ids Ids
|
||||
* @param array $followData Retrieve the follow meta data
|
||||
* @return array
|
||||
*/
|
||||
public function processResults( $ids )
|
||||
public function processFollowedResults( $ids, $followData=array() )
|
||||
{
|
||||
/* Topics? */
|
||||
if( IPSSearchRegistry::get('in.followContentType') == 'topics' )
|
||||
{
|
||||
IPSSearchRegistry::set('set.returnType', 'tids' );
|
||||
return $this->processResults( $ids, $followData );
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats / grabs extra data for results
|
||||
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
|
||||
*
|
||||
* @param array $ids Ids
|
||||
* @param array $followData Retrieve the follow meta data
|
||||
* @return array
|
||||
*/
|
||||
public function processResults( $ids, $followData=array() )
|
||||
{
|
||||
/* INIT */
|
||||
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
|
||||
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
|
||||
$search_term = IPSSearchRegistry::get('in.clean_search_term');
|
||||
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
|
||||
$onlyPosts = IPSSearchRegistry::get('opt.onlySearchPosts');
|
||||
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
|
||||
$content_title_only = IPSSearchRegistry::searchTitleOnly();
|
||||
$_post_joins = array();
|
||||
$members = array();
|
||||
$results = array();
|
||||
@@ -262,7 +365,7 @@ class search_format_forums extends search_format
|
||||
$permissions['SoftDeleteContent'] = $this->registry->getClass('class_forums')->canSeeSoftDeleteContent( 0 );
|
||||
$permissions['PostSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeletePosts( 0 );
|
||||
$permissions['TopicSoftDeleteRestore'] = $this->registry->getClass('class_forums')->can_Un_SoftDeleteTopics( 0 );
|
||||
|
||||
|
||||
/* Got some? */
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
@@ -278,14 +381,16 @@ class search_format_forums extends search_format
|
||||
{
|
||||
$_post_joins[] = IPSContentCache::join( 'sig' , 'p.author_id', 'ccb', 'left', 'ccb.cache_content as cache_content_sig, ccb.cache_updated as cache_updated_sig' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$_post_joins[] = $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) );
|
||||
|
||||
/* Sorting */
|
||||
switch( $sort_by )
|
||||
{
|
||||
default:
|
||||
case 'date':
|
||||
$sortKey = ( $content_title_only ) ? 'last_post' : 'post_date';
|
||||
$sortKey = ( IPSSearchRegistry::get('set.returnType') == 'tids' ) ? 'last_post' : 'post_date';
|
||||
$sortType = 'numerical';
|
||||
break;
|
||||
case 'title':
|
||||
@@ -304,14 +409,14 @@ class search_format_forums extends search_format
|
||||
|
||||
/* Set vars */
|
||||
IPSSearch::$ask = $sortKey;
|
||||
IPSSearch::$aso = strtolower( $order_dir );
|
||||
IPSSearch::$aso = strtolower( $sort_order );
|
||||
IPSSearch::$ast = $sortType;
|
||||
|
||||
|
||||
/* If we are search in titles only, then the ID array will be TIDs */
|
||||
if( $content_title_only )
|
||||
if ( IPSSearchRegistry::get('set.returnType') == 'tids' )
|
||||
{
|
||||
$k = 'tid';
|
||||
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => "t.*",
|
||||
'from' => array( 'topics' => 't' ),
|
||||
@@ -344,7 +449,7 @@ class search_format_forums extends search_format
|
||||
'type' => 'left' ) ), $_post_joins ) ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Grab data */
|
||||
$this->DB->execute();
|
||||
|
||||
@@ -354,6 +459,18 @@ class search_format_forums extends search_format
|
||||
$_rows[ $row[ $k ] ] = $row;
|
||||
}
|
||||
|
||||
/* Get the 'follow' meta data? */
|
||||
if( count($followData) )
|
||||
{
|
||||
$followData = classes_like_meta::get( $followData );
|
||||
|
||||
/* Merge the data from the follow class into the results */
|
||||
foreach( $followData as $_formatted )
|
||||
{
|
||||
$_rows[ $_formatted['like_rel_id'] ]['_followData'] = $_formatted;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sort */
|
||||
if ( count( $_rows ) )
|
||||
{
|
||||
@@ -364,10 +481,20 @@ class search_format_forums extends search_format
|
||||
/* Prevent member from stepping on it */
|
||||
$row['topic_title'] = $row['title'];
|
||||
|
||||
/* Got author but no member data? */
|
||||
if ( ! empty( $row['author_id'] ) )
|
||||
/* Get author data? */
|
||||
if( $k == 'tid' )
|
||||
{
|
||||
$members[ $row['author_id'] ] = $row['author_id'];
|
||||
if ( ! empty( $row['last_poster_id'] ) )
|
||||
{
|
||||
$members[ $row['last_poster_id'] ] = $row['last_poster_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! empty( $row['author_id'] ) )
|
||||
{
|
||||
$members[ $row['author_id'] ] = $row['author_id'];
|
||||
}
|
||||
}
|
||||
|
||||
/* Topic ids? */
|
||||
@@ -394,7 +521,7 @@ class search_format_forums extends search_format
|
||||
}
|
||||
|
||||
$row['cleanSearchTerm'] = urlencode($search_term);
|
||||
$row['topicPrefix'] = $row['pinned'] ? $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap( $this->settings['pre_pinned'] ) : '';
|
||||
$row['topicPrefix'] = $row['pinned'] ? $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap( $this->lang->words['pre_pinned'] ) : '';
|
||||
|
||||
$row['_isVisible'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $row ) == 'visible' ) ? true : false;
|
||||
$row['_isHidden'] = ( $this->registry->getClass('class_forums')->fetchHiddenTopicType( $row ) == 'hidden' ) ? true : false;
|
||||
@@ -442,7 +569,13 @@ class search_format_forums extends search_format
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Tags */
|
||||
if ( ! empty( $row['tag_cache_key'] ) )
|
||||
{
|
||||
$row['tags'] = $this->registry->tags->formatCacheJoinData( $row );
|
||||
}
|
||||
|
||||
$results[ $row['pid'] ] = $this->genericizeResults( $row );
|
||||
}
|
||||
}
|
||||
@@ -450,23 +583,26 @@ class search_format_forums extends search_format
|
||||
/* Need to load members? */
|
||||
if ( count( $members ) )
|
||||
{
|
||||
$mems = IPSMember::load( $members, 'all' );
|
||||
$mems = IPSMember::load( $members, 'all' );
|
||||
$mems[0] = array();
|
||||
|
||||
foreach( $results as $id => $r )
|
||||
{
|
||||
if ( ! empty( $r['author_id'] ) AND isset( $mems[ $r['author_id'] ] ) )
|
||||
$_memberIdColumn = ( IPSSearchRegistry::get('set.returnType') == 'tids' ) ? 'last_poster_id' : 'author_id';
|
||||
|
||||
if ( isset( $mems[ $r[ $_memberIdColumn ] ] ) )
|
||||
{
|
||||
$mems[ $r['author_id'] ]['m_posts'] = $mems[ $r['author_id'] ]['posts'];
|
||||
//unset( $mems[ $r['author_id'] ]['posts'] );
|
||||
unset( $mems[ $r['author_id'] ]['last_post'] );
|
||||
$mems[ $r[ $_memberIdColumn ] ]['m_posts'] = $mems[ $r[ $_memberIdColumn ] ]['posts'];
|
||||
|
||||
unset( $mems[ $r[ $_memberIdColumn ] ]['last_post'] );
|
||||
|
||||
if ( isset( $r['cache_content_sig'] ) )
|
||||
{
|
||||
$mems[ $r['author_id'] ]['cache_content'] = $r['cache_content_sig'];
|
||||
$mems[ $r['author_id'] ]['cache_updated'] = $r['cache_updated_sig'];
|
||||
$mems[ $r[ $_memberIdColumn ] ]['cache_content'] = $r['cache_content_sig'];
|
||||
$mems[ $r[ $_memberIdColumn ] ]['cache_updated'] = $r['cache_updated_sig'];
|
||||
}
|
||||
|
||||
$_mem = IPSMember::buildDisplayData( $mems[ $r['author_id'] ], array( 'signature' => 1 ) );
|
||||
$_mem = IPSMember::buildDisplayData( $mems[ $r[ $_memberIdColumn ] ], array( 'reputation' => 0, 'warn' => 0 ) );
|
||||
|
||||
unset( $_mem['cache_content'], $_mem['cache_updated'] );
|
||||
|
||||
@@ -476,13 +612,15 @@ class search_format_forums extends search_format
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Generate 'dot' folder icon */
|
||||
if ( $this->settings['show_user_posted'] AND count( $topicIds ) )
|
||||
{
|
||||
$_queued = $this->registry->class_forums->fetchPostHiddenQuery( array( 'visible' ), '' );
|
||||
|
||||
$this->DB->build( array( 'select' => 'author_id, topic_id',
|
||||
'from' => 'posts',
|
||||
'where' => 'queued=0 AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topicIds ) . ')' ) );
|
||||
'where' => $_queued . ' AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode( ',', $topicIds ) . ')' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
@@ -557,7 +695,7 @@ class search_format_forums extends search_format
|
||||
$r['type_2'] = 'topic';
|
||||
$r['type_id_2'] = $r['tid'];
|
||||
$r['misc'] = $r['pid'];
|
||||
|
||||
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2010-10-28 12:07:41 -0400 (Thu, 28 Oct 2010) $
|
||||
* Last Updated: $Date: 2011-09-23 11:38:00 -0400 (Fri, 23 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7063 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9545 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
@@ -28,17 +28,17 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
$appSphinxTemplate = <<<EOF
|
||||
|
||||
################################# --- FORUM --- ##############################
|
||||
source forums_search_posts_main : ipb_source_config
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
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() )
|
||||
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, 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, \
|
||||
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, \
|
||||
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, \
|
||||
CONCAT(t.last_post, '.', t.tid ) as last_post_group \
|
||||
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 )
|
||||
|
||||
@@ -57,47 +57,50 @@ source forums_search_posts_main : ipb_source_config
|
||||
sql_attr_uint = posts
|
||||
sql_attr_uint = views
|
||||
sql_attr_str2ordinal = tordinal
|
||||
sql_attr_str2ordinal = last_post_group
|
||||
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 forums_search_posts_delta : forums_search_posts_main
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
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, 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, \
|
||||
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, \
|
||||
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, \
|
||||
CONCAT(t.last_post, '.', t.tid ) as last_post_group \
|
||||
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' )
|
||||
}
|
||||
|
||||
index forums_search_posts_main
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
{
|
||||
source = forums_search_posts_main
|
||||
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_main
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
charset_type = utf-8
|
||||
html_strip = 0
|
||||
#infix_fields = post, title
|
||||
#min_infix_len = 3
|
||||
#enable_star = 1
|
||||
}
|
||||
|
||||
index forums_search_posts_delta : forums_search_posts_main
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
{
|
||||
source = forums_search_posts_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/forums_search_posts_delta
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_posts_delta
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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,336 @@
|
||||
<?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 ];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user