Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / scripts / articlethread.php
diff --git a/scripts/articlethread.php b/scripts/articlethread.php
new file mode 100644 (file)
index 0000000..bc7d4ee
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+//requiring main config file with path/database etc. constants
+require('../config/config.inc');
+
+//connecting to database and creating universal $db object
+require(SYSTEM_ROOT.'/inc/log.inc');
+require(SYSTEM_ROOT.'/inc/database.inc');
+require(SYSTEM_ROOT.'/inc/nodes.inc');
+$db=new CLASS_DATABASE();
+
+
+$q="select node_id,node_thread_vector from nodes where node_type='5'";
+$set=$db->query($q);
+while ($set->next()) {
+       $vector_array[$set->getString('node_id')]=$set->getString('node_thread_vector');
+}
+
+print_r($vector_array);
+$q="select * from nodes where node_type='4' and node_thread_vector='0' and old_type='article' order by node_id asc";
+$set=$db->query($q);
+while ($set->next()) {
+       $vector_array[$set->getString('node_id')]=$vector_array[$set->getString('node_parent')].";".$set->getString('node_parent');
+       $db->query("update nodes set node_thread_vector='".$vector_array[$set->getString('node_parent')].";".$set->getString('node_parent')."' where node_id='".$set->getString('node_id')."'");
+       echo "update nodes set node_thread_vector='".$vector_array[$set->getString('node_parent')].";".$set->getString('node_parent')."' where node_id='".$set->getString('node_id')."'";
+}
+?>
\ No newline at end of file
This page took 0.139697 seconds and 4 git commands to generate.