3 require('../config/config.inc');
5 //connecting to database and creating universal $db object
6 require(SYSTEM_ROOT
.'/inc/log.inc');
7 require(SYSTEM_ROOT
.'/inc/database.inc');
8 require(SYSTEM_ROOT
.'/inc/nodes.inc');
9 $db=new CLASS_DATABASE();
10 $db_old=new CLASS_DATABASE("kyberia","kyberia","cyb3ry","127.0.0.1");
12 $q="select * from nodes where old_id_diskuse>0 and node_type='6'";
14 $bigset=$db->query($q);
16 while ($bigset->next()) {
19 unset($set_array_item);
21 unset($prispevky_array);
22 unset($prispevky_new_array);
23 unset($prispevky_old_array);
26 $q="select * from nodes where node_type='7'";
27 $userset=$db->query($q);
28 while ($userset->next()) {
29 $users[$userset->getString('node_name')]=$userset->getString('node_id');
33 $q="select * from prispevky where id_diskuse='".$bigset->getString('old_id_diskuse')."' order by id_prispevku";
34 $set=$db_old->query($q);
38 while ($set->next()) {
39 $set_array[]=$set->getRecord();
40 $prispevky[$set->getString('thread')]=$set->getString('id_prispevku');
43 foreach ($prispevky as $thread_vector => $prispevok_id) {
44 if (strlen($thread_vector)>4) {
45 $prispevky_old_array[$prispevok_id]=$prispevky[substr($thread_vector,0,strlen($thread_vector)-5)];
49 foreach ($set_array as $set_array_item) {
51 $q="insert into nodes set
52 node_name='".addslashes($set_array_item['vlozeno'])."::".addslashes($set_array_item['jmeno'])."',node_type='4'
53 ,old_id='".$set_array_item['id_prispevku']."'
54 ,node_created='".$set_array_item['vlozeno']."'
55 ,old_id_diskuse='".$set_array_item['id_diskuse']."'
57 ,node_creator='".($users[$set_array_item['jmeno']])."'";
61 $lid=$db->getLastInsertId();
63 $k="insert into node_content set node_content='".addslashes($set_array_item['telo'])."',node_id='$lid'";
65 $oldidz[$set_array_item['id_prispevku']]=true;
71 print_r($prispevky_old_array);
73 foreach ($oldidz as $key=>$value) {
74 echo "wantin key $key";
75 if ($prispevky_old_array[$key]) {
76 $q23="select node_id from nodes where old_id=".$prispevky_old_array[$key]." and node_type='4'";
77 $lal=$db->query($q23);
80 $g="update nodes set node_parent='".$lal->getString('node_id')."' where old_id=$key and node_type='4'";
82 else $g="update nodes set node_parent='".$bigset->getString('node_id')."' where old_id=$key and node_type='4'";
This page took 0.509431 seconds and 4 git commands to generate.