Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,210 +1,198 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Forums application initialization
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class app_class_forums
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
|
||||
if ( IN_ACP )
|
||||
{
|
||||
try
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 0;
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
IPS_exception_error( $error );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 1;
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
IPS_exception_error( $error );
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// Grab and cache the topic now as we need the 'f' attr for
|
||||
// the skins...
|
||||
//---------------------------------------------------
|
||||
|
||||
if ( !empty( $_GET['showtopic'] ) )
|
||||
{
|
||||
/* Load tagging stuff */
|
||||
if ( ! $this->registry->isClassLoaded('tags') )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
$this->request['t'] = intval( $_GET['showtopic'] );
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=' . $this->request['t'],
|
||||
'add_join' => array( $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$topic = $this->DB->fetch();
|
||||
|
||||
$this->registry->getClass('class_forums')->topic_cache = $topic;
|
||||
|
||||
$this->request['f'] = $topic['forum_id'];
|
||||
|
||||
/* Update query location */
|
||||
$this->member->sessionClass()->addQueryKey( 'location_2_id', ipsRegistry::$request['f'] );
|
||||
}
|
||||
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$this->memberData = IPSMember::setUpModerator( $this->memberData );
|
||||
}
|
||||
|
||||
/**
|
||||
* Do some set up after ipsRegistry::init()
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function afterOutputInit()
|
||||
{
|
||||
if ( !empty( $_GET['showtopic'] ) AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
|
||||
{
|
||||
$topic = $this->registry->getClass('class_forums')->topic_cache;
|
||||
|
||||
if ( IPB_USE_ONLY_ID_FURL )
|
||||
{
|
||||
$topic['title_seo'] = $topic['tid'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic['title_seo'] = ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
|
||||
}
|
||||
|
||||
/* Check TOPIC permalink... */
|
||||
$this->registry->getClass('output')->checkPermalink( $topic['title_seo'] );
|
||||
|
||||
/* Add canonical tag */
|
||||
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showtopic=' . $topic['tid'] . '&st=' . $this->request['st'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' ) );
|
||||
}
|
||||
else if ( !empty( $_GET['showforum'] ) )
|
||||
{
|
||||
$_GET['showforum'] = intval($_GET['showforum']);
|
||||
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['showforum']);
|
||||
|
||||
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
|
||||
if ( IPB_USE_ONLY_ID_FURL )
|
||||
{
|
||||
$data['name_seo'] = $data['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['name_seo'] = ( $data['name_seo'] ) ? $data['name_seo'] : IPSText::makeSeoTitle( $data['name'] );
|
||||
}
|
||||
|
||||
/* Check FORUM permalink... */
|
||||
$this->registry->getClass('output')->checkPermalink( $data['name_seo'] );
|
||||
|
||||
/* Add canonical tag */
|
||||
if( $data['id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showforum=' . $data['id'] . '&st=' . $this->request['st'] : 'showforum=' . $data['id'], $data['name_seo'], 'showforum' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $data['id'], 'publicNoSession', $data['name_seo'], 'showforum' ) );
|
||||
}
|
||||
}
|
||||
else if ( !empty( $_GET['showannouncement'] ) )
|
||||
{
|
||||
$announce = $this->caches['announcements'][ intval( $_GET['showannouncement'] ) ];
|
||||
|
||||
if ( $announce['announce_id'] )
|
||||
{
|
||||
$_seoTitle = $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
|
||||
|
||||
$this->registry->getClass('output')->checkPermalink( $_seoTitle );
|
||||
|
||||
/* Add canonical tag */
|
||||
if( $announce['announce_id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->addCanonicalTag( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&f=' . intval($_GET['f']) : '&f=0' ), $_seoTitle, 'showannouncement' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&f=' . intval($_GET['f']) : '&f=0' ), 'publicNoSession', $_seoTitle, 'showannouncement' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Forums application initialization
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class app_class_forums
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
|
||||
if ( IN_ACP )
|
||||
{
|
||||
try
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 0;
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
IPS_exception_error( $error );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 1;
|
||||
}
|
||||
catch( Exception $error )
|
||||
{
|
||||
IPS_exception_error( $error );
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// Grab and cache the topic now as we need the 'f' attr for
|
||||
// the skins...
|
||||
//---------------------------------------------------
|
||||
|
||||
if ( ! empty( $_GET['showtopic'] ) )
|
||||
{
|
||||
/* Load tagging stuff */
|
||||
if ( ! $this->registry->isClassLoaded('tags') )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
$this->request['t'] = intval( $_GET['showtopic'] );
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=' . $this->request['t'],
|
||||
'add_join' => array( $this->registry->tags->getCacheJoin( array( 'meta_id_field' => 't.tid' ) ) ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$topic = $this->DB->fetch();
|
||||
|
||||
$this->registry->getClass('class_forums')->topic_cache = $topic;
|
||||
|
||||
$this->request['f'] = $topic['forum_id'];
|
||||
|
||||
/* Update query location */
|
||||
$this->member->sessionClass()->addQueryKey( 'location_2_id', ipsRegistry::$request['f'] );
|
||||
}
|
||||
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$this->memberData = IPSMember::setUpModerator( $this->memberData );
|
||||
|
||||
/* Other set up for this app */
|
||||
$this->settings['topic_title_max_len'] = ( $this->settings['topic_title_max_len'] > 2 ) ? $this->settings['topic_title_max_len'] : 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do some set up after ipsRegistry::init()
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function afterOutputInit()
|
||||
{
|
||||
if ( !empty( $_GET['showtopic'] ) AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
|
||||
{
|
||||
$topic = $this->registry->getClass('class_forums')->topic_cache;
|
||||
$topic['title_seo'] = ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
|
||||
|
||||
/* Check TOPIC permalink... */
|
||||
$this->registry->getClass('output')->checkPermalink( $topic['title_seo'] );
|
||||
|
||||
/* Add canonical tag */
|
||||
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showtopic=' . $topic['tid'] . '&st=' . $this->request['st'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' ) );
|
||||
}
|
||||
else if ( !empty( $_GET['showforum'] ) )
|
||||
{
|
||||
$_GET['showforum'] = intval($_GET['showforum']);
|
||||
ipsRegistry::$request['showforum'] = intval(ipsRegistry::$request['showforum']);
|
||||
|
||||
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_GET['showforum'] );
|
||||
$data['name_seo'] = ( $data['name_seo'] ) ? $data['name_seo'] : IPSText::makeSeoTitle( $data['name'] );
|
||||
|
||||
/* Check FORUM permalink... */
|
||||
$this->registry->getClass('output')->checkPermalink( $data['name_seo'] );
|
||||
|
||||
/* Add canonical tag */
|
||||
if( $data['id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->addCanonicalTag( ( $this->request['st'] ) ? 'showforum=' . $data['id'] . '&st=' . $this->request['st'] : 'showforum=' . $data['id'], $data['name_seo'], 'showforum' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $data['id'], 'publicNoSession', $data['name_seo'], 'showforum' ) );
|
||||
}
|
||||
}
|
||||
else if ( !empty( $_GET['showannouncement'] ) )
|
||||
{
|
||||
$announce = $this->caches['announcements'][ intval( $_GET['showannouncement'] ) ];
|
||||
|
||||
if ( $announce['announce_id'] )
|
||||
{
|
||||
$_seoTitle = $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
|
||||
|
||||
$this->registry->getClass('output')->checkPermalink( $_seoTitle );
|
||||
|
||||
/* Add canonical tag */
|
||||
if( $announce['announce_id'] )
|
||||
{
|
||||
$this->registry->getClass('output')->addCanonicalTag( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&f=' . intval($_GET['f']) : '&f=0' ), $_seoTitle, 'showannouncement' );
|
||||
|
||||
/* Store root doc URL */
|
||||
$this->registry->getClass('output')->storeRootDocUrl( $this->registry->getClass('output')->buildSEOUrl( 'showannouncement=' . $announce['announce_id'] . ( $_GET['f'] ? '&f=' . intval($_GET['f']) : '&f=0' ), 'publicNoSession', $_seoTitle, 'showannouncement' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file group_form.php Forums group editing form
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-03-03 13:09:09 -0500 (Thu, 03 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 7948 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,127 +1,127 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2011-04-19 12:42:57 -0400 (Tue, 19 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Revision: 8391 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_member_form__forums implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
|
||||
|
||||
$array = array();
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deleteposts',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deletesubscriptions',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array(), $tabsUsed=5 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
return array( 'tabs' => $this->html->acp_member_form_tabs( $member, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_member_form_main( $member, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
$return = array( 'core' => array(), 'extendedProfile' => array() );
|
||||
|
||||
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
|
||||
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
|
||||
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
|
||||
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_member_form__forums implements admin_member_form
|
||||
{
|
||||
/**
|
||||
* Tab name
|
||||
* This can be left blank and the application title will
|
||||
* be used
|
||||
*
|
||||
* @var string Tab name
|
||||
*/
|
||||
public $tab_name = "";
|
||||
|
||||
|
||||
/**
|
||||
* Returns sidebar links for this tab
|
||||
* You may return an empty array or FALSE to not have
|
||||
* any links show in the sidebar for this block.
|
||||
*
|
||||
* The links must have 'section=xxxxx&module=xxxxx[&do=xxxxxx]'. The rest of the URL
|
||||
* is added automatically.
|
||||
*
|
||||
* The image must be a full URL or blank to use a default image.
|
||||
*
|
||||
* Use the format:
|
||||
* $array[] = array( 'img' => '', 'url' => '', 'title' => '' );
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of links
|
||||
*/
|
||||
public function getSidebarLinks( $member=array() )
|
||||
{
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
|
||||
|
||||
$array = array();
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deleteposts',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_deltitle'] );
|
||||
|
||||
$array[] = array( 'img' => '',
|
||||
'url' => 'section=tools&module=tools&do=deletesubscriptions',
|
||||
'title' => ipsRegistry::getClass('class_localization')->words['m_delsubs'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns content for the page.
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @param array Member data
|
||||
* @return array Array of tabs, content
|
||||
*/
|
||||
public function getDisplayContent( $member=array(), $tabsUsed=5 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form', 'forums');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums' ), 'forums' );
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member_form' ), 'forums' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
return array( 'tabs' => $this->html->acp_member_form_tabs( $member, ( $tabsUsed + 1 ) ), 'content' => $this->html->acp_member_form_main( $member, ( $tabsUsed + 1 ) ), 'tabsUsed' => 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the entries for saving and return
|
||||
*
|
||||
* @author Brandon Farber
|
||||
* @return array Multi-dimensional array (core, extendedProfile) for saving
|
||||
*/
|
||||
public function getForSave()
|
||||
{
|
||||
$return = array( 'core' => array(), 'extendedProfile' => array() );
|
||||
|
||||
$return['core']['posts'] = intval(ipsRegistry::$request['posts']);
|
||||
$return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : ( ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'] ) ) : '' );
|
||||
$return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : ( ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry( array( 'timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'] ) ) : '' );
|
||||
$return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode( ",", ipsRegistry::$request['org_perm_id'] ) . ',' : '';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Show a poll widget
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Content
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 9350 $
|
||||
* @since 1st March 2009
|
||||
*/
|
||||
|
||||
class plugin_site_poll implements pluginBlockInterface
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
protected $registry;
|
||||
protected $request;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object Registry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make shortcuts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $registry->DB();
|
||||
$this->settings = $registry->fetchSettings();
|
||||
$this->member = $registry->member();
|
||||
$this->memberData =& $registry->member()->fetchMemberData();
|
||||
$this->cache = $registry->cache();
|
||||
$this->caches =& $registry->cache()->fetchCaches();
|
||||
$this->request = $registry->fetchRequest();
|
||||
$this->lang = $registry->class_localization;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the tag help for this block type
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return array(
|
||||
$this->lang->words['block_plugin__generic'] => array(
|
||||
array( '$title', $this->lang->words['block_custom__title'] ) ,
|
||||
array( '$content', $this->lang->words['block_plugin_sp_content'] ) ,
|
||||
array( '$tid', $this->lang->words['block_plugin_sp_tid'] ) ,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the plugin meta data
|
||||
*
|
||||
* @access public
|
||||
* @return array Plugin data (name, description, hasConfig)
|
||||
*/
|
||||
public function returnPluginInfo()
|
||||
{
|
||||
return array(
|
||||
'key' => 'site_poll',
|
||||
'name' => $this->lang->words['plugin_name__site_poll'],
|
||||
'description' => $this->lang->words['plugin_description__site_poll'],
|
||||
'hasConfig' => true,
|
||||
'templateBit' => 'block__site_poll',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plugin configuration data. Returns form elements and data
|
||||
*
|
||||
* @access public
|
||||
* @param array Session data
|
||||
* @return array Form data
|
||||
*/
|
||||
public function returnPluginConfig( $session )
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
'label' => $this->lang->words['plugin__poll_label1'],
|
||||
'description' => $this->lang->words['plugin__poll_desc1'],
|
||||
'field' => $this->registry->output->formInput( 'plugin__poll', $session['config_data']['custom_config']['poll'] ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the plugin config data
|
||||
*
|
||||
* @access public
|
||||
* @param array Submitted plugin data to check (usually $this->request)
|
||||
* @return array Array( (bool) Ok or not, (array) Plugin data to use )
|
||||
*/
|
||||
public function validatePluginConfig( $data )
|
||||
{
|
||||
return array( $data['plugin__poll'] ? true : false, array( 'poll' => $data['plugin__poll'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the plugin and return the HTML to show on the page.
|
||||
* Can be called from ACP or front end, so the plugin needs to setup any appropriate lang files, skin files, etc.
|
||||
*
|
||||
* @access public
|
||||
* @param array Block data
|
||||
* @return string Block HTML to display or cache
|
||||
*/
|
||||
public function executePlugin( $block )
|
||||
{
|
||||
$config = unserialize($block['block_config']);
|
||||
|
||||
if( !$config['custom']['poll'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/* Friendly URL */
|
||||
if( $this->settings['use_friendly_urls'] )
|
||||
{
|
||||
preg_match( "#/topic/(\d+)(.*?)/#", $config['custom']['poll'], $match );
|
||||
$tid = intval( trim( $match[1] ) );
|
||||
}
|
||||
/* Normal URL */
|
||||
else
|
||||
{
|
||||
preg_match( "/(\?|&)(t|showtopic)=(\d+)($|&)/", $config['custom']['poll'], $match );
|
||||
$tid = intval( trim( $match[3] ) );
|
||||
}
|
||||
|
||||
if( !$tid )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$poll = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'polls', 'where' => 'tid=' . $tid ) );
|
||||
|
||||
if( !$poll['pid'] )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_boards', 'public_topic' ), 'forums' );
|
||||
$this->lang->loadLanguageFile( array( 'public_editors' ), 'core' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", "class_forums", 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/modules_public/forums/topics.php', "public_forums_forums_topics", 'forums' );
|
||||
$topic = new $classToLoad( $this->registry );
|
||||
$topic->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
ipsRegistry::$request['t'] = $poll['tid'];
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
/* Load up the data dudes */
|
||||
$this->registry->getClass('topics')->autoPopulate();
|
||||
}
|
||||
catch( Exception $crowdCheers )
|
||||
{}
|
||||
|
||||
$topic->forumClass = $this->registry->getClass('class_forums');
|
||||
|
||||
$topic->topicSetUp( $this->registry->getClass('topics')->getTopicData() );
|
||||
|
||||
if ( $this->registry->getClass('topics')->getTopicData('poll_state') )
|
||||
{
|
||||
$pluginConfig = $this->returnPluginInfo();
|
||||
$templateBit = $pluginConfig['templateBit'] . '_' . $block['block_id'];
|
||||
$pollOutput = $topic->_generatePollOutput();
|
||||
|
||||
ob_start();
|
||||
$_return = $this->registry->output->getTemplate('ccs')->$templateBit( $block['block_name'], $pollOutput['html'], $tid );
|
||||
ob_end_clean();
|
||||
return $_return;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,19 +3,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Core variables extensions
|
||||
* Defines the reset array, which caches to load, how to recache those caches, and the bitwise array
|
||||
* Last Updated: $Date: 2011-06-27 06:48:51 -0400 (Mon, 27 Jun 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9090 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -154,11 +154,7 @@ $_BITWISE = array( 'moderators' => array( 'bw_flag_spammers',
|
||||
'bw_mod_soft_delete',
|
||||
'bw_mod_un_soft_delete',
|
||||
'bw_mod_soft_delete_see',
|
||||
'bw_mod_soft_delete_topic',
|
||||
'bw_mod_un_soft_delete_topic',
|
||||
'bw_mod_soft_delete_topic_see',
|
||||
'bw_mod_soft_delete_reason',
|
||||
'bw_mod_soft_delete_see_post' ),
|
||||
),
|
||||
'forums' => array( 'bw_disable_tagging',
|
||||
'bw_disable_prefixes' ),
|
||||
'posts' => array( 'bw_post_from_mobile') );
|
||||
'posts' => array( 'bw_post_from_mobile' ) );
|
||||
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Define data hook locations (Forums)
|
||||
* Last Updated: $Date: 2011-05-18 04:49:10 -0400 (Wed, 18 May 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8812 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
$dataHookLocations = array(
|
||||
@@ -28,8 +28,8 @@ $dataHookLocations = array(
|
||||
array( 'postAddTopicPoll', 'New Topic: Poll' ),
|
||||
array( 'editPostAddPoll', 'Edit Post: Added Poll' ),
|
||||
array( 'editPostUpdatePoll', 'Edit Post: Updated Poll' ),
|
||||
array( 'editPostUpdateTopicTitle', 'Edit Post: Update Topic Title'),
|
||||
array( 'editPostData', 'Edit Post: Post Data' ),
|
||||
array( 'editPostTopicData', 'Edit Post: Update Topic'),
|
||||
array( 'updateForumLastPostData', 'Forum last post update data' ),
|
||||
array( 'incrementUsersPostCount', 'Increment users post count' ),
|
||||
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* BBCode Management : Determines if bbcode can be used in this section
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
|
||||
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
|
||||
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
* An array of key => value pairs
|
||||
* When going to parse, the key should be passed to the editor
|
||||
* to determine which bbcodes should be parsed in the section
|
||||
*
|
||||
*/
|
||||
$BBCODE = array(
|
||||
'topics' => ipsRegistry::getClass('class_localization')->words['ctype__topics'],
|
||||
'announcement' => ipsRegistry::getClass('class_localization')->words['ctype__announcement'],
|
||||
'rules' => ipsRegistry::getClass('class_localization')->words['ctype__rules'],
|
||||
);
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.1
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2009-03-04 15:08:31 +0000 (Wed, 04 Mar 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package Invision Power Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 4136 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* SEO templates
|
||||
*
|
||||
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
|
||||
*
|
||||
* OUT FORMAT REGEX:
|
||||
* First array element is a regex to run to see if we've a match for the URL
|
||||
* The second array element is the template to use the results of the parenthesis capture
|
||||
*
|
||||
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
|
||||
*
|
||||
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
|
||||
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
|
||||
*
|
||||
* IN FORMAT REGEX
|
||||
*
|
||||
* This allows the registry to piece back together a URL based on the template regex
|
||||
* So, for example: "/user/(\d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
|
||||
* of the parenthesis capture #1
|
||||
*/
|
||||
$_SEOTEMPLATES = array(
|
||||
|
||||
'showannouncement' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showannouncement=(.+?)((?:&|&)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1/$4' ),
|
||||
'in' => array( 'regex' => "#/forum-(\d+?)?/announcement-(\d+)/?#i",
|
||||
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),
|
||||
|
||||
'showforum' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1/$2' ),
|
||||
'in' => array( 'regex' => "#/forum/(\d+)/?#i",
|
||||
'matches' => array( array( 'showforum', '$1' ) ) ) ),
|
||||
|
||||
'showtopic' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1/$2' ),
|
||||
'in' => array( 'regex' => "#/topic/(\d+)/?#i",
|
||||
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
|
||||
|
||||
'act=idx' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 0,
|
||||
'out' => array( '#act=idx(&|$)#i', 'index' ),
|
||||
'in' => array( 'regex' => "#/index$#i",
|
||||
'matches' => array( array( 'act', 'idx' ) ) ) ),
|
||||
);
|
||||
|
||||
@@ -1,206 +1,205 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class furlRedirect_forums
|
||||
{
|
||||
/**
|
||||
* Key type: Type of action (topic/forum)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_type = '';
|
||||
|
||||
/**
|
||||
* Key ID
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_id = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $registry->DB();
|
||||
$this->settings =& $registry->fetchSettings();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the key ID
|
||||
* @example furlRedirect_forums::setKey( 'topic', 12 );
|
||||
*
|
||||
* @param string Type
|
||||
* @param mixed Value
|
||||
*/
|
||||
public function setKey( $name, $value )
|
||||
{
|
||||
$this->_type = $name;
|
||||
$this->_id = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the key by URI
|
||||
*
|
||||
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
|
||||
* @return @e void
|
||||
*/
|
||||
public function setKeyByUri( $uri )
|
||||
{
|
||||
$uri = str_replace( '&', '&', $uri );
|
||||
|
||||
if ( strstr( $uri, '?' ) )
|
||||
{
|
||||
list( $_chaff, $uri ) = explode( '?', $uri );
|
||||
}
|
||||
|
||||
foreach( explode( '&', $uri ) as $bits )
|
||||
{
|
||||
list( $k, $v ) = explode( '=', $bits );
|
||||
|
||||
if ( $k )
|
||||
{
|
||||
if ( $k == 'showtopic' )
|
||||
{
|
||||
$this->setKey( 'topic', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if( $k == 'act' AND $v == 'ST' )
|
||||
{
|
||||
$this->setKey( 'topic', intval( $_REQUEST['t'] ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if ( $k == 'showforum' )
|
||||
{
|
||||
$this->setKey( 'forum', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if( $k == 'showannouncement' )
|
||||
{
|
||||
$this->setKey( 'announcement', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title
|
||||
*
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function fetchSeoTitle()
|
||||
{
|
||||
switch ( $this->_type )
|
||||
{
|
||||
default:
|
||||
return FALSE;
|
||||
break;
|
||||
case 'topic':
|
||||
return $this->_fetchSeoTitle_topic();
|
||||
break;
|
||||
case 'forum':
|
||||
return $this->_fetchSeoTitle_forum();
|
||||
break;
|
||||
case 'announcement':
|
||||
return $this->_fetchSeoTitle_announcement();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for a topic
|
||||
*
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_topic()
|
||||
{
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
|
||||
'from' => 'topics',
|
||||
'where' => 'tid=' . intval( $this->_id ) ) );
|
||||
|
||||
if ( $topic['tid'] )
|
||||
{
|
||||
/* Check permission */
|
||||
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( IPB_USE_ONLY_ID_FURL ) return $topic['tid'];
|
||||
|
||||
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for a forum
|
||||
*
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_forum()
|
||||
{
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( intval( $this->_id ) );
|
||||
|
||||
if ( $forum['id'] )
|
||||
{
|
||||
/* Check permission */
|
||||
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for an announcement
|
||||
*
|
||||
* @return string The SEO friendly name
|
||||
*/
|
||||
public function _fetchSeoTitle_announcement()
|
||||
{
|
||||
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
|
||||
|
||||
if ( $announce['announce_id'] )
|
||||
{
|
||||
return $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class furlRedirect_forums
|
||||
{
|
||||
/**
|
||||
* Key type: Type of action (topic/forum)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_type = '';
|
||||
|
||||
/**
|
||||
* Key ID
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_id = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $registry->DB();
|
||||
$this->settings =& $registry->fetchSettings();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the key ID
|
||||
*
|
||||
* @param string Type
|
||||
* @param mixed Value
|
||||
* @return @e void
|
||||
*/
|
||||
public function setKey( $name, $value )
|
||||
{
|
||||
$this->_type = $name;
|
||||
$this->_id = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the key by URI
|
||||
*
|
||||
* @param string URI (example: index.php?showtopic=5&view=getlastpost)
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function setKeyByUri( $uri )
|
||||
{
|
||||
$uri = str_replace( '&', '&', $uri );
|
||||
|
||||
if ( strstr( $uri, '?' ) )
|
||||
{
|
||||
list( $_chaff, $uri ) = explode( '?', $uri );
|
||||
}
|
||||
|
||||
foreach( explode( '&', $uri ) as $bits )
|
||||
{
|
||||
list( $k, $v ) = explode( '=', $bits );
|
||||
|
||||
if ( $k )
|
||||
{
|
||||
if ( $k == 'showtopic' )
|
||||
{
|
||||
$this->setKey( 'topic', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if( $k == 'act' AND $v == 'ST' )
|
||||
{
|
||||
$this->setKey( 'topic', intval( $_REQUEST['t'] ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if ( $k == 'showforum' )
|
||||
{
|
||||
$this->setKey( 'forum', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
else if( $k == 'showannouncement' )
|
||||
{
|
||||
$this->setKey( 'announcement', intval( $v ) );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title
|
||||
*
|
||||
* @return @e mixed The SEO friendly name or boolean false
|
||||
*/
|
||||
public function fetchSeoTitle()
|
||||
{
|
||||
switch ( $this->_type )
|
||||
{
|
||||
default:
|
||||
return FALSE;
|
||||
break;
|
||||
case 'topic':
|
||||
return $this->_fetchSeoTitle_topic();
|
||||
break;
|
||||
case 'forum':
|
||||
return $this->_fetchSeoTitle_forum();
|
||||
break;
|
||||
case 'announcement':
|
||||
return $this->_fetchSeoTitle_announcement();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for a topic
|
||||
*
|
||||
* @return @e mixed The SEO friendly name or boolean false
|
||||
*/
|
||||
public function _fetchSeoTitle_topic()
|
||||
{
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'tid, title_seo, title, forum_id',
|
||||
'from' => 'topics',
|
||||
'where' => 'tid=' . intval( $this->_id ) ) );
|
||||
|
||||
if ( $topic['tid'] )
|
||||
{
|
||||
/* Check permission */
|
||||
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $topic['forum_id'], 0, 'topic', $topic, TRUE ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ( $topic['title_seo'] ) ? $topic['title_seo'] : IPSText::makeSeoTitle( $topic['title'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for a forum
|
||||
*
|
||||
* @return @e mixed The SEO friendly name or boolean false
|
||||
*/
|
||||
public function _fetchSeoTitle_forum()
|
||||
{
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( intval( $this->_id ) );
|
||||
|
||||
if ( $forum['id'] )
|
||||
{
|
||||
/* Check permission */
|
||||
if ( ! $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), TRUE ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return ( $forum['name_seo'] ) ? $forum['name_seo'] : IPSText::makeSeoTitle( $forum['name'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SEO title for an announcement
|
||||
*
|
||||
* @return @e mixed The SEO friendly name or boolean false
|
||||
*/
|
||||
public function _fetchSeoTitle_announcement()
|
||||
{
|
||||
$announce = $this->caches['announcements'][ intval( $this->_id ) ];
|
||||
|
||||
if ( $announce['announce_id'] )
|
||||
{
|
||||
return $announce['announce_seo_title'] ? $announce['announce_seo_title'] : IPSText::makeSeoTitle( $announce['announce_title'] );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Sets up SEO templates
|
||||
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 9351 $
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@ $_SEOTEMPLATES = array(
|
||||
|
||||
'showtopic' => array( 'app' => 'forums',
|
||||
'allowRedirect' => 1,
|
||||
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
|
||||
'out' => array( '#showtopic=(.+?)(\#|&|$)#i', 'topic/$1-#{__title__}/$2' ),
|
||||
'in' => array( 'regex' => '#^/topic/(\d+?)-#i',
|
||||
'matches' => array( array( 'showtopic', '$1' ) ) ) ),
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,329 +1,347 @@
|
||||
<?php
|
||||
/**
|
||||
* @file forums.php Forums like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since 15th Feb 2011
|
||||
* $LastChangedDate: 2011-09-30 05:21:05 -0400 (Fri, 30 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9571 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class like_forums_forums_composite
|
||||
* @brief Forums like class (forums application)
|
||||
*/
|
||||
class like_forums_forums_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'forum';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'forums', $this->lang->words['follow_notify_forums'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_f';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $metaData['like_rel_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$forum = array_merge( $data, $this->registry->permissions->parse( $data ) );
|
||||
$fFurl = $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $forum['id'], 'publicNoSession', $forum['name_seo'], 'showforum' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $forum['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bndf'][ $forum['id'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$topics = $this->registry->getClass('topics')->getTopics( array( 'forumId' => $forum['id'],
|
||||
'topicType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'getFirstPost' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $topics as $pid => $topic )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $topic['starter_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $this->lang->words['topic_langbit'] . ": " . $topic['title'] . " ( ". $topic['starter_name'] . " -- " . ipsRegistry::getClass('class_localization')->getDate( $topic['start_date'], 'SHORT' ) . ")<br />"
|
||||
. $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' )
|
||||
. "<br />............................................<br />"
|
||||
. $topic['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output = $this->lang->words['forum_langbit'] . ":" . $forum['name'] . ")<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bndf'][ $forum['id'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bndf'][ $forum['id'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_forums_digest',
|
||||
'notification_url' => $fFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_forum_daily' : 'digest_forum_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_forum_daily'] : $this->lang->words['subject__digest_forum_weekly'],
|
||||
'build_message_array' => array( 'URL' => $fFurl,
|
||||
'TITLE' => $forum['name'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'FORUM_NAME' => $forum['name'],
|
||||
'FORUM_ID' => $forum['id'],
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 'f.*', 'from' => array( 'forums' => 'f'), 'where' => 'f.id=' . $field, 'type' => 'left' ),
|
||||
array( 'select' => 'p.*', 'from' => array( 'permission_index' => 'p'), 'where' => "p.perm_type_id=f.id AND p.app='forums' AND p.perm_type='forum'", 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'p.id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=f.parent_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.title'] = $row['name'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showforum=" . $row['id'], "public", $row['name_seo'], "showforum" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.type'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentType'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file forums.php Forums like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 15th Feb 2011
|
||||
* $LastChangedDate: 2012-06-20 06:37:39 -0400 (Wed, 20 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10955 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class like_forums_forums_composite
|
||||
* @brief Forums like class (forums application)
|
||||
*/
|
||||
class like_forums_forums_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'forum';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'forums', $this->lang->words['follow_notify_forums'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_f';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
$group = $this->caches['group_cache'][ $metaData['member_group_id'] ];
|
||||
|
||||
/* Can only see own topics? */
|
||||
if ( ! $group['g_other_topics'] )
|
||||
{
|
||||
/* Send nothing because we can only see our topics and we never get notification of our own content */
|
||||
return false;
|
||||
}
|
||||
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $metaData['like_rel_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $metaData );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$forum = array_merge( $data, $this->registry->permissions->parse( $data ) );
|
||||
$fFurl = $this->registry->getClass('output')->buildSEOUrl( 'showforum=' . $forum['id'], 'publicNoSession', $forum['name_seo'], 'showforum' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $forum['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', array(), true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bndf'][ $forum['id'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$topics = $this->registry->getClass('topics')->getTopics( array( 'forumId' => $forum['id'],
|
||||
'topicType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'getFirstPost' => true,
|
||||
'sortField' => 'tid',
|
||||
'sortOrder' => 'asc',
|
||||
'limit' => 50 ) );
|
||||
|
||||
foreach( $topics as $pid => $topic )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $topic['starter_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $this->lang->words['follow_topic'] . ": " . $topic['title'] . " ( ". $topic['starter_name'] . " -- " . ipsRegistry::getClass('class_localization')->getDate( $topic['start_date'], 'SHORT' ) . ")<br />"
|
||||
. $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' )
|
||||
. "<br />............................................<br />"
|
||||
. $topic['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output = $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bndf'][ $forum['id'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bndf'][ $forum['id'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_forums_digest',
|
||||
'notification_url' => $fFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_forum_daily' : 'digest_forum_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_forum_daily'] : $this->lang->words['subject__digest_forum_weekly'],
|
||||
'build_message_array' => array( 'URL' => $fFurl,
|
||||
'TITLE' => $forum['name'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'FORUM_NAME' => $forum['name'],
|
||||
'FORUM_ID' => $forum['id'],
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 'f.*', 'from' => array( 'forums' => 'f'), 'where' => 'f.id=' . $field, 'type' => 'left' ),
|
||||
array( 'select' => 'p.*', 'from' => array( 'permission_index' => 'p'), 'where' => "p.perm_type_id=f.id AND p.app='forums' AND p.perm_type='forum'", 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'p.id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=f.parent_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.title'] = $row['name'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showforum=" . $row['id'], "public", $row['name_seo'], "showforum" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.type'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['id'] ]['like.parentType'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'extraWhere' => $this->DB->buildWherePermission( $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] ), 'l.like_rel_id', FALSE ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,359 +1,361 @@
|
||||
<?php
|
||||
/**
|
||||
* @file topics.php Topics like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* $LastChangedDate: 2011-10-05 16:14:58 -0400 (Wed, 05 Oct 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9584 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class like_forums_topics_composite
|
||||
* @brief Topics like class (forums application)
|
||||
*/
|
||||
class like_forums_topics_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'topic';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'topics', $this->lang->words['follow_notify_topics'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_t';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
/* Digests are checked in buildNotificationData */
|
||||
$topic = $this->registry->getClass('topics')->getTopicById( $metaData['like_rel_id'] );
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $metaData );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to let plugins determine if a notification should not be sent. Return false to send notification, or true to skip sending it.
|
||||
*
|
||||
* @param array Notification data
|
||||
* @return @e bool
|
||||
*/
|
||||
public function excludeNotification( $row )
|
||||
{
|
||||
if ( $row['like_notify_freq'] == 'offline' AND $row['last_activity'] < $row['like_notify_sent'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$topic = $data;
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
$flag = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
$tFurl = $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $topic['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Unapproved or deleted */
|
||||
if ( $flag != 'visible' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bnd'][ $topic['tid'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$posts = $this->registry->getClass('topics')->getPosts( array( 'topicId' => $topic['tid'],
|
||||
'postType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'sortField' => 'pid',
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $posts as $pid => $post )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $post['author_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $post['author_name'] . " -- " . ipsRegistry::getClass( 'class_localization')->getDate( $post['post_date'], 'SHORT' ) . "<br />" . $post['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output .= $this->lang->words['topic_langbit'] . ": " . $topic['title'] . " (" . $this->lang->words['forum_langbit'] . ":" . $forum['name'] . ")<br />"
|
||||
. $tFurl . "<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bnd'][ $topic['tid'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bnd'][ $topic['tid'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_topics_digest',
|
||||
'notification_url' => $tFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_topic_daily' : 'digest_topic_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_topic_daily'] : $this->lang->words['subject__digest_topic_weekly'],
|
||||
'build_message_array' => array( 'URL' => $tFurl,
|
||||
'TITLE' => $topic['title'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 't.*', 'from' => array( 'topics' => 't'), 'where' => 't.tid=' . $field, 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=t.forum_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.title'] = $row['title'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showtopic=" . $row['tid'], "public", $row['title_seo'], "showtopic" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.type'] = $this->lang->words['follow_topic'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentType'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => 'l.like_rel_id=t.tid',
|
||||
'order' => 't.last_post' );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file topics.php Topics like class (forums application)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* $LastChangedDate: 2012-06-20 06:37:39 -0400 (Wed, 20 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10955 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class like_forums_topics_composite
|
||||
* @brief Topics like class (forums application)
|
||||
*/
|
||||
class like_forums_topics_composite extends classes_like_composite
|
||||
{
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $request
|
||||
* @var $lang
|
||||
* @var $member
|
||||
* @var $memberData
|
||||
* @var $cache
|
||||
* @var $caches
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
/* Init */
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'public_forums', 'public_topic' ), 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the template group
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function skin()
|
||||
{
|
||||
return 'topic';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of acceptable frequencies
|
||||
* Possible: immediate, offline, daily, weekly
|
||||
*
|
||||
* @return @e array
|
||||
*/
|
||||
public function allowedFrequencies()
|
||||
{
|
||||
return array( 'immediate', 'offline', 'daily', 'weekly' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return types of notification available for this item
|
||||
*
|
||||
* @return @e array array( key, human readable )
|
||||
*/
|
||||
public function getNotifyType()
|
||||
{
|
||||
return array( 'topics', $this->lang->words['follow_notify_topics'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vernacular (like or follow)
|
||||
*
|
||||
* @return @e string
|
||||
*/
|
||||
public function getVernacular()
|
||||
{
|
||||
return 'follow_t';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check notifications that are to be sent to make sure they're valid and that
|
||||
*
|
||||
* @param array $metaData like_ DB data and like owner member data
|
||||
* @return @e boolean
|
||||
*/
|
||||
public function notificationCanSend( $metaData )
|
||||
{
|
||||
/* Digests are checked in buildNotificationData */
|
||||
$topic = $this->registry->getClass('topics')->getTopicById( $metaData['like_rel_id'] );
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $metaData );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to let plugins determine if a notification should not be sent. Return false to send notification, or true to skip sending it.
|
||||
*
|
||||
* @param array Notification data
|
||||
* @return @e bool
|
||||
*/
|
||||
public function excludeNotification( $row )
|
||||
{
|
||||
if ( $row['like_notify_freq'] == 'offline' AND $row['last_activity'] < $row['like_notify_sent'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the notification data via the app class
|
||||
*
|
||||
* @param array $data like_ DB data and like owner member data
|
||||
* @param string $type Types of notifications to send
|
||||
* @return @e array array( notification_key, notification_url, email_template, email_subject, build_message_array )
|
||||
* @see allowedFrequencies()
|
||||
*/
|
||||
public function buildNotificationData( $data, $type )
|
||||
{
|
||||
$topic = $data;
|
||||
$forum = $this->registry->getClass('class_forums')->getForumById( $topic['forum_id'] );
|
||||
$flag = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
$tFurl = $this->registry->getClass('output')->buildSEOUrl( 'showtopic=' . $topic['tid'], 'publicNoSession', $topic['title_seo'], 'showtopic' );
|
||||
$group = $this->caches['group_cache'][ $data['member_group_id'] ];
|
||||
|
||||
/* Topic has been posted in since last digest? */
|
||||
if ( $topic['last_post'] <= $data['like_notify_sent'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Unapproved or deleted */
|
||||
if ( $flag != 'visible' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set member */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $data );
|
||||
|
||||
$result = $this->registry->getClass('class_forums')->forumsCheckAccess( $forum['id'], 0, 'forum', $topic, true );
|
||||
|
||||
/* reset */
|
||||
$this->registry->getClass('class_forums')->setMemberData( $this->memberData );
|
||||
|
||||
if ( ! $result )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* build email unless cached */
|
||||
if ( empty( $this->_cache['bnd'][ $topic['tid'] ] ) )
|
||||
{
|
||||
$othersPosted = false;
|
||||
$posts = $this->registry->getClass('topics')->getPosts( array( 'topicId' => $topic['tid'],
|
||||
'postType' => 'visible',
|
||||
'dateIsGreater' => $data['like_notify_sent'],
|
||||
'sortField' => 'pid',
|
||||
'limit' => 50,
|
||||
'sortOrder' => 'asc' ) );
|
||||
|
||||
foreach( $posts as $pid => $post )
|
||||
{
|
||||
/* Don't send if it's just us... */
|
||||
if ( $data['like_member_id'] != $post['author_id'] )
|
||||
{
|
||||
$othersPosted = true;
|
||||
}
|
||||
|
||||
$post_output .= "<br />-------------------------------------------<br />"
|
||||
. $post['author_name'] . " -- " . ipsRegistry::getClass( 'class_localization')->getDate( $post['post_date'], 'SHORT' ) . "<br />" . $post['post'] . "<br /><br />";
|
||||
}
|
||||
|
||||
/* ensure we have something to send */
|
||||
if ( ! $post_output )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Process it */
|
||||
$main_output .= $this->lang->words['follow_topic'] . ": " . $topic['title'] . " (" . $this->lang->words['follow_forum'] . ":" . $forum['name'] . ")<br />"
|
||||
. $tFurl . "<br />"
|
||||
. "=====================================<br />"
|
||||
. $post_output
|
||||
. "<br />=====================================<br />";
|
||||
|
||||
$this->_cache['bnd'][ $topic['tid'] ] = $main_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$othersPosted = true;
|
||||
$main_output = $this->_cache['bnd'][ $topic['tid'] ];
|
||||
}
|
||||
|
||||
if ( $othersPosted )
|
||||
{
|
||||
/* Return array */
|
||||
return array( 'notification_key' => 'followed_topics_digest',
|
||||
'notification_url' => $tFurl,
|
||||
'email_template' => ( $data['like_notify_freq'] == 'daily' ) ? 'digest_topic_daily' : 'digest_topic_weekly',
|
||||
'email_subject' => ( $data['like_notify_freq'] == 'daily' ) ? $this->lang->words['subject__digest_topic_daily'] : $this->lang->words['subject__digest_topic_weekly'],
|
||||
'build_message_array' => array( 'URL' => $tFurl,
|
||||
'TITLE' => $topic['title'],
|
||||
'NAME' => '-member:members_display_name-',
|
||||
'CONTENT' => $main_output ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches joins for fetching data
|
||||
*
|
||||
* @param string $field DB field name (defaults to 'l.like_rel_id')
|
||||
* @return @e array
|
||||
*/
|
||||
public function getDataJoins( $field='l.like_rel_id' )
|
||||
{
|
||||
return array( array( 'select' => 't.*, t.last_post as topic_last_post', 'from' => array( 'topics' => 't' ), 'where' => 't.tid=' . $field, 'type' => 'left' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of item
|
||||
*
|
||||
* @param mixed $relId Relationship ID or array of IDs
|
||||
* @param array $selectType Array of meta to select (title, url, type, parentTitle, parentUrl, parentType) null fetches all
|
||||
* @return @e array Meta data
|
||||
*/
|
||||
public function getMeta( $relId, $selectType=null )
|
||||
{
|
||||
$return = array();
|
||||
$isNumeric = false;
|
||||
|
||||
if ( is_numeric( $relId ) )
|
||||
{
|
||||
$relId = array( intval($relId) );
|
||||
$isNumeric = true;
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid IN (' . implode( ',', $relId ) . ')',
|
||||
'add_join' => array( array( 'select' => 'id as parent_fid, p.name as parent_name, p.name_seo as parent_name_seo',
|
||||
'from' => array( 'forums' => 'p' ),
|
||||
'where' => 'p.id=t.forum_id',
|
||||
'type' => 'left' ) ) ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'title', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.title'] = $row['title'];
|
||||
}
|
||||
|
||||
/* URL */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'url', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.url'] = $this->registry->output->buildSEOUrl( "showtopic=" . $row['tid'], "public", $row['title_seo'], "showtopic" );
|
||||
}
|
||||
|
||||
/* Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'type', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.type'] = $this->lang->words['follow_topic'];
|
||||
}
|
||||
|
||||
/* Parent title */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentTitle'] = ( ! empty( $row['parent_name'] ) ) ? $row['parent_name'] : null;
|
||||
}
|
||||
|
||||
/* Parent url */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentTitle', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentUrl'] = ( ! empty( $row['parent_name'] ) ) ? $this->registry->output->buildSEOUrl( "showforum=" . $row['parent_fid'], "public", $row['parent_name_seo'], "showforum" ) : null;
|
||||
}
|
||||
|
||||
/* Parent Type */
|
||||
if ( $selectType === null OR ( is_array( $selectType ) AND in_array( 'parentType', $selectType ) ) )
|
||||
{
|
||||
$return[ $row['tid'] ]['like.parentType'] = $this->lang->words['follow_forum'];
|
||||
}
|
||||
}
|
||||
|
||||
return ( $isNumeric === true ) ? array_pop( $return ) : $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the join table for sorting when using 'view content I follow'
|
||||
* core_like has the alias "l".
|
||||
*/
|
||||
public function getSearchJoinAndSortBy()
|
||||
{
|
||||
return array( 'from' => array( 'topics' => 't' ),
|
||||
'where' => 'l.like_rel_id=t.tid',
|
||||
'order' => 't.last_post',
|
||||
'extraWhere' => $this->DB->buildWherePermission( $this->registry->class_forums->fetchSearchableForumIds( $this->memberData['member_id'] ), 't.forum_id', FALSE ) );
|
||||
}
|
||||
}
|
||||
@@ -1,206 +1,206 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Synchronization extensions
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
class forumsMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a new account is created
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onCreateAccount( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when the register form is displayed to a user
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function onRegisterForm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is ren when a user successfully logs in
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogin( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member's account has been merged into another member's account
|
||||
*
|
||||
* @param array $member Member account being kept
|
||||
* @param array $member2 Member account being removed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users email address is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_email New email address
|
||||
* @param string $old_email Old email address
|
||||
* @return void
|
||||
*/
|
||||
public function onEmailChange( $id, $new_email, $old_email )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users password is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_plain_text_pass The new password
|
||||
* @return @e void
|
||||
*/
|
||||
public function onPassChange( $id, $new_plain_text_pass )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users profile is successfully updated
|
||||
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
|
||||
* IPSMember::save().
|
||||
*
|
||||
* @param array $member Array of values that were changed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onProfileUpdate( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users group is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param integer $new_group New Group ID
|
||||
* @param integer $old_group Old Group ID
|
||||
* @return @e void
|
||||
*/
|
||||
public function onGroupChange( $id, $new_group, $old_group )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users display name is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_name New display name
|
||||
* @return @e void
|
||||
*/
|
||||
public function onNameChange( $id, $new_name )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user logs out
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogOut( $member )
|
||||
{
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Forum permissions mappings
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Synchronization extensions
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
class forumsMemberSync
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a member is un-flagged as a spammer
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onUnSetAsSpammer( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a new account is created
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onCreateAccount( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when the register form is displayed to a user
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function onRegisterForm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user successfully logs in
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogin( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member account has been removed
|
||||
*
|
||||
* @param string $ids SQL IN() clause
|
||||
* @return @e void
|
||||
*/
|
||||
public function onDelete( $mids )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called after a member's account has been merged into another member's account
|
||||
*
|
||||
* @param array $member Member account being kept
|
||||
* @param array $member2 Member account being removed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onMerge( $member, $member2 )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users email address is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_email New email address
|
||||
* @param string $old_email Old email address
|
||||
* @return void
|
||||
*/
|
||||
public function onEmailChange( $id, $new_email, $old_email )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users password is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_plain_text_pass The new password
|
||||
* @return @e void
|
||||
*/
|
||||
public function onPassChange( $id, $new_plain_text_pass )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users profile is successfully updated
|
||||
* $member will contain EITHER 'member_id' OR 'email' depending on what data was passed to
|
||||
* IPSMember::save().
|
||||
*
|
||||
* @param array $member Array of values that were changed
|
||||
* @return @e void
|
||||
*/
|
||||
public function onProfileUpdate( $member )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users group is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param integer $new_group New Group ID
|
||||
* @param integer $old_group Old Group ID
|
||||
* @return @e void
|
||||
*/
|
||||
public function onGroupChange( $id, $new_group, $old_group )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run after a users display name is successfully changed
|
||||
*
|
||||
* @param integer $id Member ID
|
||||
* @param string $new_name New display name
|
||||
* @return @e void
|
||||
*/
|
||||
public function onNameChange( $id, $new_name )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is run when a user logs out
|
||||
*
|
||||
* @param array $member Array of member data
|
||||
* @return @e void
|
||||
*/
|
||||
public function onLogOut( $member )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_announcements.php Moderator control panel plugin: manage announcements
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/18/2011
|
||||
* $LastChangedDate: 2011-09-26 15:52:07 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9550 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -170,7 +170,7 @@ class plugin_forums_announcements
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['announce_seo_title'] = IPSText::makeSeoTitle( $r['announce_title'] );
|
||||
$r['announce_seo_title'] = $r['announce_seo_title'] ? $r['announce_seo_title'] : IPSText::makeSeoTitle( $r['announce_title'] );
|
||||
|
||||
if ( $r['announce_forum'] == '*' )
|
||||
{
|
||||
@@ -211,6 +211,12 @@ class plugin_forums_announcements
|
||||
*/
|
||||
protected function _delete()
|
||||
{
|
||||
|
||||
if ( $this->request['secure_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10311902, null, null, 403 );
|
||||
}
|
||||
|
||||
$announce_id = intval( $this->request['announce_id'] );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -268,7 +274,7 @@ class plugin_forums_announcements
|
||||
{
|
||||
if ( !empty($this->request[$bit]) )
|
||||
{
|
||||
$announce[ $bit ] = $this->request[ $bit ];
|
||||
$announce[ $bit ] = $bit == 'announce_post' ? $_POST[ $bit ] : $this->request[ $bit ];
|
||||
}
|
||||
else if( !isset($announce[ $bit] ) )
|
||||
{
|
||||
@@ -315,6 +321,12 @@ class plugin_forums_announcements
|
||||
*/
|
||||
protected function _save( $type='add' )
|
||||
{
|
||||
|
||||
if ( $this->request['secure_key'] != $this->member->form_hash )
|
||||
{
|
||||
$this->registry->output->showError( 'no_permission', 10311903, null, null, 403 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
@@ -419,7 +431,8 @@ class plugin_forums_announcements
|
||||
'announce_html_enabled' => $this->request['announce_html_enabled'] ? $this->request['announce_html_enabled'] : 0,
|
||||
'announce_nlbr_enabled' => $this->request['announce_nlbr_enabled'] ? $this->request['announce_nlbr_enabled'] : 0,
|
||||
'announce_start' => $start_date,
|
||||
'announce_end' => $end_date
|
||||
'announce_end' => $end_date,
|
||||
'announce_seo_title' => IPSText::makeSeoTitle( $this->request['announce_title'] ),
|
||||
);
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_deletedposts.php Moderator control panel plugin: show deleted posts
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ class plugin_forums_deletedposts
|
||||
'currentStartValue' => $st,
|
||||
'baseUrl' => "app=core&module=modcp&fromapp=forums&tab=deletedposts",
|
||||
) );
|
||||
|
||||
|
||||
return $this->registry->output->getTemplate('modcp')->deletedPosts( $posts, $other_data, $pages );
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ class plugin_forums_deletedposts
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_post'] )
|
||||
if( $forum['bw_mod_soft_delete_see'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_deletedtopics.php Moderator control panel plugin: show deleted topics
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -246,23 +246,23 @@ class plugin_forums_deletedtopics
|
||||
*/
|
||||
protected function _getFilters()
|
||||
{
|
||||
$_return = array();
|
||||
$_return = array();
|
||||
|
||||
if( $this->memberData['g_is_supmod'] )
|
||||
{
|
||||
$_return['skipForumCheck'] = true;
|
||||
$_return['skipForumCheck'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_return['forumId'] = array( 0 );
|
||||
$_return['forumId'] = array( 0 );
|
||||
|
||||
if( count($this->memberData['forumsModeratorData']) )
|
||||
{
|
||||
foreach( $this->memberData['forumsModeratorData'] as $fid => $forum )
|
||||
{
|
||||
if( $forum['delete_topic'] )
|
||||
if( $forum['bw_mod_soft_delete_see'] )
|
||||
{
|
||||
$_return['forumId'][] = $fid;
|
||||
$_return['forumId'][] = $fid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file plugin_unapprovedposts.php Moderator control panel plugin: show posts pending approval
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8930 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file plugin_unapprovedtopics.php Moderator control panel plugin: show topics pending approval
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* @since 2/15/2011
|
||||
* $LastChangedDate: 2011-05-31 14:07:00 -0400 (Tue, 31 May 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8930 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ class plugin_forums_unapprovedtopics
|
||||
$topics = $this->registry->getClass('topics')->getTopics( $_filters );
|
||||
$total = $this->registry->getClass('topics')->getTopicsCount();
|
||||
$final = array();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Format data
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
/**
|
||||
* @file generate.php Navigation plugin: attachments
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 3/8/2011
|
||||
* $LastChangedDate: 2011-03-31 06:17:44 -0400 (Thu, 31 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8229 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,51 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2011-03-29 08:39:51 -0400 (Tue, 29 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 8208 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification types
|
||||
*/
|
||||
|
||||
class forums_notifications
|
||||
{
|
||||
public function getConfiguration()
|
||||
{
|
||||
/**
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'post_quoted', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_quoted' ),
|
||||
array( 'key' => 'new_likes', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
// This is defined in ACP forum settings as an email, so it's not mapped to a specific member
|
||||
//array( 'key' => 'new_topic_queue', 'default' => array( 'email' ), 'disabled' => array() ),
|
||||
);/*noLibHook*/
|
||||
return $_NOTIFY;
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Define the core notification types
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Rev: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification types
|
||||
*/
|
||||
|
||||
class forums_notifications
|
||||
{
|
||||
public function getConfiguration()
|
||||
{
|
||||
/**
|
||||
* Notification types - Needs to be a method so when require_once is used, $_NOTIFY isn't empty
|
||||
*/
|
||||
$_NOTIFY = array(
|
||||
array( 'key' => 'post_quoted', 'default' => array(), 'disabled' => array(), 'icon' => 'notify_quoted' ),
|
||||
array( 'key' => 'new_likes', 'default' => array( 'inline' ), 'disabled' => array(), 'icon' => 'notify_newreply', 'show_callback' => TRUE ),
|
||||
array( 'key' => 'followed_topics', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums', 'default' => array( 'email' ), 'disabled' => array(), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_topics_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
array( 'key' => 'followed_forums_digest', 'default' => array( 'email' ), 'disabled' => array('inline'), 'icon' => 'notify_newreply' ),
|
||||
// This is defined in ACP forum settings as an email, so it's not mapped to a specific member
|
||||
//array( 'key' => 'new_topic_queue', 'default' => array( 'email' ), 'disabled' => array() ),
|
||||
);/*noLibHook*/
|
||||
return $_NOTIFY;
|
||||
}
|
||||
|
||||
function new_likes()
|
||||
{
|
||||
return (bool) (
|
||||
ipsRegistry::$settings['reputation_enabled'] and
|
||||
!in_array( ipsRegistry::member()->getProperty('member_group_id'), explode( ',', ipsRegistry::$settings['reputation_protected_groups'] ) ) and
|
||||
ipsRegistry::$settings['reputation_point_types'] == 'like'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Config for posts plugin
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7442 $
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,4 +47,4 @@ $CONFIG['plugin_enabled'] = 1;
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 4;
|
||||
$CONFIG['plugin_order'] = 5;
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2011-07-27 10:14:00 -0400 (Wed, 27 Jul 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 9326 $
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Config for topics plugin
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 7442 $
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,4 +47,4 @@ $CONFIG['plugin_enabled'] = 1;
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
$CONFIG['plugin_order'] = 3;
|
||||
$CONFIG['plugin_order'] = 4;
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Profile Plugin Library
|
||||
* Last Updated: $Date: 2011-07-21 05:49:32 -0400 (Thu, 21 Jul 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 20th February 2002
|
||||
* @version $Revision: 9298 $
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,49 +1,224 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Reputation configuration for application
|
||||
* Last Updated: $Date: 2010-12-17 07:40:13 -0500 (Fri, 17 Dec 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 7442 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
$rep_author_config = array(
|
||||
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
|
||||
);
|
||||
|
||||
/**
|
||||
* The following config items are for the log viewer in the ACP
|
||||
*/
|
||||
|
||||
$rep_log_joins = array(
|
||||
array(
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.title as repContentTitle, t.tid as repContentID',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
);
|
||||
|
||||
$rep_log_where = "p.author_id=%s";
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Reputation configuration for application
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class reputation_forums
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Init attachments */
|
||||
$classname = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
|
||||
$this->class_attach = new $classname( ipsRegistry::instance() );
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' );
|
||||
|
||||
$this->class_attach->type = 'post';
|
||||
$this->class_attach->init();
|
||||
$this->class_attach->getUploadFormSettings();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache' );
|
||||
ipsRegistry::setClass( 'repCache', new $classToLoad() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Database Query to get results
|
||||
*
|
||||
* @param string 'given' if we want to return items as user has liked
|
||||
* 'received' if we want to fetch items a user has posted that others have liked
|
||||
'most' if we want to fetch 'most' repped items
|
||||
* @param array Member this applies to
|
||||
*
|
||||
* @return array Parameters to pass to ipsRegistry::DB()->build
|
||||
* Must return at least the data from reputation_index
|
||||
* limit and order will be applied automatically
|
||||
*/
|
||||
public function fetch( $type=NULL, $member=NULL )
|
||||
{
|
||||
$allowedForumIDs = ipsRegistry::getClass('class_forums')->fetchSearchableForumIds();
|
||||
|
||||
$userGiving = 'r';
|
||||
$extraWhere = '';
|
||||
$extraJoin = array();
|
||||
|
||||
if ( $type == 'most' )
|
||||
{
|
||||
return array( 'type' => 'pid',
|
||||
|
||||
/* Used in first query to fetch type_ids */
|
||||
'inner' => array( 'select' => 'p.pid',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
//'where' => '1=1',
|
||||
'where' => 'p.queued=' . ipsRegistry::getClass('class_forums')->fetchPostHiddenFlag( 'visible' ),
|
||||
'add_join' => array( array( 'select' => '',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id AND t.approved=' . ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'visible' ) . ' AND ' . ( empty( $allowedForumIDs ) ? '1=0' : ipsRegistry::DB()->buildWherePermission( $allowedForumIDs, 't.forum_id', FALSE ) ),
|
||||
'type' => 'inner' ) ) # join must be INNER to prevent loading ALL the post IDs without a matching topic row
|
||||
),
|
||||
/* Used in second query to fetch actual data */
|
||||
'joins' => array( array( 'select' => 'rc.*',
|
||||
'from' => array( 'reputation_cache' => 'rc' ),
|
||||
'where' => "rc.app='forums' AND rc.type='pid' AND rc.type_id=r.type_id" ),
|
||||
array( 'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type_id=p.pid' ),
|
||||
array( 'select' => 't.*, t.title as topic_title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid' ),
|
||||
array( 'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => 'f.id=t.forum_id' ) )
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $type !== NULL )
|
||||
{
|
||||
$extraWhere = ( ( $type == 'given' ) ? "r.member_id={$member['member_id']}" : "p.author_id={$member['member_id']}" ) . ' AND ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$userGiving = 'r2';
|
||||
$extraJoin = array( array(
|
||||
'from' => array( 'reputation_index' => 'r2' ),
|
||||
'where' => "r2.app=r.app AND r2.type=r.type AND r2.type_id=r.type_id AND r2.member_id=" . ipsRegistry::member()->getProperty('member_id')
|
||||
) );
|
||||
}
|
||||
|
||||
return array(
|
||||
'select' => "r.*, rc.*, {$userGiving}.member_id as repUserGiving, p.*, t.*, t.title as topic_title", // we have to do aliases on some of them due to duplicate column names
|
||||
'from' => array( 'reputation_index' => 'r'),
|
||||
'add_join' => array_merge( $extraJoin, array(
|
||||
array(
|
||||
'from' => array( 'reputation_cache' => 'rc' ),
|
||||
'where' => "rc.app=r.app AND rc.type=r.type AND rc.type_id=r.type_id"
|
||||
),
|
||||
array(
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type_id=p.pid'
|
||||
),
|
||||
array(
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid'
|
||||
)
|
||||
) ),
|
||||
'where' => "r.app='forums' AND r.type='pid' AND " . // belongs to this app
|
||||
$extraWhere . // is for this member
|
||||
" t.tid<>0 AND " . // is valid
|
||||
"t.approved=" . ipsRegistry::getClass('class_forums')->fetchTopicHiddenFlag( 'visible' ) . " AND " . // topic is visible
|
||||
"p.queued=" . ipsRegistry::getClass('class_forums')->fetchPostHiddenFlag( 'visible' ) . " AND " . // post is visible
|
||||
( empty( $allowedForumIDs ) ? '1=0' : ipsRegistry::DB()->buildWherePermission( $allowedForumIDs, 't.forum_id', FALSE ) ), // we have permission to view
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process Results
|
||||
*
|
||||
* @param array Row from database using query specified in fetch()
|
||||
* @return array Same data with any additional processing necessary
|
||||
*/
|
||||
public function process( $row )
|
||||
{
|
||||
/* Build poster's display data */
|
||||
$member = $row['author_id'] ? IPSMember::load( $row['author_id'], 'profile_portal,pfields_content,sessions,groups', 'id' ) : IPSMember::setUpGuest();
|
||||
$row = array_merge( $row, IPSMember::buildDisplayData( $member, array( 'reputation' => 0, 'warn' => 0 ) ) );
|
||||
|
||||
/* Get forum data (damn HTML >.<) */
|
||||
$forumData = ipsRegistry::getClass('class_forums')->getForumById( $row['forum_id'] );
|
||||
|
||||
/* Parse BBCode */
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = $row['use_emo'];
|
||||
IPSText::getTextClass('bbcode')->parse_html = ( $forumData['use_html'] and $member['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'topics';
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup = $member['member_group_id'];
|
||||
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others'];
|
||||
$row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse( $row['post'] );
|
||||
|
||||
/* Parse attachments */
|
||||
$messageHTML = array( $row['pid'] => $row['post'] );
|
||||
$attachHTML = $this->class_attach->renderAttachments( $messageHTML, array( $row['pid'] ) );
|
||||
|
||||
if( is_array( $attachHTML ) AND count( $attachHTML ) )
|
||||
{
|
||||
/* Get rid of any lingering attachment tags */
|
||||
if ( stristr( $attachHTML[ $row['pid'] ]['html'], "[attachment=" ) )
|
||||
{
|
||||
$attachHTML[ $row['pid'] ]['html'] = IPSText::stripAttachTag( $attachHTML[ $row['pid'] ]['html'] );
|
||||
}
|
||||
$row['post'] = $attachHTML[ $row['pid'] ]['html'] . $attachHTML[ $row['pid'] ]['attachmentHtml'];
|
||||
}
|
||||
|
||||
/* Get rep buttons */
|
||||
if ( $row['repUserGiving'] == ipsRegistry::member()->getProperty('member_id') )
|
||||
{
|
||||
$row['has_given_rep'] = $row['rep_rating'];
|
||||
}
|
||||
|
||||
$row['rep_points'] = ipsRegistry::getClass('repCache')->getRepPoints( array( 'app' => 'forums', 'type' => 'pid', 'type_id' => $row['pid'], 'rep_points' => $row['rep_points'] ) );
|
||||
$row['repButtons'] = ipsRegistry::getClass('repCache')->getLikeFormatted( array( 'app' => 'forums', 'type' => 'pid', 'id' => $row['pid'], 'rep_like_cache' => $row['rep_like_cache'] ) );
|
||||
|
||||
/* Return */
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display Results
|
||||
*
|
||||
* @param array Results after being processed
|
||||
* @param string HTML
|
||||
*/
|
||||
public function display( $results )
|
||||
{
|
||||
return ipsRegistry::getClass('output')->getTemplate( 'profile' )->tabReputation_posts( $results );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$rep_author_config = array(
|
||||
'pid' => array( 'column' => 'author_id', 'table' => 'posts' )
|
||||
);
|
||||
|
||||
$rep_log_joins = array(
|
||||
array(
|
||||
'select' => 'p.*, p.author_id as repAuthorId, p.post as repContentToParse, p.pid as repPostId',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'r.type="pid" AND r.type_id=p.pid and r.app="forums"',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.*, t.title as repContentTitle, t.tid as repContentID',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
);
|
||||
|
||||
$rep_log_where = "p.author_id=%s";
|
||||
$rep_log_link = 'findpost=%d';
|
||||
@@ -1,133 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2011-03-10 16:00:38 -0500 (Thu, 10 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 8021 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class rss_output_forums
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @return array RSS links
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
|
||||
ipsRegistry::DB()->execute();
|
||||
|
||||
while( $r = ipsRegistry::DB()->fetch() )
|
||||
{
|
||||
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&module=global&section=rss&type=forums&id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_export_id = intval( ipsRegistry::$request['id'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
$this->expires = time();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'rss_export',
|
||||
'where' => 'rss_export_id=' . $rss_export_id ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Correct expires time
|
||||
//-----------------------------------------
|
||||
|
||||
$this->expires += $rss_data['rss_export_cache_time'] * 60;
|
||||
|
||||
//-----------------------------------------
|
||||
// Need to recache?
|
||||
//-----------------------------------------
|
||||
|
||||
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
|
||||
|
||||
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Yes
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php', 'admin_forums_rss_export' );
|
||||
$rss_export = new $classToLoad();
|
||||
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
|
||||
|
||||
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// No
|
||||
//-----------------------------------------
|
||||
|
||||
return $rss_data['rss_export_cache_content'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return $this->expires ? $this->expires : time();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* RSS output plugin :: posts
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 6/24/2008
|
||||
* @version $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class rss_output_forums
|
||||
{
|
||||
/**
|
||||
* Expiration date
|
||||
*
|
||||
* @var integer Expiration timestamp
|
||||
*/
|
||||
protected $expires = 0;
|
||||
|
||||
/**
|
||||
* Grab the RSS links
|
||||
*
|
||||
* @return array RSS links
|
||||
*/
|
||||
public function getRssLinks()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
ipsRegistry::DB()->build( array( 'select' => 'rss_export_title, rss_export_id', 'from' => 'rss_export', 'where' => 'rss_export_enabled=1' ) );
|
||||
ipsRegistry::DB()->execute();
|
||||
|
||||
while( $r = ipsRegistry::DB()->fetch() )
|
||||
{
|
||||
$return[] = array( 'title' => $r['rss_export_title'], 'url' => ipsRegistry::getClass('output')->formatUrl( ipsRegistry::$settings['board_url'] . "/index.php?app=core&module=global&section=rss&type=forums&id=" . $r['rss_export_id'], '%%' . $r['rss_export_title'] . '%%', 'section=rss2' ) );
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document content and return it
|
||||
*
|
||||
* @return string RSS document
|
||||
*/
|
||||
public function returnRSSDocument()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_export_id = intval( ipsRegistry::$request['id'] );
|
||||
$rss_data = array();
|
||||
$to_print = '';
|
||||
$this->expires = time();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get RSS export
|
||||
//-----------------------------------------
|
||||
|
||||
$rss_data = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'rss_export',
|
||||
'where' => 'rss_export_id=' . $rss_export_id ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got one?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $rss_data['rss_export_id'] AND $rss_data['rss_export_enabled'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Correct expires time
|
||||
//-----------------------------------------
|
||||
|
||||
$this->expires += $rss_data['rss_export_cache_time'] * 60;
|
||||
|
||||
//-----------------------------------------
|
||||
// Need to recache?
|
||||
//-----------------------------------------
|
||||
|
||||
$time_check = time() - ( $rss_data['rss_export_cache_time'] * 60 );
|
||||
|
||||
if ( ( ! $rss_data['rss_export_cache_content'] ) OR $time_check > $rss_data['rss_export_cache_last'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Yes
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'forums' ) . '/modules_admin/rss/export.php', 'admin_forums_rss_export' );
|
||||
$rss_export = new $classToLoad();
|
||||
$rss_export->makeRegistryShortcuts( ipsRegistry::instance() );
|
||||
|
||||
return $rss_export->rssExportRebuildCache( $rss_data['rss_export_id'], 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// No
|
||||
//-----------------------------------------
|
||||
|
||||
return $rss_data['rss_export_cache_content'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grab the RSS document expiration timestamp
|
||||
*
|
||||
* @return integer Expiration timestamp
|
||||
*/
|
||||
public function grabExpiryDate()
|
||||
{
|
||||
return $this->expires ? $this->expires : time();
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Config file
|
||||
* Last Updated: $Date: 2011-04-18 21:34:01 -0400 (Mon, 18 Apr 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8370 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can further filter VNC by removing non-followed 'categories' */
|
||||
$CONFIG['can_vnc_filter_by_followed'] = 1;
|
||||
$CONFIG['can_vnc_unread_content'] = 1;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Can search tags */
|
||||
$CONFIG['can_searchTags'] = 1;
|
||||
|
||||
/* Content types for 'follow', default one first */
|
||||
$CONFIG['followContentTypes'] = array( 'topics', 'forums' );
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Config file
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Can search with this app */
|
||||
$CONFIG['can_search'] = 1;
|
||||
|
||||
/* Can view new content with this app */
|
||||
$CONFIG['can_viewNewContent'] = 1;
|
||||
|
||||
/* Can further filter VNC by removing non-followed 'categories' */
|
||||
$CONFIG['can_vnc_filter_by_followed'] = 1;
|
||||
$CONFIG['can_vnc_unread_content'] = 1;
|
||||
|
||||
/* Can fetch user generated content */
|
||||
$CONFIG['can_userContent'] = 1;
|
||||
|
||||
/* Can search tags */
|
||||
$CONFIG['can_searchTags'] = 1;
|
||||
|
||||
/* Content types for 'follow', default one first */
|
||||
$CONFIG['followContentTypes'] = array( 'topics', 'forums' );
|
||||
|
||||
$CONFIG['can_moderate_results'] = 1;
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,80 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class search_form_forums
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
{
|
||||
$array = array( 'date' => $this->lang->words['s_search_type_0'],
|
||||
'title' => $this->lang->words['forum_sort_title'],
|
||||
'posts' => $this->lang->words['forum_sort_posts'],
|
||||
'views' => $this->lang->words['forum_sort_views'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the html for displaying the forum category filter on the advanced search page
|
||||
*
|
||||
* @return string Filter HTML
|
||||
*/
|
||||
public function getHtml()
|
||||
{
|
||||
/* Make sure class_forums is setup */
|
||||
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('class_forums')->strip_invisible = 1;
|
||||
ipsRegistry::getClass('class_forums')->forumsInit();
|
||||
|
||||
return array( 'title' => ipsRegistry::$applications['forums']['app_public_title'], 'html' => ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->forumAdvancedSearchFilters( ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1 ) ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Returns HTML for the form (optional class, not required)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $author$
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class search_form_forums
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make object */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return sort drop down
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchSortDropDown()
|
||||
{
|
||||
$array = array( 'date' => $this->lang->words['s_search_type_0'],
|
||||
'title' => $this->lang->words['forum_sort_title'],
|
||||
'posts' => $this->lang->words['forum_sort_posts'],
|
||||
'views' => $this->lang->words['forum_sort_views'] );
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the html for displaying the forum category filter on the advanced search page
|
||||
*
|
||||
* @return string Filter HTML
|
||||
*/
|
||||
public function getHtml()
|
||||
{
|
||||
/* Make sure class_forums is setup */
|
||||
if( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
ipsRegistry::setClass( 'class_forums', new $classToLoad( ipsRegistry::instance() ) );
|
||||
}
|
||||
|
||||
ipsRegistry::getClass('class_forums')->strip_invisible = 1;
|
||||
ipsRegistry::getClass('class_forums')->forumsInit();
|
||||
|
||||
/* Got any archived content? */
|
||||
$canSearchArchives = false;
|
||||
|
||||
if ( $this->settings['archive_on'] )
|
||||
{
|
||||
$canSearchArchives = true;
|
||||
|
||||
if ( ( $this->settings['search_method'] == 'traditional' || $this->settings['search_method'] == 'sql' ) && $this->settings['archive_remote_sql_database'] )
|
||||
{
|
||||
$canSearchArchives = false;
|
||||
}
|
||||
}
|
||||
|
||||
$topic = NULL;
|
||||
if ( $this->request['cType'] == 'topic' )
|
||||
{
|
||||
$this->request['cId'] = intval( $this->request['cId'] );
|
||||
$topic = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid={$this->request['cId']}" ) );
|
||||
}
|
||||
|
||||
return array(
|
||||
'title' => IPSLib::getAppTitle('forums'),
|
||||
'html' => ipsRegistry::getClass('output')->getTemplate('search')->forumAdvancedSearchFilters(
|
||||
ipsRegistry::getClass( 'class_forums' )->buildForumJump( 0, 1, 0, ( isset( $this->request['cId'] ) and $this->request['cType'] == 'forum' ) ? array( $this->request['cId'] ) : array() ),
|
||||
$canSearchArchives,
|
||||
$topic
|
||||
) );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Sphinx template file
|
||||
* Last Updated: $Date: 2011-09-23 11:38:00 -0400 (Fri, 23 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9545 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10914 $
|
||||
* @since 3.0.0
|
||||
*
|
||||
*/
|
||||
@@ -31,13 +31,15 @@ $appSphinxTemplate = <<<EOF
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_posts', (SELECT max(pid) FROM <!--SPHINX_DB_PREFIX-->posts), 0, UNIX_TIMESTAMP(), 0 )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
|
||||
t.tid, t.title, LOWER(t.title) as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, REPLACE( p.post, '-', '&\#8208') as post, p.topic_id, p.queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid )
|
||||
@@ -46,6 +48,7 @@ source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFI
|
||||
sql_attr_uint = queued
|
||||
sql_attr_uint = approved
|
||||
sql_attr_uint = soft_deleted
|
||||
sql_attr_uint = archive_status
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_uint = forum_id
|
||||
sql_attr_timestamp = post_date
|
||||
@@ -66,19 +69,21 @@ source <!--SPHINX_CONF_PREFIX-->forums_search_posts_main : <!--SPHINX_CONF_PREFI
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the delta source
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, p.post, p.topic_id, p.queued, \
|
||||
t.tid, t.title, LOWER(t.title) as tordinal, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
sql_query = SELECT p.pid, p.pid as search_id, p.author_id, p.post_date, REPLACE( p.post, '-', '&\#8208') as post, p.topic_id, p.queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.topic_id=t.tid ) \
|
||||
WHERE p.pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
|
||||
sql_query_killlist = SELECT pid FROM !--SPHINX_DB_PREFIX-->posts WHERE pid > ( SELECT cs_value FROM !--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
sql_query_killlist = SELECT pid FROM <!--SPHINX_DB_PREFIX-->posts WHERE pid > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_posts' )
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
@@ -90,7 +95,7 @@ index <!--SPHINX_CONF_PREFIX-->forums_search_posts_main
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = utf-8
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
#infix_fields = post, title
|
||||
#min_infix_len = 3
|
||||
@@ -103,5 +108,84 @@ index <!--SPHINX_CONF_PREFIX-->forums_search_posts_delta : <!--SPHINX_CONF_PREFI
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_posts_delta
|
||||
}
|
||||
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_archive_main : <!--SPHINX_CONF_PREFIX-->ipb_source_config
|
||||
{
|
||||
# Set our forum PID counter
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre = REPLACE INTO <!--SPHINX_DB_PREFIX-->cache_store VALUES( 'sphinx_forums_counter_archives', (SELECT max(archive_id) FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts), 0, UNIX_TIMESTAMP(), 0 )
|
||||
|
||||
# Query posts for the main source
|
||||
sql_query = SELECT p.archive_id, p.archive_id as search_id, p.archive_author_id as author_id, p.archive_content_date as post_date, REPLACE( p.archive_content, '-', '&\#8208') as archive_content, p.archive_topic_id, p.archive_queued as queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.archive_topic_id=t.tid )
|
||||
|
||||
# Fields
|
||||
sql_attr_uint = queued
|
||||
sql_attr_uint = approved
|
||||
sql_attr_uint = soft_deleted
|
||||
sql_attr_uint = archive_status
|
||||
sql_attr_uint = search_id
|
||||
sql_attr_uint = forum_id
|
||||
sql_attr_timestamp = post_date
|
||||
sql_attr_timestamp = last_post
|
||||
sql_attr_timestamp = start_date
|
||||
sql_attr_uint = author_id
|
||||
sql_attr_uint = starter_id
|
||||
sql_attr_uint = tid
|
||||
sql_attr_uint = posts
|
||||
sql_attr_uint = views
|
||||
sql_attr_str2ordinal = tordinal
|
||||
sql_attr_bigint = last_post_group
|
||||
sql_attr_multi = uint tag_id from query; SELECT t.topic_firstpost, c.tag_id FROM <!--SPHINX_DB_PREFIX-->core_tags c LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON (t.tid=c.tag_meta_id) WHERE c.tag_meta_app='forums' AND c.tag_meta_area='topics'
|
||||
|
||||
sql_ranged_throttle = 0
|
||||
}
|
||||
|
||||
source <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta : <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
# Override the base sql_query_pre
|
||||
<!--SPHINX_DB_SET_NAMES-->
|
||||
sql_query_pre =
|
||||
|
||||
# Query posts for the delta source
|
||||
sql_query = SELECT p.archive_id, p.archive_id as search_id, p.archive_author_id as author_id, p.archive_content_date as post_date, REPLACE( p.archive_content, '-', '&\#8208') as archive_content, p.archive_topic_id, p.archive_queued as queued, \
|
||||
t.tid, LOWER(t.title) as tordinal, REPLACE( t.title, '-', '&\#8208') as title, t.views, t.posts, t.forum_id, t.last_post, t.state, t.start_date, t.starter_id, t.last_poster_id, t.topic_firstpost, \
|
||||
CASE WHEN t.approved = -1 THEN 1 ELSE 0 END AS soft_deleted, \
|
||||
CASE WHEN t.approved = -1 THEN 0 ELSE t.approved END AS approved, \
|
||||
CASE WHEN t.topic_archive_status IN (0,3) THEN 0 ELSE 1 END AS archive_status, \
|
||||
CONCAT( SUBSTRING( t.last_post, 2, 8 ), '0', LPAD( t.tid, 10, 0 ) ) as last_post_group \
|
||||
FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts p \
|
||||
LEFT JOIN <!--SPHINX_DB_PREFIX-->topics t ON ( p.archive_topic_id=t.tid ) \
|
||||
WHERE p.archive_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_archives' )
|
||||
|
||||
sql_query_killlist = SELECT archive_id FROM <!--SPHINX_DB_PREFIX-->forums_archive_posts WHERE archive_id > ( SELECT cs_value FROM <!--SPHINX_DB_PREFIX-->cache_store WHERE cs_key='sphinx_forums_counter_archives' )
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
|
||||
docinfo = extern
|
||||
mlock = 0
|
||||
morphology = none
|
||||
min_word_len = 2
|
||||
charset_type = sbcs
|
||||
html_strip = 0
|
||||
#infix_fields = archive_content, title
|
||||
#min_infix_len = 3
|
||||
#enable_star = 1
|
||||
}
|
||||
|
||||
index <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta : <!--SPHINX_CONF_PREFIX-->forums_search_archive_main
|
||||
{
|
||||
source = <!--SPHINX_CONF_PREFIX-->forums_search_archive_delta
|
||||
path = <!--SPHINX_BASE_PATH-->/<!--SPHINX_CONF_PREFIX-->forums_search_archive_delta
|
||||
}
|
||||
|
||||
EOF;
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,336 +1,360 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Tagging: Forums/Topics Class
|
||||
* Matt Mecham
|
||||
* Last Updated: $Date: 2011-09-12 20:59:05 -0400 (Mon, 12 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2011 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://hatynka.in
|
||||
* @since 25 Feb 2011
|
||||
* @version $Revision: 9483 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class tags_forums_topics extends classes_tag_abstract
|
||||
{
|
||||
protected $topicCache = array();
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Little 'trick' to force preset tags
|
||||
*
|
||||
* @param string view to show
|
||||
* @param array Where data to show
|
||||
*/
|
||||
public function render( $what, $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $forum['tag_predefined'] ) )
|
||||
{
|
||||
/* Turn off open system */
|
||||
$this->settings['tags_open_system'] = false;
|
||||
}
|
||||
|
||||
return parent::render( $what, $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches parent ID
|
||||
* @param array Where Data
|
||||
* @return int Id of parent if one exists or 0
|
||||
*/
|
||||
public function getParentId( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
|
||||
return intval( $topic['forum_id'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches permission data
|
||||
* @param array Where Data
|
||||
* @return string Comma delimiter or *
|
||||
*/
|
||||
public function getPermissionData( $where )
|
||||
{
|
||||
if ( isset( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( isset( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
return $forum['perm_view'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic permission check
|
||||
* @param string $what (add/remove/edit/create/prefix) [ add = add new tags to items, create = create unique tags, use a tag as a prefix for an item ]
|
||||
* @param array $where data
|
||||
*/
|
||||
public function can( $what, $where )
|
||||
{
|
||||
$topic = array();
|
||||
$forum = array();
|
||||
|
||||
if ( ! empty( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
/* Check parent */
|
||||
$return = parent::can( $what, $where );
|
||||
|
||||
if ( $return === false )
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* Forum disabled */
|
||||
if ( $forum['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( $what )
|
||||
{
|
||||
case 'create':
|
||||
if ( ! $this->_isOpenSystem() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
break;
|
||||
case 'add':
|
||||
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
case 'remove':
|
||||
if ( $this->memberData['member_id'] == $topic['starter_id'] )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'prefix':
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DEFAULT: returns true and should be defined in your own class
|
||||
* @param array Where Data
|
||||
* @return int If meta item is visible (not unapproved, etc)
|
||||
*/
|
||||
public function getIsVisible( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$approved = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
|
||||
return ( $approved == 'visible' ) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for tags
|
||||
* @param mixed $tags Array or string
|
||||
* @param array $options Array( 'meta_id' (array), 'meta_parent_id' (array), 'olderThan' (int), 'youngerThan' (int), 'limit' (int), 'sortKey' (string) 'sortOrder' (string) )
|
||||
*/
|
||||
public function search( $tags, $options )
|
||||
{
|
||||
$ok = array();
|
||||
|
||||
/* Fix up forum IDs */
|
||||
if ( isset( $options['meta_parent_id'] ) )
|
||||
{
|
||||
if ( is_array( $options['meta_parent_id'] ) )
|
||||
{
|
||||
foreach( $options['meta_parent_id'] as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->_canSearchForum( $options['meta_parent_id'] ) === true )
|
||||
{
|
||||
$ok[] = $options['meta_parent_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fetch forum IDs */
|
||||
$ok = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
}
|
||||
|
||||
$options['meta_parent_id'] = $ok;
|
||||
|
||||
return parent::search( $tags, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a list of pre-defined tags
|
||||
*
|
||||
* @param array Where Data
|
||||
* @return Array of pre-defined tags or null
|
||||
*/
|
||||
protected function _getPreDefinedTags( $where=array() )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
$this->settings['tags_predefined'] = ( ! empty( $forum['tag_predefined'] ) ) ? $forum['tag_predefined'] : $this->settings['tags_predefined'];
|
||||
|
||||
return parent::_getPreDefinedTags( $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can set an item as a topic prefix
|
||||
*
|
||||
* @param array $where Where Data
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _prefixesEnabled( $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( $forum['bw_disable_prefixes'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::_prefixesEnabled( $where );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a forum for tag searching
|
||||
*
|
||||
* @param id $id Forum ID
|
||||
* @return @e boolean True if it can be searched
|
||||
*/
|
||||
protected function _canSearchForum( $id )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumById( $id );
|
||||
|
||||
if ( ! $this->registry->permissions->check( 'read', $data ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a topic
|
||||
*
|
||||
* @param integer $tid Topic ID
|
||||
* @return @e array Topic data
|
||||
*/
|
||||
protected function _getTopic( $tid )
|
||||
{
|
||||
if ( ! isset( $this->topicCache[ $tid ] ) )
|
||||
{
|
||||
$this->topicCache[ $tid ] = $this->registry->getClass('topics')->getTopicById( $tid );
|
||||
}
|
||||
|
||||
return $this->topicCache[ $tid ];
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Tagging: Forums/Topics Class
|
||||
* Matt Mecham
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2011 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 25 Feb 2011
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class tags_forums_topics extends classes_tag_abstract
|
||||
{
|
||||
protected $topicCache = array();
|
||||
|
||||
/**
|
||||
* CONSTRUCTOR
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ( ! $this->registry->isClassLoaded('class_forums') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir('forums') . '/sources/classes/forums/class_forums.php', 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $this->registry ) );
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
}
|
||||
|
||||
if ( ! $this->registry->isClassLoaded('topics') )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$this->registry->setClass( 'topics', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Little 'trick' to force preset tags
|
||||
*
|
||||
* @param string view to show
|
||||
* @param array Where data to show
|
||||
*/
|
||||
public function render( $what, $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $forum['tag_predefined'] ) )
|
||||
{
|
||||
/* Turn off open system */
|
||||
$this->settings['tags_open_system'] = false;
|
||||
}
|
||||
|
||||
return parent::render( $what, $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches parent ID
|
||||
* @param array Where Data
|
||||
* @return int Id of parent if one exists or 0
|
||||
*/
|
||||
public function getParentId( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
|
||||
return intval( $topic['forum_id'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches permission data
|
||||
* @param array Where Data
|
||||
* @return string Comma delimiter or *
|
||||
*/
|
||||
public function getPermissionData( $where )
|
||||
{
|
||||
if ( isset( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( isset( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
return $forum['perm_view'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic permission check
|
||||
* @param string $what (add/remove/edit/create/prefix) [ add = add new tags to items, create = create unique tags, use a tag as a prefix for an item ]
|
||||
* @param array $where data
|
||||
*/
|
||||
public function can( $what, $where )
|
||||
{
|
||||
/* Check parent */
|
||||
$return = parent::can( $what, $where );
|
||||
|
||||
if ( $return === false )
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* Init some vars */
|
||||
$topic = array();
|
||||
$forum = array();
|
||||
|
||||
if ( ! empty( $where['meta_id'] ) )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$forum = $this->registry->class_forums->getForumById( $topic['forum_id'] );
|
||||
}
|
||||
else if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
/* Forum disabled */
|
||||
if ( $forum['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( $what )
|
||||
{
|
||||
case 'create':
|
||||
if ( ! $this->_isOpenSystem() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
break;
|
||||
case 'add':
|
||||
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( defined('IN_CONVERTER') AND IN_CONVERTER == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
case 'remove':
|
||||
if ( $this->memberData['member_id'] == $topic['starter_id'] or $this->memberData['g_is_supmod'] or ( $this->memberData['is_mod'] and isset( $this->memberData['forumsModeratorData'][ $forum['id'] ] ) and $this->memberData['forumsModeratorData'][ $forum['id'] ]['edit_post'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 'prefix':
|
||||
if ( $this->registry->class_forums->canStartTopic( $forum['id'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( defined('IN_CONVERTER') AND IN_CONVERTER == true )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DEFAULT: returns true and should be defined in your own class
|
||||
* @param array Where Data
|
||||
* @return int If meta item is visible (not unapproved, etc)
|
||||
*/
|
||||
public function getIsVisible( $where )
|
||||
{
|
||||
$topic = $this->_getTopic( $where['meta_id'] );
|
||||
$approved = $this->registry->class_forums->fetchHiddenTopicType( $topic );
|
||||
|
||||
return ( $approved == 'visible' ) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for tags
|
||||
* @param mixed $tags Array or string
|
||||
* @param array $options Array( 'meta_id' (array), 'meta_parent_id' (array), 'olderThan' (int), 'youngerThan' (int), 'limit' (int), 'sortKey' (string) 'sortOrder' (string) )
|
||||
*/
|
||||
public function search( $tags, $options )
|
||||
{
|
||||
$ok = array();
|
||||
|
||||
/* Fix up forum IDs */
|
||||
if ( isset( $options['meta_parent_id'] ) )
|
||||
{
|
||||
if ( is_array( $options['meta_parent_id'] ) )
|
||||
{
|
||||
foreach( $options['meta_parent_id'] as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->_canSearchForum( $options['meta_parent_id'] ) === true )
|
||||
{
|
||||
$ok[] = $options['meta_parent_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fetch forum IDs */
|
||||
$allForums = $this->registry->class_forums->fetchSearchableForumIds();
|
||||
|
||||
foreach( $allForums as $id )
|
||||
{
|
||||
if ( $this->_canSearchForum( $id ) === true )
|
||||
{
|
||||
$ok[] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$options['meta_parent_id'] = $ok;
|
||||
|
||||
return parent::search( $tags, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a list of pre-defined tags
|
||||
*
|
||||
* @param array Where Data
|
||||
* @return Array of pre-defined tags or null
|
||||
*/
|
||||
protected function _getPreDefinedTags( $where=array() )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
$this->settings['tags_predefined'] = ( ! empty( $forum['tag_predefined'] ) ) ? $forum['tag_predefined'] : $this->settings['tags_predefined'];
|
||||
|
||||
return parent::_getPreDefinedTags( $where );
|
||||
}
|
||||
|
||||
/**
|
||||
* Can set an item as a topic prefix
|
||||
*
|
||||
* @param array $where Where Data
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _prefixesEnabled( $where )
|
||||
{
|
||||
if ( ! empty( $where['meta_parent_id'] ) )
|
||||
{
|
||||
$forum = $this->registry->class_forums->getForumById( $where['meta_parent_id'] );
|
||||
}
|
||||
|
||||
if ( $forum['bw_disable_prefixes'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::_prefixesEnabled( $where );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a forum for tag searching
|
||||
*
|
||||
* @param id $id Forum ID
|
||||
* @return @e boolean True if it can be searched
|
||||
*/
|
||||
protected function _canSearchForum( $id )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumById( $id );
|
||||
|
||||
if ( ! $this->registry->permissions->check( 'read', $data ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Can read, but is it password protected, etc? */
|
||||
if ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $data['sub_can_post'] OR ! $data['can_view_others'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Tagging disabled */
|
||||
if ( $data['bw_disable_tagging'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch a topic
|
||||
*
|
||||
* @param integer $tid Topic ID
|
||||
* @return @e array Topic data
|
||||
*/
|
||||
protected function _getTopic( $tid )
|
||||
{
|
||||
if ( ! isset( $this->topicCache[ $tid ] ) )
|
||||
{
|
||||
$this->topicCache[ $tid ] = $this->registry->getClass('topics')->getTopicById( $tid );
|
||||
}
|
||||
|
||||
return $this->topicCache[ $tid ];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @file warnings.php Warnings extension for forums
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $ (Original: Mark)
|
||||
* @since -
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @class warnings_forums
|
||||
* @brief Warnings Extension for forums
|
||||
*/
|
||||
class warnings_forums
|
||||
{
|
||||
/**
|
||||
* Get Content URL
|
||||
*
|
||||
* @param array $warning Row from members_warn_logs
|
||||
* @return @e array array( url => URL to the content the warning came from, title => Title )
|
||||
*/
|
||||
public function getContentUrl( $warning )
|
||||
{
|
||||
if ( is_numeric( $warning['wl_content_id1'] ) )
|
||||
{
|
||||
$post = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'posts', 'where' => "pid={$warning['wl_content_id1']}" ) );
|
||||
|
||||
if ( ! empty($post['topic_id']) )
|
||||
{
|
||||
$topic = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'topics', 'where' => "tid={$post['topic_id']}" ) );
|
||||
|
||||
if ( ! empty($topic['tid']) )
|
||||
{
|
||||
return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showtopic={$topic['tid']}&findpost={$post['pid']}", 'public', $topic['title_seo'], 'showtopic' ), 'title' => $topic['title'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( $warning['wl_content_id1'] == 'announcement' )
|
||||
{
|
||||
$announcement = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*', 'from' => 'announcements', 'where' => "announce_id=" . intval( $warning['wl_content_id2'] ) ) );
|
||||
|
||||
if ( ! empty($announcement['announce_id']) )
|
||||
{
|
||||
return array( 'url' => ipsRegistry::getClass('output')->buildSEOUrl( "showannouncement={$announcement['announce_id']}", 'public', IPSText::makeSeoTitle( $announcement['announce_title'] ), 'showannouncement' ), 'title' => $announcement['announce_title'] );
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,490 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.archive.js - Archive javascript */
|
||||
/* (c) IPS, Inc 2011 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham */
|
||||
/************************************************/
|
||||
|
||||
IPBoard.prototype.ACPArchive = {
|
||||
inSection: null,
|
||||
ruleData: null,
|
||||
keys: [ 'approved', 'forum', 'member', 'pinned', 'poll', 'post', 'rating', 'lastpost', 'state', 'view' ],
|
||||
lastBlur: 0,
|
||||
ajaxPending: false,
|
||||
popUps: {},
|
||||
autoComplete: null,
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.archive.js");
|
||||
|
||||
document.observe("dom:loaded", function()
|
||||
{
|
||||
/* Set up the handles */
|
||||
if ( this.inSection == 'rules' )
|
||||
{
|
||||
this.setUpRulesPage();
|
||||
}
|
||||
}.bind(this) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove a member
|
||||
* @param e
|
||||
* @param elem
|
||||
*/
|
||||
deleteMember: function(elem, e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var type = elem.readAttribute('data-type');
|
||||
var id = elem.readAttribute('data-id');
|
||||
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=deleteMember&type=' + type + '&id=' + id + '&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( t.responseJSON )
|
||||
{
|
||||
Debug.write( t.responseJSON );
|
||||
|
||||
this._updateMembers( t.responseJSON['data'], t.responseJSON['count'], type );
|
||||
$(type + '_field_member_text').value = t.responseJSON['ids'];
|
||||
|
||||
/* Update stats */
|
||||
this.lastBlur = this.getUnixTime();
|
||||
this.updateStats();
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
/**
|
||||
* Save the dialog box
|
||||
* @param e
|
||||
* @param elem
|
||||
*/
|
||||
saveAddMemberDialog: function(elem, e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var type = elem.readAttribute('data-type');
|
||||
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=saveAddMemberDialog&type=' + type + '&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
parameters: { addName: $F('addName') },
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* close box */
|
||||
this.popUps['lmd'].hide();
|
||||
|
||||
if ( t.responseJSON )
|
||||
{
|
||||
Debug.write( t.responseJSON );
|
||||
|
||||
this._updateMembers( t.responseJSON['data'], t.responseJSON['count'], type );
|
||||
$(type + '_field_member_text').value = t.responseJSON['ids'];
|
||||
|
||||
/* Update stats */
|
||||
this.lastBlur = this.getUnixTime();
|
||||
this.updateStats();
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the add member dialog box
|
||||
* @param e
|
||||
* @param elem
|
||||
*/
|
||||
launchAddMemberDialog: function(elem, e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! Object.isUndefined( this.popUps['lmd'] ) )
|
||||
{
|
||||
//this.popUps['lmd'].kill();
|
||||
}
|
||||
|
||||
var type = elem.readAttribute('data-type');
|
||||
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=showAddMemberDialog&type=' + type + '&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( t.responseText )
|
||||
{
|
||||
/* Create the pop-up */
|
||||
if ( ! Object.isUndefined( this.popUps['lmd'] ) )
|
||||
{
|
||||
this.popUps['lmd'].show();
|
||||
$('addName').value = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
this.popUps['lmd'] = new ipb.Popup( 'lmd', { type: 'pane',
|
||||
modal: true,
|
||||
initial: t.responseText,
|
||||
hideAtStart: false,
|
||||
w: '550px' } );
|
||||
|
||||
setTimeout( function ()
|
||||
{
|
||||
this.autoComplete = new ipb.Autocomplete( $('addName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
}.bind(this), 1000 );
|
||||
}
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Save the dialog box
|
||||
* @param e
|
||||
* @param elem
|
||||
*/
|
||||
saveAddForumDialog: function(elem, e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var type = elem.readAttribute('data-type');
|
||||
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=saveAddForumDialog&type=' + type + '&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
Debug.dir( $F('forumIds') );
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
parameters: $('forumIds').serialize(true),
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* close box */
|
||||
this.popUps['lfd'].hide();
|
||||
|
||||
if ( t.responseJSON )
|
||||
{
|
||||
Debug.write( t.responseJSON );
|
||||
|
||||
this._updateForums( t.responseJSON['data'], type );
|
||||
$(type + '_field_forum_text').value = t.responseJSON['ids'];
|
||||
|
||||
/* Update stats */
|
||||
this.lastBlur = this.getUnixTime();
|
||||
this.updateStats();
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the add forum dialog box
|
||||
* @param e
|
||||
* @param elem
|
||||
*/
|
||||
launchAddForumDialog: function(elem, e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var type = elem.readAttribute('data-type');
|
||||
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=showAddForumDialog&type=' + type + '&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( t.responseText )
|
||||
{
|
||||
/* Create the pop-up */
|
||||
this.popUps['lfd'] = new ipb.Popup( 'lfd', { type: 'pane',
|
||||
modal: true,
|
||||
initial: t.responseText,
|
||||
hideAtStart: false,
|
||||
w: '550px' } );
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetch dialog to set unarchive preferences
|
||||
*
|
||||
*/
|
||||
showRestorePrefs: function()
|
||||
{
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=showRestoreDialog&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
hideLoader: true,
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( t.responseText )
|
||||
{
|
||||
/* Create the pop-up */
|
||||
new ipb.Popup( 'rpd', { type: 'pane',
|
||||
modal: true,
|
||||
initial: t.responseText,
|
||||
hideAtStart: false,
|
||||
w: '550px' } );
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set up rules page
|
||||
*/
|
||||
setUpRulesPage: function()
|
||||
{
|
||||
Debug.dir( this.ruleData );
|
||||
|
||||
/* Set current values */
|
||||
$H( this.ruleData['archive'] ).each( function( data )
|
||||
{
|
||||
var _key = data.key;
|
||||
var _val = data.value;
|
||||
|
||||
this._setUpField( _key, _val, true );
|
||||
}.bind(this) );
|
||||
|
||||
$H( this.ruleData['skip'] ).each( function( data )
|
||||
{
|
||||
var _key = data.key;
|
||||
var _val = data.value;
|
||||
|
||||
this._setUpField( _key, _val, false );
|
||||
}.bind(this) );
|
||||
|
||||
/* Got anything for forums? */
|
||||
if ( ! Object.isUndefined( this.ruleData['archive']['forum']['_parseData'] ) )
|
||||
{
|
||||
this._updateForums( this.ruleData['archive']['forum']['_parseData'], 'archive' );
|
||||
$('archive_field_forum_text').value = this.ruleData['archive']['forum']['text'];
|
||||
}
|
||||
|
||||
/* Got anything for members? */
|
||||
if ( ! Object.isUndefined( this.ruleData['archive']['member']['_parseData'] ) )
|
||||
{
|
||||
this._updateMembers( this.ruleData['archive']['member']['_parseData']['data'], this.ruleData['archive']['member']['_parseData']['count'], 'archive' );
|
||||
$('archive_field_member_text').value = this.ruleData['archive']['member']['text'];
|
||||
}
|
||||
|
||||
/* set up blurs */
|
||||
this.keys.each( function(key)
|
||||
{
|
||||
if ( $( 'archive_field_' + key ) )
|
||||
{
|
||||
$( 'archive_field_' + key ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
|
||||
if ( $( 'archive_field_' + key + '_text' ) )
|
||||
{
|
||||
$( 'archive_field_' + key + '_text' ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
|
||||
if ( $( 'archive_field_' + key + '_unit' ) )
|
||||
{
|
||||
$( 'archive_field_' + key + '_unit' ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
|
||||
if ( $( 'skip_field_' + key ) )
|
||||
{
|
||||
$( 'skip_field_' + key ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
|
||||
if ( $( 'skip_field_' + key + '_text' ) )
|
||||
{
|
||||
$( 'skip_field_' + key + '_text' ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
|
||||
if ( $( 'skip_field_' + key + '_unit' ) )
|
||||
{
|
||||
$( 'skip_field_' + key + '_unit' ).on('blur', this._blur.bindAsEventListener(this) );
|
||||
}
|
||||
}.bind(this) );
|
||||
|
||||
setInterval( function() { this.updateStats() }.bind(this), 1000 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Number of seconds since epoch aka unixtime
|
||||
* @returns int
|
||||
*/
|
||||
getUnixTime: function()
|
||||
{
|
||||
return Math.round( new Date().getTime() / 1000 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Update stats
|
||||
*/
|
||||
updateStats: function()
|
||||
{
|
||||
if ( this.lastBlur > 0 && ( ( this.getUnixTime() - this.lastBlur ) <= 20 ) )
|
||||
{
|
||||
if ( this.ajaxPending === false )
|
||||
{
|
||||
/* Reset */
|
||||
this.ajaxPending = true;
|
||||
|
||||
/* Get the data */
|
||||
var postParams = $('archiveForm').serialize(true);
|
||||
var url = ( ipb.vars['base_url'] + 'app=forums&module=ajax§ion=archive&withApp=forums&do=updateCounter&md5check=' + ipb.vars['md5_hash'] ).replace( /&/g, '&');
|
||||
|
||||
Debug.write( url );
|
||||
Debug.dir( postParams);
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
parameters: postParams,
|
||||
hideLoader: true,
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* Save it sister */
|
||||
this.ajaxPending = false;
|
||||
this.lastBlur = 0;
|
||||
|
||||
if ( t.responseJSON['textString'] )
|
||||
{
|
||||
$('archiveCount').update( t.responseJSON['textString'] );
|
||||
|
||||
/* Pervy flashing */
|
||||
var bg = $('archiveCount').getStyle('backgroundColor');
|
||||
|
||||
new Effect.Highlight( $('archiveCount'), { 'startcolor': '#ffff99', 'restorecolor': bg, 'keepBackgroundImage': true } );
|
||||
}
|
||||
}.bind(this)
|
||||
} );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Set up row
|
||||
*/
|
||||
_setUpField: function( key, obj, isArchive )
|
||||
{
|
||||
var prefix = ( isArchive ) ? 'archive' : 'skip';
|
||||
|
||||
switch( key )
|
||||
{
|
||||
case 'approved':
|
||||
case 'pinned':
|
||||
case 'poll':
|
||||
case 'state':
|
||||
var seek = ( obj.value == '-' ) ? 'any' : obj.value;
|
||||
|
||||
$( prefix + '_field_' + key + '_' + seek ).selected = true;
|
||||
break;
|
||||
case 'post':
|
||||
case 'rating':
|
||||
case 'view':
|
||||
var seek = ( obj.value == '<' ) ? 'less' : 'more';
|
||||
|
||||
$( prefix + '_field_' + key + '_' + seek ).selected = true;
|
||||
$( prefix + '_field_' + key + '_text').value = obj.text;
|
||||
break;
|
||||
case 'forum':
|
||||
case 'member':
|
||||
var seek = ( obj.value == '-' ) ? 'more' : 'less';
|
||||
|
||||
$( prefix + '_field_' + key + '_' + seek ).selected = true;
|
||||
break;
|
||||
case 'lastpost':
|
||||
var seek = ( obj.value == '<' ) ? 'less' : 'more';
|
||||
|
||||
$( prefix + '_field_' + key + '_' + seek ).selected = true;
|
||||
$( prefix + '_field_' + key + '_text').value = obj.text;
|
||||
|
||||
$( prefix + '_field_' + key + '_unit_' + obj.unit ).selected = true;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* It's all a bit of a
|
||||
*/
|
||||
_blur: function( e )
|
||||
{
|
||||
var elem = Event.findElement(e);
|
||||
|
||||
this.lastBlur = this.getUnixTime();
|
||||
},
|
||||
|
||||
/**
|
||||
* Update members box out
|
||||
*/
|
||||
_updateMembers: function( obj, count, type )
|
||||
{
|
||||
/* Wipe it */
|
||||
$(type + '_membersGoHere').show().update('');
|
||||
|
||||
/* Do it */
|
||||
if ( count )
|
||||
{
|
||||
$H(obj).each( function( data )
|
||||
{
|
||||
var val = data.value;
|
||||
var img = '<a href="#" data-clicklaunch="deleteMember" data-scope="ACPArchive" data-type="' + type + '" data-id="' + val.member_id + '"><img src="' + ipb.vars['image_acp_url'] + 'icons/delete.png" /></a> ';
|
||||
$(type + '_membersGoHere').insert( new Element('div').update( img + val['photoTag'] + ' <strong>' + val['members_display_name'] + '</strong> (' + val['g_title'] + ')' ) );
|
||||
} );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(type + '_membersGoHere').hide();
|
||||
}
|
||||
|
||||
$$("[data-clicklaunch]").invoke('clickLaunch');
|
||||
},
|
||||
|
||||
/**
|
||||
* Update forums box out
|
||||
*/
|
||||
_updateForums: function( obj, type )
|
||||
{
|
||||
/* Wipe it */
|
||||
$(type + '_forumsGoHere').show().update('');
|
||||
|
||||
/* Do it */
|
||||
$H(obj).each( function( data )
|
||||
{
|
||||
var val = data.value;
|
||||
|
||||
$(type + '_forumsGoHere').insert( new Element('div').update( val.nav + ' ' + val.data.name ) );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
ipb.ACPArchive.init();
|
||||
@@ -1,73 +1,76 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.forums.js - Forum javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPForums = {
|
||||
showModForm: 0,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.forums.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
if( $('modUserName') )
|
||||
{
|
||||
ACPForums.autoComplete = new ipb.Autocomplete( $('modUserName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toggleModOptions: function()
|
||||
{
|
||||
$$('.moddiv').each( function(div){
|
||||
if( ACPForums.showModForm )
|
||||
{
|
||||
div.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
div.show();
|
||||
}
|
||||
});
|
||||
|
||||
$( 'togglemod' ).innerHTML = ACPForums.showModForm ? ipb.lang['forums_showmod'] : ipb.lang['forums_hidemod'];
|
||||
ACPForums.showModForm = ACPForums.showModForm == 1 ? 0 : 1;
|
||||
return false;
|
||||
},
|
||||
|
||||
submitModForm: function()
|
||||
{
|
||||
var submitValue = '';
|
||||
|
||||
$$('input').each( function(cb){
|
||||
if( cb.type == 'checkbox' && cb.checked == true )
|
||||
{
|
||||
var mainname = cb.id.replace( /^(.+?)_.+?$/ , "$1" );
|
||||
var idname = cb.id.replace( /^(.+?)_(.+?)$/, "$2" );
|
||||
|
||||
if ( mainname == 'id' )
|
||||
{
|
||||
submitValue += ',' + idname;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('modforumids').value = submitValue;
|
||||
return true;
|
||||
},
|
||||
|
||||
convert: function()
|
||||
{
|
||||
$('convert').value = 1;
|
||||
$('adminform').submit();
|
||||
}
|
||||
};
|
||||
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.forums.js - Forum javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPForums = {
|
||||
showModForm: 0,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.forums.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
if( $('modUserName') )
|
||||
{
|
||||
ACPForums.autoComplete = new ipb.Autocomplete( $('modUserName'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toggleModOptions: function()
|
||||
{
|
||||
$$('.moddiv').each( function(div){
|
||||
if( ACPForums.showModForm )
|
||||
{
|
||||
div.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
div.show();
|
||||
}
|
||||
});
|
||||
|
||||
$( 'togglemod' ).innerHTML = ACPForums.showModForm ? ipb.lang['forums_showmod'] : ipb.lang['forums_hidemod'];
|
||||
ACPForums.showModForm = ACPForums.showModForm == 1 ? 0 : 1;
|
||||
return false;
|
||||
},
|
||||
|
||||
submitModForm: function()
|
||||
{
|
||||
var submitValue = '';
|
||||
|
||||
$$('input').each( function(cb){
|
||||
if( cb.type == 'checkbox' && cb.checked == true )
|
||||
{
|
||||
var mainname = cb.id.replace( /^(.+?)_.+?$/ , "$1" );
|
||||
var idname = cb.id.replace( /^(.+?)_(.+?)$/, "$2" );
|
||||
|
||||
if ( mainname == 'id' )
|
||||
{
|
||||
submitValue += ',' + idname;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('modforumids').value = submitValue;
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* @todo: not used anymore it seems, we need to remove it at some point
|
||||
*/
|
||||
convert: function()
|
||||
{
|
||||
$('convert').value = 1;
|
||||
$('adminform').submit();
|
||||
}
|
||||
};
|
||||
|
||||
ACPForums.init();
|
||||
@@ -1,50 +1,50 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.rss.js - RSS Form javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPRss = {
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.rss.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
if( $('rss_import_mid') )
|
||||
{
|
||||
ACPRss.autoComplete = new ipb.Autocomplete( $('rss_import_mid'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
showAuthBoxes: function()
|
||||
{
|
||||
if( $('rss_import_auth_userinfo_1').visible() )
|
||||
{
|
||||
$('rss_import_auth_userinfo_1').hide();
|
||||
$('rss_import_auth_userinfo_2').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('rss_import_auth_userinfo_1').show();
|
||||
$('rss_import_auth_userinfo_2').show();
|
||||
}
|
||||
},
|
||||
|
||||
validate: function()
|
||||
{
|
||||
formobj = $('rssimport_validate');
|
||||
formobj.value = "1";
|
||||
$('rssimport_form').submit();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* acp.rss.js - RSS Form javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
ACPRss = {
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing acp.rss.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
if( $('rss_import_mid') )
|
||||
{
|
||||
ACPRss.autoComplete = new ipb.Autocomplete( $('rss_import_mid'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
showAuthBoxes: function()
|
||||
{
|
||||
if( $('rss_import_auth_userinfo_1').visible() )
|
||||
{
|
||||
$('rss_import_auth_userinfo_1').hide();
|
||||
$('rss_import_auth_userinfo_2').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('rss_import_auth_userinfo_1').show();
|
||||
$('rss_import_auth_userinfo_2').show();
|
||||
}
|
||||
},
|
||||
|
||||
validate: function()
|
||||
{
|
||||
formobj = $('rssimport_validate');
|
||||
formobj.value = "1";
|
||||
$('rssimport_form').submit();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
ACPRss.init();
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Archive stuff (AJAX) - Matt Mecham
|
||||
* Last Updated: $Date: 2011-05-05 12:03:47 +0100 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 17 November 2011
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_ajax_archive extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_archive');
|
||||
$this->form_code = $this->html->form_code = 'module=archive&section=archive&';
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_archive' ) );
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$this->archiveWriter = new $classToLoad();
|
||||
|
||||
$this->archiveWriter->setApp('forums');
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'updateCounter':
|
||||
default:
|
||||
$this->_updateCounter();
|
||||
break;
|
||||
case 'showRestoreDialog':
|
||||
$this->_showRestoreDialog();
|
||||
break;
|
||||
case 'showAddForumDialog':
|
||||
$this->_showAddForumDialog();
|
||||
break;
|
||||
case 'saveAddForumDialog':
|
||||
$this->_saveAddForumDialog();
|
||||
break;
|
||||
case 'showAddMemberDialog':
|
||||
$this->_showAddMemberDialog();
|
||||
break;
|
||||
case 'saveAddMemberDialog':
|
||||
$this->_saveAddMemberDialog();
|
||||
break;
|
||||
case 'deleteMember':
|
||||
$this->_deleteMember();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a member
|
||||
*/
|
||||
protected function _deleteMember()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$id = intval( $this->request['id'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = array();
|
||||
$members = array();
|
||||
|
||||
/* Existing names */
|
||||
$current = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
foreach( $current as $_id )
|
||||
{
|
||||
if ( $id != $_id )
|
||||
{
|
||||
$return[] = $_id;
|
||||
}
|
||||
}
|
||||
|
||||
$return = array_unique( $return );
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_member_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'member',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $return ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Update members */
|
||||
if ( count( $return ) )
|
||||
{
|
||||
$members = IPSMember::load( $return, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'count' => count( $members ), 'data' => $members, 'ids' => serialize( array_keys( $members ) ) ) );
|
||||
}
|
||||
/**
|
||||
* Saves the add forum dialog
|
||||
*/
|
||||
protected function _saveAddMemberDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = array();
|
||||
|
||||
/* INIT */
|
||||
$memberName = trim( $this->request['addName'] );
|
||||
|
||||
/* Existing names */
|
||||
$current = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
/* Fetch from DB */
|
||||
$member = $this->DB->buildAndFetch( array( 'select' => 'member_id',
|
||||
'from' => 'members',
|
||||
'where' => "members_display_name = '" . $this->DB->addSlashes( $memberName ) . "'" ) );
|
||||
|
||||
if ( $member['member_id'] )
|
||||
{
|
||||
$current[] = $member['member_id'];
|
||||
}
|
||||
|
||||
$current = array_unique( $current );
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_member_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'member',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $current ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Update members */
|
||||
if ( count( $current ) )
|
||||
{
|
||||
$members = IPSMember::load( $current, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
}
|
||||
|
||||
$this->returnJsonArray( array( 'count' => count( $members ), 'data' => $members, 'ids' => serialize( array_keys( $members ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the add members dialog
|
||||
*/
|
||||
protected function _showAddMemberDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
|
||||
//IPSText::jsonEncodeForTemplate( $rules )
|
||||
|
||||
$this->returnHtml( $this->html->showAddMemberDialog( $type ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add forum dialog
|
||||
*/
|
||||
protected function _saveAddForumDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$forums = array();
|
||||
$int = ( $type == 'archive' ) ? 0 : 1;
|
||||
$return = '';
|
||||
|
||||
/* Mix in data */
|
||||
if ( is_array( $_POST['forumIds'] ) )
|
||||
{
|
||||
$forums = IPSLib::cleanIntArray( $_POST['forumIds'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$forums = array();
|
||||
}
|
||||
|
||||
/* Update DB */
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_forum_' . $int ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => 'forum',
|
||||
'archive_value' => '',
|
||||
'archive_text' => serialize( $forums ),
|
||||
'archive_unit' => '',
|
||||
'archive_skip' => $int ), array( 'archive_key' ) );
|
||||
|
||||
/* Send back serialized data */
|
||||
$return['ids'] = serialize( $forums );
|
||||
|
||||
/* Now return the data */
|
||||
foreach( $forums as $fid )
|
||||
{
|
||||
$return['data'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
|
||||
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the add forum dialog
|
||||
*/
|
||||
protected function _showAddForumDialog()
|
||||
{
|
||||
$type = trim( $this->request['type'] );
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
$current = array();
|
||||
|
||||
if ( IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) )
|
||||
{
|
||||
$current = unserialize( $rules[ $type ]['forum']['text'] );
|
||||
}
|
||||
|
||||
$multiSelect = $this->registry->class_forums->forumsForumJump( 1, 0, 1, $current, true );
|
||||
|
||||
$this->returnHtml( $this->html->showAddForumDialog( $multiSelect, $type ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the restore prefs
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _showRestoreDialog()
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
$this->returnHtml( $this->html->showRestorePrefs( $restoreData ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns updated count data
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _updateCounter()
|
||||
{
|
||||
/* Get fields to save */
|
||||
$archiveFields = $this->archiveWriter->getArchiveOnFields();
|
||||
$skipFields = $this->archiveWriter->getArchiveSkipFields();
|
||||
|
||||
/* To save */
|
||||
$rules = array();
|
||||
|
||||
/* Loop through and get archive data */
|
||||
foreach( $archiveFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
|
||||
{
|
||||
$rules['archive'][ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through and get skup data */
|
||||
foreach( $skipFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
|
||||
{
|
||||
$rules['skip'][ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->archiveWriter->getArchivePossibleCount( $rules );
|
||||
|
||||
if ( $result['count'] < 1 )
|
||||
{
|
||||
$result['textString'] = $this->lang->words['archive_no_query'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['textString'] = sprintf( $this->lang->words['archive_x_query'], $result['percentage'], $this->lang->formatNumber( $result['count'] ), $this->lang->formatNumber( $result['total'] ) );
|
||||
}
|
||||
|
||||
$this->returnJsonArray( $result );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,103 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 8644 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_ajax_member_editform extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums', 'admin_member_form' ) );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'show':
|
||||
default:
|
||||
$this->show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member data
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the form
|
||||
//-----------------------------------------
|
||||
|
||||
if ( method_exists( $this->html, $name ) )
|
||||
{
|
||||
$output = $this->html->$name( $member );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Member property updater (AJAX)
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st march 2002
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_ajax_member_editform extends ipsAjaxCommand
|
||||
{
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load skin
|
||||
//-----------------------------------------
|
||||
|
||||
$this->html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_member_form');
|
||||
|
||||
//-----------------------------------------
|
||||
// Load lang
|
||||
//-----------------------------------------
|
||||
|
||||
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_forums', 'admin_member_form' ) );
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'show':
|
||||
default:
|
||||
$this->show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function show()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$name = trim( IPSText::alphanumericalClean( ipsRegistry::$request['name'] ) );
|
||||
$member_id = intval( ipsRegistry::$request['member_id'] );
|
||||
$output = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get member data
|
||||
//-----------------------------------------
|
||||
|
||||
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a member?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
$this->returnJsonError( $this->lang->words['t_noid'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the form
|
||||
//-----------------------------------------
|
||||
|
||||
if ( method_exists( $this->html, $name ) )
|
||||
{
|
||||
$output = $this->html->$name( $member );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Print...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->returnHtml( $output );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
/**
|
||||
* @file archive.php Archive Action File
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $ (Original: Matt)
|
||||
* @since 11 Nov 2011
|
||||
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 477 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @class admin_forums_archive_archive
|
||||
* @brief Archive Action File
|
||||
*/
|
||||
class admin_forums_archive_archive extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object shortcut
|
||||
*
|
||||
* @var $html
|
||||
*/
|
||||
public $html;
|
||||
|
||||
/**
|
||||
* String for the screen url bit
|
||||
*
|
||||
* @var $form_code
|
||||
*/
|
||||
public $form_code = '';
|
||||
|
||||
/**
|
||||
* String for the JS url bit
|
||||
*
|
||||
* @var $form_code_js
|
||||
*/
|
||||
public $form_code_js = '';
|
||||
|
||||
/**
|
||||
* Main function executed automatically by the controller
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_archive' );
|
||||
$this->form_code = $this->html->form_code = 'module=archive&section=archive&';
|
||||
$this->html->form_code_js = $this->html->form_code_js = 'module=archive§ion=archive&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_archive' ) );
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$this->archiveWriter = new $classToLoad();
|
||||
|
||||
$this->archiveWriter->setApp('forums');
|
||||
|
||||
/* Check for class_forums */
|
||||
if ( ipsRegistry::isClassLoaded('class_forums') !== TRUE )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'toggleArchiving':
|
||||
$this->_archiveToggle();
|
||||
break;
|
||||
case 'rules':
|
||||
$this->_archiveRules();
|
||||
break;
|
||||
case 'saveRules':
|
||||
$this->_saveRules();
|
||||
break;
|
||||
case 'saveRestorePrefs':
|
||||
$this->_saveRestorePrefs();
|
||||
break;
|
||||
case 'overview':
|
||||
default:
|
||||
$this->_archiveDash();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Toggle
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveRestorePrefs()
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
/* Update */
|
||||
IPSLib::updateSettings( array( 'archive_restore_days' => intval( $this->request['restoreDays'] ) ) );
|
||||
|
||||
/* Fetch and store tids */
|
||||
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->request['restoreDays'] ) );
|
||||
|
||||
$mouse = $this->DB->buildAndFetch( array( 'select' => 'min(archive_topic_id) as min, max(archive_topic_id) as max',
|
||||
'from' => 'forums_archive_posts',
|
||||
'where' => 'archive_content_date > ' . $date ) );
|
||||
|
||||
$restoreData['restore_min_tid'] = intval( $mouse['min'] );
|
||||
$restoreData['restore_max_tid'] = intval( $mouse['max'] );
|
||||
|
||||
/* Save */
|
||||
$archiveRestore->setRestoreData( $restoreData );
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Toggle
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveToggle()
|
||||
{
|
||||
/* Update */
|
||||
IPSLib::updateSettings( array( 'archive_on' => ( $this->settings['archive_on'] ? 0 : 1 ) ) );
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . 'do=overview', TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive dashboard
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveDash()
|
||||
{
|
||||
/* Init */
|
||||
$archTopics = array();
|
||||
$restoreTopics = array();
|
||||
$restoreCount = 0;
|
||||
$unArchiveCount = 0;
|
||||
|
||||
/* Test remote DB */
|
||||
$connexTest = $this->_connectionTest();
|
||||
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
|
||||
$archiveRestore = new $classToLoad();
|
||||
|
||||
$archiveRestore->setApp('forums');
|
||||
|
||||
/* Load topic class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums' );
|
||||
$topicClass = new $classToLoad( $this->registry );
|
||||
|
||||
/* Show topics waiting unarchiving */
|
||||
$restoreData = $archiveRestore->getRestoreData();
|
||||
|
||||
/* Get pids and that */
|
||||
if ( count( $restoreData['restore_manual_tids'] ) )
|
||||
{
|
||||
$restoreTopics = $topicClass->getTopics( array( 'topicId' => array_keys( $restoreData['restore_manual_tids'] ), 'limit' => 10, 'getCount' => true ) );
|
||||
$restoreCount = $topicClass->getTopicsCount();
|
||||
|
||||
foreach( $restoreTopics as $tid => $data )
|
||||
{
|
||||
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Get count of topics left to unarchive */
|
||||
if ( $restoreData['restore_min_tid'] AND $restoreData['restore_max_tid'] )
|
||||
{
|
||||
$date = IPS_UNIX_TIME_NOW - ( 86400 * intval( $this->settings['archive_restore_days'] ) );
|
||||
$restoreCount += $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] -1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'getCountOnly' => true ) );
|
||||
|
||||
if ( count( $restoreCount ) < 10 )
|
||||
{
|
||||
$tmp = $topicClass->getTopics( array( 'archiveState' => array( 'archived' ), 'dateIsGreater' => $date, 'tidIsGreater' => ( $restoreData['restore_min_tid'] - 1 ), 'tidIsLess' => ( $restoreData['restore_max_tid'] - 1 ), 'limit' => (10 - count( $restoreTopics ) ) ) );
|
||||
}
|
||||
|
||||
foreach( $tmp as $tid => $data )
|
||||
{
|
||||
$restoreTopics[ $tid ] = $data;
|
||||
$restoreTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Fetch latest archived topics */
|
||||
$archTopics = $topicClass->getTopics( array( 'archiveState' => array( 'working', 'archived' ), 'topicType' => array( 'hidden', 'visible' ), 'limit' => 10, 'getCount' => true, 'sortField' => 'start_date', 'sortOrder' => 'desc' ) );
|
||||
$archCount = $topicClass->getTopicsCount();
|
||||
|
||||
foreach( $archTopics as $tid => $data )
|
||||
{
|
||||
$archTopics[ $tid ]['nav'] = $this->registry->class_forums->forumsBreadcrumbNav( $data['forum_id'] );
|
||||
}
|
||||
|
||||
$possibleCounts = $this->archiveWriter->getArchivePossibleCount();
|
||||
|
||||
/* Show dash */
|
||||
$this->registry->output->html .= $this->html->archiveDashboard( $restoreTopics, $restoreCount, $archTopics, $archCount, $possibleCounts, $connexTest );
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Rules overview
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _archiveRules()
|
||||
{
|
||||
/* Get archive count so far */
|
||||
$counts = $this->archiveWriter->getArchivePossibleCount();
|
||||
$rules = $this->archiveWriter->getRulesFromDb();
|
||||
|
||||
if ( $counts['count'] < 1 )
|
||||
{
|
||||
$textString = $this->lang->words['archive_no_query'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$textString = sprintf( $this->lang->words['archive_x_query'], $counts['percentage'], $this->lang->formatNumber( $counts['count'] ), $this->lang->formatNumber( $counts['total'] ) );
|
||||
}
|
||||
|
||||
/* Post process */
|
||||
foreach( array('archive', 'skip' ) as $type )
|
||||
{
|
||||
if ( ! empty( $rules[ $type ]['forum']['text'] ) )
|
||||
{
|
||||
$ids = IPSLib::isSerialized( $rules[ $type ]['forum']['text'] ) ? unserialize( $rules[ $type ]['forum']['text'] ) : array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
foreach( $ids as $fid )
|
||||
{
|
||||
$data = $this->registry->class_forums->getForumbyId( $fid );
|
||||
|
||||
if ( $data['id'] )
|
||||
{
|
||||
$rules[ $type ]['forum']['_parseData'][ $fid ] = array( 'data' => $this->registry->class_forums->getForumbyId( $fid ),
|
||||
'nav' => $this->html->buildForumNav( $this->registry->class_forums->forumsBreadcrumbNav( $fid, 'showforum=', true ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $rules[ $type ]['member']['text'] ) )
|
||||
{
|
||||
$ids = ( IPSLib::isSerialized( $rules[ $type ]['member']['text'] ) ) ? unserialize( $rules[ $type ]['member']['text'] ) : array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
$members = IPSMember::load( $ids, 'all' );
|
||||
|
||||
foreach( $members as $id => $data )
|
||||
{
|
||||
$members[ $id ] = IPSMember::buildProfilePhoto( $members[ $id ]);
|
||||
$members[ $id ]['photoTag'] = IPSMember::buildPhotoTag( $members[ $id ], 'inset' );
|
||||
}
|
||||
|
||||
foreach( $ids as $fid )
|
||||
{
|
||||
$rules[ $type ]['member']['_parseData']['count'] = count( $members );
|
||||
$rules[ $type ]['member']['_parseData']['data'] = $members;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Show rules page */
|
||||
$this->registry->output->html .= $this->html->archiveRules( IPSText::jsonEncodeForTemplate( $rules ), $textString );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Rules
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
protected function _saveRules()
|
||||
{
|
||||
/* Get fields to save */
|
||||
$archiveFields = $this->archiveWriter->getArchiveOnFields();
|
||||
$skipFields = $this->archiveWriter->getArchiveSkipFields();
|
||||
|
||||
/* To save */
|
||||
$archiveData = array();
|
||||
$skipData = array();
|
||||
|
||||
/* Loop through and get archive data */
|
||||
foreach( $archiveFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'archive_field_' . $k ] ) )
|
||||
{
|
||||
$archiveData[ $k ] = array( 'value' => $_POST[ 'archive_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'archive_field_' . $k . '_text' ] ) ? $_POST[ 'archive_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'archive_field_' . $k . '_unit' ] ) ? $_POST[ 'archive_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through and get skup data */
|
||||
foreach( $skipFields as $k )
|
||||
{
|
||||
if ( isset( $_POST[ 'skip_field_' . $k ] ) )
|
||||
{
|
||||
$skipData[ $k ] = array( 'value' => $_POST[ 'skip_field_' . $k ],
|
||||
'text' => isset( $_POST[ 'skip_field_' . $k . '_text' ] ) ? $_POST[ 'skip_field_' . $k . '_text' ] : '',
|
||||
'unit' => isset( $_POST[ 'skip_field_' . $k . '_unit' ] ) ? $_POST[ 'skip_field_' . $k . '_unit' ] : '' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Update rules */
|
||||
foreach( $archiveData as $k => $data )
|
||||
{
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_0' ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => $k,
|
||||
'archive_value' => $data['value'],
|
||||
'archive_text' => $data['text'],
|
||||
'archive_unit' => $data['unit'],
|
||||
'archive_skip' => 0 ), array( 'archive_key' ) );
|
||||
}
|
||||
|
||||
/* Update rules */
|
||||
foreach( $skipData as $k => $data )
|
||||
{
|
||||
$this->DB->replace( 'core_archive_rules', array( 'archive_key' => md5( 'forums_' . $k . '_1' ),
|
||||
'archive_app' => 'forums',
|
||||
'archive_field' => $k,
|
||||
'archive_value' => $data['value'],
|
||||
'archive_text' => $data['text'],
|
||||
'archive_unit' => $data['unit'],
|
||||
'archive_skip' => 1 ), array( 'archive_key' ) );
|
||||
}
|
||||
|
||||
/* Done */
|
||||
return $this->_archiveRules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remote DB
|
||||
*
|
||||
* @return @e boolean
|
||||
*/
|
||||
protected function _connectionTest()
|
||||
{
|
||||
if ( ! empty( $this->settings['archive_remote_sql_database'] ) && ! empty( $this->settings['archive_remote_sql_user'] ) )
|
||||
{
|
||||
/* Load up archive class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
|
||||
$archiveWriter = new $classToLoad();
|
||||
|
||||
$archiveWriter->setApp('forums');
|
||||
|
||||
/* Test */
|
||||
$result = $archiveWriter->testConnection();
|
||||
|
||||
if ( is_string( $result ) && $result == 'NO_TABLE' )
|
||||
{
|
||||
/* Try and create table */
|
||||
$archiveWriter->createTable();
|
||||
$archiveWriter->flush();
|
||||
|
||||
/* Try test again */
|
||||
return $archiveWriter->testConnection();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @file defaultSection.php Define the default section for the 'archive' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since Tuesday 17th August 2004
|
||||
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 477 $
|
||||
*/
|
||||
|
||||
$DEFAULT_SECTION = 'archive';
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Archiving</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Archive Overview</subitemtitle>
|
||||
<subitemlang>archive_overview</subitemlang>
|
||||
<subsection>archive</subsection>
|
||||
<subitemurl>do=forums_overview</subitemurl>
|
||||
<subitemrolekey>archive_overview</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Archive Rules</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Archive Rules</subitemtitle>
|
||||
<subitemlang>archive_rules</subitemlang>
|
||||
<subsection>archive</subsection>
|
||||
<subitemurl>do=rules</subitemurl>
|
||||
<subitemrolekey>archive_rules</subitemrolekey>
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Archiving</grouptitle>
|
||||
<grouplang>forums_archive</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>archive_rules</key>
|
||||
<string>Can manage archiving rules?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'attachments' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,355 +1,355 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Search
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load HTML and language bits
|
||||
//-----------------------------------------
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=attachments&section=search';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=attachments§ion=search';
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_search_complete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchResults();
|
||||
break;
|
||||
|
||||
case 'attach_bulk_remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
|
||||
$this->_bulkRemoveAttachments();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
case 'search':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchForm();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk remove attachments
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _bulkRemoveAttachments()
|
||||
{
|
||||
foreach ( $_POST as $key => $value )
|
||||
{
|
||||
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if ( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
$attach_tid = array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get attach details?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.pid, p.topic_id',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
|
||||
}
|
||||
|
||||
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Recount topic upload marker
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
|
||||
$postlib = new $classToLoad( $this->registry );
|
||||
|
||||
foreach( $attach_tid as $tid )
|
||||
{
|
||||
if( $tid )
|
||||
{
|
||||
$postlib->recountTopicAttachments( $tid );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
|
||||
}
|
||||
|
||||
if ( $this->request['return'] == 'stats' )
|
||||
{
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments§ion=stats' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $_POST['url'] )
|
||||
{
|
||||
foreach( explode( '&', $_POST['url'] ) as $u )
|
||||
{
|
||||
list ( $k, $v ) = explode( '=', $u );
|
||||
|
||||
$this->request[ $k] = $v ;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_searchResults();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachment search results
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchResults()
|
||||
{
|
||||
$show = intval($this->request['show']);
|
||||
$show = $show > 100 ? 100 : $show;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build URL
|
||||
//-----------------------------------------
|
||||
|
||||
$url = "";
|
||||
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
|
||||
|
||||
foreach( $url_components as $u )
|
||||
{
|
||||
$url .= $u . '=' . $this->request[ $u ] . '&';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build Query
|
||||
//-----------------------------------------
|
||||
|
||||
$queryfinal = "";
|
||||
$query = array();
|
||||
|
||||
if ( $this->request['extension'] )
|
||||
{
|
||||
$query[] = 'a.attach_ext="' . mb_strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
|
||||
}
|
||||
|
||||
if ( $this->request['filesize'] )
|
||||
{
|
||||
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
|
||||
}
|
||||
|
||||
if ( $this->request['days'] )
|
||||
{
|
||||
$day_break = time() - intval( $this->request['days'] * 86400 );
|
||||
|
||||
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_date {$gt} {$day_break}";
|
||||
}
|
||||
|
||||
if ( $this->request['hits'] )
|
||||
{
|
||||
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
|
||||
}
|
||||
|
||||
if ( $this->request['filename'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . mb_strtolower( $this->request['filename'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['authorname'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . mb_strtolower( $this->request['authorname'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['onlyimage'] )
|
||||
{
|
||||
$query[] = 'a.attach_is_image=1';
|
||||
}
|
||||
|
||||
if ( count($query) )
|
||||
{
|
||||
$queryfinal = 'AND '. implode( " AND ", $query );
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'".$queryfinal,
|
||||
'add_join' => array(
|
||||
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
1 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left' )
|
||||
),
|
||||
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
|
||||
'limit' => array( 0, $show ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
|
||||
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show attachment search form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchForm()
|
||||
{
|
||||
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
|
||||
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
|
||||
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
|
||||
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
|
||||
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
|
||||
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
|
||||
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
|
||||
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
|
||||
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
|
||||
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
|
||||
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
|
||||
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
|
||||
2 => array( 'filesize', $this->lang->words['se_osize'] ),
|
||||
3 => array( 'file' , $this->lang->words['se_oname'] ),
|
||||
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
|
||||
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
|
||||
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
|
||||
), isset($_POST['sort']) ? $_POST['sort'] : '' );
|
||||
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
|
||||
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Search
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_search extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Skin object
|
||||
*
|
||||
* @var object Skin templates
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Shortcut for url
|
||||
*
|
||||
* @var string URL shortcut
|
||||
*/
|
||||
protected $form_code;
|
||||
|
||||
/**
|
||||
* Shortcut for url (javascript)
|
||||
*
|
||||
* @var string JS URL shortcut
|
||||
*/
|
||||
protected $form_code_js;
|
||||
|
||||
/**
|
||||
* Main class entry point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load HTML and language bits
|
||||
//-----------------------------------------
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$this->form_code = $this->html->form_code = 'module=attachments&section=search';
|
||||
$this->form_code_js = $this->html->form_code_js = 'module=attachments§ion=search';
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_search_complete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchResults();
|
||||
break;
|
||||
|
||||
case 'attach_bulk_remove':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'remove_attachments' );
|
||||
$this->_bulkRemoveAttachments();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
case 'search':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'view_attachments' );
|
||||
$this->_searchForm();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk remove attachments
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _bulkRemoveAttachments()
|
||||
{
|
||||
foreach ( $_POST as $key => $value )
|
||||
{
|
||||
if ( preg_match( "/^attach_(\d+)$/", $key, $match ) )
|
||||
{
|
||||
if ( $this->request[ $match[0] ] )
|
||||
{
|
||||
$ids[] = $match[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = IPSLib::cleanIntArray( $ids );
|
||||
$attach_tid = array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get attach details?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "a.attach_rel_id > 0 AND a.attach_id IN(" . implode( ",", $ids ) . ")",
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.pid, p.topic_id',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => "p.pid=a.attach_rel_id AND attach_rel_module='post'",
|
||||
'type' => 'left',
|
||||
),
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $killmeh = $this->DB->fetch() )
|
||||
{
|
||||
if ( $killmeh['attach_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_location'] );
|
||||
}
|
||||
|
||||
if ( $killmeh['attach_thumb_location'] )
|
||||
{
|
||||
@unlink( $this->settings['upload_dir'] . "/" . $killmeh['attach_thumb_location'] );
|
||||
}
|
||||
|
||||
$attach_tid[ $killmeh['topic_id'] ] = $killmeh['topic_id'];
|
||||
}
|
||||
|
||||
$this->DB->delete( 'attachments', "attach_id IN(" . implode( ",", $ids ) . ")" );
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['deleted_attachments'], implode( ",", $ids ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Recount topic upload marker
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir('forums') . '/sources/classes/post/classPost.php' );/*noLibHook*/
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums' );
|
||||
|
||||
$postlib = new $classToLoad( $this->registry );
|
||||
|
||||
foreach( $attach_tid as $tid )
|
||||
{
|
||||
if( $tid )
|
||||
{
|
||||
$postlib->recountTopicAttachments( $tid );
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['attachments_removed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['noattach_to_remove'];
|
||||
}
|
||||
|
||||
if ( $this->request['return'] == 'stats' )
|
||||
{
|
||||
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=attachments§ion=stats' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $_POST['url'] )
|
||||
{
|
||||
foreach( explode( '&', $_POST['url'] ) as $u )
|
||||
{
|
||||
list ( $k, $v ) = explode( '=', $u );
|
||||
|
||||
$this->request[ $k] = $v ;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_searchResults();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Attachment search results
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchResults()
|
||||
{
|
||||
$show = intval($this->request['show']);
|
||||
$show = $show > 100 ? 100 : $show;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build URL
|
||||
//-----------------------------------------
|
||||
|
||||
$url = "";
|
||||
$url_components = array( 'extension', 'filesize', 'filesize_gt', 'days', 'days_gt', 'hits', 'hits_gt', 'filename', 'authorname', 'onlyimage', 'orderby', 'sort', 'show' );
|
||||
|
||||
foreach( $url_components as $u )
|
||||
{
|
||||
$url .= $u . '=' . $this->request[ $u ] . '&';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Build Query
|
||||
//-----------------------------------------
|
||||
|
||||
$queryfinal = "";
|
||||
$query = array();
|
||||
|
||||
if ( $this->request['extension'] )
|
||||
{
|
||||
$query[] = 'a.attach_ext="' . strtolower( str_replace( ".", "", $this->request['extension'] ) ) . '"';
|
||||
}
|
||||
|
||||
if ( $this->request['filesize'] )
|
||||
{
|
||||
$gt = $this->request['filesize_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_filesize {$gt} " . intval( $this->request['filesize']*1024 );
|
||||
}
|
||||
|
||||
if ( $this->request['days'] )
|
||||
{
|
||||
$day_break = time() - intval( $this->request['days'] * 86400 );
|
||||
|
||||
$gt = $this->request['days_gt'] == 'lt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_date {$gt} {$day_break}";
|
||||
}
|
||||
|
||||
if ( $this->request['hits'] )
|
||||
{
|
||||
$gt = $this->request['hits_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_hits {$gt} " . intval($this->request['hits']);
|
||||
}
|
||||
|
||||
if ( $this->request['filename'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('a.attach_file') . ' LIKE "%' . strtolower( $this->request['filename'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['authorname'] )
|
||||
{
|
||||
$query[] = $this->DB->buildLower('p.author_name') . ' LIKE "%' . strtolower( $this->request['authorname'] ) . '%"';
|
||||
}
|
||||
|
||||
if ( $this->request['onlyimage'] )
|
||||
{
|
||||
$query[] = 'a.attach_is_image=1';
|
||||
}
|
||||
|
||||
if ( count($query) )
|
||||
{
|
||||
$queryfinal = 'AND '. implode( " AND ", $query );
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'".$queryfinal,
|
||||
'add_join' => array(
|
||||
0 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
1 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left' ),
|
||||
2 => array( 'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left' )
|
||||
),
|
||||
'order' => "a.attach_" . $this->request['orderby'] . " " . $this->request['sort'],
|
||||
'limit' => array( 0, $show ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat($r['attach_filesize']);
|
||||
$r['attach_date'] = ipsRegistry::getClass( 'class_localization')->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchResults( $url, $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show attachment search form
|
||||
*
|
||||
* @return @e void [Outputs to screen]
|
||||
*/
|
||||
protected function _searchForm()
|
||||
{
|
||||
$gt_array = array( 0 => array( 'gt', $this->lang->words['se_morethan'] ), 1 => array( 'lt', $this->lang->words['se_lessthan'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$form['extension'] = $this->registry->output->formSimpleInput( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 );
|
||||
$form['filesize_gt'] = $this->registry->output->formDropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' );
|
||||
$form['filesize'] = $this->registry->output->formSimpleInput( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 );
|
||||
$form['days_gt'] = $this->registry->output->formDropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' );
|
||||
$form['days'] = $this->registry->output->formSimpleInput( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 );
|
||||
$form['hits_gt'] = $this->registry->output->formDropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' );
|
||||
$form['hits'] = $this->registry->output->formSimpleInput( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 );
|
||||
$form['filename'] = $this->registry->output->formInput( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '' );
|
||||
$form['authorname'] = $this->registry->output->formInput( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '' );
|
||||
$form['onlyimage'] = $this->registry->output->formYesNo( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '' );
|
||||
$form['orderby'] = $this->registry->output->formDropdown( 'orderby', array( 0 => array( 'date' , $this->lang->words['se_odate'] ),
|
||||
1 => array( 'hits' , $this->lang->words['se_oviews'] ),
|
||||
2 => array( 'filesize', $this->lang->words['se_osize'] ),
|
||||
3 => array( 'file' , $this->lang->words['se_oname'] ),
|
||||
), isset($_POST['orderby']) ? $_POST['orderby'] : '' );
|
||||
$form['sort'] = $this->registry->output->formDropdown( 'sort' , array( 0 => array( 'desc' , $this->lang->words['se_odsc'] ),
|
||||
1 => array( 'asc' , $this->lang->words['se_oasc'] ),
|
||||
), isset($_POST['sort']) ? $_POST['sort'] : '' );
|
||||
$form['show'] = $this->registry->output->formSimpleInput( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 );
|
||||
|
||||
|
||||
$this->registry->output->html .= $this->html->attachmentSearchForm( $form );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,233 +1,233 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Stats
|
||||
* Last Updated: $LastChangedDate: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_stats extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=stats&';
|
||||
$this->html->form_code_js = 'module=attachments&section=stats&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'overview':
|
||||
case 'stats':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
|
||||
$this->attachmentStatsOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows attachment statistics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentStatsOverview()
|
||||
{
|
||||
/* Get attachment Types */
|
||||
$cache['attachtypes'] = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
|
||||
|
||||
/* Overall Stats */
|
||||
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
|
||||
|
||||
/* Last 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_date DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$last_5 = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$last_5[] = $r;
|
||||
}
|
||||
|
||||
/* Largest 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_filesize DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$largest_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$largest_5[] = $r;
|
||||
}
|
||||
|
||||
/* 5 Most Viewed Downloads */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_hits DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$most_viewed_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$most_viewed_5[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Stats
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_stats extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=stats&';
|
||||
$this->html->form_code_js = 'module=attachments&section=stats&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'overview':
|
||||
case 'stats':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'stats_attachments' );
|
||||
$this->attachmentStatsOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows attachment statistics
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentStatsOverview()
|
||||
{
|
||||
/* Get attachment Types */
|
||||
$cache['attachtypes'] = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$cache['attachtypes'][ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$stats = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum', 'from' => 'attachments', 'where' => 'attach_rel_module=\'post\'' ) );
|
||||
|
||||
/* Overall Stats */
|
||||
$overall_stats = array( 'total_attachments' => $this->registry->class_localization->formatNumber( $stats['count'] ), 'total_size' => IPSLib::sizeFormat( $stats['sum'] ) );
|
||||
|
||||
/* Last 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_date DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$last_5 = array();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$last_5[] = $r;
|
||||
}
|
||||
|
||||
/* Largest 5 Attachments */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_filesize DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$largest_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$largest_5[] = $r;
|
||||
}
|
||||
|
||||
/* 5 Most Viewed Downloads */
|
||||
$this->DB->build( array(
|
||||
'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => "attach_rel_module='post'",
|
||||
'order' => "a.attach_hits DESC",
|
||||
'limit' => array( 0, 5 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 't.tid, t.forum_id, t.title',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 'p.topic_id=t.tid',
|
||||
'type' => 'left'
|
||||
),
|
||||
array(
|
||||
'select' => 'm.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=a.attach_member_id',
|
||||
'type' => 'left'
|
||||
)
|
||||
)
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the last 5 */
|
||||
$most_viewed_5 = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* Format Fields */
|
||||
$r['stitle'] = $r['title'] ? "<a href='{$this->settings['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' title='{$r['title']}'>" . IPSText::truncate( $r['title'], 30 ) . "</a>" : $this->lang->words['attach_not_topic'];
|
||||
$r['_icon'] = $this->settings['mime_img'] . '/' . $cache['attachtypes'][ $r['attach_ext'] ]['atype_img'];
|
||||
$r['attach_filesize'] = IPSLib::sizeFormat( $r['attach_filesize'] );
|
||||
$r['post_date'] = $this->registry->class_localization->getDate( $r['attach_date'], 'SHORT', 1 );
|
||||
|
||||
/* Add to output array */
|
||||
$most_viewed_5[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentStats( $overall_stats, $last_5, $largest_5, $most_viewed_5 );
|
||||
}
|
||||
}
|
||||
@@ -1,420 +1,420 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Attachments: Manage
|
||||
* Last Updated: $LastChangedDate: 2011-06-23 12:03:27 -0400 (Thu, 23 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 9081 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_types extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=types&';
|
||||
$this->html->form_code_js = 'module=attachments&section=types&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeForm('add');
|
||||
break;
|
||||
|
||||
case 'attach_doadd':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeSave('add');
|
||||
break;
|
||||
|
||||
case 'attach_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeForm('edit');
|
||||
break;
|
||||
|
||||
case 'attach_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_delete' );
|
||||
$this->attachmentTypeDelete();
|
||||
break;
|
||||
|
||||
case 'attach_doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeSave('edit');
|
||||
break;
|
||||
|
||||
case 'attach_export':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_export' );
|
||||
$this->attachmentTypeExport();
|
||||
break;
|
||||
|
||||
case 'attach_import':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_import' );
|
||||
$this->attachmentTypeImport();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_view' );
|
||||
$this->attachmentTypesOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports attachment types from an xml document
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeImport()
|
||||
{
|
||||
/* Get the XML Content */
|
||||
$content = $this->registry->adminFunctions->importXml( 'ipb_attachtypes.xml' );
|
||||
|
||||
/* Check to make sure we have content */
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_failed'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/* Get the XML class */
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
|
||||
/* Get a list of the types already installed */
|
||||
$types = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => "atype_extension" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$types[ $r['atype_extension'] ] = 1;
|
||||
}
|
||||
|
||||
/* Loop through the xml document and insert new types */
|
||||
foreach( $xml->fetchElements('attachtype') as $record )
|
||||
{
|
||||
$entry = $xml->fetchElementsFromRecord( $record );
|
||||
|
||||
/* Build the insert array */
|
||||
$insert_array = array( 'atype_extension' => $entry['atype_extension'],
|
||||
'atype_mimetype' => $entry['atype_mimetype'],
|
||||
'atype_post' => $entry['atype_post'],
|
||||
'atype_img' => $entry['atype_img']
|
||||
);
|
||||
|
||||
/* Bypass if this type has already been added */
|
||||
if ( $types[ $entry['atype_extension'] ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Insert the new type */
|
||||
if ( $entry['atype_extension'] and $entry['atype_mimetype'] )
|
||||
{
|
||||
$this->DB->insert( 'attachments_type', $insert_array );
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild the cache and bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_imported'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the attachment type xml export
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeExport()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'attachtypesexport' );
|
||||
$xml->addElement( 'attachtypesgroup', 'attachtypesexport' );
|
||||
|
||||
/* Query the attachment Types */
|
||||
$this->DB->build( array(
|
||||
'select' => 'atype_extension,atype_mimetype,atype_post,atype_img',
|
||||
'from' => 'attachments_type',
|
||||
'order' => "atype_extension"
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the types */
|
||||
$entry = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$xml->addElementAsRecord( 'attachtypesgroup', 'attachtype', $r );
|
||||
}
|
||||
|
||||
/* Send for download */
|
||||
$this->registry->output->showDownload( $xml->fetchDocument(), 'attachments.xml', "unknown/unknown", false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified attachment type
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeDelete()
|
||||
{
|
||||
/* INI */
|
||||
$this->request[ 'id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Delete the type */
|
||||
$this->DB->delete( 'attachments_type', "atype_id={$this->request['id']}" );
|
||||
|
||||
/* Build the cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_deleted'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the from for adding/editing attachments
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeSave( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Make sure the form was filled out */
|
||||
if ( ! $this->request['atype_extension'] or ! $this->request['atype_mimetype'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_enterinfo'];
|
||||
$this->attachmentTypeForm( $type );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the save array */
|
||||
$save_array = array( 'atype_extension' => str_replace( ".", "", $this->request['atype_extension'] ),
|
||||
'atype_mimetype' => trim( $this->request['atype_mimetype'] ),
|
||||
'atype_post' => trim( $this->request['atype_post'] ),
|
||||
'atype_img' => trim( $this->request['atype_img'] ) );
|
||||
|
||||
/* Add attachment type to the database */
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
/* Check to see if this attachment type already exists */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => "atype_extension='".$save_array['atype_extension']."'" ) );
|
||||
|
||||
if ( $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['ty_already'], $save_array['atype_extension'] );
|
||||
$this->attachmentTypeForm($type);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the attachment type */
|
||||
$this->DB->insert( 'attachments_type', $save_array );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_added'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update the attachment type */
|
||||
$this->DB->update( 'attachments_type', $save_array, 'atype_id=' . $this->request['id'] );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_edited'];
|
||||
}
|
||||
|
||||
/* Cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for adding/editing attachment types
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeForm( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = $this->request['id'] ? intval( $this->request['id'] ) : 0;
|
||||
$this->request['baseon'] = $this->request['baseon'] ? intval( $this->request['baseon'] ) : 0;
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->nav[] = array( '', $this->lang->words['ty_addedit'] );
|
||||
|
||||
$baseon = '';
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doadd';
|
||||
$button = $this->lang->words['ty_addnew'];
|
||||
$id = 0;
|
||||
|
||||
/* Default Data */
|
||||
if( $this->request['baseon'] )
|
||||
{
|
||||
$attach = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'attachments_type',
|
||||
'where' => 'atype_id=' . $this->request['baseon']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$attach = array( 'atype_extension' => '',
|
||||
'atype_mimetype' => '',
|
||||
'atype_post' => '',
|
||||
'atype_img' => '' );
|
||||
}
|
||||
|
||||
/* Generate Based On Dropdown*/
|
||||
$dd = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$dd[] = array( $r['atype_id'], $this->lang->words['ty_baseon'] . $r['atype_extension'] );
|
||||
}
|
||||
|
||||
$title = $button;
|
||||
$baseon = $this->html->attachmentTypeBaseOn( $this->registry->output->formDropdown( 'baseon', $dd ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doedit';
|
||||
$button = $this->lang->words['ty_edit'];
|
||||
$title = $button;
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Default Data */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => 'atype_id='.ipsRegistry::$request['id'] ) );
|
||||
|
||||
/* Check for valid id */
|
||||
if ( ! $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_noid'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
}
|
||||
|
||||
/* Form Elements */
|
||||
$form = array(
|
||||
'atype_extension' => $this->registry->output->formSimpleInput( 'atype_extension', !empty( $this->request['atype_extension'] ) ? $this->request['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
'atype_mimetype' => $this->registry->output->formSimpleInput( 'atype_mimetype' , !empty( $this->request['atype_mimetype'] ) ? $this->request['atype_mimetype'] : $attach['atype_mimetype'] , 40 ),
|
||||
'atype_post' => $this->registry->output->formYesNo( 'atype_post' , !empty( $this->request['atype_post'] ) ? $this->request['atype_post'] : $attach['atype_post'] ),
|
||||
'atype_img' => $this->registry->output->formSimpleInput( 'atype_img' , !empty( $this->request['atype_img'] ) ? $this->request['atype_img'] : $attach['atype_img'] , 40 ),
|
||||
);
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeForm( $title, $code, $id, $form, $button, $baseon );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the attachment types that have been setup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypesOverview()
|
||||
{
|
||||
/* Get the attachments */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the attachments */
|
||||
$attach_rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_imagedir'] = $this->registry->output->skin['set_image_dir'];
|
||||
|
||||
$r['apost_checked'] = $r['atype_post'] ? "<img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['yesno_yes']}' />" : "<img src='{$this->settings['skin_acp_url']}/images/icons/cross.png' alt='{$this->lang->words['yesno_no']}' />";
|
||||
|
||||
$attach_rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeOverview( $attach_rows );
|
||||
}
|
||||
|
||||
/*
|
||||
* Rebuilds the attachment type cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeCacheRebuild()
|
||||
{
|
||||
$cache = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['atype_extension'] = strtolower( $r['atype_extension'] );
|
||||
$cache[ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'attachtypes', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Attachments: Manage
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Mon 24th May 2004
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_attachments_types extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* HTML object
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $html;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_attachments' );
|
||||
$this->html->form_code = 'module=attachments&section=types&';
|
||||
$this->html->form_code_js = 'module=attachments&section=types&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_attachments' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
//-----------------------------------------
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'attach_add':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeForm('add');
|
||||
break;
|
||||
|
||||
case 'attach_doadd':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_add' );
|
||||
$this->attachmentTypeSave('add');
|
||||
break;
|
||||
|
||||
case 'attach_edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeForm('edit');
|
||||
break;
|
||||
|
||||
case 'attach_delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_delete' );
|
||||
$this->attachmentTypeDelete();
|
||||
break;
|
||||
|
||||
case 'attach_doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_edit' );
|
||||
$this->attachmentTypeSave('edit');
|
||||
break;
|
||||
|
||||
case 'attach_export':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_export' );
|
||||
$this->attachmentTypeExport();
|
||||
break;
|
||||
|
||||
case 'attach_import':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_import' );
|
||||
$this->attachmentTypeImport();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mime_view' );
|
||||
$this->attachmentTypesOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports attachment types from an xml document
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeImport()
|
||||
{
|
||||
/* Get the XML Content */
|
||||
$content = $this->registry->adminFunctions->importXml( 'ipb_attachtypes.xml' );
|
||||
|
||||
/* Check to make sure we have content */
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_failed'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/* Get the XML class */
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
$xml->loadXML( $content );
|
||||
|
||||
/* Get a list of the types already installed */
|
||||
$types = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => "atype_extension" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$types[ $r['atype_extension'] ] = 1;
|
||||
}
|
||||
|
||||
/* Loop through the xml document and insert new types */
|
||||
foreach( $xml->fetchElements('attachtype') as $record )
|
||||
{
|
||||
$entry = $xml->fetchElementsFromRecord( $record );
|
||||
|
||||
/* Build the insert array */
|
||||
$insert_array = array( 'atype_extension' => $entry['atype_extension'],
|
||||
'atype_mimetype' => $entry['atype_mimetype'],
|
||||
'atype_post' => $entry['atype_post'],
|
||||
'atype_img' => $entry['atype_img']
|
||||
);
|
||||
|
||||
/* Bypass if this type has already been added */
|
||||
if ( $types[ $entry['atype_extension'] ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Insert the new type */
|
||||
if ( $entry['atype_extension'] and $entry['atype_mimetype'] )
|
||||
{
|
||||
$this->DB->insert( 'attachments_type', $insert_array );
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild the cache and bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_imported'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the attachment type xml export
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeExport()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH.'classXML.php' );/*noLibHook*/
|
||||
|
||||
$xml = new classXML( IPS_DOC_CHAR_SET );
|
||||
|
||||
$xml->newXMLDocument();
|
||||
$xml->addElement( 'attachtypesexport' );
|
||||
$xml->addElement( 'attachtypesgroup', 'attachtypesexport' );
|
||||
|
||||
/* Query the attachment Types */
|
||||
$this->DB->build( array(
|
||||
'select' => 'atype_extension,atype_mimetype,atype_post,atype_img',
|
||||
'from' => 'attachments_type',
|
||||
'order' => "atype_extension"
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the types */
|
||||
$entry = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$xml->addElementAsRecord( 'attachtypesgroup', 'attachtype', $r );
|
||||
}
|
||||
|
||||
/* Send for download */
|
||||
$this->registry->output->showDownload( $xml->fetchDocument(), 'attachments.xml', "unknown/unknown", false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified attachment type
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeDelete()
|
||||
{
|
||||
/* INI */
|
||||
$this->request[ 'id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Delete the type */
|
||||
$this->DB->delete( 'attachments_type', "atype_id={$this->request['id']}" );
|
||||
|
||||
/* Build the cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['ty_deleted'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the from for adding/editing attachments
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeSave( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = intval( $this->request['id'] );
|
||||
|
||||
/* Make sure the form was filled out */
|
||||
if ( ! $this->request['atype_extension'] or ! $this->request['atype_mimetype'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_enterinfo'];
|
||||
$this->attachmentTypeForm( $type );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build the save array */
|
||||
$save_array = array( 'atype_extension' => str_replace( ".", "", $this->request['atype_extension'] ),
|
||||
'atype_mimetype' => trim( $this->request['atype_mimetype'] ),
|
||||
'atype_post' => trim( $this->request['atype_post'] ),
|
||||
'atype_img' => trim( $this->request['atype_img'] ) );
|
||||
|
||||
/* Add attachment type to the database */
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
/* Check to see if this attachment type already exists */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => "atype_extension='".$save_array['atype_extension']."'" ) );
|
||||
|
||||
if ( $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['ty_already'], $save_array['atype_extension'] );
|
||||
$this->attachmentTypeForm($type);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Insert the attachment type */
|
||||
$this->DB->insert( 'attachments_type', $save_array );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_added'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update the attachment type */
|
||||
$this->DB->update( 'attachments_type', $save_array, 'atype_id=' . $this->request['id'] );
|
||||
|
||||
/* Done Message */
|
||||
$this->registry->output->global_message = $this->lang->words['ty_edited'];
|
||||
}
|
||||
|
||||
/* Cache and Bounce */
|
||||
$this->attachmentTypeCacheRebuild();
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for adding/editing attachment types
|
||||
*
|
||||
* @param string $type Either add or edit
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeForm( $type='add' )
|
||||
{
|
||||
/* INI */
|
||||
$this->request['id'] = $this->request['id'] ? intval( $this->request['id'] ) : 0;
|
||||
$this->request['baseon'] = $this->request['baseon'] ? intval( $this->request['baseon'] ) : 0;
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->nav[] = array( '', $this->lang->words['ty_addedit'] );
|
||||
|
||||
$baseon = '';
|
||||
|
||||
if( $type == 'add' )
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doadd';
|
||||
$button = $this->lang->words['ty_addnew'];
|
||||
$id = 0;
|
||||
|
||||
/* Default Data */
|
||||
if( $this->request['baseon'] )
|
||||
{
|
||||
$attach = $this->DB->buildAndFetch( array(
|
||||
'select' => '*',
|
||||
'from' => 'attachments_type',
|
||||
'where' => 'atype_id=' . $this->request['baseon']
|
||||
) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$attach = array( 'atype_extension' => '',
|
||||
'atype_mimetype' => '',
|
||||
'atype_post' => '',
|
||||
'atype_img' => '' );
|
||||
}
|
||||
|
||||
/* Generate Based On Dropdown*/
|
||||
$dd = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$dd[] = array( $r['atype_id'], $this->lang->words['ty_baseon'] . $r['atype_extension'] );
|
||||
}
|
||||
|
||||
$title = $button;
|
||||
$baseon = $this->html->attachmentTypeBaseOn( $this->registry->output->formDropdown( 'baseon', $dd ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$code = 'attach_doedit';
|
||||
$button = $this->lang->words['ty_edit'];
|
||||
$title = $button;
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
/* Default Data */
|
||||
$attach = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'attachments_type', 'where' => 'atype_id='.ipsRegistry::$request['id'] ) );
|
||||
|
||||
/* Check for valid id */
|
||||
if ( ! $attach['atype_id'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['ty_noid'];
|
||||
$this->attachmentTypesOverview();
|
||||
}
|
||||
}
|
||||
|
||||
/* Form Elements */
|
||||
$form = array(
|
||||
'atype_extension' => $this->registry->output->formSimpleInput( 'atype_extension', !empty( $this->request['atype_extension'] ) ? $this->request['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
'atype_mimetype' => $this->registry->output->formSimpleInput( 'atype_mimetype' , !empty( $this->request['atype_mimetype'] ) ? $this->request['atype_mimetype'] : $attach['atype_mimetype'] , 40 ),
|
||||
'atype_post' => $this->registry->output->formYesNo( 'atype_post' , !empty( $this->request['atype_post'] ) ? $this->request['atype_post'] : $attach['atype_post'] ),
|
||||
'atype_img' => $this->registry->output->formSimpleInput( 'atype_img' , !empty( $this->request['atype_img'] ) ? $this->request['atype_img'] : $attach['atype_img'] , 40 ),
|
||||
);
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeForm( $title, $code, $id, $form, $button, $baseon );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the attachment types that have been setup
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypesOverview()
|
||||
{
|
||||
/* Get the attachments */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through the attachments */
|
||||
$attach_rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['_imagedir'] = $this->registry->output->skin['set_image_dir'];
|
||||
|
||||
$r['apost_checked'] = $r['atype_post'] ? "<img src='{$this->settings['skin_acp_url']}/images/icons/tick.png' alt='{$this->lang->words['yesno_yes']}' />" : "<img src='{$this->settings['skin_acp_url']}/images/icons/cross.png' alt='{$this->lang->words['yesno_no']}' />";
|
||||
|
||||
$attach_rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->attachmentTypeOverview( $attach_rows );
|
||||
}
|
||||
|
||||
/*
|
||||
* Rebuilds the attachment type cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function attachmentTypeCacheRebuild()
|
||||
{
|
||||
$cache = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_img', 'from' => 'attachments_type', 'where' => "atype_post=1" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $r = $this->DB->fetch() )
|
||||
{
|
||||
$r['atype_extension'] = strtolower( $r['atype_extension'] );
|
||||
$cache[ $r['atype_extension'] ] = $r;
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'attachtypes', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Типы файлов</title>
|
||||
<title>Attachment Types</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Типы файлов</subitemtitle>
|
||||
<subitemtitle>Attachment Types</subitemtitle>
|
||||
<subitemlang>attachment_types</subitemlang>
|
||||
<subsection>types</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Статистика</title>
|
||||
<title>Attachment Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика</subitemtitle>
|
||||
<subitemtitle>Attachment Stats</subitemtitle>
|
||||
<subitemlang>attachment_stats</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -28,10 +28,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Поиск</title>
|
||||
<title>Attachment Search</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Поиск</subitemtitle>
|
||||
<subitemtitle>Attachment Search</subitemtitle>
|
||||
<subitemlang>attachment_search</subitemlang>
|
||||
<subsection>search</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление прикрепленными файлами</grouptitle>
|
||||
<grouptitle>Manage Attachments</grouptitle>
|
||||
<grouplang>forums_attachments</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>view_attachments</key>
|
||||
<string>Может просматривать и искать файлы?</string>
|
||||
<string>Can search and review attachments?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_attachments</key>
|
||||
<string>Может просматривать статистику?</string>
|
||||
<string>Can view attachment stats?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>remove_attachments</key>
|
||||
<string>Может удалять?</string>
|
||||
<string>Can remove attachments?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление типами прикрепляемых файлов</grouptitle>
|
||||
<grouptitle>Manage Attachments Mime-Types</grouptitle>
|
||||
<grouplang>forums_mimes</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mime_view</key>
|
||||
<string>Может просматривать?</string>
|
||||
<string>Can view attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_add</key>
|
||||
<string>Может добавлять?</string>
|
||||
<string>Can add attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_edit</key>
|
||||
<string>Может изменять?</string>
|
||||
<string>Can edit attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_delete</key>
|
||||
<string>Может удалять?</string>
|
||||
<string>Can remove attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_import</key>
|
||||
<string>Может импортировать типы?</string>
|
||||
<string>Can import attachment types?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mime_export</key>
|
||||
<string>Может экспортировать типы?</string>
|
||||
<string>Can export attachment types?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'forums' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since Tuesday 17th August 2004
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* IP.Board v3.3.4
|
||||
* Forum management
|
||||
* Last Updated: $Date: 2011-09-01 23:02:38 -0400 (Thu, 01 Sep 2011) $
|
||||
* Last Updated: $Date: 2012-06-15 08:09:05 -0400 (Fri, 15 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: AndyMillne $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @link http://www.invisionpower.com
|
||||
* @since Tuesday 17th August 2004
|
||||
* @version $Revision: 9442 $
|
||||
* @version $Revision: 10929 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
@@ -63,6 +63,13 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
/* 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 ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// To do...
|
||||
//-----------------------------------------
|
||||
@@ -273,11 +280,11 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
|
||||
$_editor->setContent( $forum['rules_text'], 'rules' );
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 1 );
|
||||
|
||||
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350 ) );
|
||||
$_editor->setContent( $forum['rules_text'], 'rules' );
|
||||
|
||||
$forum['_editor'] = $_editor->show( 'body', array( 'height' => 350, 'isHtml' => 1 ) );
|
||||
|
||||
/* Form Fields */
|
||||
$forum['_show_rules'] = $this->registry->output->formDropdown( "show_rules", array(
|
||||
@@ -310,34 +317,26 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->registry->output->showError( $this->lang->words['for_noid'], 1136 );
|
||||
}
|
||||
|
||||
if( ! $this->request['rules_raw_html'] )
|
||||
{
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
/* Load editor stuff */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite' );
|
||||
$_editor = new $classToLoad();
|
||||
|
||||
/* About me editor */
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 0 );
|
||||
|
||||
/* About me editor */
|
||||
$_editor->setAllowHtml( 1 );
|
||||
$_editor->setAllowSmilies( 0 );
|
||||
|
||||
$_POST['body'] = $_editor->process( $_POST['body'] );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parse_smilies = 0;
|
||||
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_html = 1;
|
||||
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
|
||||
|
||||
$_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse( $_POST['body'] );
|
||||
}
|
||||
$_POST['body'] = $_editor->process( $_POST['body'] );
|
||||
|
||||
IPSText::getTextClass('bbcode')->parsing_section = 'rules';
|
||||
$_POST['body'] = IPSText::getTextClass('bbcode')->preDbParse( $_POST['body'] );
|
||||
|
||||
$rules = array(
|
||||
'rules_title' => IPSText::stripslashes( $_POST['title'] ),
|
||||
'rules_text' => IPSText::stripslashes( $_POST['body'] ),
|
||||
'show_rules' => $this->request['show_rules'],
|
||||
'rules_raw_html' => intval($this->request['rules_raw_html']),
|
||||
//'rules_raw_html' => intval($this->request['rules_raw_html']),
|
||||
);
|
||||
|
||||
|
||||
$this->DB->update( 'forums', $rules, 'id='.$this->request['f'] );
|
||||
|
||||
$this->registry->output->global_message = $this->lang->words['for_rulesup'];
|
||||
@@ -406,11 +405,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
// Make sure we have a legal forum
|
||||
//-----------------------------------------
|
||||
|
||||
if ( !$forum['id'] )
|
||||
if ( ! $forum['id'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_noid'], 1138 );
|
||||
}
|
||||
|
||||
|
||||
/* Now lets check and see if we've any archived topics and that */
|
||||
$count = $this->registry->topics->getTopics( array( 'forumId' => array( $forum['id'] ),
|
||||
'archiveState' => array( 'archived', 'working', 'restore' ),
|
||||
'getCountOnly' => true ) );
|
||||
|
||||
if ( $count )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['contains_archived_topics_so_there_haha'], '1138.1' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['frm_emptytitle'] );
|
||||
@@ -496,59 +505,82 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
*/
|
||||
public function deleteForm()
|
||||
{
|
||||
/* INI */
|
||||
//-----------------------------------------
|
||||
// Init
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['f'] = intval( $this->request['f'] );
|
||||
$form_array = array();
|
||||
|
||||
if ( ! $this->request['f'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_noid_delete'], 11311 );
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'id, name, parent_id', 'from' => 'forums', 'order' => 'position' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Make sure we have more than 1
|
||||
// forum..
|
||||
//-----------------------------------------
|
||||
$forums = $this->DB->execute($forums);
|
||||
|
||||
if( $this->DB->getTotalRows() < 2 )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['for_lastforum'], 11312 );
|
||||
}
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
/* Now lets check and see if we've any archived topics and that */
|
||||
$count = $this->registry->topics->getTopics( array( 'forumId' => array( $this->request['f'] ),
|
||||
'archiveState' => array( 'archived', 'working', 'restore' ),
|
||||
'getCountOnly' => true ) );
|
||||
|
||||
if ( $count )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['contains_archived_topics_so_there_haha'], '11312.1' );
|
||||
}
|
||||
|
||||
while( $r = $this->DB->fetch( $forums ) )
|
||||
{
|
||||
|
||||
if( $r['id'] == $this->request['f'] )
|
||||
{
|
||||
|
||||
$name = $r['name'];
|
||||
$is_cat = $r['parent_id'] > 0 ? 0 : 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$form_array = $this->registry->getClass('class_forums')->adForumsForumList( 1 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Count the number of topics
|
||||
// Where would you like to move topics?
|
||||
//-----------------------------------------
|
||||
|
||||
$posts = $this->DB->buildAndFetch( array( 'select' => 'count(*) as count', 'from' => 'topics', 'where' => 'forum_id='.$this->request['f'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Start form
|
||||
//-----------------------------------------
|
||||
|
||||
/* Move dropds */
|
||||
if( $posts['count'] )
|
||||
{
|
||||
$move = $this->registry->output->formDropdown( "MOVE_ID", $form_array );
|
||||
$move = $this->registry->output->formDropdown( "MOVE_ID", array_merge( array( array( 0, $this->lang->words['forum_delete_select'] ) ), $this->registry->getClass('class_forums')->adForumsForumList( 1, TRUE, array( $this->request['f'] ) ) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Where would you like to move subforums?
|
||||
//-----------------------------------------
|
||||
|
||||
$subforums = array();
|
||||
$this->DB->build( array( 'select' => 'id', 'from' => 'forums', 'where' => "parent_id={$this->request['f']}" ) );
|
||||
$this->DB->execute();
|
||||
while ( $row = $this->DB->fetch() )
|
||||
{
|
||||
$subforums[] = $row['id'];
|
||||
}
|
||||
|
||||
if ( !empty( $subforums ) )
|
||||
{
|
||||
$subforums[] = $this->request['f'];
|
||||
$subs = $this->registry->output->formDropdown( "new_parent_id", array_merge( array( array( 0, $this->lang->words['forum_delete_select'] ) ), $this->registry->getClass('class_forums')->adForumsForumList( FALSE, FALSE, $subforums ) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Output
|
||||
//-----------------------------------------
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['frm_deletebutton'] );
|
||||
$this->registry->output->html .= $this->html->forumDeleteForm( $this->request['f'], $name, $move, $is_cat );
|
||||
$this->registry->output->html .= $this->html->forumDeleteForm( $this->request['f'], $name, $move, $is_cat, $subs );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -569,7 +601,6 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->request['f'] = intval( $this->request['f'] );
|
||||
$this->request['MOVE_ID'] = intval( $this->request['MOVE_ID'] );
|
||||
$this->request['new_parent_id'] = intval( $this->request['new_parent_id'] );
|
||||
|
||||
$forum = $this->registry->class_forums->forum_by_id[ $this->request['f'] ];
|
||||
@@ -623,17 +654,34 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$modfunc = new $classToLoad( $this->registry );
|
||||
|
||||
|
||||
/* Load tagging stuff */
|
||||
if ( ! $this->registry->isClassLoaded('tags') )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php' );/*noLibHook*/
|
||||
$this->registry->setClass( 'tags', classes_tags_bootstrap::run( 'forums', 'topics' ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Move stuff
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->request['MOVE_ID'] )
|
||||
|
||||
if ( isset( $this->request['MOVE_ID'] ) )
|
||||
{
|
||||
if( $this->request['MOVE_ID'] == $this->request['f'] )
|
||||
$this->request['MOVE_ID'] = intval( $this->request['MOVE_ID'] );
|
||||
|
||||
if ( ! $this->request['MOVE_ID'] )
|
||||
{
|
||||
$this->registry->output->global_message = $this->lang->words['for_wherewhatwhy'];
|
||||
$this->registry->output->global_error = $this->lang->words['forum_delete_none_selected'];
|
||||
$this->deleteForm();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->request['MOVE_ID'] == $this->request['f'] )
|
||||
{
|
||||
$this->registry->output->global_error = $this->lang->words['for_wherewhatwhy'];
|
||||
$this->deleteForm();
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -654,6 +702,9 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
$this->DB->update( 'voters', array( 'forum_id' => $this->request['MOVE_ID'] ), 'forum_id='.$this->request['f'] );
|
||||
|
||||
/* Move tags */
|
||||
$this->registry->tags->moveTagsByParentId( $this->request['f'], $this->request['MOVE_ID'] );
|
||||
|
||||
$modfunc->forumRecount( $this->request['MOVE_ID'] );
|
||||
}
|
||||
|
||||
@@ -797,7 +848,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
// EDIT
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'edit' )
|
||||
if ( $type == 'edit' or $this->request['duplicate'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check
|
||||
@@ -852,6 +903,17 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$button = $this->lang->words['for_editfor_button'];
|
||||
$code = "doedit";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Duplicating?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->request['duplicate'] )
|
||||
{
|
||||
$forum['id'] = 0;
|
||||
$this->request['f'] = 0;
|
||||
$code = 'donew';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -1034,8 +1096,10 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$form['tabStrip'] = '';
|
||||
$form['tabContent'] = '';
|
||||
|
||||
$tabsUsed = 2;
|
||||
$firsttab = false;
|
||||
$tabsUsed = 2;
|
||||
$firstTab = empty($this->request['_initTab']) ? false : trim($this->request['_initTab']);
|
||||
|
||||
IPSLib::loadInterface( 'admin/forum_form.php' );
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
@@ -1055,7 +1119,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
if ( $this->request['_initTab'] == $app_dir )
|
||||
{
|
||||
$firsttab = $tabsUsed;
|
||||
$firstTab = $tabsUsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1066,17 +1130,23 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->output->extra_nav[] = array( '', $title );
|
||||
$this->registry->output->html .= $this->html->forumForm( $form, $button, $code, $title, $forum, $perm_matrix );
|
||||
$this->registry->output->html .= $this->html->forumForm( $form, $button, $code, $title, $forum, $perm_matrix, $firstTab );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the forum
|
||||
*
|
||||
* @param string [new|edit]
|
||||
* @return @e void Outputs to screen
|
||||
* @param string $type [new|edit]
|
||||
* @return @e void
|
||||
*/
|
||||
public function forumSave($type='new')
|
||||
public function forumSave( $type='new' )
|
||||
{
|
||||
/* If this is not a redirect forum anymore empty the redirect url - #35126 */
|
||||
if ( $this->request['forum_type'] != 'redirect' )
|
||||
{
|
||||
$this->request['redirect_url'] = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Converting the type?
|
||||
//-----------------------------------------
|
||||
@@ -1108,7 +1178,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
if( $this->request['name'] == "" )
|
||||
{
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], mb_strtolower( $forum_cat_lang ) );
|
||||
$this->registry->output->global_message = sprintf( $this->lang->words['for_entertitle'], strtolower( $forum_cat_lang ) );
|
||||
$this->forumForm( $type );
|
||||
return;
|
||||
}
|
||||
@@ -1145,7 +1215,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$save = array( 'name' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['name'] ) ) ),
|
||||
'name_seo' => IPSText::makeSeoTitle( $this->request['name'] ),
|
||||
'description' => IPSText::getTextClass('bbcode')->xssHtmlClean( nl2br( IPSText::stripslashes( $_POST['description'] ) ) ),
|
||||
'use_ibc' => intval($this->request['use_ibc']),
|
||||
'use_ibc' => isset( $this->request['use_ibc'] ) ? intval($this->request['use_ibc']) : 1,
|
||||
'use_html' => intval($this->request['use_html']),
|
||||
'password' => $this->request['password'],
|
||||
'password_override' => is_array($this->request['password_override']) ? implode( ",", $this->request['password_override'] ) : '',
|
||||
@@ -1175,14 +1245,20 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
'permission_custom_error' => nl2br( IPSText::stripslashes($_POST['permission_custom_error']) ) );
|
||||
|
||||
/* Save data from application tabs */
|
||||
IPSLib::loadInterface( 'admin/forum_form.php' );
|
||||
|
||||
$_forumPlugins = array();
|
||||
|
||||
foreach( IPSLib::getEnabledApplications() as $app_dir => $app_data )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/forum_form.php' ) )
|
||||
{
|
||||
$_class = IPSLib::loadLibrary( IPSLib::getAppDir( $app_dir ) . '/extensions/admin/forum_form.php', 'admin_forum_form__'.$app_dir, $app_dir );
|
||||
$_object = new $_class( $this->registry );
|
||||
$remote = $_object->getForSave();
|
||||
$save = array_merge( $remote, $save );
|
||||
$_forumPlugins[ $_class ] = new $_class( $this->registry );
|
||||
|
||||
$remote = $_forumPlugins[ $_class ]->getForSave();
|
||||
|
||||
$save = array_merge( $save, $remote );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1229,19 +1305,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
|
||||
/* Done */
|
||||
$this->registry->output->global_message = $forum_cat_lang . $this->lang->words['for__created'];
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . mb_strtolower ( $this->lang->words['for__created'] ) );
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang . " '" . $this->request['name'] . "'" . strtolower ( $this->lang->words['for__created'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->request['parent_id'] == -1 )
|
||||
{
|
||||
$forumData = $this->registry->class_forums->getForumById( $this->request['f'] );
|
||||
|
||||
if ( $this->request['parent_id'] == -1 )
|
||||
{
|
||||
$save['can_view_others'] = 1;
|
||||
|
||||
///* Permissions */
|
||||
/* Permissions */
|
||||
//$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/class_public_permissions.php', 'classPublicPermissions' );
|
||||
//$permissions = new $classToLoad( ipsRegistry::instance() );
|
||||
//$permissions->savePermMatrix( $this->request['perms'], $this->request['f'], 'forum' );
|
||||
|
||||
|
||||
if( ! $save['can_view_others'] )
|
||||
{
|
||||
$this->DB->update( 'permission_index', array( 'owner_only' => 1 ), "app='forums' AND perm_type='forum' AND perm_type_id={$this->request['f']}" );
|
||||
@@ -1253,14 +1331,48 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
}
|
||||
|
||||
$this->DB->update( 'forums', $save, "id=" . $this->request['f'] );
|
||||
|
||||
$forum_id = $this->request['f'];
|
||||
|
||||
/* Tags */
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
$this->registry->tags->updatePermssionsByParentId( $this->request['f'] );
|
||||
|
||||
/* Did we enable/disable tagging? @todo find a better way to do this. Perhaps another field in tags? */
|
||||
if ( isset( $this->request['bw_disable_tagging'] ) )
|
||||
{
|
||||
if ( $forumData['bw_disable_tagging'] != $this->request['bw_disable_tagging'] )
|
||||
{
|
||||
$toggle = ( $this->request['bw_disable_tagging'] ) ? 0 : 1;
|
||||
|
||||
$this->registry->tags->updateVisibilityByParentId( $this->request['f'], $toggle );
|
||||
|
||||
if ( $this->request['bw_disable_tagging'] == 0 )
|
||||
{
|
||||
/* We just restored all tags, so lets return hidden topics back to 0 */
|
||||
$this->DB->build( array( 'select' => 'tid',
|
||||
'from' => 'topics',
|
||||
'where' => 'forum_id=' . $this->request['f'] . ' AND ' . $this->registry->class_forums->fetchTopicHiddenQuery( array( 'sdeleted', 'hidden', 'pdelete', 'oktoremove' ) ),
|
||||
'order' => 'last_post DESC',
|
||||
'limit' => array( 0, 500 ) ) );
|
||||
$this->DB->execute();
|
||||
|
||||
$topics = array();
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$topics[] = $row['tid'];
|
||||
}
|
||||
|
||||
if ( count( $topics ) )
|
||||
{
|
||||
$this->registry->tags->updateVisibilityByMetaId( $topics, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->output->global_message = $forum_cat_lang.$this->lang->words['for__edited'];
|
||||
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . mb_strtolower ( $this->lang->words['for__edited'] ) );
|
||||
$this->registry->adminFunctions->saveAdminLog( $forum_cat_lang." '" . $this->request['name'] . "' " . strtolower ( $this->lang->words['for__edited'] ) );
|
||||
}
|
||||
|
||||
$this->request['f'] = '';
|
||||
@@ -1269,6 +1381,21 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$this->request['f'] = $save['parent_id'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Post save callbacks
|
||||
//-----------------------------------------
|
||||
|
||||
if( count($_forumPlugins) )
|
||||
{
|
||||
foreach( $_forumPlugins as $_className => $_object )
|
||||
{
|
||||
if( method_exists( $_object, 'postSave' ) )
|
||||
{
|
||||
$_object->postSave( $forum_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->registry->getClass('class_forums')->forumsInit();
|
||||
|
||||
$this->showForums();
|
||||
@@ -1343,7 +1470,7 @@ class admin_forums_forums_forums extends ipsCommand
|
||||
$perm_matrix = $permissions->adminPermMatrix( 'forum', $forum, 'forums', 'view' );
|
||||
}
|
||||
|
||||
$forumCopyDropdown = $this->registry->output->formDropdown( 'copyForumPerms', $this->registry->getClass('class_forums')->adForumsForumList() );
|
||||
$forumCopyDropdown = $this->registry->output->formDropdown( 'copyForumPerms', $this->registry->getClass('class_forums')->adForumsForumList( TRUE, FALSE, array( $forum['id'] ) ) );
|
||||
|
||||
$this->registry->output->html .= $this->html->forumPermissionForm( $forum, $relative, $perm_matrix, $forum, $forumCopyDropdown );
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,462 +1,462 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.2.3
|
||||
* Topic Multi-Moderation
|
||||
* Last Updated: $LastChangedDate: 2011-09-08 18:01:45 -0400 (Thu, 08 Sep 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://hatynka.in
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 9470 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_forums_multimods extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Forum functions library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $forumfunc;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Setup Forum Classes */
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
$this->forumfunc = new $classToLoad( $registry );
|
||||
$this->forumfunc->forumsInit();
|
||||
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
|
||||
$this->html->form_code = 'module=forums&section=multimods&';
|
||||
$this->html->form_code_js = 'module=forums&section=multimods&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['mm_nav'] );
|
||||
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'new':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'donew':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationSaveForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationSaveForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
|
||||
$this->multiModerationDelete();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
|
||||
$this->multiModerationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a multi moderation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function multiModerationDelete()
|
||||
{
|
||||
/* Check ID */
|
||||
if ($this->request['id'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
|
||||
}
|
||||
|
||||
/* Delete the record */
|
||||
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
|
||||
|
||||
/* Rebuild Cache */
|
||||
$this->multiModerationRebuildCache();
|
||||
|
||||
/* Log and bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
|
||||
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationSaveForm( $type='new' )
|
||||
{
|
||||
/* INI */
|
||||
$forums = array();
|
||||
|
||||
/* Make sure we have a title */
|
||||
if( ! $this->request['mm_title'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
|
||||
}
|
||||
|
||||
/* Check for forums */
|
||||
$forums = $this->_getSelectedForums();
|
||||
|
||||
/* Check forums */
|
||||
if( ! $forums )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
|
||||
}
|
||||
|
||||
/* Check move location */
|
||||
if( $this->request['topic_move'] == 'n' )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
|
||||
}
|
||||
|
||||
/* Build the insert array */
|
||||
$save = array(
|
||||
'mm_title' => $this->request['mm_title'],
|
||||
'mm_enabled' => 1,
|
||||
'topic_state' => $this->request['topic_state'],
|
||||
'topic_pin' => $this->request['topic_pin'],
|
||||
'topic_move' => intval( $this->request['topic_move'] ),
|
||||
'topic_move_link' => intval( $this->request['topic_move_link'] ),
|
||||
'topic_title_st' => $this->request['topic_title_st'],
|
||||
'topic_title_end' => $this->request['topic_title_end'],
|
||||
'topic_reply' => intval( $this->request['topic_reply'] ),
|
||||
'topic_reply_content' => IPSText::stripslashes( $_POST['topic_reply_content'] ),
|
||||
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
|
||||
'mm_forums' => $forums,
|
||||
'topic_approve' => intval( $this->request['topic_approve'] ),
|
||||
);
|
||||
|
||||
/* Edit */
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valid'] );
|
||||
}
|
||||
|
||||
/* Update the multi mod */
|
||||
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
|
||||
}
|
||||
/* New */
|
||||
else
|
||||
{
|
||||
/* Insert the new multi mod */
|
||||
$this->DB->insert( 'topic_mmod', $save );
|
||||
}
|
||||
|
||||
/* Log, Cache, and Bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
|
||||
$this->multiModerationRebuildCache();
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationForm( $type='new' )
|
||||
{
|
||||
if( $type == 'new' )
|
||||
{
|
||||
/* Setup */
|
||||
$form_code = 'donew';
|
||||
$id = 0;
|
||||
$description = $this->lang->words['mm_addnew'];
|
||||
$button = $this->lang->words['mm_addnew'];
|
||||
|
||||
/* Default Values */
|
||||
$topic_mm = array(
|
||||
'mm_forums' => '',
|
||||
'mm_title' => '',
|
||||
'topic_title_st' => '',
|
||||
'topic_title_end' => '',
|
||||
'topic_state' => '',
|
||||
'topic_pin' => '',
|
||||
'topic_approve' => '',
|
||||
'topic_move' => '',
|
||||
'topic_move_link' => '',
|
||||
'topic_reply' => '',
|
||||
'topic_reply_content' => '',
|
||||
'topic_reply_postcount' => ''
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$id = intval( $this->request['id'] );
|
||||
$form_code = 'doedit';
|
||||
$description = $this->lang->words['mm_edit'];
|
||||
$button = $this->lang->words['mm_edit'];
|
||||
|
||||
/* Default Values */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $topic_mm = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
|
||||
}
|
||||
}
|
||||
|
||||
/* State Drop Options */
|
||||
$state_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'close', $this->lang->words['mm_close'] ),
|
||||
2 => array( 'open' , $this->lang->words['mm_open'] ),
|
||||
);
|
||||
|
||||
/* Pinned Drop Down Options */
|
||||
$pin_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
|
||||
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
|
||||
);
|
||||
|
||||
/* Approved Drop Down Options */
|
||||
$app_dd = array(
|
||||
0 => array( '0', $this->lang->words['mm_leave'] ),
|
||||
1 => array( '1', $this->lang->words['mm_approve'] ),
|
||||
2 => array( '2', $this->lang->words['mm_unapprove'] ),
|
||||
);
|
||||
|
||||
/* Build forum multiselect */
|
||||
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
|
||||
|
||||
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
|
||||
|
||||
$forum_jump = $this->forumfunc->adForumsForumData();
|
||||
|
||||
foreach( $forum_jump as $i )
|
||||
{
|
||||
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
|
||||
if( !empty( $i['redirect_on'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
|
||||
|
||||
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
|
||||
}
|
||||
|
||||
$topic_mm['forums'] .= "</select>";
|
||||
|
||||
/* Build Form Fields */
|
||||
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
|
||||
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
|
||||
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
|
||||
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
|
||||
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
|
||||
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
|
||||
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
|
||||
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
|
||||
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
|
||||
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
|
||||
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all available multi mods
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationOverview()
|
||||
{
|
||||
/* Query the multi mods */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output arrays */
|
||||
$rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the multi moderation cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationRebuildCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the multi mods */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'topic_mmod',
|
||||
'order' => 'mm_title'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ($i = $this->DB->fetch())
|
||||
{
|
||||
$cache[ $i['mm_id'] ] = $i;
|
||||
}
|
||||
|
||||
/* Save the cache */
|
||||
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected forums
|
||||
*
|
||||
* @return string Comma separated list of forum ids
|
||||
*/
|
||||
protected function _getSelectedForums()
|
||||
{
|
||||
/* INI */
|
||||
$forumids = array();
|
||||
|
||||
/* Check for the forums array */
|
||||
if( is_array( $_POST['forums'] ) )
|
||||
{
|
||||
/* Add All Forums */
|
||||
if( in_array( 'all', $_POST['forums'] ) )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
/* Add selected Forums */
|
||||
else
|
||||
{
|
||||
/* Loop through the selected forums */
|
||||
foreach( $_POST['forums'] as $l )
|
||||
{
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! count( $forumids ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Commented out for bug: http://community.invisionpower.com/tracker/issue-20910-selected-forums-on-topic-multi-moderation/ */
|
||||
/* Do we have cats? Give 'em to Charles! */
|
||||
//if( count( $forumids ) )
|
||||
//{
|
||||
// foreach( $forumids as $f )
|
||||
// {
|
||||
// $children = $this->registry->class_forums->forumsGetChildren( $f );
|
||||
//
|
||||
// if( is_array( $children ) and count( $children ) )
|
||||
// {
|
||||
// $forumids = array_merge( $forumids, $children );
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///* No forums */
|
||||
//else
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
/* Not an array */
|
||||
else
|
||||
{
|
||||
/* All Forums */
|
||||
if ( $this->request['forums'] == 'all' )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Anything selected? */
|
||||
if( $this->request['forums'] != "" )
|
||||
{
|
||||
$l = intval( $this->request['forums'] );
|
||||
|
||||
/* Single Forum */
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
|
||||
/* Check subs */
|
||||
if ( $this->request['searchsubs'] == 1 )
|
||||
{
|
||||
$children = $this->registry->class_forums->forumsGetChildren( $l );
|
||||
|
||||
if( is_array ($children ) and count( $children ) )
|
||||
{
|
||||
$forumids = array_merge( $forumids, $children );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implode( ",", $forumids );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Topic Multi-Moderation
|
||||
* Last Updated: $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class admin_forums_forums_multimods extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Forum functions library
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
protected $forumfunc;
|
||||
|
||||
/**
|
||||
* Main execution point
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
/* Setup Forum Classes */
|
||||
$this->registry->class_forums->forumsInit();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
$this->forumfunc = new $classToLoad( $registry );
|
||||
$this->forumfunc->forumsInit();
|
||||
|
||||
/* Load Skin and Lang */
|
||||
$this->html = $this->registry->output->loadTemplate( 'cp_skin_multimods' );
|
||||
$this->html->form_code = 'module=forums&section=multimods&';
|
||||
$this->html->form_code_js = 'module=forums&section=multimods&';
|
||||
|
||||
$this->lang->loadLanguageFile( array( 'admin_forums' ) );
|
||||
|
||||
/* Navigation */
|
||||
$this->registry->output->extra_nav[] = array( '', $this->lang->words['mm_nav'] );
|
||||
$this->registry->output->extra_title[] = $this->lang->words['mm_nav'];
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'new':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'donew':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_add' );
|
||||
$this->multiModerationSaveForm( 'new' );
|
||||
break;
|
||||
|
||||
case 'doedit':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_edit' );
|
||||
$this->multiModerationSaveForm( 'edit' );
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_delete' );
|
||||
$this->multiModerationDelete();
|
||||
break;
|
||||
|
||||
case 'overview':
|
||||
default:
|
||||
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'mmod_view' );
|
||||
$this->multiModerationOverview();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
|
||||
$this->registry->output->sendOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a multi moderation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function multiModerationDelete()
|
||||
{
|
||||
/* Check ID */
|
||||
if ($this->request['id'] == "")
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_noid'], 11332 );
|
||||
}
|
||||
|
||||
/* Delete the record */
|
||||
$this->DB->delete( 'topic_mmod', "mm_id=" . intval( $this->request['id'] ) );
|
||||
|
||||
/* Rebuild Cache */
|
||||
$this->multiModerationRebuildCache();
|
||||
|
||||
/* Log and bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( $this->lang->words['mm_removed'] );
|
||||
$this->registry->output->silentRedirect($this->settings['base_url'] . $this->html->form_code );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationSaveForm( $type='new' )
|
||||
{
|
||||
/* INI */
|
||||
$forums = array();
|
||||
|
||||
/* Make sure we have a title */
|
||||
if( ! $this->request['mm_title'] )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valtitle'], 11333 );
|
||||
}
|
||||
|
||||
/* Check for forums */
|
||||
$forums = $this->_getSelectedForums();
|
||||
|
||||
/* Check forums */
|
||||
if( ! $forums )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_forums'], 11334 );
|
||||
}
|
||||
|
||||
/* Check move location */
|
||||
if( $this->request['topic_move'] == 'n' )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_wrong'], 11335 );
|
||||
}
|
||||
|
||||
/* Build the insert array */
|
||||
$save = array(
|
||||
'mm_title' => $this->request['mm_title'],
|
||||
'mm_enabled' => 1,
|
||||
'topic_state' => $this->request['topic_state'],
|
||||
'topic_pin' => $this->request['topic_pin'],
|
||||
'topic_move' => intval( $this->request['topic_move'] ),
|
||||
'topic_move_link' => intval( $this->request['topic_move_link'] ),
|
||||
'topic_title_st' => $this->request['topic_title_st'],
|
||||
'topic_title_end' => $this->request['topic_title_end'],
|
||||
'topic_reply' => intval( $this->request['topic_reply'] ),
|
||||
'topic_reply_content' => IPSText::stripslashes( $_POST['topic_reply_content'] ),
|
||||
'topic_reply_postcount' => intval( $this->request['topic_reply_postcount'] ),
|
||||
'mm_forums' => $forums,
|
||||
'topic_approve' => intval( $this->request['topic_approve'] ),
|
||||
);
|
||||
|
||||
/* Edit */
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
/* ID */
|
||||
$id = intval( $this->request['id'] );
|
||||
|
||||
if( ! $id )
|
||||
{
|
||||
$this->registry->output->showError( $this->lang->words['mm_valid'] );
|
||||
}
|
||||
|
||||
/* Update the multi mod */
|
||||
$this->DB->update( 'topic_mmod', $save, 'mm_id='.$id );
|
||||
}
|
||||
/* New */
|
||||
else
|
||||
{
|
||||
/* Insert the new multi mod */
|
||||
$this->DB->insert( 'topic_mmod', $save );
|
||||
}
|
||||
|
||||
/* Log, Cache, and Bounce */
|
||||
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['mm_update'], $type ) );
|
||||
$this->multiModerationRebuildCache();
|
||||
$this->registry->output->silentRedirect( $this->settings['base_url'] . $this->html->form_code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the add/edit multi moderation form
|
||||
*
|
||||
* @param string $type Either 'new' or 'edit'
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationForm( $type='new' )
|
||||
{
|
||||
if( $type == 'new' )
|
||||
{
|
||||
/* Setup */
|
||||
$form_code = 'donew';
|
||||
$id = 0;
|
||||
$description = $this->lang->words['mm_addnew'];
|
||||
$button = $this->lang->words['mm_addnew'];
|
||||
|
||||
/* Default Values */
|
||||
$topic_mm = array(
|
||||
'mm_forums' => '',
|
||||
'mm_title' => '',
|
||||
'topic_title_st' => '',
|
||||
'topic_title_end' => '',
|
||||
'topic_state' => '',
|
||||
'topic_pin' => '',
|
||||
'topic_approve' => '',
|
||||
'topic_move' => '',
|
||||
'topic_move_link' => '',
|
||||
'topic_reply' => '',
|
||||
'topic_reply_content' => '',
|
||||
'topic_reply_postcount' => ''
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
$id = intval( $this->request['id'] );
|
||||
$form_code = 'doedit';
|
||||
$description = $this->lang->words['mm_edit'];
|
||||
$button = $this->lang->words['mm_edit'];
|
||||
|
||||
/* Default Values */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'where' => "mm_id=$id" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
if ( ! $topic_mm = $this->DB->fetch() )
|
||||
{
|
||||
$this->registry->output->showError( sprintf( $this->lang->words['mm_noinfo'], $id ), 11337 );
|
||||
}
|
||||
}
|
||||
|
||||
/* State Drop Options */
|
||||
$state_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'close', $this->lang->words['mm_close'] ),
|
||||
2 => array( 'open' , $this->lang->words['mm_open'] ),
|
||||
);
|
||||
|
||||
/* Pinned Drop Down Options */
|
||||
$pin_dd = array(
|
||||
0 => array( 'leave', $this->lang->words['mm_leave'] ),
|
||||
1 => array( 'pin' , $this->lang->words['mm_pin'] ),
|
||||
2 => array( 'unpin', $this->lang->words['mm_unpin'] ),
|
||||
);
|
||||
|
||||
/* Approved Drop Down Options */
|
||||
$app_dd = array(
|
||||
0 => array( '0', $this->lang->words['mm_leave'] ),
|
||||
1 => array( '1', $this->lang->words['mm_approve'] ),
|
||||
2 => array( '2', $this->lang->words['mm_unapprove'] ),
|
||||
);
|
||||
|
||||
/* Build forum multiselect */
|
||||
$topic_mm['forums'] = "<select name='forums[]' class='textinput' size='15' multiple='multiple'>\n";
|
||||
|
||||
$topic_mm['forums'] .= $topic_mm['mm_forums'] == '*' ? "<option value='all' selected='selected'>{$this->lang->words['mm_allforums']}</option>\n" : "<option value='all'>{$this->lang->words['mm_allforums']}</option>\n";
|
||||
|
||||
$forum_jump = $this->forumfunc->adForumsForumData();
|
||||
|
||||
foreach( $forum_jump as $i )
|
||||
{
|
||||
if( strstr( "," . $topic_mm['mm_forums'] . ",", "," . $i['id'] . "," ) and $topic_mm['mm_forums'] != '*' )
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = "";
|
||||
}
|
||||
|
||||
if( !empty( $i['redirect_on'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$fporum_jump[] = array( $i['id'], $i['depthed_name'] );
|
||||
|
||||
$topic_mm['forums'] .= "<option value=\"{$i['id']}\" $selected>{$i['depthed_name']}</option>\n";
|
||||
}
|
||||
|
||||
$topic_mm['forums'] .= "</select>";
|
||||
|
||||
/* Build Form Fields */
|
||||
$topic_mm['mm_title'] = $this->registry->output->formInput("mm_title", $topic_mm['mm_title'] );
|
||||
$topic_mm['topic_title_st'] = $this->registry->output->formInput("topic_title_st", $topic_mm['topic_title_st'] );
|
||||
$topic_mm['topic_title_end'] = $this->registry->output->formInput("topic_title_end", $topic_mm['topic_title_end'] );
|
||||
$topic_mm['topic_state'] = $this->registry->output->formDropdown("topic_state", $state_dd, $topic_mm['topic_state'] );
|
||||
$topic_mm['topic_pin'] = $this->registry->output->formDropdown("topic_pin", $pin_dd, $topic_mm['topic_pin'] );
|
||||
$topic_mm['topic_approve'] = $this->registry->output->formDropdown("topic_approve", $app_dd, $topic_mm['topic_approve'] );
|
||||
$topic_mm['topic_move'] = $this->registry->output->formDropdown("topic_move", array_merge( array( 0 => array('-1', $this->lang->words['mm_nobodymovenobodygethurt'] ) ), $fporum_jump ), $topic_mm['topic_move'] );
|
||||
$topic_mm['topic_move_link'] = $this->registry->output->formCheckbox('topic_move_link', $topic_mm['topic_move_link'] );
|
||||
$topic_mm['topic_reply'] = $this->registry->output->formYesNo('topic_reply', $topic_mm['topic_reply'] );
|
||||
$topic_mm['topic_reply_content'] = $this->registry->output->formTextarea("topic_reply_content", $topic_mm['topic_reply_content'] );
|
||||
$topic_mm['topic_reply_postcount'] = $this->registry->output->formCheckbox('topic_reply_postcount', $topic_mm['topic_reply_postcount'] );
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationForm( $id, $form_code, $description, $topic_mm, $button );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show all available multi mods
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationOverview()
|
||||
{
|
||||
/* Query the multi mods */
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'topic_mmod', 'order' => "mm_title" ) );
|
||||
$this->DB->execute();
|
||||
|
||||
/* Loop through and build output arrays */
|
||||
$rows = array();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
/* Output */
|
||||
$this->registry->output->html .= $this->html->multiModerationOverview( $rows );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the multi moderation cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function multiModerationRebuildCache()
|
||||
{
|
||||
/* INI */
|
||||
$cache = array();
|
||||
|
||||
/* Get the multi mods */
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'topic_mmod',
|
||||
'order' => 'mm_title'
|
||||
) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while ($i = $this->DB->fetch())
|
||||
{
|
||||
$cache[ $i['mm_id'] ] = $i;
|
||||
}
|
||||
|
||||
/* Save the cache */
|
||||
$this->cache->setCache( 'multimod', $cache, array( 'array' => 1, 'donow' => 0 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected forums
|
||||
*
|
||||
* @return string Comma separated list of forum ids
|
||||
*/
|
||||
protected function _getSelectedForums()
|
||||
{
|
||||
/* INI */
|
||||
$forumids = array();
|
||||
|
||||
/* Check for the forums array */
|
||||
if( is_array( $_POST['forums'] ) )
|
||||
{
|
||||
/* Add All Forums */
|
||||
if( in_array( 'all', $_POST['forums'] ) )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
/* Add selected Forums */
|
||||
else
|
||||
{
|
||||
/* Loop through the selected forums */
|
||||
foreach( $_POST['forums'] as $l )
|
||||
{
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
}
|
||||
|
||||
if( ! count( $forumids ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Commented out for bug: http://community.invisionpower.com/tracker/issue-20910-selected-forums-on-topic-multi-moderation/ */
|
||||
/* Do we have cats? Give 'em to Charles! */
|
||||
//if( count( $forumids ) )
|
||||
//{
|
||||
// foreach( $forumids as $f )
|
||||
// {
|
||||
// $children = $this->registry->class_forums->forumsGetChildren( $f );
|
||||
//
|
||||
// if( is_array( $children ) and count( $children ) )
|
||||
// {
|
||||
// $forumids = array_merge( $forumids, $children );
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
///* No forums */
|
||||
//else
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
/* Not an array */
|
||||
else
|
||||
{
|
||||
/* All Forums */
|
||||
if ( $this->request['forums'] == 'all' )
|
||||
{
|
||||
return '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Anything selected? */
|
||||
if( $this->request['forums'] != "" )
|
||||
{
|
||||
$l = intval( $this->request['forums'] );
|
||||
|
||||
/* Single Forum */
|
||||
if( $this->registry->class_forums->forum_by_id[ $l ] )
|
||||
{
|
||||
$forumids[] = intval( $l );
|
||||
}
|
||||
|
||||
/* Check subs */
|
||||
if ( $this->request['searchsubs'] == 1 )
|
||||
{
|
||||
$children = $this->registry->class_forums->forumsGetChildren( $l );
|
||||
|
||||
if( is_array ($children ) and count( $children ) )
|
||||
{
|
||||
$forumids = array_merge( $forumids, $children );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implode( ",", $forumids );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Управление форумами</title>
|
||||
<title>Manage Forums</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Управление форумами</subitemtitle>
|
||||
<subitemtitle>Manage Forums</subitemtitle>
|
||||
<subitemlang>forums</subitemlang>
|
||||
<subsection>forums</subsection>
|
||||
<subitemurl>do=forums_overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Мульти-модерация</title>
|
||||
<title>Topic Multi-Moderation</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Мульти-модерация тем</subitemtitle>
|
||||
<subitemtitle>Topic Multi-Moderation</subitemtitle>
|
||||
<subitemlang>multimod</subitemlang>
|
||||
<subsection>multimods</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
|
||||
@@ -1,105 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление форумами</grouptitle>
|
||||
<grouptitle>Manage Forums</grouptitle>
|
||||
<grouplang>forums_forums</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>forums_add</key>
|
||||
<string>Может добавлять форумы?</string>
|
||||
<string>Can add new forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_edit</key>
|
||||
<string>Может изменять форумы?</string>
|
||||
<string>Can edit forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_delete</key>
|
||||
<string>Может удалять форумы?</string>
|
||||
<string>Can delete forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_reorder</key>
|
||||
<string>Может изменять порядок вывода форумов?</string>
|
||||
<string>Can reorder forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_permissions</key>
|
||||
<string>Может редактировать права доступа к форумам?</string>
|
||||
<string>Can edit permissions for forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_empty</key>
|
||||
<string>Может очищать форумы?</string>
|
||||
<string>Can empty forums?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_rules</key>
|
||||
<string>Может редактировать правила форумов?</string>
|
||||
<string>Can edit forum rules?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>forums_skins</key>
|
||||
<string>Может изменять стиль конкретного форума?</string>
|
||||
<string>Can assign/unassign skins to forums?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление модераторами</grouptitle>
|
||||
<grouptitle>Manage Forum Moderators</grouptitle>
|
||||
<grouplang>forums_moderators</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mods_add</key>
|
||||
<string>Может добавлять модераторов?</string>
|
||||
<string>Can add new moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_edit</key>
|
||||
<string>Может редактировать модераторов?</string>
|
||||
<string>Can edit moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_delete</key>
|
||||
<string>Может удалять модераторов?</string>
|
||||
<string>Can delete moderators?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mods_view</key>
|
||||
<string>Может просматривать модераторов?</string>
|
||||
<string>Can list forum moderators?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление мульти-модерацией</grouptitle>
|
||||
<grouptitle>Manage Multi-Moderation</grouptitle>
|
||||
<grouplang>forums_multimods</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>mmod_add</key>
|
||||
<string>Может добавлять новые мульти-модерации?</string>
|
||||
<string>Can add new multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_edit</key>
|
||||
<string>Может изменять существующие мульти-модерации?</string>
|
||||
<string>Can edit multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_delete</key>
|
||||
<string>Может удалять мульти-модерации?</string>
|
||||
<string>Can delete multi-moderation routines?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>mmod_view</key>
|
||||
<string>Может просматривать мульти-модерации?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<group>
|
||||
<grouptitle>Управление масками доступа</grouptitle>
|
||||
<items>
|
||||
<item>
|
||||
<key>permmasks_add</key>
|
||||
<string>Может добавлять новые маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_edit</key>
|
||||
<string>Может изменять существующие маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_delete</key>
|
||||
<string>Может удалять маски?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>permmasks_view</key>
|
||||
<string>Может просматривать маски?</string>
|
||||
<string>Can view multi-moderation routines?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'rss' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Импорт</title>
|
||||
<title>RSS Import</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Импорт RSS</subitemtitle>
|
||||
<subitemtitle>RSS Import</subitemtitle>
|
||||
<subitemlang>rssimports</subitemlang>
|
||||
<subsection>import</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Экспорт</title>
|
||||
<title>RSS Export</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Экспорт RSS</subitemtitle>
|
||||
<subitemtitle>RSS Export</subitemtitle>
|
||||
<subitemlang>rssexports</subitemlang>
|
||||
<subsection>export</subsection>
|
||||
<subitemurl>do=overview</subitemurl>
|
||||
@@ -26,6 +26,6 @@
|
||||
<subisredirect>0</subisredirect>
|
||||
</subitem>
|
||||
</subitems>
|
||||
</item>
|
||||
</item>
|
||||
</tabitems>
|
||||
</menu>
|
||||
@@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление RSS</grouptitle>
|
||||
<grouptitle>RSS Management</grouptitle>
|
||||
<grouplang>forums_rss</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>export_manage</key>
|
||||
<string>Может изменять/добавлять RSS экспорт?</string>
|
||||
<string>Can manage forum RSS exports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>export_delete</key>
|
||||
<string>Может удалять RSS экспорт?</string>
|
||||
<string>Can delete forum RSS exports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_manage</key>
|
||||
<string>Может изменять/добавлять RSS импорт?</string>
|
||||
<string>Can manage forum RSS imports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_delete</key>
|
||||
<string>Может удалять RSS импорт?</string>
|
||||
<string>Can delete forum RSS imports?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>import_remove</key>
|
||||
<string>Может удалять темы импортированные через RSS?</string>
|
||||
<string>Can remove topics previously imported via RSS?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'statistics' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,10 +2,10 @@
|
||||
<menu>
|
||||
<tabitems>
|
||||
<item>
|
||||
<title>Регистрации</title>
|
||||
<title>Registration Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика регистраций</subitemtitle>
|
||||
<subitemtitle>Registration Stats</subitemtitle>
|
||||
<subitemlang>stats_reg</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=reg</subitemurl>
|
||||
@@ -15,10 +15,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Новые темы</title>
|
||||
<title>New Topic Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика создания тем</subitemtitle>
|
||||
<subitemtitle>New Topic Stats</subitemtitle>
|
||||
<subitemlang>stats_topics</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=topic</subitemurl>
|
||||
@@ -28,10 +28,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Новые сообщения</title>
|
||||
<title>Post Stats</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика отправки сообщений</subitemtitle>
|
||||
<subitemtitle>Post Stats</subitemtitle>
|
||||
<subitemlang>stats_posts</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=post</subitemurl>
|
||||
@@ -41,10 +41,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Личные сообщения</title>
|
||||
<title>Personal Message</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика использования ЛС</subitemtitle>
|
||||
<subitemtitle>Personal Message</subitemtitle>
|
||||
<subitemlang>stats_pms</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=msg</subitemurl>
|
||||
@@ -54,10 +54,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Просмотры тем</title>
|
||||
<title>Topic Views</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика просмотров тем</subitemtitle>
|
||||
<subitemtitle>Topic Views</subitemtitle>
|
||||
<subitemlang>stats_tviews</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=views</subitemurl>
|
||||
@@ -67,10 +67,10 @@
|
||||
</subitems>
|
||||
</item>
|
||||
<item>
|
||||
<title>Антиспам сервис</title>
|
||||
<title>Spam Service</title>
|
||||
<subitems>
|
||||
<subitem>
|
||||
<subitemtitle>Статистика антиспам сервиса</subitemtitle>
|
||||
<subitemtitle>Spam Service</subitemtitle>
|
||||
<subitemlang>stats_spam</subitemlang>
|
||||
<subsection>stats</subsection>
|
||||
<subitemurl>do=spam</subitemurl>
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Управление статистикой</grouptitle>
|
||||
<grouplang>forums_stats</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>stats_topics</key>
|
||||
<string>Может просматривать отчет о новых темах?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_registration</key>
|
||||
<string>Может просматривать отчет о новых регистрациях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_posts</key>
|
||||
<string>Может просматривать отчет о новых сообщениях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_msg</key>
|
||||
<string>Может просматривать отчет о новых личных сообщениях?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_views</key>
|
||||
<string>Может просматривать отчет о просмотрах тем?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<permissions>
|
||||
<group>
|
||||
<grouptitle>Manage Statistics</grouptitle>
|
||||
<grouplang>forums_stats</grouplang>
|
||||
<items>
|
||||
<item>
|
||||
<key>stats_topics</key>
|
||||
<string>Can run reports on new topics?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_registration</key>
|
||||
<string>Can run reports on new registrations?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_posts</key>
|
||||
<string>Can run reports on new posts?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_msg</key>
|
||||
<string>Can run reports on new messages?</string>
|
||||
</item>
|
||||
<item>
|
||||
<key>stats_views</key>
|
||||
<string>Can run reports on topic views?</string>
|
||||
</item>
|
||||
</items>
|
||||
</group>
|
||||
</permissions>
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file defaultSection.php Define the default section for the 'tools' module
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $
|
||||
* @since 14th May 2003
|
||||
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 8655 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 100 of 2206 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user