registration fix fixed
[mirrors/Kyberia-bloodline.git] / scripts / user2node.php
1 <?php
2 //requiring main config file with path/database etc. constants
3 require('../config/config.inc');
4
5 //connecting to database and creating universal $db object
6 require(SYSTEM_ROOT.'/inc/log.inc');
7 require(SYSTEM_ROOT.'/inc/database.inc');
8 $db=new CLASS_DATABASE();
9 $db_old=new CLASS_DATABASE("kyberia","kyberia","cyb3ry","127.0.0.1");
10
11 $q="select distinct login,user.* from user";
12 $set=$db_old->query($q);
13 $db->query("set autocommit=0");
14 while ($set->next()) {
15
16 $q="insert into nodes set node_name='".addslashes($set->getString('login'))."'
17 ,node_parent='7',node_system_access='public',node_external_access='no',node_thread_vector=';1;7;',node_type='7',old_id='".$set->getString('id')."'";
18 $db->query($q);
19 $q="insert into node_content set
20 node_content='".addSlashes($set->getString('user_info'))."',node_id=LAST_INSERT_ID()";
21 $db->query($q);
22 $q="insert into users set user_id=LAST_INSERT_ID(),
23 login='".addslashes($set->getString('login'))."',
24 password='".$set->getString('password')."',
25 email='".$set->getString('email')."',
26 user_status='".$set->getString('user_active')."',
27 user_ad='".$set->getString('user_ad')."',
28 www='".$set->getString('www')."',
29 icq='".$set->getString('icq')."',
30 charisma='".$set->getString('charisma')."',
31 last_action='".$set->getString('last_click')."'";
32 $db->query($q);
33 $db->query("commit");
34 }
35
36 ?>
This page took 0.59468 seconds and 4 git commands to generate.