summaryrefslogtreecommitdiff
path: root/data.php
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2008-12-07 00:26:18 +0000
committerChristian Pointner <equinox@ffgraz.net>2008-12-07 00:26:18 +0000
commit3d4bdf9088184500442c451b237fcc2e954a7b21 (patch)
tree4b96fc2326710261aca364365564876b0f5600db /data.php
parentf3902147657cf2773e73f76f7e5fe810d0db6c78 (diff)
drawing links now
Diffstat (limited to 'data.php')
-rw-r--r--data.php15
1 files changed, 9 insertions, 6 deletions
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" . '<link fromid="%s" from="%s" latfrom="%s" lngfrom="%s" toid="%s" to="%s" latto="%s" lngto="%s" color="%s" />' . "\n",
+ printf("\t" . '<link fromid="%s" from="%s" latfrom="%s" lngfrom="%s" toid="%s" to="%s" latto="%s" lngto="%s" value="%s" />' . "\n",
$data1->locid, $data1->locname, $data1->lat,$data1->lng,$data2->locid, $data2->locname, $data2->lat, $data2->lng, $link->label);
}
echo "</links>\n";