1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 18:14:26 +02:00

Allow for importing of table data from e107 v1.x "Content Management" plugin into "Pages/Menus" tables.

This commit is contained in:
Cameron
2017-03-22 13:57:11 -07:00
parent e1ce2f528d
commit 0ec1c74e6b
5 changed files with 298 additions and 17 deletions

View File

@@ -41,14 +41,14 @@ class page_import
'page_metakeys' => '',
'page_metadscr' => '',
'page_text' => '',
'page_author' => 1,
'page_author' => USERID,
'page_datestamp' => '',
'page_rating_flag' => '0',
'page_comment_flag' => '0',
'page_password' => '',
'page_class' => '0',
'page_ip_restrict' => '',
'menu_name' => '',
'menu_name' => '',
'page_template' => 'default'
);
@@ -61,15 +61,14 @@ class page_import
// Constructor
function __construct()
{
global $sql;
$this->pageDB = new db; // Have our own database object to write to the table
$this->pageDB = e107::getDb('page'); // Have our own database object to write to the table
}
// Empty the DB - not necessary
function emptyTargetDB($inc_admin = FALSE)
{
// $this->pageDB->db_Delete('page');
$this->pageDB->truncate('page');
}
@@ -95,7 +94,7 @@ class page_import
*/
function saveData($row)
{
if(!$result = $this->pageDB->db_Insert('page',$row))
if(!$result = $this->pageDB->insert('page',$row))
{
return 4;
}
@@ -109,6 +108,7 @@ class page_import
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
{
return $this->pageDB->getLastErrorText();
$errorTexts = array(
0 => 'No error',
1 => 'Can\'t change main admin data',