| 1 | #!/usr/local/bin/php |
| 2 | <?php |
| 3 | require('../config/config.inc'); |
| 4 | //connecting to database and creating universal $db object |
| 5 | require(SYSTEM_ROOT.'/inc/log.inc'); |
| 6 | require(SYSTEM_ROOT.'/inc/database.inc'); |
| 7 | require(SYSTEM_ROOT.'/inc/nodes.inc'); |
| 8 | $db=new CLASS_DATABASE(); |
| 9 | |
| 10 | $set=$db->query("select * from node_access where node_bookmark='yes'"); |
| 11 | while ($set->next()) { |
| 12 | $creator=$set->getString('user_id'); |
| 13 | $node=$set->getString('node_id'); |
| 14 | $category=$set->getString('bookmark_category'); |
| 15 | if (!$category) $category=$creator; |
| 16 | $help=$db->query("select * from neurons where central='$category' and peripheral='$node'"); |
| 17 | if (!$help->getNumRows()) { |
| 18 | $q="insert into neurons set central='$category',peripheral='$node',synapse_creator='$creator',link='bookmark',synapse_created=NOW()"; |
| 19 | echo $q."\n"; |
| 20 | $db->query($q); |
| 21 | } |
| 22 | unset($help); |
| 23 | } |
| 24 | |
| 25 | |
| 26 | |
| 27 | ?> |