From 3d4bdf9088184500442c451b237fcc2e954a7b21 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 7 Dec 2008 00:26:18 +0000 Subject: drawing links now --- data.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'data.php') diff --git a/data.php b/data.php index 8f26a68..284e65e 100644 --- a/data.php +++ b/data.php @@ -85,19 +85,22 @@ foreach ($lines as $num => $line) if($already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used == true) { $jot = $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i; - $links[$jot]->label = ($links[$jot]->label + $label)/2; + if($links[$jot]->label != -1) + $links[$jot]->label = ($links[$jot]->label + $label)/2; } elseif($already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->used == true) { $jot = $already[$locations[$locids[$iptoLoc]]->locid . '-' . $locations[$locids[$ipfromLoc]]->locid]->i; - $links[$jot]->label = ($links[$jot]->label + $label)/2; + if($links[$jot]->label != -1) + $links[$jot]->label = ($links[$jot]->label + $label)/2; } else { - $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used =true; + $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->used = true; $already[$locations[$locids[$ipfromLoc]]->locid . '-' . $locations[$locids[$iptoLoc]]->locid]->i = $i; $links[$i]->ipfromLoc = $ipfromLoc; $links[$i]->iptoLoc = $iptoLoc; - $links[$i]->label = $label; + if($links[$i]->label != -1) + $links[$i]->label = $label; if($locations[$locids[$ipfromLoc]]->state == "offline") $locations[$locids[$ipfromLoc]]->state = "online"; if($locations[$locids[$iptoLoc]]->state == "offline") @@ -106,7 +109,7 @@ foreach ($lines as $num => $line) if (($nodename[$ipfromLoc] == "tunnel" && $locations[$locids[$ipfromLoc]]->locname=="housing") || ($nodename[$iptoLoc] == "tunnel" && $locations[$locids[$iptoLoc]]->locname=="housing" ) || ($locations[$locids[$iptoLoc]]->hastinc && $locations[$locids[$ipfromLoc]]->hastinc)) { - $link->label = -1; + $links[$i]->label = -1; $locations[$locids[$ipfromLoc]]->state = "tunnel"; $locations[$locids[$iptoLoc]]->state = "tunnel"; } @@ -136,7 +139,7 @@ foreach ($links as $link) $count[$data1->locid]=true; $count[$data2->locid]=true; - printf("\t" . '' . "\n", + printf("\t" . '' . "\n", $data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label); } echo "\n"; -- cgit v1.2.1