Commit | Line | Data |
---|---|---|
b42b2bf9 H |
1 | <? |
2 | // ini_set("error_reporting", "E_ALL & ~E_NOTICE"); | |
3 | ||
4 | require('config/config.inc'); | |
5 | require(SYSTEM_ROOT.'inc/database.inc'); | |
6 | ||
7 | $db=new CLASS_DATABASE(); | |
8 | ||
9 | $vector_size = VECTOR_CHARS; | |
10 | ||
11 | $target = '1478222'; | |
12 | ||
13 | $query = "select node_thread_vector from tiamat where node_id = '$target'"; | |
14 | $set = $db->query($query); | |
15 | $set->next(); | |
16 | $parent_vector = $set->getString('node_thread_vector'); | |
17 | ||
18 | $query = "select * from nodes where node_parent = '$target'"; | |
19 | $set = $db->query($query); | |
20 | ||
21 | while($set->next()) | |
22 | { | |
23 | $level_one[$set->getString('node_id')] = $set->getString('node_name'); | |
24 | } | |
25 | ||
26 | print_r($level_one); | |
27 | ||
28 | echo $parent_vector; | |
29 | ||
30 | $test = str_split($parent_vector, $vector_size); | |
31 | ||
32 | print_r($test); | |
33 | ||
34 | echo "parent node_id :: $target <br /><br />"; | |
35 | ||
36 | $query = "insert into nodes | |
37 | (node_id, node_name, node_parent, node_vector, node_type, node_external_access, | |
38 | node_system_access, node_children_count, node_creator, node_created, | |
39 | lastchild_created, k, node_views, node_descendant_count, lastdescendant_created, template_id) | |
40 | select | |
41 | tiamat.node_id, tiamat.node_name, tiamat.node_parent, tiamat.node_thread_vector, tiamat.node_type, | |
42 | tiamat.node_external_access, tiamat.node_system_access, tiamat.node_children_count, tiamat.node_creator, | |
43 | tiamat.node_created, tiamat.lastchild_created, tiamat.k, tiamat.node_views, tiamat.node_descendant_count, | |
44 | tiamat.lastdescendant_created, tiamat.template_id from tiamat where tiamat.node_id = '$target' limit 1"; | |
45 | ||
46 | // $db->query($query); | |
47 | // echo $query."<br><br>"; | |
48 | ||
49 | // echo "recovered!<br /><br />"; | |
50 | ||
51 | echo "starting update process at vector $parent_vector ...<br /><br />"; | |
52 | ||
53 | foreach($level_one as $target_id => $target_name) | |
54 | { | |
55 | $q = "select * from nodes where node_vector like '%$target_id%'"; | |
56 | echo $q."<br>"; | |
57 | /* $raise = $db->query($q); | |
58 | while($raise->next()) | |
59 | { | |
60 | $q = "update nodes set node_vector = '".$parent_vector.$raise->getString('node_vector')."' where node_id = '".$raise->getString('node_id')."'"; | |
61 | // $db->query($q); | |
62 | echo $q."<br>"; | |
63 | }*/ | |
64 | } | |
65 | ||
66 | echo "update finished!"; | |
67 | ||
68 | ?> |