Version 3.0.5

This commit is contained in:
Neo committed 2025-12-19 00:31:03 -08:00
1 parent 19b38c7c74
commit 1d4720f3e2
3755 files changed
+508378 -664541

No files matched your search

+86
View File
@@ -0,0 +1,86 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* API: Core
* Last Updated: $Date: 2009-05-11 17:39:45 -0400 (Mon, 11 May 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4628 $
*/
class apiCore
{
/**
* Registry Object Shortcuts
*/
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $cache;
protected $registry;
/**
* API Error string
*
* @var array Errors
*/
public $api_error = array();
/**
* API Path to IPB root (where init.php/index.php is)
*
* @var string Path to IPB root folder
*/
public $path_to_ipb = '';
/**
* Loads the API Classes
*
* @return void
*/
public function init()
{
if( !$this->path_to_ipb )
{
if( defined('DOC_IPS_ROOT_PATH') )
{
$this->path_to_ipb = DOC_IPS_ROOT_PATH;
}
else
{
$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' );
$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();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
/* INIT Child? */
if( method_exists( $this, 'childInit' ) )
{
$this->childInit();
}
}
}
+194
View File
@@ -0,0 +1,194 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Blog API file
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage IP.Gallery
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
* @since 2.2.0
*
*/
if ( ! class_exists( 'apiCore' ) )
{
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
}
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 */
require_once( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php' );
$this->registry->setClass( 'blogFunctions', new blogFunctions( $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();
$extra = "";
$allowguests = "";
/* Build permissions */
$this->registry->blogFunctions->buildPerms();
/* Got permission to view blog entries? */
if ( $this->memberData['g_blog_settings']['g_blog_allowview'] )
{
/* Private club? */
if( ! $this->memberData['member_id'] )
{
$allowguests .= " AND b.blog_allowguests = 1";
}
if( ! $this->memberData['_blogmod']['moderate_can_view_private'] )
{
$extra = " AND ( ( ( b.blog_owner_only=1 AND b.member_id={$this->memberData['member_id']} ) OR b.blog_owner_only=0 ) AND ( b.blog_authorized_users LIKE '%,{$this->memberData['member_id']},%' OR b.blog_authorized_users IS NULL ) ) ";
}
$qtype = $type == 'member' ? "b.member_id={$id}" : "b.blog_id={$id}";
$this->DB->build( array( 'select' => "e.*",
'from' => array('blog_entries' => 'e'),
'where' => "{$qtype} AND b.blog_type='local' AND e.entry_status='published'".$allowguests.$extra,
'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) )
{
$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();
}
}
}
?>
+289
View File
@@ -0,0 +1,289 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Forums topic view API file
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
* @since 2.2.0
*
*/
if ( ! class_exists( 'apiCore' ) )
{
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
}
class apiTopicView extends apiCore
{
/**
* Topic list config
*
* @access public
* @var array
*/
public $topic_list_config = array( 'offset' => 0,
'limit' => 5,
'forums' => '*',
'order_field' => 'last_post',
'order_by' => 'DESC' );
/**
* Attachment pids
*
* @access protected
* @var array
*/
protected $attach_pids = array();
/**
* Constructor. Calls parent init() method
*
* @access public
* @return void
*/
public function __construct()
{
$this->init();
//-----------------------------------------
// Get some classes
//-----------------------------------------
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
$appClass = new app_class_forums( $this->registry );
}
/**
* Returns an array of gallery data
*
* @access public
* @param bool View as guest?
* @return mixed Array of data, or void
*/
public function return_topic_list_data( $view_as_guest=0 )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topics = array();
if( !$view_as_guest )
{
$this->registry->class_forums->strip_invisible = false;
$this->registry->class_forums->forumsInit();
}
else
{
$this->registry->class_forums->strip_invisible = true;
$this->registry->class_forums->forumsInit();
}
//-----------------------------------------
// Set up
//-----------------------------------------
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field'];
$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field'];
$this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( ",", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums'];
//-----------------------------------------
// Fix up allowed forums
//-----------------------------------------
if ( $this->topic_list_config['forums'] )
{
# Reset topics...
if ( $this->topic_list_config['forums'] == '*' )
{
$_tmp_array = array();
$this->topic_list_config['forums'] = '';
foreach( $this->registry->class_forums->forum_by_id as $id => $data )
{
$_tmp_forums[] = $id;
}
}
else
{
$_tmp_forums = explode( ',', $this->topic_list_config['forums'] );
$_tmp_array = array();
$this->topic_list_config['forums'] = '';
}
foreach( $_tmp_forums as $_id )
{
$_tmp_array[] = $_id;
}
$this->topic_list_config['forums'] = implode( ',', $_tmp_array );
}
//-----------------------------------------
// Get from the DB
//-----------------------------------------
$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'].')',
'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(
0 => array( 'select' => 'p.*',
'from' => array( 'posts' => 'p' ),
'where' => 't.topic_firstpost=p.pid',
'type' => 'left' ),
1 => array( 'select' => 'm.member_id, m.members_display_name as member_name, m.members_seo_name, m.member_group_id, m.email',
'from' => array( 'members' => 'm' ),
'where' => "m.member_id=p.author_id",
'type' => 'left' ),
2 => array( 'select' => 'f.id as forum_id, f.name as forum_name, f.use_html, f.name_seo',
'from' => array( 'forums' => 'f' ),
'where' => "t.forum_id=f.id",
'type' => 'left' ) )
) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
if( $row['topic_hasattach'] )
{
$this->attach_pids[] = $row['pid'];
}
//-----------------------------------------
// Guest name?
//-----------------------------------------
$row['member_name'] = $row['member_name'] ? $row['member_name'] : $row['author_name'];
//-----------------------------------------
// Topic link
//-----------------------------------------
$row['link-topic'] = $this->registry->getClass('output')->buildSEOUrl( "showtopic={$row['tid']}", 'public', $row['title_seo'], 'showtopic' );
$row['link-forum'] = $this->registry->getClass('output')->buildSEOUrl( "showforum={$row['forum_id']}", 'public', $row['name_seo'], 'showforum' );
$row['link-profile'] = $this->registry->getClass('output')->buildSEOUrl( "showuser={$row['member_id']}", 'public', $row['members_seo_name'], 'showuser' );
$topics[] = $row;
}
if( count( $this->attach_pids ) )
{
$final_attachments = array();
$this->DB->build( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_rel_module='post' AND attach_rel_id IN (" . implode( ",", $this->attach_pids ) . ")"
) );
$this->DB->execute;
while ( $a = $this->DB->fetch() )
{
$final_attachments[ $a[ 'attach_pid' ] ][ $a['attach_id'] ] = $a;
}
$final_topics = array();
foreach( $topics as $mytopic )
{
$this_topic_attachments = array();
foreach ( $final_attachments as $pid => $data )
{
if( $pid <> $mytopic['pid'] )
{
continue;
}
$temp_out = "";
$temp_hold = array();
foreach( $final_attachments[$pid] as $aid => $row )
{
//-----------------------------------------
// Is it an image, and are we viewing the image in the post?
//-----------------------------------------
if ( $this->settings['show_img_upload'] and $row['attach_is_image'] )
{
if ( $this->settings['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] )
{
$this_topic_attachments[] = array( 'size' => IPSLib::sizeFormat( $row['attach_filesize'] ),
'method' => 'post',
'id' => $row['attach_id'],
'file' => $row['attach_file'],
'hits' => $row['attach_hits'],
'thumb_location' => $row['attach_thumb_location'],
'type' => 'thumb',
'thumb_x' => $row['attach_thumb_width'],
'thumb_y' => $row['attach_thumb_height'],
'ext' => $row['attach_ext'],
);
}
else
{
$this_topic_attachments[] = array( 'size' => IPSLib::sizeFormat( $row['attach_filesize'] ),
'method' => 'post',
'id' => $row['attach_id'],
'file' => $row['attach_file'],
'hits' => $row['attach_hits'],
'thumb_location' => $row['attach_thumb_location'],
'type' => 'image',
'thumb_x' => $row['attach_thumb_width'],
'thumb_y' => $row['attach_thumb_height'],
'ext' => $row['attach_ext'],
);
}
}
else
{
$this_topic_attachments[] = array( 'size' => IPSLib::sizeFormat( $row['attach_filesize'] ),
'method' => 'post',
'id' => $row['attach_id'],
'file' => $row['attach_file'],
'hits' => $row['attach_hits'],
'thumb_location' => $row['attach_thumb_location'],
'type' => 'reg',
'thumb_x' => $row['attach_thumb_width'],
'thumb_y' => $row['attach_thumb_height'],
'ext' => $row['attach_ext'],
);
}
}
}
if( count( $this_topic_attachments ) )
{
$mytopic['attachment_data'] = $this_topic_attachments;
}
$final_topics[] = $mytopic;
}
}
//-----------------------------------------
// Return...
//-----------------------------------------
if( count( $final_topics ) )
{
return $final_topics;
}
else
{
return $topics;
}
}
}
+190
View File
@@ -0,0 +1,190 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Gallery API file
* Last Updated: $Date: 2009-11-11 11:00:08 -0500 (Wed, 11 Nov 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @subpackage IP.Gallery
* @link http://www.iinvisionpower.com
* @version $Rev: 5351 $
* @since 2.2.0
*
*/
if ( ! class_exists( 'apiCore' ) )
{
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
}
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;
}
}
}
+1
View File
@@ -0,0 +1 @@
<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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
+1
View File
@@ -0,0 +1 @@
<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.invisionboard.com/">IP.Board</a>␍</body>␍</html>