summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-11-22 13:30:32 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-11-22 13:30:32 +0000
commite17d15cadd51abf7afc4826c1d4ecb54662034de (patch)
treeb86fef8679ac3b991a8221c47570bc2c5fea0741
parent2293b2718f1e394cee33a2238da68497f79999a6 (diff)
downloadgpsd-e17d15cadd51abf7afc4826c1d4ecb54662034de.tar.gz
Conditionalize so the satellite-view caption is not displayed...
...when the gpsd instance is not accessible.
-rw-r--r--gpsd.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/gpsd.php b/gpsd.php
index 329b835d..3a518c5c 100644
--- a/gpsd.php
+++ b/gpsd.php
@@ -367,7 +367,12 @@ function write_html($resp){
<tr><td align="justify">
{$blurb}
</td>
+EOF;
+ if (!$sock)
+ $part2 = "";
+ else
+ $part2 = <<<EOF
<!-- ------------------------------------------------------------ -->
<td rowspan="4" align="center" valign="top">
@@ -397,9 +402,9 @@ Use a different server:<br/>
EOF;
if (!$sock)
- $part2 = "<tr><td><font color='red'>The gpsd instance that this page monitors is not running.</font></td></tr>";
+ $part3 = "<tr><td><font color='red'>The gpsd instance that this page monitors is not running.</font></td></tr>";
else
- $part2 = <<<EOF
+ $part3 = <<<EOF
<tr><td align=center valign=top>
<table border=1>
<tr><td colspan=2 align=center><b>Current Information</b></td></tr>
@@ -416,7 +421,7 @@ EOF;
<tr><td><small>{$resp}</small></td></tr>
EOF;
- $part3 = <<<EOF
+ $part4 = <<<EOF
</table>
</center>
@@ -430,7 +435,7 @@ EOF;
EOF;
-print $part1 . $part2 . $part3;
+print $part1 . $part2 . $part3 . $part4;
}