mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Add some work in progress - needs further testing
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/import_classes.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/import_classes.php,v $
|
||||||
| $Revision: 1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2009-07-20 15:24:34 $
|
| $Date: 2009-07-20 21:18:09 $
|
||||||
| $Author: e107coders $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -55,6 +55,27 @@ class base_import_class
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function saveData($dataRecord)
|
||||||
|
{
|
||||||
|
switch($this->currentTask)
|
||||||
|
{
|
||||||
|
case 'users' :
|
||||||
|
return $this->saveUserData($dataRecord);
|
||||||
|
break;
|
||||||
|
case 'forumdefs' :
|
||||||
|
return $this->saveForumData($dataRecord);
|
||||||
|
return FALSE;
|
||||||
|
case 'forumposts' :
|
||||||
|
return $this->savePostData($dataRecord);
|
||||||
|
return FALSE;
|
||||||
|
case 'polls' :
|
||||||
|
return FALSE;
|
||||||
|
case 'news' :
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the next record as an array. All data has been converted to the appropriate E107 formats
|
// Return the next record as an array. All data has been converted to the appropriate E107 formats
|
||||||
// Return FALSE if no more data
|
// Return FALSE if no more data
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/import_user_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/import_user_class.php,v $
|
||||||
| $Revision: 1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2009-07-20 15:24:34 $
|
| $Date: 2009-07-20 21:18:09 $
|
||||||
| $Author: e107coders $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -95,7 +95,6 @@ class user_import
|
|||||||
// Constructor
|
// Constructor
|
||||||
function user_import()
|
function user_import()
|
||||||
{
|
{
|
||||||
global $sql;
|
|
||||||
$this->userDB = new db; // Have our own database object to write to the user table
|
$this->userDB = new db; // Have our own database object to write to the user table
|
||||||
|
|
||||||
// Create list of predefined extended user fields which are present
|
// Create list of predefined extended user fields which are present
|
||||||
@@ -155,7 +154,7 @@ class user_import
|
|||||||
|
|
||||||
// Add a user record to the DB - pass array as parameter.
|
// Add a user record to the DB - pass array as parameter.
|
||||||
// Returns an error code on failure. TRUE on success
|
// Returns an error code on failure. TRUE on success
|
||||||
function saveData($userRecord)
|
function saveUserData($userRecord)
|
||||||
{
|
{
|
||||||
if ($this->blockMainAdmin && isset($userRecord['user_id']) && ($userRecord['user_id'] == 1)) return 1;
|
if ($this->blockMainAdmin && isset($userRecord['user_id']) && ($userRecord['user_id'] == 1)) return 1;
|
||||||
$extendedFields = array();
|
$extendedFields = array();
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/phpbb2_import_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/import/phpbb2_import_class.php,v $
|
||||||
| $Revision: 1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2009-07-20 15:24:34 $
|
| $Date: 2009-07-20 21:18:09 $
|
||||||
| $Author: e107coders $
|
| $Author: e107steved $
|
||||||
|
|
|
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +87,14 @@ class phpbb2_import extends base_import_class
|
|||||||
if ($this->copyUserInfo) $target['user_id'] = $source['user_id'];
|
if ($this->copyUserInfo) $target['user_id'] = $source['user_id'];
|
||||||
$target['user_name'] = $source['username'];
|
$target['user_name'] = $source['username'];
|
||||||
$target['user_loginname'] = $source['username'];
|
$target['user_loginname'] = $source['username'];
|
||||||
|
if ((substr($source['user_password']) == '$H$') && (strlen($source['user_password']) == 34))
|
||||||
|
{ // Convert salted password to E107 style (they use the same basic coding)
|
||||||
|
$target['user_password'] = substr_replace($source['user_password'], '$E$',0,3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Probably an old md5 password
|
||||||
$target['user_password'] = $source['user_password'];
|
$target['user_password'] = $source['user_password'];
|
||||||
|
}
|
||||||
$target['user_email'] = $source['user_email'];
|
$target['user_email'] = $source['user_email'];
|
||||||
$target['user_signature'] = $this->proc_bb($source['user_sig'],'phpbb,bblower');
|
$target['user_signature'] = $this->proc_bb($source['user_sig'],'phpbb,bblower');
|
||||||
$target['user_hideemail'] = $source['user_viewemail'];
|
$target['user_hideemail'] = $source['user_viewemail'];
|
||||||
@@ -375,7 +382,9 @@ while($topic = mysql_fetch_array($phpbb_res))
|
|||||||
|
|
||||||
//echo "PARENT: $parent_id, TOPIC: $topic_id<br />";
|
//echo "PARENT: $parent_id, TOPIC: $topic_id<br />";
|
||||||
|
|
||||||
$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' AND post_subject = '' ORDER BY post_time DESC";
|
// Not checking post_subject might work better
|
||||||
|
$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' ORDER BY post_time DESC";
|
||||||
|
// $query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' AND post_subject = '' ORDER BY post_time DESC";
|
||||||
$phpbb_res2 = mysql_query($query, $phpbbConnection);
|
$phpbb_res2 = mysql_query($query, $phpbbConnection);
|
||||||
if(!$phpbb_res2)
|
if(!$phpbb_res2)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user