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,17 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* API: Core
|
||||
* Last Updated: $Date: 2009-05-11 17:39:45 -0400 (Mon, 11 May 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @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 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
class apiCore
|
||||
|
||||
+211
-193
@@ -1,194 +1,212 @@
|
||||
<?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&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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?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&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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Forums topic view API file
|
||||
* Last Updated: $Date: 2009-02-04 15:03:59 -0500 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $Date: 2010-10-25 11:20:47 -0400 (Mon, 25 Oct 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @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
|
||||
* @version $Rev: 3887 $
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 7036 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
@@ -22,6 +24,11 @@ if ( ! class_exists( 'apiCore' ) )
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiTopicView class
|
||||
* @package IP.Board
|
||||
* @subpackage Forums
|
||||
*/
|
||||
class apiTopicView extends apiCore
|
||||
{
|
||||
/**
|
||||
@@ -58,8 +65,8 @@ class apiTopicView extends apiCore
|
||||
// Get some classes
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php' );
|
||||
$appClass = new app_class_forums( $this->registry );
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/app_class_forums.php', 'app_class_forums', 'forums' );
|
||||
$appClass = new $classToLoad( $this->registry );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,7 +193,7 @@ class apiTopicView extends apiCore
|
||||
'where' => "attach_rel_module='post' AND attach_rel_id IN (" . implode( ",", $this->attach_pids ) . ")"
|
||||
) );
|
||||
|
||||
$this->DB->execute;
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $a = $this->DB->fetch() )
|
||||
{
|
||||
|
||||
@@ -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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Gallery API file
|
||||
* Last Updated: $Date: 2009-11-11 11:00:08 -0500 (Wed, 11 Nov 2009) $
|
||||
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @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: 5351 $
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Gallery
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5713 $
|
||||
* @since 2.2.0
|
||||
*
|
||||
*/
|
||||
@@ -22,6 +23,10 @@ if ( ! class_exists( 'apiCore' ) )
|
||||
require_once( IPS_ROOT_PATH . 'api/api_core.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* apiGallery class
|
||||
* @package IP.Gallery
|
||||
*/
|
||||
class apiGallery extends apiCore
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<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 +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.invisionboard.com/">IP.Board</a>␍</body>␍</html>
|
||||
<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>
|
||||
Reference in new issue
Block a user