Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

+47 -32
View File
@@ -1,83 +1,98 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* API: Core
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
* @file api_core.php Core functions for the API classes
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-03-18 17:34:15 -0400 (Fri, 18 Mar 2011) $
* @version v3.2.3
* $Revision: 8129 $
*/
/**
*
* @class apiCore
* @brief Core functions for the API classes
*/
class apiCore
{
/**
* 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 $cache;
protected $registry;
protected $memberData;
protected $cache;
protected $caches;
/**
* API Error string
* Array of the API errors
*
* @var array Errors
* @var $api_error
*/
public $api_error = array();
/**
* API Path to IPB root (where init.php/index.php is)
* API Path to IPB root (where initdata.php/index.php is)
*
* @var string Path to IPB root folder
* @var $path_to_ipb
*/
public $path_to_ipb = '';
/**
* Loads the API Classes
* Loads the registry class
*
* @return void
* @return @e void
*/
public function init()
{
/* Path not set? */
if( !$this->path_to_ipb )
{
/* Constant available? */
if( defined('DOC_IPS_ROOT_PATH') )
{
$this->path_to_ipb = DOC_IPS_ROOT_PATH;
}
else
{
/* Fallback.. */
$this->path_to_ipb = dirname(__FILE__) . '/../../';
}
}
/* Load the registry */
require_once( $this->path_to_ipb . 'initdata.php' );
require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' );
require_once( $this->path_to_ipb . 'initdata.php' );/*noLibHook*/
require_once( $this->path_to_ipb . CP_DIRECTORY . '/sources/base/ipsRegistry.php' );/*noLibHook*/
$this->registry = ipsRegistry::instance();
$this->registry->init();
/* Make Shortcuts */
$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();
/* Make registry shortcuts */
$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();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* INIT Child? */
if( method_exists( $this, 'childInit' ) )
-212
View File
@@ -1,212 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Blog API file
* Last Updated: $Date: 2010-10-22 14:06:33 -0400 (Fri, 22 Oct 2010) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Blog
* @link http://www.invisionpower.com
* @version $Rev: 7018 $
* @since 2.2.0
*
*/
if ( ! class_exists( 'apiCore' ) )
{
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
}
/**
* apiBlog class
* @package IP.Blog
*/
class apiBlog extends apiCore
{
/**
* Constructor. Calls parent init() method
*
* @access public
* @return void
*/
public function __construct()
{
$this->init();
if( ! ipsRegistry::isClassLoaded( 'blogFunctions' ) )
{
/* Load the Blog functions library */
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php', 'blogFunctions', 'blog' );
$this->registry->setClass( 'blogFunctions', new $classToLoad( $this->registry ) );
}
}
/**
* Retrieve the Blog ID of a member
* THIS IS DEPRECATED - use fetchBlogIds
*
* @param int Member ID
* @return int Blog ID ( 0 if no Blog found )
*/
public function getBlogID( $member_id=0 )
{
$member_id = intval( $member_id );
//-----------------------------------------
// We entered here on member id, find blog_id and redirect them to here
//-----------------------------------------
$blog = $this->DB->buildAndFetch( array(
'select' => 'blog_id, blog_name',
'from' => 'blog_blogs',
'where' => "member_id={$member_id}"
) );
if( ! $blog['blog_id'] or ! $blog['blog_name'] )
{
return 0;
}
else
{
return $blog['blog_id'];
}
}
/**
* Retrieve blog IDs this member can author in
*
* @access public
* @param int Member ID
* @return array array of ids with basic information, like: array( blog_id => array( 'blog_name', 'blog_seo_name' )
*/
public function fetchBlogIds( $member_id=0 )
{
$return = array();
$member_id = intval( $member_id );
$data = $this->registry->getClass('blogFunctions')->fetchMyBlogs( IPSMember::load( $member_id ) );
if ( is_array( $data ) AND count( $data ) )
{
foreach( $data as $id => $blog )
{
if ( $blog['_canPostIn'] )
{
$return[ $id ] = $blog;
}
}
}
return $return;
}
/**
* Retrieve the Blog ID of a member
*
* @param int Blog ID
* @return string Blog URL
*/
public function getBlogUrl( $blog_id=0 )
{
$blog_id = intval( $blog_id );
//-----------------------------------------
// We entered here on member id, find blog_id and redirect them to here
//-----------------------------------------
$blog = $this->DB->buildAndFetch( array (
'select' => 'blog_id, blog_name, blog_seo_name',
'from' => 'blog_blogs',
'where' => "blog_id={$blog_id}"
) );
if( ! $blog['blog_id'] or ! $blog['blog_name'] )
{
return '';
}
else
{
return $this->registry->output->buildSEOUrl( 'app=blog&amp;blogid=' . $blog_id, 'public', $blog['blog_seo_name'], 'showblog' );
}
}
/**
* Retrieve the last x entries of a Blog
* Only public publishes entries are returned
*
* @param string Either 'member' or 'blog'
* @param int Blog ID or Member ID
* @param int Number of entries (to return)
* @return array Array of last X entries
*/
public function lastXEntries( $type, $id, $number_of_entries=10 )
{
/* INIT */
$id = intval( $id );
$return_array = array();
$where = array();
/* Build permissions */
$modData = $this->registry->blogFunctions->buildPerms();
/* Got permission to view blog entries? */
if ( $this->memberData['g_blog_settings']['g_blog_allowview'] )
{
$this->DB->build( array( 'select' => "e.*, b.*",
'from' => array('blog_entries' => 'e'),
'where' => ( $type == 'member' ? "b.member_id={$id}" : "b.blog_id={$id}" ) . " AND b.blog_type='local' AND e.entry_status='published'",
'order' => 'e.entry_date DESC',
'limit' => array( 0, intval( $number_of_entries ) ),
'add_join' => array( array( 'select' => 'b.blog_name, b.blog_seo_name',
'from' => array( 'blog_blogs' => 'b' ),
'where' => "e.blog_id=b.blog_id",
'type' => 'left' ) ) ) );
$outer = $this->DB->execute();
while( $entry = $this->DB->fetch($outer) )
{
if ( !$this->memberData['member_id'] or !$modData['_blogmod']['moderate_can_view_private'] )
{
switch ( $entry['blog_view_level'] )
{
case 'public':
if ( !$this->memberData['member_id'] and !$entry['blog_allowguests'] )
{
continue 2;
}
break;
case 'private':
if ( !$this->memberData['member_id'] or $this->memberData['member_id'] != $entry['member_id'] )
{
continue 2;
}
break;
case 'privateclub':
if ( !$this->memberData['member_id'] or !in_array( $this->memberData['member_id'], explode( ',', $entry['blog_authorized_users'] ) ) )
{
continue 2;
}
break;
}
}
$entry['blog_url'] = $this->registry->blogFunctions->getBlogUrl( $entry['blog_id'] );
$entry['entry_url'] = $entry['blog_url'] . 'showentry='.$entry['entry_id'];
$return_array[] = $entry;
}
return $return_array;
}
else
{
return array();
}
}
}
?>
-10
View File
@@ -1,10 +0,0 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
+34 -48
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
-195
View File
@@ -1,195 +0,0 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Gallery API file
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Gallery
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
* @since 2.2.0
*
*/
if ( ! class_exists( 'apiCore' ) )
{
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
}
/**
* apiGallery class
* @package IP.Gallery
*/
class apiGallery extends apiCore
{
/**
* Gallery library object
*
* @access public
* @var object
*/
public $glib;
/**
* Gallery category object
*
* @access public
* @var object
*/
public $category;
/**
* Total images found for result
*
* @access public
* @var integer
*/
public $total = 0;
/**
* Database result resource
*
* @access public
* @var resource
*/
public $res;
/**
* Constructor. Calls parent init() method
*
* @access public
* @return void
*/
public function __construct()
{
$this->init();
}
/**
* Returns an array of gallery data
*
* @access public
* @param integer Member id
* @param integer Limit
* @param integer true pulls the image results and returns them, false leaves the result set as $this->res
* @return mixed Array of gallery data, or void
*/
function return_gallery_data( $member_id=0, $limit=5, $do_pull=true )
{
if( !$member_id )
{
return array();
}
//-----------------------------------------
// INIT
//-----------------------------------------
$images = array();
$member_id = intval($member_id);
$categories = $this->category->getAllowedCats( 0 );
$albums = $this->glib->getAllowedAlbums();
if( !count($categories) AND !count($albums) )
{
return array();
}
$where = array();
$where_statement = "";
if( count($categories) )
{
$where[] = "i.category_id IN (".implode( ',', $categories ).")";
}
if( is_array($albums) AND count($albums) )
{
$where[] = "i.album_id IN (".implode( ",", $albums ).")";
}
else if( $albums == true AND count($categories) )
{
$dewhere .= " ( i.album_id > 0 AND a.category_id IN ( ".implode( ",", $categories )." ) ";
if( !$this->memberData['g_mod_albums'] )
{
$dewhere .= " AND ( a.public_album=1 OR a.member_id={$this->memberData['member_id']} ) ";
}
$dewhere .= ")";
$where[] = $dewhere;
}
if( !count($where) )
{
return array();
}
else
{
$where_statement = implode( " OR ", $where );
}
$this->DB->build( array(
'select' => 'i.*',
'from' => array( 'gallery_images' => 'i' ),
'where' => "i.approved=1 AND i.member_id={$member_id} AND ({$where_statement})",
'add_join' => array(
array(
'type' => 'left',
'select' => 'a.name as album_name, a.public_album',
'from' => array( 'gallery_albums' => 'a' ),
'where' => 'a.id=i.album_id',
),
array(
'type' => 'left',
'select' => 'c.name as category_name',
'from' => array( 'gallery_categories' => 'c' ),
'where' => "c.id=i.category_id",
),
array(
'type' => 'left',
'select' => 'm.members_display_name',
'from' => array( 'members' => 'm' ),
'where' => "m.member_id=i.member_id",
),
array(
'type' => 'left',
'select' => 'r.id as rated, r.rate as my_rate',
'from' => array( 'gallery_ratings' => 'r' ),
'where' => "r.img_id=i.id AND r.member_id={$this->memberData['member_id']}",
)
),
'order' => 'i.idate DESC',
'limit' => array( 0, $limit )
) );
$this->res = $this->DB->execute();
$this->total = $this->DB->getTotalRows( $this->res );
if( $do_pull )
{
while( $r = $this->DB->fetch() )
{
$r['_my_rate'] = $r['my_rate'];
$images[] = $r;
}
return $images;
}
}
}
-10
View File
@@ -1,10 +0,0 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; 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.invisionboard.com/">IP.Board</a>
</body>
</html>
+1 -1
View File
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>