Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,82 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Forums topic view API file
|
||||
* Last Updated: $Date: 2010-10-25 11:20:47 -0400 (Mon, 25 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7036 $
|
||||
* @file api_topic_view.php Forums topic view API
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since 2.2.0
|
||||
*
|
||||
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8129 $
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'apiCore' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
/**
|
||||
* apiTopicView class
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
*
|
||||
* @class apiTopicView
|
||||
* @brief Forums topic view API
|
||||
*/
|
||||
class apiTopicView extends apiCore
|
||||
{
|
||||
/**
|
||||
* Topic list config
|
||||
* Configuration array for the topic list
|
||||
*
|
||||
* @access public
|
||||
* @var array
|
||||
* @var $topic_list_config
|
||||
*/
|
||||
public $topic_list_config = array( 'offset' => 0,
|
||||
public $topic_list_config = array( 'offset' => 0,
|
||||
'limit' => 5,
|
||||
'forums' => '*',
|
||||
'order_field' => 'last_post',
|
||||
'order_by' => 'DESC' );
|
||||
|
||||
'order_by' => 'DESC'
|
||||
);
|
||||
|
||||
/**
|
||||
* Attachment pids
|
||||
* Array of post IDs with attachments
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
* @var $attach_pids
|
||||
*/
|
||||
protected $attach_pids = array();
|
||||
|
||||
/**
|
||||
* Constructor. Calls parent init() method
|
||||
* Constructor: calls parent init() method and runs other additional calls
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$appClass = new $classToLoad( $this->registry );
|
||||
/* Load forums app main class */
|
||||
ipsRegistry::getAppClass( 'forums' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of gallery data
|
||||
* Returns an array of topics
|
||||
*
|
||||
* @access public
|
||||
* @param bool View as guest?
|
||||
* @return mixed Array of data, or void
|
||||
* @param boolean Load only topics viewable by guests?
|
||||
* @return @e array Array of topics data
|
||||
*/
|
||||
public function return_topic_list_data( $view_as_guest=0 )
|
||||
public function return_topic_list_data( $view_as_guest=false )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -84,14 +69,14 @@ class apiTopicView extends apiCore
|
||||
|
||||
$topics = array();
|
||||
|
||||
if( !$view_as_guest )
|
||||
if( $view_as_guest )
|
||||
{
|
||||
$this->registry->class_forums->strip_invisible = false;
|
||||
$this->registry->class_forums->strip_invisible = true;
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->registry->class_forums->strip_invisible = true;
|
||||
$this->registry->class_forums->strip_invisible = false;
|
||||
$this->registry->class_forums->forumsInit();
|
||||
}
|
||||
|
||||
@@ -139,9 +124,11 @@ class apiTopicView extends apiCore
|
||||
// Get from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$_approved = $this->registry->getClass('class_forums')->fetchTopicHiddenQuery( array( 'visible' ), 't.' );
|
||||
|
||||
$this->DB->build( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',
|
||||
'where' => $_approved . ' AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',
|
||||
'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'],
|
||||
'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ),
|
||||
'add_join' => array(
|
||||
@@ -292,5 +279,4 @@ class apiTopicView extends apiCore
|
||||
return $topics;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user