Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+125 -14
View File
@@ -2,27 +2,17 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -124,6 +114,13 @@ class api_components extends api_core
*/
var $component;
/**
* XML Parser Object
*
* @var object
*/
var $xml;
/*-------------------------------------------------------------------------*/
// Get component by key
/*-------------------------------------------------------------------------*/
@@ -164,6 +161,120 @@ class api_components extends api_core
}
}
/*-------------------------------------------------------------------------*/
// Import XML File
/*-------------------------------------------------------------------------*/
/**
* Updates/inserts a component from xml file
*
* @param string Path to XML File
* @return array;
*/
function acp_component_import( $xml_file_path )
{
if( !file_exists($xml_file_path) )
{
return array( 'inserted' => 0, 'updated' => 0 );
}
$content = implode( '', @file( $xml_file_path ) );
if( !$content )
{
return array( 'inserted' => 0, 'updated' => 0 );
}
//-----------------------------------------
// Get current components.
//-----------------------------------------
$cur_components = array();
$this->ipsclass->DB->simple_construct( array( 'select' => 'com_id, com_section',
'from' => 'components',
'order' => 'com_id' ) );
$this->ipsclass->DB->simple_exec();
while ( $r = $this->ipsclass->DB->fetch_row() )
{
$cur_components[ $r['com_section'] ] = $r['com_id'];
}
//-----------------------------------------
// Get xml mah-do-dah
//-----------------------------------------
require_once( KERNEL_PATH.'class_xml.php' );
$this->xml = new class_xml();
//-----------------------------------------
// Unpack the datafile
//-----------------------------------------
$this->xml->xml_parse_document( $content );
//-----------------------------------------
// pArse
//-----------------------------------------
$fields = array( 'com_title' , 'com_description', 'com_author' , 'com_url', 'com_version', 'com_menu_data',
'com_enabled' , 'com_safemode' , 'com_section', 'com_filename' );
if ( ! is_array( $this->xml->xml_array['componentexport']['componentgroup']['component'][0] ) )
{
//-----------------------------------------
// Ensure [0] is populated
//-----------------------------------------
$tmp = $this->xml->xml_array['componentexport']['componentgroup']['component'];
unset($this->xml->xml_array['componentexport']['componentgroup']['component']);
$this->xml->xml_array['componentexport']['componentgroup']['component'][0] = $tmp;
}
$updated = $inserted = 0;
foreach( $this->xml->xml_array['componentexport']['componentgroup']['component'] as $id => $entry )
{
$newrow = array();
foreach( $fields as $f )
{
$newrow[$f] = $entry[ $f ]['VALUE'];
}
$this->ipsclass->DB->force_data_type = array( 'com_version' => 'string' );
if ( $cur_components[ $entry['com_section']['VALUE'] ] )
{
//-----------------------------------------
// Update
//-----------------------------------------
$this->ipsclass->DB->do_update( 'components', $newrow, 'com_id='.$cur_components[ $entry['com_section']['VALUE'] ] );
$updated++;
}
else
{
//-----------------------------------------
// INSERT
//-----------------------------------------
$newrow['com_date_added'] = time();
$this->ipsclass->DB->do_insert( 'components', $newrow );
$inserted++;
}
}
$this->acp_component_rebuildcache();
return array( 'inserted' => $inserted, 'updated' => $updated );
}
/*-------------------------------------------------------------------------*/
// Update component
/*-------------------------------------------------------------------------*/