Esempio n. 1
0
if (!$localNode) {
    // clear old entry
    $localNode = new sotf_Node();
    $localNode->set('name', $config['nodeName']);
    $localNode->find();
    if ($localNode->exists()) {
        $localNode->delete();
    }
    // create local node entry if does not exist
    $localNode = new sotf_Node();
    $localNode->set('node_id', $config['nodeId']);
    $localNode->set('name', $config['nodeName']);
    $localNode->set('url', $config['rootUrl']);
    $localNode->create();
}
$smarty->assign("LOCAL_NODE", $localNode->getAll());
// nodes
//$nodes = sotf_Node::countAll();
//$smarty->assign('NODES',$nodeData);
// neighbours
//$neighbours = sotf_Neighbour::listAll();
$nodes = sotf_Node::listAll();
print_r($neighbours);
while (list(, $node) = each($nodes)) {
    $nodeId = $node->get('node_id');
    if ($nodeId == $config['nodeId']) {
        continue;
    }
    $data = $node->getAll();
    $nei = sotf_Neighbour::getById($nodeId);
    if ($nei) {