} if ($topic_name != "") { $x = new sotf_NodeObject("sotf_topics"); $x->set('topic_id', $topic_id); $x->set('language', "en"); $x->set('topic_name', $topic_name); $x->create(); $id = $x->getID(); print $id; } if ($topic_counter != "") { $x = new sotf_Object("sotf_topics_counter"); $x->set('topic_id', $topic_id); $x->set('number', $topic_counter); $x->create(); $id = $x->getID(); print $id; } $query = "SELECT sotf_topic_tree_defs.*, sotf_topics.topic_name, sotf_topics_counter.number from sotf_topic_tree_defs" . " LEFT JOIN sotf_topics ON sotf_topics.topic_id = sotf_topic_tree_defs.id" . " LEFT JOIN sotf_topics_counter ON sotf_topics_counter.topic_id = sotf_topic_tree_defs.id"; $result = $db->getAll($query); usort($result, "SORTIT"); $parentid; $counter = 0; $max = count($result); for ($i = 0; $i < $max; $i++) { if ($result[$i]["supertopic"] == 0) { if ($i != 0) { $result[$parentid]["numberall"] = $counter; } $parentid = $i; $counter = 0;