2 //requiring main config file with path/database etc. constants
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 articles";
13 $set=$db_old->query($q);
14 $db->query("set autocommit=0");
15 while ($set->next()) {
17 $q="insert into nodes set ";
19 if (!is_numeric($set->getString('autor'))) $node_name=$set->getString('autor')."::".$set->getString('nazov');
20 else $node_name=$set->getString('nazov');
21 $node_name=addslashes(strip_tags($node_name));
23 $q.="node_name='$node_name'";
25 $q2="select * from nodes where node_type='2' and old_id='".$set->getString('id_rubrika')."'";
26 $res2=$db->query($q2);
28 $q.=",node_parent='".$res2->getString('node_id')."'";
29 $q.=",node_thread_vector='".$res2->getString('node_thread_vector').";".$res2->getString('node_id')."'";
32 if (is_numeric($set->getString('autor'))) {
33 $autor=nodes
::getNodeByOldId($set->getString('autor'));
34 $q.=",node_creator='".$autor['node_id']."'";
36 else $q.=",node_creator='548'";
40 ,node_created='".$set->getString('datum')."'
41 ,node_views='".$set->getString('hits')."'
42 ,node_system_access='public'
43 ,node_external_access='yes'
44 ,node_children_count='".$set->getString('prispevky')."'
45 ,old_id_diskuse='".$set->getString('id_diskuse')."'
46 ,old_id='".$set->getString('id_article')."'";
49 $q="insert into node_content set node_content='".AddSlashes($set->getString('short_desc')).":::".AddSlashes($set->getString('text1'))."',node_id=LAST_INSERT_ID()";
This page took 0.379395 seconds and 4 git commands to generate.