Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -3,20 +3,20 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Very lightweight simple, basic node class
|
||||
* Owner: Matt Mecham
|
||||
* Last Updated: $Date: 2010-08-03 17:20:16 +0100 (Tue, 03 Aug 2010) $
|
||||
* Last Updated: $Date: 2011-07-14 06:24:58 -0400 (Thu, 14 Jul 2011) $
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 6725 $
|
||||
* @version $Revision: 9234 $
|
||||
*/
|
||||
|
||||
class classNodes
|
||||
@@ -68,6 +68,7 @@ class classNodes
|
||||
* @var object
|
||||
*/
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
|
||||
/**
|
||||
* Cache object
|
||||
@@ -76,6 +77,7 @@ class classNodes
|
||||
* @var object
|
||||
*/
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
/**
|
||||
* Item Cache
|
||||
@@ -222,7 +224,7 @@ class classNodes
|
||||
* 'sqlNodeLeft' (the SQL table field for node left)
|
||||
* 'sqlNodeRight' (the SQL table field for node right)
|
||||
* 'sqlWhere' (Any additional 'where' information *Optional) ]
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -349,11 +351,19 @@ class classNodes
|
||||
$gotCache = array();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isset( $this->_nodeCache[ $nodeId ] ) )
|
||||
{
|
||||
return $this->_nodeCache[ $nodeId ];
|
||||
}
|
||||
}
|
||||
|
||||
/* Still here? */
|
||||
if ( is_numeric( $nodeId ) OR ! count( $gotCache ) )
|
||||
{
|
||||
if ( is_array( $this->_sqlJoins ) and count( $this->_sqlJoins ) )
|
||||
{
|
||||
{
|
||||
$this->DB->build( array( 'select' => $this->_sqlTblPrefix . '.' . $this->_sqlSelect,
|
||||
'from' => array( $this->_sqlTable => $this->_sqlTblPrefix ),
|
||||
'where' => $this->_sqlTblPrefix . '.' . $this->_sqlPrimaryID . $fetch,
|
||||
@@ -370,7 +380,8 @@ class classNodes
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$return[ $nodeId ] = $this->_nodeCache[ $nodeId ] = $row;
|
||||
$return[ $row[ $this->_sqlPrimaryID ] ] = $row;
|
||||
$this->_nodeCache[ $row[ $this->_sqlPrimaryID ] ] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +492,7 @@ class classNodes
|
||||
$where = ( $where ) ? $where : $this->_sqlWhere;
|
||||
|
||||
/* Fetch data */
|
||||
if ( is_array( $this->_sqlJoins ) and count( $this->_sqlJoins ) )
|
||||
if ( is_array( $this->_sqlJoins ) and count( $this->_sqlJoins ) OR ! empty( $this->_sqlTblPrefix ) )
|
||||
{
|
||||
$_order = $this->getOrder();
|
||||
$order = ( ! empty( $_order ) ) ? $_order : $this->_sqlTblPrefix . '.' . $this->_sqlNodeLeft;
|
||||
@@ -489,8 +500,8 @@ class classNodes
|
||||
$this->DB->build( array( 'select' => $this->_sqlTblPrefix . '.' . $this->_sqlSelect,
|
||||
'from' => array( $this->_sqlTable => $this->_sqlTblPrefix ),
|
||||
'where' => $where,
|
||||
'order' => $order,
|
||||
'limit' => $this->getLimit(),
|
||||
'order' => $order,
|
||||
'add_join' => $this->_sqlJoins ) );
|
||||
}
|
||||
else
|
||||
@@ -636,6 +647,7 @@ class classNodes
|
||||
'from' => array( $this->_sqlTable => $a ),
|
||||
'where' => $where,
|
||||
'order' => $a . '.' . $this->_sqlNodeLeft,
|
||||
'limit' => $this->getLimit(),
|
||||
'add_join' => $_joins ) );
|
||||
|
||||
|
||||
@@ -771,7 +783,7 @@ class classNodes
|
||||
{
|
||||
$nInfo = $this->fetchNodeInfo( $parentId );
|
||||
|
||||
if ( ! isset( $nInfo[0] ) )
|
||||
if ( ! isset( $nInfo[0] ) OR empty( $parentId ) )
|
||||
{
|
||||
/* Add without parents? */
|
||||
if ( empty( $parentId ) )
|
||||
@@ -872,7 +884,7 @@ class classNodes
|
||||
|
||||
$whr = $this->_sqlNodeLeft . ' BETWEEN ' . ( $leftIdP + 1 ) . ' AND ' . ( $rightIdP - 1 );
|
||||
}
|
||||
else if ( $newParentId > 0 && $leftIdP < $leftId )
|
||||
else if ( $leftIdP < $leftId )
|
||||
{
|
||||
$set = $this->_sqlNodeLevel . ' = CASE WHEN ' . $this->_sqlNodeLeft . ' BETWEEN ' . $leftId . ' AND ' . $rightId . ' THEN ' . $this->_sqlNodeLevel . sprintf( '%+d', - ( $level - 1 ) + $levelP ) . ' ELSE ' . $this->_sqlNodeLevel . ' END, '
|
||||
. $this->_sqlNodeLeft . ' = CASE WHEN ' . $this->_sqlNodeLeft . ' BETWEEN ' . $rightIdP . ' AND ' . ( $leftId - 1 ) . ' THEN ' . $this->_sqlNodeLeft . '+' . ( $rightId - $leftId + 1 ) . ' '
|
||||
@@ -1166,7 +1178,7 @@ class nodeFunctions
|
||||
/* Init */
|
||||
$nested = array();
|
||||
$depths = array();
|
||||
|
||||
|
||||
foreach( $array as $key => $data )
|
||||
{
|
||||
if ( $data[ $nDepthField ] == 0 )
|
||||
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user