Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,19 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Forums application initialization
|
||||
* Last Updated: $LastChangedDate: 2009-12-01 17:42:17 -0500 (Tue, 01 Dec 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 14th May 2003
|
||||
* @version $Rev: 5501 $
|
||||
* @version $Rev: 7003 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -27,7 +28,6 @@ class app_class_forums
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
@@ -36,13 +36,14 @@ class app_class_forums
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return void
|
||||
*/
|
||||
@@ -64,9 +65,9 @@ class app_class_forums
|
||||
try
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php" );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums' );
|
||||
|
||||
$this->registry->setClass( 'class_forums', new admin_forum_functions( $registry ) );
|
||||
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
|
||||
$this->registry->getClass('class_forums')->strip_invisible = 0;
|
||||
}
|
||||
catch( Exception $error )
|
||||
@@ -78,8 +79,8 @@ class app_class_forums
|
||||
{
|
||||
try
|
||||
{
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
|
||||
$this->registry->setClass( 'class_forums', new class_forums( $registry ) );
|
||||
$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 )
|
||||
@@ -117,7 +118,7 @@ class app_class_forums
|
||||
'where' => "tid=" . $this->request['t'],
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
$this->registry->getClass('class_forums')->topic_cache = $topic;
|
||||
|
||||
$this->request['f'] = $topic['forum_id'];
|
||||
@@ -132,14 +133,14 @@ class app_class_forums
|
||||
// Set up moderators
|
||||
//-----------------------------------------
|
||||
|
||||
$this->memberData = $this->registry->getClass('class_forums')->setUpModerator( $this->memberData );
|
||||
$this->memberData = IPSMember::setUpModerator( $this->memberData );
|
||||
}
|
||||
|
||||
/**
|
||||
* Do some set up after ipsRegistry::init()
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
* Do some set up after ipsRegistry::init()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function afterOutputInit()
|
||||
{
|
||||
if ( isset( $_GET['showtopic'] ) AND $_GET['showtopic'] != '' AND is_array( $this->registry->getClass('class_forums')->topic_cache ) )
|
||||
@@ -160,11 +161,16 @@ class app_class_forums
|
||||
|
||||
/* 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 ( isset( $_GET['showforum'] ) AND $_GET['showforum'] != '' )
|
||||
{
|
||||
$data = $this->registry->getClass('class_forums')->forumsFetchData( $_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'];
|
||||
@@ -181,6 +187,32 @@ class app_class_forums
|
||||
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 ( isset( $_GET['showannouncement'] ) AND $_GET['showannouncement'] != '' )
|
||||
{
|
||||
//$announce = $this->DB->buildAndFetch( array( 'select' => 'announce_id, announce_title',
|
||||
// 'from' => 'announcements',
|
||||
// 'where' => 'announce_id=' . intval( $_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' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user