kopia lustrzana https://github.com/glidernet/ogn-live
update correct index.php for 3D
rodzic
764a9d4575
commit
daee184f53
296
3D/index.php
296
3D/index.php
|
@ -1,161 +1,135 @@
|
||||||
<?php
|
<?php
|
||||||
$uri = $_SERVER["REQUEST_URI"];
|
$link="";
|
||||||
$uri=explode("/",$uri);
|
require('../sql.php');
|
||||||
if ($uri[1]=="markers")
|
ouvrebase();
|
||||||
{
|
|
||||||
$fin=substr($uri[2],-6);
|
$tld="http://live.glidernet.org";
|
||||||
$png = explode(".",$uri[2]);
|
|
||||||
$cn1=$png[0];
|
if (isset($_GET['offline'])) {
|
||||||
$cn=substr($cn1,0,-2);
|
if ($_GET['offline']==1) $offl=1; else $offl=0;
|
||||||
$x=5;
|
}
|
||||||
if (strlen($cn)==2) $x=8;
|
else $offl=0;
|
||||||
if (strlen($cn)==1) $x=12;
|
|
||||||
|
|
||||||
|
$req="select * from live";
|
||||||
switch($fin) {
|
|
||||||
case "_o.png": // old, gris
|
$latmax=$latmin=$lonmax=$lonmin=0;
|
||||||
$filename = "../markers/".$cn."_o.png";
|
|
||||||
|
if (!$result=@mysql_query ($req))
|
||||||
if (file_exists($filename)) {}
|
{
|
||||||
else {
|
echo "<BR><BR><CENTER>Database Error</CENTER><BR><BR>";
|
||||||
$source = imagecreatefrompng("../modele_off.png");
|
@mysql_close($link);
|
||||||
imagealphablending($source, true);
|
exit();
|
||||||
imagesavealpha($source, true);
|
}
|
||||||
$noir = imagecolorallocate($source, 0, 0, 0);
|
|
||||||
imagestring($source,4,$x,4,"$cn",$noir);
|
|
||||||
imagepng($source, "../markers/".$cn."_o.png");
|
if (@mysql_num_rows($result)==0)
|
||||||
header('Content-Type: image/png');
|
{
|
||||||
imagepng($source);
|
$latmax=60;
|
||||||
imagedestroy($source);
|
$latmin=35;
|
||||||
}
|
$lonmax=30;
|
||||||
break;
|
$lonmin=-10;
|
||||||
case "_b.png": // blue: bleu clair
|
$lon=2;
|
||||||
$filename = "../markers/".$cn."_b.png";
|
$lat=45;
|
||||||
|
|
||||||
if (file_exists($filename)) {}
|
}
|
||||||
else {
|
else
|
||||||
$source = imagecreatefrompng("../modele_b.png");
|
{
|
||||||
imagealphablending($source, true);
|
|
||||||
imagesavealpha($source, true);
|
$aa=0;
|
||||||
$noir = imagecolorallocate($source, 0, 0, 0);
|
|
||||||
imagestring($source,4,$x,4,"$cn",$noir);
|
while($ligne = @mysql_fetch_array($result))
|
||||||
imagepng($source, "../markers/".$cn."_b.png");
|
{
|
||||||
header('Content-Type: image/png');
|
extract($ligne);
|
||||||
imagepng($source);
|
if ($aa==0)
|
||||||
imagedestroy($source);
|
{
|
||||||
}
|
$latmax=$latmin=$lat;
|
||||||
break;
|
$lonmax=$lonmin=$lon;
|
||||||
case "_g.png": // green: vert
|
$aa=1;
|
||||||
$filename = "../markers/".$cn."_g.png";
|
}
|
||||||
|
else
|
||||||
if (file_exists($filename)) {}
|
{
|
||||||
else {
|
if ($lat>$latmax) $latmax=$lat;
|
||||||
$source = imagecreatefrompng("../modele_g.png");
|
if ($lat<$latmin) $latmin=$lat;
|
||||||
imagealphablending($source, true);
|
if ($lon>$lonmax) $lonmax=$lon;
|
||||||
imagesavealpha($source, true);
|
if ($lon<$lonmin) $lonmin=$lon;
|
||||||
$noir = imagecolorallocate($source, 0, 0, 0);
|
}
|
||||||
imagestring($source,4,$x,4,"$cn",$noir);
|
}
|
||||||
imagepng($source, "../markers/".$cn."_g.png");
|
$lon = $lonmin + (($lonmax-$lonmin)/2);
|
||||||
header('Content-Type: image/png');
|
$lat = $latmin + (($latmax-$latmin)/2);
|
||||||
imagepng($source);
|
|
||||||
imagedestroy($source);
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "_r.png": // red: rouge
|
echo "<!DOCTYPE html>
|
||||||
$filename = "../markers/".$cn."_r.png";
|
<!--
|
||||||
|
____ _____ _ _ _ _ _ _ _
|
||||||
if (file_exists($filename)) {}
|
/ __ \ / ____| (_) | | | \ | | | | | |
|
||||||
else {
|
| | | |_ __ ___ _ __ | | __| |_ __| | ___ _ __ | \| | ___| |___ _____ _ __| | __
|
||||||
$source = imagecreatefrompng("../modele_r.png");
|
| | | | '_ \ / _ \ '_ \ | | |_ | | |/ _` |/ _ \ '__| | . ` |/ _ \ __\ \ /\ / / _ \| '__| |/ /
|
||||||
imagealphablending($source, true);
|
| |__| | |_) | __/ | | | | |__| | | | (_| | __/ | | |\ | __/ |_ \ V V / (_) | | | <
|
||||||
imagesavealpha($source, true);
|
\____/| .__/ \___|_| |_| \_____|_|_|\__,_|\___|_| |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\
|
||||||
$noir = imagecolorallocate($source, 0, 0, 0);
|
| |
|
||||||
imagestring($source,4,$x,4,"$cn",$noir);
|
|_|
|
||||||
imagepng($source, "../markers/".$cn."_r.png");
|
-->
|
||||||
header('Content-Type: image/png');
|
<html>
|
||||||
imagepng($source);
|
<head>
|
||||||
imagedestroy($source);
|
<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" />
|
||||||
}
|
<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>
|
||||||
break;
|
<title>Spot the gliders!</title>
|
||||||
case "_p.png": // pink: rose
|
<link href=\"{$tld}/cunimb3d.css\" rel=\"stylesheet\" type=\"text/css\" />
|
||||||
$filename = "../markers/".$cn."_p.png";
|
|
||||||
|
<script type=\"text/javascript\">
|
||||||
if (file_exists($filename)) {}
|
var cxml = \"../lxml.php\";
|
||||||
else {
|
var cxml1 = \"../livexml1.php\";
|
||||||
$source = imagecreatefrompng("../modele_p.png");
|
var dxml = \"../dataxml.php\";
|
||||||
imagealphablending($source, true);
|
var rxml = \"../rec.php\";
|
||||||
imagesavealpha($source, true);
|
var tld = \"{$tld}\";
|
||||||
$noir = imagecolorallocate($source, 0, 0, 0);
|
var vlon = $lon;
|
||||||
imagestring($source,4,$x,4,"$cn",$noir);
|
var vlat = $lat;
|
||||||
imagepng($source, "../markers/".$cn."_p.png");
|
var vlatmin = $latmin;
|
||||||
header('Content-Type: image/png');
|
var vlonmin = $lonmin;
|
||||||
imagepng($source);
|
var vlatmax = $latmax;
|
||||||
imagedestroy($source);
|
var vlonmax = $lonmax;
|
||||||
}
|
var bound = false;
|
||||||
break;
|
var boundc = '';
|
||||||
case "_k.png": // black: noir
|
var amax = 85;
|
||||||
$filename = "../markers/".$cn."_k.png";
|
var amin = -85;
|
||||||
|
var omax = 180;
|
||||||
if (file_exists($filename)) {}
|
var omin = -180;
|
||||||
else {
|
var all = $offl;
|
||||||
$source = imagecreatefrompng("../modele_k.png");
|
var tz;
|
||||||
imagealphablending($source, true);
|
try {
|
||||||
imagesavealpha($source, true);
|
tz = new Date().getTimezoneOffset();
|
||||||
$blanc = imagecolorallocate($source, 255, 255, 255);
|
}
|
||||||
imagestring($source,4,$x,4,"$cn",$blanc);
|
catch(e) {
|
||||||
imagepng($source, "../markers/".$cn."_k.png");
|
tz = 0;
|
||||||
header('Content-Type: image/png');
|
}
|
||||||
imagepng($source);
|
|
||||||
imagedestroy($source);
|
</script>
|
||||||
}
|
<script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"> </script>
|
||||||
break;
|
<script type=\"text/javascript\" src=\"{$tld}/util.js\"></script>
|
||||||
case "_d.png": // dark blue: bleu foncé
|
<script type=\"text/javascript\" src=\"{$tld}/cunimb3d.js\"></script>
|
||||||
$filename = "../markers/".$cn."_d.png";
|
<script type=\"text/javascript\">
|
||||||
|
var ge;
|
||||||
if (file_exists($filename)) {}
|
google.load(\"earth\", \"1\");
|
||||||
else {
|
google.setOnLoadCallback(initialize);
|
||||||
$source = imagecreatefrompng("../modele_d.png");
|
</script>
|
||||||
imagealphablending($source, true);
|
|
||||||
imagesavealpha($source, true);
|
|
||||||
$blanc = imagecolorallocate($source, 255, 255, 255);
|
</head>
|
||||||
imagestring($source,4,$x,4,"$cn",$blanc);
|
<body>
|
||||||
imagepng($source, "../markers/".$cn."_d.png");
|
<div id=\"popup\" onclick=\"cp('popup');\"></div>
|
||||||
header('Content-Type: image/png');
|
<div id=\"map_canvas\"></div>
|
||||||
imagepng($source);
|
<div id=\"divInfoac\" class=\"divInfoclass\" style=\"display: none;\" onclick=\"autocenteroff();\"></div>
|
||||||
imagedestroy($source);
|
<div id=\"ac\" class=\"acright\" onclick=\"this.style.display='none';\"></div>
|
||||||
}
|
<div id=\"dlist\" class=\"lright\">
|
||||||
break;
|
<DIV id=\"ett1\" ></DIV>
|
||||||
|
<DIV id=\"ett2\" ></DIV>
|
||||||
default:
|
<DIV id=\"dtable\"></DIV>
|
||||||
$filename = "../markers/".$cn1.".png";
|
</div>
|
||||||
|
</body>
|
||||||
if (file_exists($filename)) {}
|
|
||||||
else {
|
</html>";
|
||||||
$x=5;
|
@mysql_close($link);
|
||||||
if (strlen($cn1)==2) $x=8;
|
?>
|
||||||
if (strlen($cn1)==1) $x=12;
|
|
||||||
$source = imagecreatefrompng("../modele.png");
|
|
||||||
imagealphablending($source, true);
|
|
||||||
imagesavealpha($source, true);
|
|
||||||
|
|
||||||
//imagestring($source,4,$x,5,"$cn",0);
|
|
||||||
imagestring($source,4,$x,4,"$cn1",0);
|
|
||||||
imagepng($source, "../markers/".$cn1.".png");
|
|
||||||
header('Content-Type: image/png');
|
|
||||||
imagepng($source);
|
|
||||||
imagedestroy($source);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "..:: 404_error ::..<BR>File not found<BR>Fichier non trouvé";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
Ładowanie…
Reference in New Issue