diff --git a/aurora.php b/aurora.php index eeac359..2accc69 100644 --- a/aurora.php +++ b/aurora.php @@ -1,130 +1,795 @@ + - - weather34 Radio Aurora Borealis and Sun Index Data - - + + weather34 Radio Aurora Borealis and Sun Index Data + + + @font-face { + font-family: weathertext; + src: url(css/fonts/sanfranciscodisplay-regular-webfont.woff) format("woff") + } + + *, + *:before, + *:after { + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0 + } + + html, + body { + font-size: 62.5%; + font-family: "weathertext", Helvetica, Arial, sans-serif; + background: rgba(11, 12, 12, 0.4); + background-repeat: no-repeat + } + + body { + color: #aaa; + overflow: hidden; + height: 105vh; + padding: 10px + } + + section { + width: 80vw; + max-width: 64rem; + min-width: 58.9rem; + margin: 0 auto; + padding: 10px + } + + .weather34title { + font-size: 14px; + font-weight: normal; + padding-top: 3px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + width: 400px + } + + .weather34cards { + padding-top: 2rem; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 5px + } + + .weather34card { + width: 31rem; + height: 14.5rem; + background-color: 0; + border-radius: 4px; + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + color: #aaa; + font-size: 11px; + font-weight: normal; + padding: 10px; + border: solid #444 1px + } + + .weather34card__weather34-container { + height: 50%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: end; + -ms-flex-align: end; + align-items: flex-end; + padding: 10px; + font-family: 'weathertext', sans-serif + } + + .weather34card__weather34-wrapper { + width: 8rem; + font-family: "weathertext", Helvetica, Arial, sans-serif; + font-weight: 100 + } + + .weather34cardguide { + width: 27rem; + height: 200px; + background: RGBA(37, 41, 45, 0); + border-radius: 4px; + position: relative; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + color: #aaa; + font-size: 12px; + font-weight: normal; + padding: 5px; + border: solid #444 1px; + line-height: 13px + } + + .weather34card__weather34-guide { + width: 3rem; + font-family: "weathertext", Helvetica, Arial, sans-serif; + font-weight: 100 + } + + .weather34card__count-container { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 10px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + } + + .weather34card__count-text { + font-family: "weathertext", Helvetica, Arial, sans-serif; + text-align: center + } + + .weather34card__count-text--big { + font-size: 42px; + font-weight: 200; + font-family: 'weathertext', sans-serif + } + + .weather34card__count-text--bigs { + font-size: 12px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + font-weight: normal; + color: #aaa; + text-align: center + } + + weather34card__count-text--bigsa { + font-size: 13px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + font-weight: normal; + color: #aaa; + text-align: center + } + + .weather34card__stuff-container { + margin: 0 auto; + width: 99%; + height: 16%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 15px; + color: #aaa; + background: RGBA(37, 41, 45, 0); + border: solid RGBA(156, 156, 156, 0.1) 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + text-align: center; + font-size: 1em + } + + .weather34card:after { + content: ""; + display: block; + position: absolute; + top: 0; + left: 0; + width: 16rem; + height: 4.625rem; + padding: 10px + } + + .weather34card--earthquake1:after { + background-image: radial-gradient(to bottom, rgba(106, 122, 135, 0.5), transparent 70%) + } + + .weather34card--earthquake2:after { + background-image: radial-gradient(to bottom, rgba(106, 191, 96, 0.5), transparent 70%) + } + + .weather34card--earthquake3:after { + background-image: radial-gradient(to bottom, rgba(96, 203, 231, 0.5), transparent 70%) + } + + blue { + color: #01a4b4 + } + + orange { + color: #ff8841 + } + + green { + color: #9aba2f + } + + red { + color: #f37867 + } + + red6 { + color: #d65b4a + } + + value { + color: #fff + } + + yellow { + color: #CC0 + } + + purple { + color: #916392 + } + + time { + color: #aaa; + font-weight: normal; + font-family: "weathertext", Helvetica, Arial, sans-serif; + } + + time span { + color: #ff8841; + font-weight: normal; + font-family: "weathertext", Helvetica, Arial, sans-serif; + } + + a { + color: #aaa; + font-size: 11px; + top: 5px; + margin-top: 10px; + text-decoration: none + } + + .provided { + position: absolute; + color: #aaa; + font-size: 11px; + bottom: 7px; + text-decoration: none; + margin-left: 100px; + } + + updated { + position: absolute; + bottom: 5px; + float: right; + font-size: 10px; + font-family: "weathertext", Helvetica, Arial, sans-serif; + } + + .weather34chart-btn.close:after, + .weather34chart-btn.close:before { + color: #ccc; + position: absolute; + font-size: 14px; + font-family: Arial, Helvetica, sans-serif; + font-weight: 600 + } + + .weather34browser-header { + flex-basis: auto; + height: 35px; + background: #ebebeb; + background: 0; + border-bottom: 0; + display: flex; + margin-top: -20px; + width: 100%; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px + } + + .weather34browser-footer { + flex-basis: auto; + height: 35px; + background: #ebebeb; + background: rgba(56, 56, 60, 1); + border-bottom: 0; + display: flex; + bottom: -20px; + width: 97.4%; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; + -moz-border-radius-bottomright: 5px; + -moz-border-radius-bottomleft: 5px; + border-bottom-right-radius: 5px; + border-bottom-left-radius: 5px + } + + .weather34chart-btns { + position: absolute; + height: 35px; + display: inline-block; + padding: 0 10px; + line-height: 38px; + width: 55px; + flex-basis: auto; + top: 5px + } + + .weather34chart-btn { + width: 14px; + height: 14px; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 6px; + display: inline-block; + margin: 1px + } + + .weather34chart-btn.close { + background-color: rgba(255, 124, 57, 1) + } + + .weather34chart-btn.close:before { + content: "x"; + margin-top: -14px; + margin-left: 2px + } + + .weather34chart-btn.close:after { + content: "close window"; + margin-top: -13px; + margin-left: 15px; + width: 300px + } + + a { + color: #aaa; + text-decoration: none + } + + .weather34darkbrowser { + position: relative; + background: 0; + width: 104%; + max-height: 30px; + margin: auto; + margin-top: -15px; + margin-left: -20px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + padding-top: 45px; + background-image: radial-gradient(circle, #EB7061 6px, transparent 8px), radial-gradient(circle, #F5D160 6px, transparent 8px), radial-gradient(circle, #81D982 6px, transparent 8px), radial-gradient(circle, rgba(97, 106, 114, 1) 2px, transparent 2px), radial-gradient(circle, rgba(97, 106, 114, 1) 2px, transparent 2px), radial-gradient(circle, rgba(97, 106, 114, 1) 2px, transparent 2px), linear-gradient(to bottom, rgba(59, 60, 63, 0.4) 40px, transparent 0); + background-position: left top, left top, left top, right top, right top, right top, 0 0; + background-size: 50px 45px, 90px 45px, 130px 45px, 50px 30px, 50px 45px, 50px 60px, 100%; + background-repeat: no-repeat, no-repeat + } + + .weather34darkbrowser[url]:after { + content: attr(url); + color: #aaa; + font-size: 14px; + position: absolute; + left: 0; + right: 0; + top: 0; + padding: 2px 15px; + margin: 11px 50px 0 90px; + border-radius: 3px; + background: rgba(97, 106, 114, 0.3); + height: 20px; + box-sizing: border-box + } + + .weather34-uvrate-bar { + background: 0; + position: absolute; + height: 100px; + width: 30px; + margin-left: 235px; + margin-top: -49px; + color: RGBA(57, 61, 64, 1) + } + + .weather34-uvrate-bar .bar { + shape-rendering: crispEdges; + background: url(css/rain/uvrulerw34.svg) no-repeat; + width: 37px; + border: 1px solid RGBA(57, 61, 64, 1.00); + border-bottom: 5px solid RGBA(57, 61, 64, 1.00); + border-top: 3px solid RGBA(57, 61, 64, 1.00); + -webkit-border-radius: 1px 1px 2px 2px; + position: absolute; + bottom: 0 + } + + .weather34-uvrate-bar .bar-1 { + height: 100px; + max-height: 100px + } + + .weather34-uvrate-bar .bar-inner10 { + shape-rendering: crispEdges; + background: rgba(128, 105, 152, 0.8); + width: 100%; + -webkit-border-radius: 1px 1px 2px 2px; + border: 0 + } + + .weather34-uvrate-bar .bar-inner8 { + shape-rendering: crispEdges; + background: rgba(208, 80, 65, 0.8); + width: 100%; + -webkit-border-radius: 1px 1px 2px 2px; + border: 0 + } + + .weather34-uvrate-bar .bar-inner5 { + shape-rendering: crispEdges; + background: rgba(255, 124, 57, 0.8); + width: 100%; + -webkit-border-radius: 1px 1px 2px 2px; + border: 0 + } + + .weather34-uvrate-bar .bar-inner3 { + shape-rendering: crispEdges; + background: rgba(255, 190, 65, 0.7); + width: 100%; + -webkit-border-radius: 1px 1px 2px 2px; + border: 0 + } + + .weather34-uvrate-bar .bar-inner { + shape-rendering: crispEdges; + background: rgba(143, 177, 42, 0.8); + width: 100%; + -webkit-border-radius: 1px 1px 2px 2px; + border: 0 + } + + .weather34uvrate { + color: #ff8841; + position: absolute; + margin-left: 238px; + margin-top: 17px; + font-size: 12px; + width: 20px; + font-family: weathertext, arial, sans-serif; + max-height: 100px; + line-height: 10px; + font-weight: normal + } + + .weather34uvrate span { + color: #777; + font-family: weathertext, arial, sans-serif; + font-size: 12px; + font-weight: normal + } + + -
- - -
-
-
-
- =7){echo "",number_format($kp,1),"";}else if($kp>=5.8){echo "",number_format($kp,1),"";} - else if($kp>=5){echo "",number_format($kp,1),"";}else if($kp>=4){echo "",number_format($kp,1),"";} - else if($kp>=0){echo "",number_format($kp,1),"";} - ?> KP-INDEX +
+
+ + +
+
+
+
+ = 7) { + echo "", number_format($kp, 1), ""; + } else if ($kp >= 5.8) { + echo "", number_format($kp, 1), ""; + } else if ($kp >= 5) { + echo "", number_format($kp, 1), ""; + } else if ($kp >= 4) { + echo "", number_format($kp, 1), ""; + } else if ($kp >= 0) { + echo "", number_format($kp, 1), ""; + } + ?> KP-INDEX +
-
-
-
- =9){echo "G5 Geomagnetic Severe Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=8){echo "G4 Geomagnetic Major Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=7){echo "G3 Geomagnetic Major Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=6){echo "G2 Geomagnetic Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=5){echo "G1 Geomagnetic Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=4){echo "Minor G1 Geomagnetic Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=3.5){echo "Weak Geomagnetic Storm
";echo 'KP-PLANETARY INDEX';}else if($kp>=0){echo " Quiet No Geomagnetic Storm
";echo 'KP-PLANETARY INDEX';}?> +
+
+ + = 9) { + echo "G5 Geomagnetic Severe Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 8) { + echo "G4 Geomagnetic Major Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 7) { + echo "G3 Geomagnetic Major Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 6) { + echo "G2 Geomagnetic Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 5) { + echo "G1 Geomagnetic Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 4) { + echo "Minor G1 Geomagnetic Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 3.5) { + echo "Weak Geomagnetic Storm
"; + echo 'KP-PLANETARY INDEX'; + } else if ($kp >= 0) { + echo " Quiet No Geomagnetic Storm
"; + echo 'KP-PLANETARY INDEX'; + } ?> +
-
-
- -
7){echo 'Excellent
Aurora Viewing Possible';}else if($kp>6){echo 'Mid to High Latitude
Aurora Viewing Possible';}else if($kp>4){echo 'High Latitude Aurora
Viewing Possible';}else if($kp>3.5){echo 'Weak High Latitude Aurora
Viewing Possible';}else{echo 'No Aurora Viewing';}echo "\n";?>
-
-
-
-
-
- =8.9){echo "400";}else if($kp>=7.9){echo "208";}else if($kp>=6.9){echo "132";}else if($kp>=6){echo "80";}else if($kp>=4.9){echo "",number_format($kp*6,0),"";}else if($kp>=3.9){echo "",number_format($kp*5,0),"";}else if($kp>=2.9){echo "",number_format($kp*4,0),"";}else if($kp>=2){echo "",number_format($kp*2,0),"";}else if($kp>=0){echo "",number_format($kp*2,0),"";}?> A-INDEX +
+ +
+ 7) { + echo 'Excellent
Aurora Viewing Possible'; + } else if ($kp > 6) { + echo 'Mid to High Latitude
Aurora Viewing Possible'; + } else if ($kp > 4) { + echo 'High Latitude Aurora
Viewing Possible'; + } else if ($kp > 3.5) { + echo 'Weak High Latitude Aurora
Viewing Possible'; + } else { + echo 'No Aurora Viewing'; + } + echo "\n"; ?> +
-
-
- - -" opacity="1.00" d=" M 7.00 8.01 C 17.00 8.00 27.00 8.00 37.00 8.00 C 37.00 8.75 37.00 10.25 37.00 11.00 C 27.00 11.00 17.00 11.00 7.00 11.00 C 7.00 10.25 7.00 8.75 7.00 8.01 Z" /> -" opacity="1.00" d=" M 7.00 12.00 C 17.00 12.00 27.00 12.00 37.00 12.00 C 37.00 13.67 37.00 15.33 37.00 17.00 C 27.00 17.00 17.00 17.00 7.00 17.00 C 7.00 15.33 7.00 13.67 7.00 12.00 Z" /> -" opacity="1.00" d=" M 7.00 18.00 C 17.00 18.00 27.00 18.00 37.00 18.00 C 37.00 19.67 37.00 21.33 37.00 23.00 C 27.00 23.00 17.00 23.00 7.00 23.00 C 7.00 21.33 7.00 19.67 7.00 18.00 Z" /> -" opacity="1.00" d=" M 7.00 24.00 C 17.00 24.00 27.00 24.00 37.00 24.00 C 37.00 25.67 37.00 27.33 37.00 29.00 C 27.00 29.00 17.00 29.00 7.00 29.00 C 7.00 27.33 7.00 25.67 7.00 24.00 Z" /> -" opacity="1.00" d=" M 7.00 30.00 C 17.00 30.00 27.00 30.00 37.00 30.00 C 37.00 31.67 37.00 33.33 37.00 35.00 C 27.00 35.00 17.00 35.00 7.00 35.00 C 7.00 33.33 7.00 31.67 7.00 30.00 Z" /> -" opacity="1.00" d=" M 7.00 36.00 C 17.00 36.00 27.00 36.00 37.00 36.00 C 37.00 37.67 37.00 39.33 37.00 41.00 C 27.00 41.00 17.00 41.00 7.00 41.00 C 7.00 39.33 7.00 37.67 7.00 36.00 Z" /> -" opacity="1.00" d=" M 7.00 42.00 C 17.00 41.99 27.00 42.00 37.00 42.00 C 37.00 43.67 37.00 45.33 37.00 47.00 C 27.00 47.00 17.00 47.00 7.00 47.00 C 7.00 45.33 7.00 43.67 7.00 42.00 Z" /> -" opacity="1.00" d=" M 7.00 48.00 C 17.00 48.00 27.00 48.00 37.00 48.00 C 37.00 49.67 37.00 51.33 37.00 53.00 C 27.00 53.00 17.00 53.00 7.00 53.00 C 7.00 51.33 7.00 49.67 7.00 48.00 Z" /> -" opacity="1.00" d=" M 7.00 54.00 C 17.00 54.00 27.00 54.00 37.00 54.00 C 37.00 55.67 37.00 57.33 37.00 59.00 C 27.00 59.00 17.00 59.00 7.00 59.00 C 7.00 57.33 7.00 55.67 7.00 54.00 Z" /> -" opacity="1.00" d=" M 7.00 60.00 C 17.00 60.00 27.00 60.00 37.00 60.00 C 37.00 61.67 37.00 63.33 37.00 65.00 C 27.00 65.00 17.00 65.00 7.00 65.00 C 7.00 63.33 7.00 61.67 7.00 60.00 Z" /> -" opacity="1.00" d=" M 7.00 66.00 C 17.00 66.00 27.00 66.00 37.00 66.00 C 37.00 67.67 37.00 69.33 37.00 71.00 C 27.00 71.00 17.00 71.00 7.00 71.00 C 7.00 69.33 7.00 67.67 7.00 66.00 Z" /> -" opacity="1.00" d=" M 7.00 72.00 C 17.00 72.00 27.00 72.00 37.00 72.00 C 37.00 73.67 37.00 75.33 37.00 77.00 C 27.00 77.00 17.00 77.00 7.00 77.00 C 7.00 75.33 7.00 73.67 7.00 72.00 Z" /> -
-
-
-
- =9){echo "G5 Severe Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=8){echo "G4 Major Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=7){echo "G3 Major Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=6){echo "G2 Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=5){echo "G1 Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=4){echo "Minor G1 Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>=3.5){echo "Weak Storm
";echo 'RADIO AURORA ACTIVE';}else if($kp>0){echo "Quiet No Storms
";echo 'NOT ACTIVE';}?> +
+
+
+ = 8.9) { + echo "400"; + } else if ($kp >= 7.9) { + echo "208"; + } else if ($kp >= 6.9) { + echo "132"; + } else if ($kp >= 6) { + echo "80"; + } else if ($kp >= 4.9) { + echo "", number_format($kp * 6, 0), ""; + } else if ($kp >= 3.9) { + echo "", number_format($kp * 5, 0), ""; + } else if ($kp >= 2.9) { + echo "", number_format($kp * 4, 0), ""; + } else if ($kp >= 2) { + echo "", number_format($kp * 2, 0), ""; + } else if ($kp >= 0) { + echo "", number_format($kp * 2, 0), ""; + } ?> + A-INDEX +
+
+
+ + + " + opacity="1.00" + d=" M 7.00 8.01 C 17.00 8.00 27.00 8.00 37.00 8.00 C 37.00 8.75 37.00 10.25 37.00 11.00 C 27.00 11.00 17.00 11.00 7.00 11.00 C 7.00 10.25 7.00 8.75 7.00 8.01 Z" /> + " + opacity="1.00" + d=" M 7.00 12.00 C 17.00 12.00 27.00 12.00 37.00 12.00 C 37.00 13.67 37.00 15.33 37.00 17.00 C 27.00 17.00 17.00 17.00 7.00 17.00 C 7.00 15.33 7.00 13.67 7.00 12.00 Z" /> + " + opacity="1.00" + d=" M 7.00 18.00 C 17.00 18.00 27.00 18.00 37.00 18.00 C 37.00 19.67 37.00 21.33 37.00 23.00 C 27.00 23.00 17.00 23.00 7.00 23.00 C 7.00 21.33 7.00 19.67 7.00 18.00 Z" /> + " + opacity="1.00" + d=" M 7.00 24.00 C 17.00 24.00 27.00 24.00 37.00 24.00 C 37.00 25.67 37.00 27.33 37.00 29.00 C 27.00 29.00 17.00 29.00 7.00 29.00 C 7.00 27.33 7.00 25.67 7.00 24.00 Z" /> + " + opacity="1.00" + d=" M 7.00 30.00 C 17.00 30.00 27.00 30.00 37.00 30.00 C 37.00 31.67 37.00 33.33 37.00 35.00 C 27.00 35.00 17.00 35.00 7.00 35.00 C 7.00 33.33 7.00 31.67 7.00 30.00 Z" /> + " + opacity="1.00" + d=" M 7.00 36.00 C 17.00 36.00 27.00 36.00 37.00 36.00 C 37.00 37.67 37.00 39.33 37.00 41.00 C 27.00 41.00 17.00 41.00 7.00 41.00 C 7.00 39.33 7.00 37.67 7.00 36.00 Z" /> + " + opacity="1.00" + d=" M 7.00 42.00 C 17.00 41.99 27.00 42.00 37.00 42.00 C 37.00 43.67 37.00 45.33 37.00 47.00 C 27.00 47.00 17.00 47.00 7.00 47.00 C 7.00 45.33 7.00 43.67 7.00 42.00 Z" /> + " + opacity="1.00" + d=" M 7.00 48.00 C 17.00 48.00 27.00 48.00 37.00 48.00 C 37.00 49.67 37.00 51.33 37.00 53.00 C 27.00 53.00 17.00 53.00 7.00 53.00 C 7.00 51.33 7.00 49.67 7.00 48.00 Z" /> + " + opacity="1.00" + d=" M 7.00 54.00 C 17.00 54.00 27.00 54.00 37.00 54.00 C 37.00 55.67 37.00 57.33 37.00 59.00 C 27.00 59.00 17.00 59.00 7.00 59.00 C 7.00 57.33 7.00 55.67 7.00 54.00 Z" /> + " + opacity="1.00" + d=" M 7.00 60.00 C 17.00 60.00 27.00 60.00 37.00 60.00 C 37.00 61.67 37.00 63.33 37.00 65.00 C 27.00 65.00 17.00 65.00 7.00 65.00 C 7.00 63.33 7.00 61.67 7.00 60.00 Z" /> + " + opacity="1.00" + d=" M 7.00 66.00 C 17.00 66.00 27.00 66.00 37.00 66.00 C 37.00 67.67 37.00 69.33 37.00 71.00 C 27.00 71.00 17.00 71.00 7.00 71.00 C 7.00 69.33 7.00 67.67 7.00 66.00 Z" /> + " + opacity="1.00" + d=" M 7.00 72.00 C 17.00 72.00 27.00 72.00 37.00 72.00 C 37.00 73.67 37.00 75.33 37.00 77.00 C 27.00 77.00 17.00 77.00 7.00 77.00 C 7.00 75.33 7.00 73.67 7.00 72.00 Z" /> + +
+
+ +
+
+
+ + = 9) { + echo "G5 Severe Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 8) { + echo "G4 Major Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 7) { + echo "G3 Major Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 6) { + echo "G2 Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 5) { + echo "G1 Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 4) { + echo "Minor G1 Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp >= 3.5) { + echo "Weak Storm
"; + echo 'RADIO AURORA ACTIVE'; + } else if ($kp > 0) { + echo "Quiet No Storms
"; + echo 'NOT ACTIVE'; + } ?> +
-
-
- -
7){echo 'Strong Radio Aurora
28-433MHZ Possible';}else if($kp>6){echo 'Mid-High Latitude Radio Aurora
28-144MHZ Possible';}else if($kp>5){echo 'Radio Aurora
50-144MHZ Possible';}else if($kp>=4){echo 'High Latitude Radio Aurora
50-144MHZ Possible';}else if($kp>=3.5){echo 'High Latitude Weak Radio Aurora
50-144MHZ Possible';}else{echo 'No Radio Aurora';}echo "\n";?>
-
- -
-
-
-
-
- Guide
KP-INDEX figure provides a good indicator of viewing the Aurora Borealis or Northern Lights The greater the KP-Index the higher probability of viewing .The Estimated 3-hour Planetary Kp-index data is collected from ground-based magnetometers. +
+ +
+ 7) { + echo 'Strong Radio Aurora
28-433MHZ Possible'; + } else if ($kp > 6) { + echo 'Mid-High Latitude Radio Aurora
28-144MHZ Possible'; + } else if ($kp > 5) { + echo 'Radio Aurora
50-144MHZ Possible'; + } else if ($kp >= 4) { + echo 'High Latitude Radio Aurora
50-144MHZ Possible'; + } else if ($kp >= 3.5) { + echo 'High Latitude Weak Radio Aurora
50-144MHZ Possible'; + } else { + echo 'No Radio Aurora'; + } + echo "\n"; ?> +
-
-
-
-
- Guide
A-INDEX is an indicator of possible enhanced VHF radio signal communication at a range of upto 1000 miles or more. During strong solar activity frequencies from 28 to 433MHZ or higher allowing radio communications to be possible at mid to high latitudes . - - '; -; echo " Last Updated: ".date("H:i:s",filemtime('jsondata/kindex.txt'));?> - + +
+
+
+
+
+ + Guide
+ KP-INDEX figure provides a good indicator of viewing the Aurora Borealis + or Northern Lights The greater the KP-Index the higher probability of + viewing .The Estimated 3-hour Planetary Kp-index data is collected from ground-based + magnetometers. +
-
+
+
+
+ + Guide
+ A-INDEX is an indicator of possible enhanced VHF radio signal communication at a + range of upto 1000 miles or more. During strong solar activity frequencies from 28 to 433MHZ or + higher allowing radio communications to be possible at mid to high latitudes . + + '; + ; + echo " Last Updated: " . date("H:i:s", filemtime('jsondata/kindex.txt')); ?> + +
+
+
-
-Data Provided by https://services.swpc.noaa.gov -  - CSS/SVG/PHP scripts by weather34.com © 2015-
+
+ Data Provided by + https://services.swpc.noaa.gov +   + CSS/SVG/PHP scripts by weather34.com © 2015- +
+ \ No newline at end of file diff --git a/common.php b/common.php index 5148c9f..c4ff54e 100644 --- a/common.php +++ b/common.php @@ -6,81 +6,319 @@ $language set to DarkSky language (doesn't always match $lang in the scripts) Simplified the settings for language selection via array lookup - ktrue 19-Mar-2019 */ -if(isSet($_GET['lang'])) -{ +if (isset($_GET['lang'])) { $lang = $_GET['lang']; - + // GET the session set the cookie $_SESSION['lang'] = $lang; - - setcookie("lang", $lang, time() +3600); -} -else if(isSet($_SESSION['lang'])) -{ + + setcookie("lang", $lang, time() + 3600); +} else if (isset($_SESSION['lang'])) { $lang = $_SESSION['lang']; -} -else if(isSet($_COOKIE['lang'])) -{ +} else if (isset($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; +} else { + $lang = $defaultlanguage; +} + +$LanguageList = array( + // lang => langfile,langflag,langoption,language,locale +//english uk + 'en' => 'lang.en.php|en|en|en|"en_EN"', + //canada english + 'can' => 'lang.can.php|can|en|en|"en_CA"', + //english us + 'us' => 'lang.us.php|us|en|en|"en_US"', + //danish + 'dk' => 'lang.dk.php|dk|da|da|danish.UTF-8,da_DK.UTF-8', + //dutch + 'nl' => 'lang.nl.php|nl|nl|nl|dutch.UTF-8,nl_NL.UTF-8', + //brazilian/south america + 'br' => 'lang.br.php|br|pt|pt|portugues.UTF-8,pt_BR.UTF-8', + //argentine + 'ar' => 'lang.ar.php|ar|es|es|spanish.UTF-8,es_ES.UTF-8', + //maori + 'mi' => 'lang.mi.php|mi|mi|en|maori.UTF-8,mi_MI.UTF-8', + //polish + 'pl' => 'lang.pl.php|pl|pl|pl|polish.UTF-8,pl_PL.UTF-8,polish_pol.UTF-8', + //german + 'dl' => 'lang.dl.php|dl|de|de|german.UTF-8,de_DE.UTF-8', + //italian + 'it' => 'lang.it.php|it|it|it|italian.UTF-8,it_IT.UTF-8', + //spanish + 'sp' => 'lang.sp.php|sp|es|es|spanish.UTF-8,es_ES.UTF-8', + //catalan + 'cat' => 'lang.cat.php|cat|ca|ca|catalan.UTF-8,ca_ES.UTF-8', + //french + 'fr' => 'lang.fr.php|fr|fr|fr|french.UTF-8,fr_FR.UTF-8', + //greek + 'gr' => 'lang.gr.php|gr|el|el|el_GR.UTF-8,el_GR,greek.UTF-8', + //turkish + 'tr' => 'lang.tr.php|tr|tr|tr|turkish.UTF-8,tr_TR.UTF-8', + //swedish + 'sw' => 'lang.sw.php|sv|sv|sv|swedish.UTF-8,sv_SE.UTF-8', + //Suomi (finnish) + 'fi' => 'lang.fi.php|fi|fi|fi|finnish.UTF-8,fi_FI.UTF-8,suomi.UTF-8', + //Portuguese + 'pt' => 'lang.pt.php|pt|pt|pt|portuguese.UTF-8,pt_PT.UTF-8', + +); + +if (!isset($LanguageList[$lang])) { // Assume English if language not in current list + $lang = 'en'; } -else -{ +// Set the template options +list($lang_file, $lang_flag, $lang_option, $language, $lang_locale) = explode('|', $LanguageList[$lang]); +setlocale(LC_TIME, explode(',', $lang_locale)); + + +$WClanguages = array( // our language codes v.s. lang:LL codes for JSON to TWC/WU API + 'ar' => 'es-ES', + 'bg' => 'bg-BG', + 'br' => 'pt-BR', + 'cs' => 'cs-CZ', + 'ca' => 'ca_ES', + 'ct' => 'ca-ES', + 'da' => 'da-DK', + 'dk' => 'da-DK', + 'de' => 'de-DE', + 'dl' => 'de-DE', + 'nl' => 'nl-NL', + 'el' => 'el-GR', + 'en' => 'en-US', + 'fi' => 'fi-FI', + 'fr' => 'fr-FR', + 'it' => 'it-IT', + 'he' => 'he-IL', + 'hu' => 'hu-HU', + 'mi' => 'mi-MI', + 'no' => 'no-NO', + 'pl' => 'pl-PL', + 'pt' => 'pt-PT', + 'ro' => 'ro-RO', + 'es' => 'es-ES', + 'se' => 'sv-SE', + 'si' => 'sl-SI', + 'sk' => 'sk-SK', + 'sv' => 'sv-SE', + 'sr' => 'sr-RS', + 'tr' => 'tr-TR', +); + +if (isset($WClanguages[$language])) { + $wuapilang = $WClanguages[$language]; +} else { + $wuapilang = 'en-US'; +} + +$Modules = array( + # module => legend|index + 'advisory.php' => '', + 'airqualitymodule.php' => '', + 'airqualitysolar.php' => '', + 'airqualityuv.php' => '', + 'aqi.php' => '', + 'aqisolar.php' => '', + 'aqiuv.php' => '', + 'aurora.php' => '', + 'azimuth.php' => '', + 'barometer.php' => '', + 'bio.php' => '', + 'boltek.php' => '', + 'cam.php' => '', + 'cumulus-sunshine.php' => '', + 'cumulusindoor.php' => '', + 'currentconditionsds.php' => '', + 'currentconditionsmetar34.php' => '', + 'currentconditionsmetar34davis.php' => '', + 'diags.php' => '', + 'dsuvindex.php' => '', + 'earthquake.php' => '', + 'easyweathersetup.php' => '', + 'eq.php' => '', + 'eqlist.php' => '', + 'forecast3ds.php' => '', + 'forecast3wu.php' => '', + 'forecastdshour.php' => '', + 'homeindoor.php' => '', + 'index.php' => '', + 'indoortemperature.php' => '', + 'lightning34.php' => '', + 'livedata.php' => '', + 'max-mintemp.php' => '', + 'max-minwind.php' => '', + 'menu.php' => '', + 'metar34get.php' => '', + 'metarnearby.php' => '', + 'meteorshowers.php' => '', + 'mooninfo.php' => '', + 'moonphase.php' => '', + 'outlookds.php' => '', + 'outlookwu.php' => '', + 'purpleair.php' => '', + 'rainfall.php' => '', + 'rainfallf-year-month.php' => '', + 'rainfallf-year-month1.php' => '', + 'realtimetxtdescription.php' => '', + 'solaralmanac.php' => '', + 'solaruvds.php' => '', + 'stationinfo.php' => '', + 'sun1.php' => '', + 'sun2.php' => '', + 'sun3.php' => '', + 'tempalmanac.php' => '', + 'temperature.php' => '', + 'temperaturein.php' => '', + 'temperatureyear.php' => '', + 'tempyesterday.php' => '', + 'updater.php' => '', + 'uvalmanac.php' => '', + 'uvindex.php' => '', + 'uvindexds.php' => '', + 'uvindexwf.php' => '', + 'uvsolar.php' => '', + 'uvsolarbri.php' => '', + 'weather34clock.php' => '', + 'weather34cloudbase.php' => '', + 'weather34svgicons.php' => '', + 'weather34uvsolar.php' => '', + 'weatherflow.php' => '', + 'weatherflowuvsolar.php' => '', + 'webcam.php' => '', + 'webcamsmall.php' => '', + 'wflightning.php' => '', + 'wfsensor.php' => '', + 'windalmanac.php' => '', + 'windgustyear.php' => '', + 'windspeeddirection.php' => '', + 'windy-radar.php' => '', + 'windyesterday.php' => '', + 'yearlyrainfall.php' => '', + 'chartswu/humidity.php' => '', + 'chartswu/monthlybarometer.php' => '', + 'chartswu/monthlyrainfall.php' => '', + 'chartswu/monthlytemperature.php' => '', + 'chartswu/monthlywindspeedgust.php' => '', + 'chartswu/todaybarometer.php' => '', + 'chartswu/todayrainfall.php' => '', + 'chartswu/todaysolar.php' => '', + 'chartswu/todaytemperature.php' => '', + 'chartswu/todaywinddirection.php' => '', + 'chartswu/todaywindspeedgust.php' => '', + 'chartswu/yearlybarometer.php' => '', + 'chartswu/yearlyrainfall.php' => '', + 'chartswu/yearlytemperature.php' => '', + 'chartswu/yearlywindspeedgust.php' => '', + +); + +$ModuleLinks = array( + # 'script' => array('legend' => 'linkedmodule') + 'temperature.php' => array( + 'YEAR' => 'chartswu/yearlytemperature.php', + 'MONTH' => 'chartswu/monthlytemperature.php', + 'TODAY' => 'chartswu/todaytemperature.php', + ), + 'barometer.php' => array( + 'YEAR' => 'chartswu/yearlybarometer.php', + 'MONTH' => 'chartswu/monthlybarometer.php', + 'TODAY' => 'chartswu/todaybarometer.php', + ), + 'windspeeddirection.php' => array( + 'YEAR' => 'chartswu/yearlywindspeedgust.php', + 'MONTH' => 'chartswu/monthlywindspeedgust.php', + 'TODAY' => 'chartswu/todaywindspeedgust.php', + ), + 'rainfall.php' => array( + 'YEAR' => 'chartswu/yearlyrainfall.php', + 'MONTH' => 'chartswu/monthlyrainfall.php', + 'TODAY' => 'chartswu/todayrainfall.php', + ), +); + +//path to language files +if (file_exists("languages/$lang_file")) { + include_once("languages/$lang_file"); +} else { + include_once("languages/lang.en.php"); +} + +# End of common.php langfile,langflag,langoption,language,locale + // lang => langfile,langflag,langoption,language,locale //english uk - 'en' => 'lang.en.php|en|en|en|"en_EN"', -//canada english - 'can' => 'lang.can.php|can|en|en|"en_CA"', -//english us - 'us' => 'lang.us.php|us|en|en|"en_US"', -//danish - 'dk' => 'lang.dk.php|dk|da|da|danish.UTF-8,da_DK.UTF-8', -//dutch - 'nl' => 'lang.nl.php|nl|nl|nl|dutch.UTF-8,nl_NL.UTF-8', -//brazilian/south america - 'br' => 'lang.br.php|br|pt|pt|portugues.UTF-8,pt_BR.UTF-8', -//argentine - 'ar' => 'lang.ar.php|ar|es|es|spanish.UTF-8,es_ES.UTF-8', -//maori - 'mi' => 'lang.mi.php|mi|mi|en|maori.UTF-8,mi_MI.UTF-8', -//polish - 'pl' => 'lang.pl.php|pl|pl|pl|polish.UTF-8,pl_PL.UTF-8,polish_pol.UTF-8', -//german - 'dl' => 'lang.dl.php|dl|de|de|german.UTF-8,de_DE.UTF-8', -//italian - 'it' => 'lang.it.php|it|it|it|italian.UTF-8,it_IT.UTF-8', -//spanish - 'sp' => 'lang.sp.php|sp|es|es|spanish.UTF-8,es_ES.UTF-8', -//catalan - 'cat' => 'lang.cat.php|cat|ca|ca|catalan.UTF-8,ca_ES.UTF-8', -//french - 'fr' => 'lang.fr.php|fr|fr|fr|french.UTF-8,fr_FR.UTF-8', -//greek - 'gr' => 'lang.gr.php|gr|el|el|el_GR.UTF-8,el_GR,greek.UTF-8', -//turkish - 'tr' => 'lang.tr.php|tr|tr|tr|turkish.UTF-8,tr_TR.UTF-8', -//swedish - 'sw' => 'lang.sw.php|sv|sv|sv|swedish.UTF-8,sv_SE.UTF-8', -//Suomi (finnish) - 'fi' => 'lang.fi.php|fi|fi|fi|finnish.UTF-8,fi_FI.UTF-8,suomi.UTF-8', -//Portuguese - 'pt' => 'lang.pt.php|pt|pt|pt|portuguese.UTF-8,pt_PT.UTF-8', + 'en' => 'lang.en.php|en|en|en|"en_EN"', + //canada english + 'can' => 'lang.can.php|can|en|en|"en_CA"', + //english us + 'us' => 'lang.us.php|us|en|en|"en_US"', + //danish + 'dk' => 'lang.dk.php|dk|da|da|danish.UTF-8,da_DK.UTF-8', + //dutch + 'nl' => 'lang.nl.php|nl|nl|nl|dutch.UTF-8,nl_NL.UTF-8', + //brazilian/south america + 'br' => 'lang.br.php|br|pt|pt|portugues.UTF-8,pt_BR.UTF-8', + //argentine + 'ar' => 'lang.ar.php|ar|es|es|spanish.UTF-8,es_ES.UTF-8', + //maori + 'mi' => 'lang.mi.php|mi|mi|en|maori.UTF-8,mi_MI.UTF-8', + //polish + 'pl' => 'lang.pl.php|pl|pl|pl|polish.UTF-8,pl_PL.UTF-8,polish_pol.UTF-8', + //german + 'dl' => 'lang.dl.php|dl|de|de|german.UTF-8,de_DE.UTF-8', + //italian + 'it' => 'lang.it.php|it|it|it|italian.UTF-8,it_IT.UTF-8', + //spanish + 'sp' => 'lang.sp.php|sp|es|es|spanish.UTF-8,es_ES.UTF-8', + //catalan + 'cat' => 'lang.cat.php|cat|ca|ca|catalan.UTF-8,ca_ES.UTF-8', + //french + 'fr' => 'lang.fr.php|fr|fr|fr|french.UTF-8,fr_FR.UTF-8', + //greek + 'gr' => 'lang.gr.php|gr|el|el|el_GR.UTF-8,el_GR,greek.UTF-8', + //turkish + 'tr' => 'lang.tr.php|tr|tr|tr|turkish.UTF-8,tr_TR.UTF-8', + //swedish + 'sw' => 'lang.sw.php|sv|sv|sv|swedish.UTF-8,sv_SE.UTF-8', + //Suomi (finnish) + 'fi' => 'lang.fi.php|fi|fi|fi|finnish.UTF-8,fi_FI.UTF-8,suomi.UTF-8', + //Portuguese + 'pt' => 'lang.pt.php|pt|pt|pt|portuguese.UTF-8,pt_PT.UTF-8', ); -if(!isset($LanguageList[$lang])) { // Assume English if language not in current list +if (!isset($LanguageList[$lang])) { // Assume English if language not in current list $lang = 'en'; } // Set the template options -list ($lang_file,$lang_flag,$lang_option,$language,$lang_locale) = explode('|',$LanguageList[$lang]); -setlocale(LC_TIME,explode(',',$lang_locale)); +list($lang_file, $lang_flag, $lang_option, $language, $lang_locale) = explode('|', $LanguageList[$lang]); +setlocale(LC_TIME, explode(',', $lang_locale)); - $WClanguages = array( // our language codes v.s. lang:LL codes for JSON to TWC/WU API - 'ar' => 'es-ES', +$WClanguages = array( // our language codes v.s. lang:LL codes for JSON to TWC/WU API + 'ar' => 'es-ES', 'bg' => 'bg-BG', 'br' => 'pt-BR', 'cs' => 'cs-CZ', @@ -110,144 +348,144 @@ 'sv' => 'sv-SE', 'sr' => 'sr-RS', 'tr' => 'tr-TR', - ); +); -if(isset($WClanguages[$language])) { +if (isset($WClanguages[$language])) { $wuapilang = $WClanguages[$language]; } else { $wuapilang = 'en-US'; } $Modules = array( -# module => legend|index -'advisory.php' => '', -'airqualitymodule.php' => '', -'airqualitysolar.php' => '', -'airqualityuv.php' => '', -'aqi.php' => '', -'aqisolar.php' => '', -'aqiuv.php' => '', -'aurora.php' => '', -'azimuth.php' => '', -'barometer.php' => '', -'bio.php' => '', -'boltek.php' => '', -'cam.php' => '', -'cumulus-sunshine.php' => '', -'cumulusindoor.php' => '', -'currentconditionsds.php' => '', -'currentconditionsmetar34.php' => '', -'currentconditionsmetar34davis.php' => '', -'diags.php' => '', -'dsuvindex.php' => '', -'earthquake.php' => '', -'easyweathersetup.php' => '', -'eq.php' => '', -'eqlist.php' => '', -'forecast3ds.php' => '', -'forecast3wu.php' => '', -'forecastdshour.php' => '', -'homeindoor.php' => '', -'index.php' => '', -'indoortemperature.php' => '', -'lightning34.php' => '', -'livedata.php' => '', -'max-mintemp.php' => '', -'max-minwind.php' => '', -'menu.php' => '', -'metar34get.php' => '', -'metarnearby.php' => '', -'meteorshowers.php' => '', -'mooninfo.php' => '', -'moonphase.php' => '', -'outlookds.php' => '', -'outlookwu.php' => '', -'purpleair.php' => '', -'rainfall.php' => '', -'rainfallf-year-month.php' => '', -'rainfallf-year-month1.php' => '', -'realtimetxtdescription.php' => '', -'solaralmanac.php' => '', -'solaruvds.php' => '', -'stationinfo.php' => '', -'sun1.php' => '', -'sun2.php' => '', -'sun3.php' => '', -'tempalmanac.php' => '', -'temperature.php' => '', -'temperaturein.php' => '', -'temperatureyear.php' => '', -'tempyesterday.php' => '', -'updater.php' => '', -'uvalmanac.php' => '', -'uvindex.php' => '', -'uvindexds.php' => '', -'uvindexwf.php' => '', -'uvsolar.php' => '', -'uvsolarbri.php' => '', -'weather34clock.php' => '', -'weather34cloudbase.php' => '', -'weather34svgicons.php' => '', -'weather34uvsolar.php' => '', -'weatherflow.php' => '', -'weatherflowuvsolar.php' => '', -'webcam.php' => '', -'webcamsmall.php' => '', -'wflightning.php' => '', -'wfsensor.php' => '', -'windalmanac.php' => '', -'windgustyear.php' => '', -'windspeeddirection.php' => '', -'windy-radar.php' => '', -'windyesterday.php' => '', -'yearlyrainfall.php' => '', -'chartswu/humidity.php' => '', -'chartswu/monthlybarometer.php' => '', -'chartswu/monthlyrainfall.php' => '', -'chartswu/monthlytemperature.php' => '', -'chartswu/monthlywindspeedgust.php' => '', -'chartswu/todaybarometer.php' => '', -'chartswu/todayrainfall.php' => '', -'chartswu/todaysolar.php' => '', -'chartswu/todaytemperature.php' => '', -'chartswu/todaywinddirection.php' => '', -'chartswu/todaywindspeedgust.php' => '', -'chartswu/yearlybarometer.php' => '', -'chartswu/yearlyrainfall.php' => '', -'chartswu/yearlytemperature.php' => '', -'chartswu/yearlywindspeedgust.php' => '', + # module => legend|index + 'advisory.php' => '', + 'airqualitymodule.php' => '', + 'airqualitysolar.php' => '', + 'airqualityuv.php' => '', + 'aqi.php' => '', + 'aqisolar.php' => '', + 'aqiuv.php' => '', + 'aurora.php' => '', + 'azimuth.php' => '', + 'barometer.php' => '', + 'bio.php' => '', + 'boltek.php' => '', + 'cam.php' => '', + 'cumulus-sunshine.php' => '', + 'cumulusindoor.php' => '', + 'currentconditionsds.php' => '', + 'currentconditionsmetar34.php' => '', + 'currentconditionsmetar34davis.php' => '', + 'diags.php' => '', + 'dsuvindex.php' => '', + 'earthquake.php' => '', + 'easyweathersetup.php' => '', + 'eq.php' => '', + 'eqlist.php' => '', + 'forecast3ds.php' => '', + 'forecast3wu.php' => '', + 'forecastdshour.php' => '', + 'homeindoor.php' => '', + 'index.php' => '', + 'indoortemperature.php' => '', + 'lightning34.php' => '', + 'livedata.php' => '', + 'max-mintemp.php' => '', + 'max-minwind.php' => '', + 'menu.php' => '', + 'metar34get.php' => '', + 'metarnearby.php' => '', + 'meteorshowers.php' => '', + 'mooninfo.php' => '', + 'moonphase.php' => '', + 'outlookds.php' => '', + 'outlookwu.php' => '', + 'purpleair.php' => '', + 'rainfall.php' => '', + 'rainfallf-year-month.php' => '', + 'rainfallf-year-month1.php' => '', + 'realtimetxtdescription.php' => '', + 'solaralmanac.php' => '', + 'solaruvds.php' => '', + 'stationinfo.php' => '', + 'sun1.php' => '', + 'sun2.php' => '', + 'sun3.php' => '', + 'tempalmanac.php' => '', + 'temperature.php' => '', + 'temperaturein.php' => '', + 'temperatureyear.php' => '', + 'tempyesterday.php' => '', + 'updater.php' => '', + 'uvalmanac.php' => '', + 'uvindex.php' => '', + 'uvindexds.php' => '', + 'uvindexwf.php' => '', + 'uvsolar.php' => '', + 'uvsolarbri.php' => '', + 'weather34clock.php' => '', + 'weather34cloudbase.php' => '', + 'weather34svgicons.php' => '', + 'weather34uvsolar.php' => '', + 'weatherflow.php' => '', + 'weatherflowuvsolar.php' => '', + 'webcam.php' => '', + 'webcamsmall.php' => '', + 'wflightning.php' => '', + 'wfsensor.php' => '', + 'windalmanac.php' => '', + 'windgustyear.php' => '', + 'windspeeddirection.php' => '', + 'windy-radar.php' => '', + 'windyesterday.php' => '', + 'yearlyrainfall.php' => '', + 'chartswu/humidity.php' => '', + 'chartswu/monthlybarometer.php' => '', + 'chartswu/monthlyrainfall.php' => '', + 'chartswu/monthlytemperature.php' => '', + 'chartswu/monthlywindspeedgust.php' => '', + 'chartswu/todaybarometer.php' => '', + 'chartswu/todayrainfall.php' => '', + 'chartswu/todaysolar.php' => '', + 'chartswu/todaytemperature.php' => '', + 'chartswu/todaywinddirection.php' => '', + 'chartswu/todaywindspeedgust.php' => '', + 'chartswu/yearlybarometer.php' => '', + 'chartswu/yearlyrainfall.php' => '', + 'chartswu/yearlytemperature.php' => '', + 'chartswu/yearlywindspeedgust.php' => '', ); $ModuleLinks = array( -# 'script' => array('legend' => 'linkedmodule') -'temperature.php' => array( - 'YEAR' => 'chartswu/yearlytemperature.php', - 'MONTH'=> 'chartswu/monthlytemperature.php', - 'TODAY'=> 'chartswu/todaytemperature.php', + # 'script' => array('legend' => 'linkedmodule') + 'temperature.php' => array( + 'YEAR' => 'chartswu/yearlytemperature.php', + 'MONTH' => 'chartswu/monthlytemperature.php', + 'TODAY' => 'chartswu/todaytemperature.php', + ), + 'barometer.php' => array( + 'YEAR' => 'chartswu/yearlybarometer.php', + 'MONTH' => 'chartswu/monthlybarometer.php', + 'TODAY' => 'chartswu/todaybarometer.php', + ), + 'windspeeddirection.php' => array( + 'YEAR' => 'chartswu/yearlywindspeedgust.php', + 'MONTH' => 'chartswu/monthlywindspeedgust.php', + 'TODAY' => 'chartswu/todaywindspeedgust.php', + ), + 'rainfall.php' => array( + 'YEAR' => 'chartswu/yearlyrainfall.php', + 'MONTH' => 'chartswu/monthlyrainfall.php', + 'TODAY' => 'chartswu/todayrainfall.php', ), -'barometer.php' => array( - 'YEAR' => 'chartswu/yearlybarometer.php', - 'MONTH'=> 'chartswu/monthlybarometer.php', - 'TODAY'=> 'chartswu/todaybarometer.php', - ), -'windspeeddirection.php' => array( - 'YEAR' => 'chartswu/yearlywindspeedgust.php', - 'MONTH'=> 'chartswu/monthlywindspeedgust.php', - 'TODAY'=> 'chartswu/todaywindspeedgust.php', - ), -'rainfall.php' => array( - 'YEAR' => 'chartswu/yearlyrainfall.php', - 'MONTH'=> 'chartswu/monthlyrainfall.php', - 'TODAY'=> 'chartswu/todayrainfall.php', - ), ); //path to language files -if ( file_exists("languages/$lang_file") ) { - include_once("languages/$lang_file") ; +if (file_exists("languages/$lang_file")) { + include_once("languages/$lang_file"); } else { - include_once ("languages/lang.en.php"); + include_once("languages/lang.en.php"); } # End of common.php \ No newline at end of file diff --git a/css/main.dark.css b/css/main.dark.css index 7cf7f7b..7e5f7f7 100644 --- a/css/main.dark.css +++ b/css/main.dark.css @@ -174,6 +174,7 @@ hr { font-family: weathertext; src: url(fonts/sanfranciscodisplay-regular-webfont.woff) format("woff") } + @font-face { font-family: weathertext2; src: url(fonts/verbatim-regular.woff) format("woff"), url(fonts/verbatim-regular.woff2) format("woff2"), url(fonts/verbatim-regular.ttf) format("truetype") @@ -434,7 +435,7 @@ svg:not(:root) { .weather34box .title, .yearpopup { text-transform: uppercase; - white-space:nowrap !important; + white-space: nowrap !important; } .weather2-alert, @@ -667,7 +668,10 @@ supunit { .featherlight iframe { border: 0; - background: 0 + background: 0; + width: 100%; + height: 100%; + min-height: 550px; } .stationlocationtime { @@ -4153,6 +4157,7 @@ suptemp3 { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4178,12 +4183,14 @@ suptemp3 { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + .c { width: auto; left: 40px; @@ -4206,6 +4213,7 @@ suptemp3 { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4230,12 +4238,14 @@ suptemp3 { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + .c { width: auto; left: 40px; @@ -4258,6 +4268,7 @@ suptemp3 { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4282,12 +4293,14 @@ suptemp3 { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + .c { width: auto; left: 40px; @@ -8329,6 +8342,7 @@ convtext { display: block; height: 0 } + .clock-container, .homeindoordate, .menuclock, @@ -8338,6 +8352,7 @@ convtext { ogreyh1 { display: none } + .newweather34menu { width: 30px; height: 24px; @@ -8357,6 +8372,7 @@ convtext { display: block; height: 0 } + .clock-container, .homeindoordate, .menuclock, @@ -8366,6 +8382,7 @@ convtext { ogreyh1 { display: none } + .newweather34menu { width: 30px; height: 24px; @@ -9681,7 +9698,7 @@ dusk { .darkskydiv, .darkskyforecastinghome { font-family: Arial, system; - overflow: hidden!important + overflow: hidden !important } .darkskydiv { @@ -11233,9 +11250,11 @@ weather34-barometerlimitmaxf { 0% { opacity: 2 } + 50% { opacity: 1 } + 100% { opacity: 0 } @@ -11245,9 +11264,11 @@ weather34-barometerlimitmaxf { 0% { opacity: 2 } + 50% { opacity: 1 } + 100% { opacity: 0 } @@ -12442,7 +12463,7 @@ smallwindunit { margin-left: 11px; margin-top: 34px; font-size: 1.4rem; - color: rgba(86, 95, 103, .2); + color: #aaa; width: 200px; font-family: weathertext, Arial, system } diff --git a/css/main.light.css b/css/main.light.css index b44cb39..94672ef 100644 --- a/css/main.light.css +++ b/css/main.light.css @@ -857,7 +857,10 @@ supmb { .featherlight iframe { border: 0; - background: 0 + background: 0; + width: 100%; + height: 100%; + min-height: 550px; } .box.icon-humidity, @@ -4268,6 +4271,7 @@ a:hover { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4293,12 +4297,14 @@ a:hover { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + #icon { width: 55px; height: 43px; @@ -4306,6 +4312,7 @@ a:hover { padding: 5px; margin: 0 10px -5px } + .c { width: auto; left: 40px; @@ -4325,6 +4332,7 @@ a:hover { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4349,12 +4357,14 @@ a:hover { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + .c { width: auto; left: 40px; @@ -4371,6 +4381,7 @@ a:hover { font-family: arial, system; overflow: hidden } + .a, .c, .chart, @@ -4395,12 +4406,14 @@ a:hover { header { display: none } + .weather-item { float: none; width: 310px; margin: 10px auto 0; overflow: hidden } + #icon { width: 55px; height: 43px; @@ -4408,6 +4421,7 @@ a:hover { padding: 5px; margin: 0 0 0 10px } + .c { width: auto; left: 40px; @@ -5033,6 +5047,7 @@ wuhourforecastemp { 0 { -webkit-transform: rotate(0) } + 100% { -webkit-transform: rotate(360deg) } @@ -5042,6 +5057,7 @@ wuhourforecastemp { 0 { transform: rotate(0) } + 100% { transform: rotate(360deg) } @@ -5061,6 +5077,7 @@ wuhourforecastemp { 0 { -webkit-transform: rotate(0) } + 100% { -webkit-transform: rotate(360deg) } @@ -5070,6 +5087,7 @@ wuhourforecastemp { 0 { transform: rotate(0) } + 100% { transform: rotate(360deg) } @@ -8510,6 +8528,7 @@ strongnumbers { display: block; height: 0 } + .clock-container, .homeindoordate, .menuclock, @@ -8519,6 +8538,7 @@ strongnumbers { ogreyh1 { display: none } + .newweather34menu { width: 30px; height: 24px; @@ -8537,6 +8557,7 @@ strongnumbers { display: block; height: 0 } + .clock-container, .homeindoordate, .menuclock, @@ -8546,6 +8567,7 @@ strongnumbers { ogreyh1 { display: none } + .newweather34menu { width: 30px; height: 24px; @@ -9907,7 +9929,7 @@ suplight { .darkskydiv { width: 300px; - overflow: hidden!important; + overflow: hidden !important; height: 180px; margin-top: 10px } @@ -9924,7 +9946,7 @@ suplight { background-color: none; border: 1px solid rgba(153, 155, 156, .1); color: rgba(2, 29, 62, .8); - overflow: hidden!important + overflow: hidden !important } .darkskyforecasthome darkskytemphihome, @@ -11552,9 +11574,11 @@ weather34-barometerlimitmaxf { 0% { opacity: 2 } + 50% { opacity: 1 } + 100% { opacity: 0 } @@ -11564,9 +11588,11 @@ weather34-barometerlimitmaxf { 0% { opacity: 2 } + 50% { opacity: 1 } + 100% { opacity: 0 } @@ -12765,7 +12791,7 @@ smallwindunit { margin-left: 11px; margin-top: 34px; font-size: 1.4rem; - color: rgba(86, 95, 103, .1); + color: #333; width: 200px; font-family: weathertext, Arial, system } diff --git a/livedata.php b/livedata.php index fc3ca71..6523fe9 100644 --- a/livedata.php +++ b/livedata.php @@ -1,190 +1,194 @@ -\n"; - print "\n"; + print "\n"; } $windconversion = $darkskywind; @@ -471,112 +463,963 @@ // meteor shower alternative by betejuice cumulus forum // adapted for homeweatherstation template be carefull its mind blowing updated July 3rd 2016// -$o='Template by weather34.com';date_default_timezone_set($TZ); function isdayofmonth($month,$day,$year){ $dim=array(31,29,31,30,31,30,31,31,30,31,30,31); if($month!=2){ if(1<=$day&&$day<=$dim[$month-1]) return true; else return false; } $feb=$dim[0]; if(isleapyear($year)){ $feb++; } if(1<=$day&&$day<=$feb){ return true; } return false; } function isleapyear($year){ $a=floor($year-4*floor($year/4)); $b=floor($year-100*floor($year/100)); $c=floor($year-400*floor($year/400)); if($a==0){ if($b==0&&$c!=0) return false; else return true; } return false; } function moon_posit($month=null,$day=null,$year=null,$invert=false){ $moon=array(); if(!isdayofmonth($month,$day,$year)){ $moon['errors']='Invalid date'; } else{ $moon['errors']=null;$phase=''; $YY=0;$MM=0;$K1=0;$K2=0;$K3=0;$JD=0;$IP=0.0;$DP=0.0;$NP=0.0;$RP=0.0; $YY=$year-floor((12-$month)/10); $MM=$month+9; if($MM>=12){ $MM=$MM-12; } $K1=floor(365.25*($YY+4712)); $K2=floor(30.6*$MM+0.5); $K3=floor(floor(($YY/100)+49)*0.75)-38; $JD=$K1+$K2+$day+59; if($JD>2299160){ $JD=$JD-$K3; } $IP=normalize(($JD-2451550.1)/29.530588853); $age=$IP*29.53; } $moon=$phase; $ageofmoon=round($age,2); $alt = ""; if ($invert) { $alt = "-alt"; } if($ageofmoon<.53){echo "
";} else if($ageofmoon<1.58){echo "
";} else if($ageofmoon<2.64){echo "
";} else if($ageofmoon<3.69){echo "
";} else if($ageofmoon<4.75){echo "
";} else if($ageofmoon<5.80){echo "
";} else if($ageofmoon<6.86){echo "
";} else if($ageofmoon<7.91){echo "
";} else if($ageofmoon<8.96){echo "
";} else if($ageofmoon<10.02){echo "
";} else if($ageofmoon<11.07){echo "
";} else if($ageofmoon<12.13){echo "
";} else if($ageofmoon<13.18){echo "
";} else if($ageofmoon<14.23){echo "
";} else if($ageofmoon<15.29){echo "
";} else if($ageofmoon<16.35){echo "
";} else if($ageofmoon<17.40){echo "
";} else if($ageofmoon<18.46){echo "
";} else if($ageofmoon<19.51){echo "
";} else if($ageofmoon<20.57){echo "
";} else if($ageofmoon<21.62){echo "
";} else if($ageofmoon<22.67){echo "
";} else if($ageofmoon<23.73){echo "
";} else if($ageofmoon<24.78){echo "
";} else if($ageofmoon<25.84){echo "
";} else if($ageofmoon<26.89){echo "
";} else if($ageofmoon<27.95){echo "
";} else if($ageofmoon<29.00){echo "
";} else {echo "
";} echo " ${moon} \n"; } $moonify="Version 4.37"; function normalize($v){ $v=$v-floor($v); if($v<0){ $v+1; } return $v; } $date=time(); $years=date('Y',$date); $months=date('n',$date); $days=date('j',$date); define('ERR_UNDEF',-1); define('EPOCH',2444238.5); define('ELONGE',278.833540); define('ELONGP',282.596403); define('ECCENT',0.016718); define('SUNSMAX',1.495985e8); define('SUNANGSIZ',0.533128); define('MMLONG',64.975464); define('MMLONGP',349.383063); define('MLNODE',151.950429); define('MINC',5.145396); define('MECC',0.054900); define('MANGSIZ',0.5181); define('MSMAX',384401.0); define('MPARALLAX',0.9507); define('SYNMONTH',29.53058868); function sgn($arg){return(($arg<0)?-1:($arg>0?1:0));} function fixangle($arg){return($arg-360.0*(floor($arg/360.0)));} function torad($arg){return($arg*(pi()/180.0));} function todeg($arg){return($arg*(180.0/pi()));} function dsin($arg){return(sin(torad($arg)));} function dcos($arg){return(cos(torad($arg)));} function jtime($timestamp){$julian=($timestamp/86400)+2440587.5;return $julian;} function jdaytosecs($jday=0){$stamp=($jday-2440587.5)*86400;return $stamp;} function jyear($td,&$yy,&$mm,&$dd){$td+=0.5;$z=floor($td);$f=$td-$z;if($z<2299161.0){$a=$z;}else{$alpha=floor(($z-1867216.25)/36524.25);$a=$z+1+$alpha-floor($alpha/4);}$b=$a+1524;$c=floor(($b-122.1)/365.25);$d=floor(365.25*$c);$e=floor(($b-$d)/30.6001);$dd=$b-$d-floor(30.6001*$e)+$f;$mm=$e<14?$e-1:$e-13;$yy=$mm>2?$c-4716:$c-4715;} function meanphase($sdate,$k){$t=($sdate-2415020.0)/36525;$t2=$t*$t;$t3=$t2*$t;$nt1=2415020.75933+SYNMONTH*$k+0.0001178*$t2-0.000000155*$t3+0.00033*dsin(166.56+132.87*$t-0.009173*$t2);return($nt1);} function truephase($k,$phase){$apcor=0;$k+=$phase;$t=$k/1236.85;$t2=$t*$t;$t3=$t2*$t;$pt=2415020.75933+SYNMONTH*$k+0.0001178*$t2-0.000000155*$t3+0.00033*dsin(166.56+132.87*$t-0.009173*$t2);$m=359.2242+29.10535608*$k-0.0000333*$t2-0.00000347*$t3;$mprime=306.0253+385.81691806*$k+0.0107306*$t2+0.00001236*$t3;$f=21.2964+390.67050646*$k-0.0016528*$t2-0.00000239*$t3;if(($phase<0.01)||(abs($phase-0.5)<0.01)){$pt+=(0.1734-0.000393*$t)*dsin($m)+0.0021*dsin(2*$m)-0.4068*dsin($mprime)+0.0161*dsin(2*$mprime)-0.0004*dsin(3*$mprime)+0.0104*dsin(2*$f)-0.0051*dsin($m+$mprime)-0.0074*dsin($m-$mprime)+0.0004*dsin(2*$f+$m)-0.0004*dsin(2*$f-$m)-0.0006*dsin(2*$f+$mprime)+0.0010*dsin(2*$f-$mprime)+0.0005*dsin($m+2*$mprime);$apcor=1;}elseif((abs($phase-0.25)<0.01||(abs($phase-0.75)<0.01))){$pt+=(0.1721-0.0004*$t)*dsin($m)+0.0021*dsin(2*$m)-0.6280*dsin($mprime)+0.0089*dsin(2*$mprime)-0.0004*dsin(3*$mprime)+0.0079*dsin(2*$f)-0.0119*dsin($m+$mprime)-0.0047*dsin($m-$mprime)+0.0003*dsin(2*$f+$m)-0.0004*dsin(2*$f-$m)-0.0006*dsin(2*$f+$mprime)+0.0021*dsin(2*$f-$mprime)+0.0003*dsin($m+2*$mprime)+0.0004*dsin($m-2*$mprime)-0.0003*dsin(2*$m+$mprime);if($phase<0.5){$pt+=0.0028-0.0004*dcos($m)+0.0003*dcos($mprime);}else{$pt+=-0.0028+0.0004*dcos($m)-0.0003*dcos($mprime);}$apcor=1;}if(!$apcor){print"truephase() called with invalid phase selector ($phase).\n";exit(ERR_UNDEF);}return($pt);} function phasehunt($time=-1){if(empty($time)||$time==-1){$time=time();}$sdate=jtime($time);$adate=$sdate-45;jyear($adate,$yy,$mm,$dd);$k1=floor(($yy+(($mm-1)*(1.0/12.0))-1900)*12.3685);$adate=$nt1=meanphase($adate,$k1);while(1){$adate+=SYNMONTH;$k2=$k1+1;$nt2=meanphase($adate,$k2);if(($nt1<=$sdate)&&($nt2>$sdate)){break;}$nt1=$nt2;$k1=$k2;}return array(jdaytosecs(truephase($k1,0.0)),jdaytosecs(truephase($k1,0.25)),jdaytosecs(truephase($k1,0.5)),jdaytosecs(truephase($k1,0.75)),jdaytosecs(truephase($k2,0.0)));} function phaselist($sdate,$edate){if(empty($sdate)||empty($edate)){return array();}$sdate=jtime($sdate);$edate=jtime($edate);$phases=array();$d=$k=$yy=$mm=0;jyear($sdate,$yy,$mm,$d);$k=floor(($yy+(($mm-1)*(1.0/12.0))-1900)*12.3685)-2;while(1){++$k;foreach(array(0.0,0.25,0.5,0.75)as $phase){$d=truephase($k,$phase);if($d>=$edate){return $phases;}if($d>=$sdate){if(empty($phases)){array_push($phases,floor(4*$phase));}array_push($phases,jdaytosecs($d));}}}} function kepler($m,$ecc){$EPSILON=1e-6;$m=torad($m);$e=$m;do{$delta=$e-$ecc*sin($e)-$m;$e-=$delta/(1-$ecc*cos($e));}while(abs($delta)>$EPSILON);return($e);} function phase($time=0){if(empty($time)||$time==0){$time=time();}$pdate=jtime($time);$pphase;$mage;$dist;$angdia;$sudist;$suangdia;$Day=$pdate-EPOCH;$N=fixangle((360/365.2422)*$Day);$M=fixangle($N+ELONGE-ELONGP);$Ec=kepler($M,ECCENT);$Ec=sqrt((1+ECCENT)/(1-ECCENT))*tan($Ec/2);$Ec=2*todeg(atan($Ec));$Lambdasun=fixangle($Ec+ELONGP);$F=((1+ECCENT*cos(torad($Ec)))/(1-ECCENT*ECCENT));$SunDist=SUNSMAX/$F;$SunAng=$F*SUNANGSIZ;$ml=fixangle(13.1763966*$Day+MMLONG);$MM=fixangle($ml-0.1114041*$Day-MMLONGP);$MN=fixangle(MLNODE-0.0529539*$Day);$Ev=1.2739*sin(torad(2*($ml-$Lambdasun)-$MM));$Ae=0.1858*sin(torad($M));$A3=0.37*sin(torad($M));$MmP=$MM+$Ev-$Ae-$A3;$mEc=6.2886*sin(torad($MmP));$A4=0.214*sin(torad(2*$MmP));$lP=$ml+$Ev+$mEc-$Ae+$A4;$V=0.6583*sin(torad(2*($lP-$Lambdasun)));$lPP=$lP+$V;$NP=$MN-0.16*sin(torad($M));$y=sin(torad($lPP-$NP))*cos(torad(MINC));$x=cos(torad($lPP-$NP));$Lambdamoon=todeg(atan2($y,$x));$Lambdamoon+=$NP;$BetaM=todeg(asin(sin(torad($lPP-$NP))*sin(torad(MINC))));$MoonAge=$lPP-$Lambdasun;$MoonPhase=(1-cos(torad($MoonAge)))/2;$MoonDist=(MSMAX*(1-MECC*MECC))/(1+MECC*cos(torad($MmP+$mEc)));$MoonDFrac=$MoonDist/MSMAX;$MoonAng=MANGSIZ/$MoonDFrac;$MoonPar=MPARALLAX/$MoonDFrac;$pphase=$MoonPhase;$mage=SYNMONTH*(fixangle($MoonAge)/360.0);$dist=$MoonDist;$angdia=$MoonAng;$sudist=$SunDist;$suangdia=$SunAng;$mpfrac=fixangle($MoonAge)/360.0;return array($mpfrac,$pphase,$mage,$dist,$angdia,$sudist,$suangdia); } +$o = 'Template by weather34.com'; +date_default_timezone_set($TZ); +function isdayofmonth($month, $day, $year) +{ + $dim = array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); + if ($month != 2) { + if (1 <= $day && $day <= $dim[$month - 1]) + return true; + else + return false; + } + $feb = $dim[0]; + if (isleapyear($year)) { + $feb++; + } + if (1 <= $day && $day <= $feb) { + return true; + } + return false; +} +function isleapyear($year) +{ + $a = floor($year - 4 * floor($year / 4)); + $b = floor($year - 100 * floor($year / 100)); + $c = floor($year - 400 * floor($year / 400)); + if ($a == 0) { + if ($b == 0 && $c != 0) + return false; + else + return true; + } + return false; +} +function moon_posit($month = null, $day = null, $year = null, $invert = false) +{ + $moon = array(); + if (!isdayofmonth($month, $day, $year)) { + $moon['errors'] = 'Invalid date'; + } else { + $moon['errors'] = null; + $phase = ''; + $YY = 0; + $MM = 0; + $K1 = 0; + $K2 = 0; + $K3 = 0; + $JD = 0; + $IP = 0.0; + $DP = 0.0; + $NP = 0.0; + $RP = 0.0; + $YY = $year - floor((12 - $month) / 10); + $MM = $month + 9; + if ($MM >= 12) { + $MM = $MM - 12; + } + $K1 = floor(365.25 * ($YY + 4712)); + $K2 = floor(30.6 * $MM + 0.5); + $K3 = floor(floor(($YY / 100) + 49) * 0.75) - 38; + $JD = $K1 + $K2 + $day + 59; + if ($JD > 2299160) { + $JD = $JD - $K3; + } + $IP = normalize(($JD - 2451550.1) / 29.530588853); + $age = $IP * 29.53; + } + $moon = $phase; + $ageofmoon = round($age, 2); + $alt = ""; + if ($invert) { + $alt = "-alt"; + } + if ($ageofmoon < .53) { + echo "
"; + } else if ($ageofmoon < 1.58) { + echo "
"; + } else if ($ageofmoon < 2.64) { + echo "
"; + } else if ($ageofmoon < 3.69) { + echo "
"; + } else if ($ageofmoon < 4.75) { + echo "
"; + } else if ($ageofmoon < 5.80) { + echo "
"; + } else if ($ageofmoon < 6.86) { + echo "
"; + } else if ($ageofmoon < 7.91) { + echo "
"; + } else if ($ageofmoon < 8.96) { + echo "
"; + } else if ($ageofmoon < 10.02) { + echo "
"; + } else if ($ageofmoon < 11.07) { + echo "
"; + } else if ($ageofmoon < 12.13) { + echo "
"; + } else if ($ageofmoon < 13.18) { + echo "
"; + } else if ($ageofmoon < 14.23) { + echo "
"; + } else if ($ageofmoon < 15.29) { + echo "
"; + } else if ($ageofmoon < 16.35) { + echo "
"; + } else if ($ageofmoon < 17.40) { + echo "
"; + } else if ($ageofmoon < 18.46) { + echo "
"; + } else if ($ageofmoon < 19.51) { + echo "
"; + } else if ($ageofmoon < 20.57) { + echo "
"; + } else if ($ageofmoon < 21.62) { + echo "
"; + } else if ($ageofmoon < 22.67) { + echo "
"; + } else if ($ageofmoon < 23.73) { + echo "
"; + } else if ($ageofmoon < 24.78) { + echo "
"; + } else if ($ageofmoon < 25.84) { + echo "
"; + } else if ($ageofmoon < 26.89) { + echo "
"; + } else if ($ageofmoon < 27.95) { + echo "
"; + } else if ($ageofmoon < 29.00) { + echo "
"; + } else { + echo "
"; + } + echo " ${moon} \n"; +} +$moonify = "Version 4.37"; +function normalize($v) +{ + $v = $v - floor($v); + if ($v < 0) { + $v + 1; + } + return $v; +} +$date = time(); +$years = date('Y', $date); +$months = date('n', $date); +$days = date('j', $date); +define('ERR_UNDEF', -1); +define('EPOCH', 2444238.5); +define('ELONGE', 278.833540); +define('ELONGP', 282.596403); +define('ECCENT', 0.016718); +define('SUNSMAX', 1.495985e8); +define('SUNANGSIZ', 0.533128); +define('MMLONG', 64.975464); +define('MMLONGP', 349.383063); +define('MLNODE', 151.950429); +define('MINC', 5.145396); +define('MECC', 0.054900); +define('MANGSIZ', 0.5181); +define('MSMAX', 384401.0); +define('MPARALLAX', 0.9507); +define('SYNMONTH', 29.53058868); +function sgn($arg) +{ + return (($arg < 0) ? -1 : ($arg > 0 ? 1 : 0)); +} +function fixangle($arg) +{ + return ($arg - 360.0 * (floor($arg / 360.0))); +} +function torad($arg) +{ + return ($arg * (pi() / 180.0)); +} +function todeg($arg) +{ + return ($arg * (180.0 / pi())); +} +function dsin($arg) +{ + return (sin(torad($arg))); +} +function dcos($arg) +{ + return (cos(torad($arg))); +} +function jtime($timestamp) +{ + $julian = ($timestamp / 86400) + 2440587.5; + return $julian; +} +function jdaytosecs($jday = 0) +{ + $stamp = ($jday - 2440587.5) * 86400; + return $stamp; +} +function jyear($td, &$yy, &$mm, &$dd) +{ + $td += 0.5; + $z = floor($td); + $f = $td - $z; + if ($z < 2299161.0) { + $a = $z; + } else { + $alpha = floor(($z - 1867216.25) / 36524.25); + $a = $z + 1 + $alpha - floor($alpha / 4); + } + $b = $a + 1524; + $c = floor(($b - 122.1) / 365.25); + $d = floor(365.25 * $c); + $e = floor(($b - $d) / 30.6001); + $dd = $b - $d - floor(30.6001 * $e) + $f; + $mm = $e < 14 ? $e - 1 : $e - 13; + $yy = $mm > 2 ? $c - 4716 : $c - 4715; +} +function meanphase($sdate, $k) +{ + $t = ($sdate - 2415020.0) / 36525; + $t2 = $t * $t; + $t3 = $t2 * $t; + $nt1 = 2415020.75933 + SYNMONTH * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * dsin(166.56 + 132.87 * $t - 0.009173 * $t2); + return ($nt1); +} +function truephase($k, $phase) +{ + $apcor = 0; + $k += $phase; + $t = $k / 1236.85; + $t2 = $t * $t; + $t3 = $t2 * $t; + $pt = 2415020.75933 + SYNMONTH * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * dsin(166.56 + 132.87 * $t - 0.009173 * $t2); + $m = 359.2242 + 29.10535608 * $k - 0.0000333 * $t2 - 0.00000347 * $t3; + $mprime = 306.0253 + 385.81691806 * $k + 0.0107306 * $t2 + 0.00001236 * $t3; + $f = 21.2964 + 390.67050646 * $k - 0.0016528 * $t2 - 0.00000239 * $t3; + if (($phase < 0.01) || (abs($phase - 0.5) < 0.01)) { + $pt += (0.1734 - 0.000393 * $t) * dsin($m) + 0.0021 * dsin(2 * $m) - 0.4068 * dsin($mprime) + 0.0161 * dsin(2 * $mprime) - 0.0004 * dsin(3 * $mprime) + 0.0104 * dsin(2 * $f) - 0.0051 * dsin($m + $mprime) - 0.0074 * dsin($m - $mprime) + 0.0004 * dsin(2 * $f + $m) - 0.0004 * dsin(2 * $f - $m) - 0.0006 * dsin(2 * $f + $mprime) + 0.0010 * dsin(2 * $f - $mprime) + 0.0005 * dsin($m + 2 * $mprime); + $apcor = 1; + } elseif ((abs($phase - 0.25) < 0.01 || (abs($phase - 0.75) < 0.01))) { + $pt += (0.1721 - 0.0004 * $t) * dsin($m) + 0.0021 * dsin(2 * $m) - 0.6280 * dsin($mprime) + 0.0089 * dsin(2 * $mprime) - 0.0004 * dsin(3 * $mprime) + 0.0079 * dsin(2 * $f) - 0.0119 * dsin($m + $mprime) - 0.0047 * dsin($m - $mprime) + 0.0003 * dsin(2 * $f + $m) - 0.0004 * dsin(2 * $f - $m) - 0.0006 * dsin(2 * $f + $mprime) + 0.0021 * dsin(2 * $f - $mprime) + 0.0003 * dsin($m + 2 * $mprime) + 0.0004 * dsin($m - 2 * $mprime) - 0.0003 * dsin(2 * $m + $mprime); + if ($phase < 0.5) { + $pt += 0.0028 - 0.0004 * dcos($m) + 0.0003 * dcos($mprime); + } else { + $pt += -0.0028 + 0.0004 * dcos($m) - 0.0003 * dcos($mprime); + } + $apcor = 1; + } + if (!$apcor) { + print "truephase() called with invalid phase selector ($phase).\n"; + exit(ERR_UNDEF); + } + return ($pt); +} +function phasehunt($time = -1) +{ + if (empty($time) || $time == -1) { + $time = time(); + } + $sdate = jtime($time); + $adate = $sdate - 45; + jyear($adate, $yy, $mm, $dd); + $k1 = floor(($yy + (($mm - 1) * (1.0 / 12.0)) - 1900) * 12.3685); + $adate = $nt1 = meanphase($adate, $k1); + while (1) { + $adate += SYNMONTH; + $k2 = $k1 + 1; + $nt2 = meanphase($adate, $k2); + if (($nt1 <= $sdate) && ($nt2 > $sdate)) { + break; + } + $nt1 = $nt2; + $k1 = $k2; + } + return array(jdaytosecs(truephase($k1, 0.0)), jdaytosecs(truephase($k1, 0.25)), jdaytosecs(truephase($k1, 0.5)), jdaytosecs(truephase($k1, 0.75)), jdaytosecs(truephase($k2, 0.0))); +} +function phaselist($sdate, $edate) +{ + if (empty($sdate) || empty($edate)) { + return array(); + } + $sdate = jtime($sdate); + $edate = jtime($edate); + $phases = array(); + $d = $k = $yy = $mm = 0; + jyear($sdate, $yy, $mm, $d); + $k = floor(($yy + (($mm - 1) * (1.0 / 12.0)) - 1900) * 12.3685) - 2; + while (1) { + ++$k; + foreach (array(0.0, 0.25, 0.5, 0.75) as $phase) { + $d = truephase($k, $phase); + if ($d >= $edate) { + return $phases; + } + if ($d >= $sdate) { + if (empty($phases)) { + array_push($phases, floor(4 * $phase)); + } + array_push($phases, jdaytosecs($d)); + } + } + } +} +function kepler($m, $ecc) +{ + $EPSILON = 1e-6; + $m = torad($m); + $e = $m; + do { + $delta = $e - $ecc * sin($e) - $m; + $e -= $delta / (1 - $ecc * cos($e)); + } while (abs($delta) > $EPSILON); + return ($e); +} +function phase($time = 0) +{ + if (empty($time) || $time == 0) { + $time = time(); + } + $pdate = jtime($time); + $pphase = 0; + $mage = 0; + $dist = 0; + $angdia = 0; + $sudist = 0; + $suangdia = 0; + $Day = $pdate - EPOCH; + $N = fixangle((360 / 365.2422) * $Day); + $M = fixangle($N + ELONGE - ELONGP); + $Ec = kepler($M, ECCENT); + $Ec = sqrt((1 + ECCENT) / (1 - ECCENT)) * tan($Ec / 2); + $Ec = 2 * todeg(atan($Ec)); + $Lambdasun = fixangle($Ec + ELONGP); + $F = ((1 + ECCENT * cos(torad($Ec))) / (1 - ECCENT * ECCENT)); + $SunDist = SUNSMAX / $F; + $SunAng = $F * SUNANGSIZ; + $ml = fixangle(13.1763966 * $Day + MMLONG); + $MM = fixangle($ml - 0.1114041 * $Day - MMLONGP); + $MN = fixangle(MLNODE - 0.0529539 * $Day); + $Ev = 1.2739 * sin(torad(2 * ($ml - $Lambdasun) - $MM)); + $Ae = 0.1858 * sin(torad($M)); + $A3 = 0.37 * sin(torad($M)); + $MmP = $MM + $Ev - $Ae - $A3; + $mEc = 6.2886 * sin(torad($MmP)); + $A4 = 0.214 * sin(torad(2 * $MmP)); + $lP = $ml + $Ev + $mEc - $Ae + $A4; + $V = 0.6583 * sin(torad(2 * ($lP - $Lambdasun))); + $lPP = $lP + $V; + $NP = $MN - 0.16 * sin(torad($M)); + $y = sin(torad($lPP - $NP)) * cos(torad(MINC)); + $x = cos(torad($lPP - $NP)); + $Lambdamoon = todeg(atan2($y, $x)); + $Lambdamoon += $NP; + $BetaM = todeg(asin(sin(torad($lPP - $NP)) * sin(torad(MINC)))); + $MoonAge = $lPP - $Lambdasun; + $MoonPhase = (1 - cos(torad($MoonAge))) / 2; + $MoonDist = (MSMAX * (1 - MECC * MECC)) / (1 + MECC * cos(torad($MmP + $mEc))); + $MoonDFrac = $MoonDist / MSMAX; + $MoonAng = MANGSIZ / $MoonDFrac; + $MoonPar = MPARALLAX / $MoonDFrac; + $pphase = $MoonPhase; + $mage = SYNMONTH * (fixangle($MoonAge) / 360.0); + $dist = $MoonDist; + $angdia = $MoonAng; + $sudist = $SunDist; + $suangdia = $SunAng; + $mpfrac = fixangle($MoonAge) / 360.0; + return array($mpfrac, $pphase, $mage, $dist, $angdia, $sudist, $suangdia); +} //get moon rise/set updated 29th July -class Moon{ public static function calculateMoonTimes($month,$day,$year,$lat,$lon){$utrise=$utset=0;$timezone=(int)($lon / 15);$date=self::modifiedJulianDate($month,$day,$year);$date-=$timezone / 24;$latRad=deg2rad($lat);$sinho=0.0023271056;$sglat=sin($latRad);$cglat=cos($latRad);$rise=false;$set=false;$above=false;$hour=0;$ym=self::sinAlt($date,$hour ,$lon,$cglat,$sglat)- $sinho;$above=$ym>0;while($hour<25&&(false==$set||false==$rise)){$yz=self::sinAlt($date,$hour,$lon,$cglat,$sglat)- $sinho;$yp=self::sinAlt($date,$hour + 1,$lon,$cglat,$sglat)- $sinho;$quadout=self::quad($ym,$yz,$yp);$nz=$quadout[0];$z1=$quadout[1];$z2=$quadout[2];$xe=$quadout[3];$ye=$quadout[4];if($nz==1){if($ym<0){$utrise=$hour + $z1;$rise=true;}else{$utset=$hour + $z1;$set=true;}}if($nz==2){if($ye<0){$utrise=$hour + $z2;$utset=$hour + $z1;}else{$utrise=$hour + $z1;$utset=$hour + $z2;}}$ym=$yp;$hour+=2.0;}$retVal=new stdClass();$utrise=self::convertTime($utrise);$utset=self::convertTime($utset);$retVal->moonrise=$rise?mktime($utrise['hrs'],$utrise['min'],0,$month,$day,$year):mktime(0,0,0,$month,$day + 1,$year);$retVal->moonset=$set?mktime($utset['hrs'],$utset['min'],0,$month,$day,$year):mktime(0,0,0,$month,$day + 1,$year);return $retVal;} private static function quad($ym,$yz,$yp){$nz=$z1=$z2=0;$a=0.5 *($ym + $yp)- $yz;$b=0.5 *($yp - $ym);$c=$yz;$xe=-$b /(2 * $a);$ye=($a * $xe + $b)* $xe + $c;$dis=$b * $b - 4 * $a * $c;if($dis>0){$dx=0.5 * sqrt($dis)/ abs($a);$z1=$xe - $dx;$z2=$xe + $dx;$nz=abs($z1)<1?$nz + 1:$nz;$nz=abs($z2)<1?$nz + 1:$nz;$z1=$z1<-1?$z2:$z1;}return array($nz,$z1,$z2,$xe,$ye);} private static function sinAlt($mjd,$hour,$glon,$cglat,$sglat){$mjd+=$hour / 24;$t=($mjd - 51544.5)/ 36525;$objpos=self::minimoon($t);$ra=$objpos[1];$dec=$objpos[0];$decRad=deg2rad($dec);$tau=15 *(self::lmst($mjd,$glon)- $ra);return $sglat * sin($decRad)+ $cglat * cos($decRad)* cos(deg2rad($tau));} private static function degRange($x){$b=$x / 360;$a=360 *($b -(int)$b);$retVal=$a<0?$a + 360:$a;return $retVal;} private static function lmst($mjd,$glon){$d=$mjd - 51544.5;$t=$d / 36525;$lst=self::degRange(280.46061839 + 360.98564736629 * $d + 0.000387933 * $t * $t - $t * $t * $t / 38710000);return $lst / 15 + $glon / 15;} private static function minimoon($t){$p2=6.283185307;$arc=206264.8062;$coseps=0.91748;$sineps=0.39778;$lo=self::frac(0.606433 + 1336.855225 * $t);$l=$p2 * self::frac(0.374897 + 1325.552410 * $t);$l2=$l * 2;$ls=$p2 * self::frac(0.993133 + 99.997361 * $t);$d=$p2 * self::frac(0.827361 + 1236.853086 * $t);$d2=$d * 2;$f=$p2 * self::frac(0.259086 + 1342.227825 * $t);$f2=$f * 2;$sinls=sin($ls);$sinf2=sin($f2);$dl=22640 * sin($l);$dl+=-4586 * sin($l - $d2);$dl+=2370 * sin($d2);$dl+=769 * sin($l2);$dl+=-668 * $sinls;$dl+=-412 * $sinf2;$dl+=-212 * sin($l2 - $d2);$dl+=-206 * sin($l + $ls - $d2);$dl+=192 * sin($l + $d2);$dl+=-165 * sin($ls - $d2);$dl+=-125 * sin($d);$dl+=-110 * sin($l + $ls);$dl+=148 * sin($l - $ls);$dl+=-55 * sin($f2 - $d2);$s=$f +($dl + 412 * $sinf2 + 541 * $sinls)/ $arc;$h=$f - $d2;$n=-526 * sin($h);$n+=44 * sin($l + $h);$n+=-31 * sin(-$l + $h);$n+=-23 * sin($ls + $h);$n+=11 * sin(-$ls + $h);$n+=-25 * sin(-$l2 + $f);$n+=21 * sin(-$l + $f);$L_moon=$p2 * self::frac($lo + $dl / 1296000);$B_moon=(18520.0 * sin($s)+ $n)/ $arc;$cb=cos($B_moon);$x=$cb * cos($L_moon);$v=$cb * sin($L_moon);$w=sin($B_moon);$y=$coseps * $v - $sineps * $w;$z=$sineps * $v + $coseps * $w;$rho=sqrt(1 - $z * $z);$dec=(360 / $p2)* atan($z / $rho);$ra=(48 / $p2)* atan($y /($x + $rho));$ra=$ra<0?$ra + 24:$ra;return array($dec,$ra);} private static function frac($x){$x-=(int)$x;return $x<0?$x + 1:$x;} private static function modifiedJulianDate($month,$day,$year){if($month<=2){$month+=12;$year--;}$a=10000 * $year + 100 * $month + $day;$b=0;if($a<=15821004.1){$b=-2 *(int)(($year + 4716)/ 4)- 1179;}else{$b=(int)($year / 400)-(int)($year / 100)+(int)($year / 4);}$a=365 * $year - 679004;return $a + $b +(int)(30.6001 *($month + 1))+ $day;} private static function convertTime($hours){include('settings.php');$hrs=(int)($hours * 60 + 0.5)/ 60.0;$h=(int)($hrs);$m=(int)(60 *($hrs - $h)+ 0.5);return array('hrs'=>$h + $moonadj,'min'=>$m);} } $Moon=Moon::calculateMoonTimes($months,$days,$years,$lat,$lon); $MoonRise=$Moon->moonrise; $MoonSet=$Moon->moonset; $MoonRise=date($MoonRise); $MoonSet=date($MoonSet); class MoonPhase{ private $timestamp; private $phase; private $illum; private $age; private $dist; private $angdia; private $sundist; private $sunangdia; private $synmonth; private $quarters=null; function __construct($pdate=null){if(is_null($pdate))$pdate=time();$epoch=2444238.5;$elonge=278.833540;$elongp=282.596403;$eccent=0.016718;$sunsmax=1.495985e8;$sunangsiz=0.533128;$mmlong=64.975464;$mmlongp=349.383063;$mlnode=151.950429;$minc=5.145396;$mecc=0.054900;$mangsiz=0.5181;$msmax=384401;$mparallax=0.9507;$synmonth=29.53058868;$zenith=90+(50/60);$this->synmonth=$synmonth;$lunatbase=2423436.0;$this->timestamp=$pdate;$pdate=$pdate / 86400 + 2440587.5;$Day=$pdate - $epoch;$N=$this->fixangle((360 / 365.2422)* $Day);$M=$this->fixangle($N + $elonge - $elongp);$Ec=$this->kepler($M,$eccent);$Ec=sqrt((1 + $eccent)/(1 - $eccent))* tan($Ec / 2);$Ec=2 * rad2deg(atan($Ec));$Lambdasun=$this->fixangle($Ec + $elongp);$F=((1 + $eccent * cos(deg2rad($Ec)))/(1 - $eccent * $eccent));$SunDist=$sunsmax / $F;$SunAng=$F * $sunangsiz;$ml=$this->fixangle(13.1763966 * $Day + $mmlong);$MM=$this->fixangle($ml - 0.1114041 * $Day - $mmlongp);$MN=$this->fixangle($mlnode - 0.0529539 * $Day);$Ev=1.2739 * sin(deg2rad(2 *($ml - $Lambdasun)- $MM));$Ae=0.1858 * sin(deg2rad($M));$A3=0.37 * sin(deg2rad($M));$MmP=$MM + $Ev - $Ae - $A3;$mEc=6.2886 * sin(deg2rad($MmP));$A4=0.214 * sin(deg2rad(2 * $MmP));$lP=$ml + $Ev + $mEc - $Ae + $A4;$V=0.6583 * sin(deg2rad(2 *($lP - $Lambdasun)));$lPP=$lP + $V;$NP=$MN - 0.16 * sin(deg2rad($M));$y=sin(deg2rad($lPP - $NP))* cos(deg2rad($minc));$x=cos(deg2rad($lPP - $NP));$Lambdamoon=rad2deg(atan2($y,$x))+ $NP;$BetaM=rad2deg(asin(sin(deg2rad($lPP - $NP))* sin(deg2rad($minc))));$MoonAge=$lPP - $Lambdasun;$MoonPhase=(1 - cos(deg2rad($MoonAge)))/ 2;$MoonDist=($msmax *(1 - $mecc * $mecc))/(1 + $mecc * cos(deg2rad($MmP + $mEc)));$MoonDFrac=$MoonDist / $msmax;$MoonAng=$mangsiz / $MoonDFrac;$this->phase=$this->fixangle($MoonAge)/ 360;$this->illum=$MoonPhase;$this->age=$synmonth * $this->phase;$this->dist=$MoonDist;$this->angdia=$MoonAng;$this->sundist=$SunDist;$this->sunangdia=$SunAng;} private function fixangle($a){return($a - 360 * floor($a / 360));} private function kepler($m,$ecc){$epsilon=0.000001;$e=$m=deg2rad($m);do{$delta=$e - $ecc * sin($e)- $m;$e-=$delta /(1 - $ecc * cos($e));}while(abs($delta)>$epsilon);return $e;} private function meanphase($sdate,$k){$t=($sdate - 2415020.0)/ 36525;$t2=$t * $t;$t3=$t2 * $t;$nt1=2415020.75933 + $this->synmonth * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * sin(deg2rad(166.56 + 132.87 * $t - 0.009173 * $t2));return $nt1;} private function truephase($k,$phase){$apcor=false;$k+=$phase;$t=$k / 1236.85;$t2=$t * $t;$t3=$t2 * $t;$pt=2415020.75933 + $this->synmonth * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * sin(deg2rad(166.56 + 132.87 * $t - 0.009173 * $t2));$m=359.2242 + 29.10535608 * $k - 0.0000333 * $t2 - 0.00000347 * $t3;$mprime=306.0253 + 385.81691806 * $k + 0.0107306 * $t2 + 0.00001236 * $t3;$f=21.2964 + 390.67050646 * $k - 0.0016528 * $t2 - 0.00000239 * $t3;if($phase<0.01||abs($phase - 0.5)<0.01){$pt+=(0.1734 - 0.000393 * $t)* sin(deg2rad($m))+ 0.0021 * sin(deg2rad(2 * $m))- 0.4068 * sin(deg2rad($mprime))+ 0.0161 * sin(deg2rad(2 * $mprime))- 0.0004 * sin(deg2rad(3 * $mprime))+ 0.0104 * sin(deg2rad(2 * $f))- 0.0051 * sin(deg2rad($m + $mprime))- 0.0074 * sin(deg2rad($m - $mprime))+ 0.0004 * sin(deg2rad(2 * $f + $m))- 0.0004 * sin(deg2rad(2 * $f - $m))- 0.0006 * sin(deg2rad(2 * $f + $mprime))+ 0.0010 * sin(deg2rad(2 * $f - $mprime))+ 0.0005 * sin(deg2rad($m + 2 * $mprime));$apcor=true;}else if(abs($phase - 0.25)<0.01||abs($phase - 0.75)<0.01){$pt+=(0.1721 - 0.0004 * $t)* sin(deg2rad($m))+ 0.0021 * sin(deg2rad(2 * $m))- 0.6280 * sin(deg2rad($mprime))+ 0.0089 * sin(deg2rad(2 * $mprime))- 0.0004 * sin(deg2rad(3 * $mprime))+ 0.0079 * sin(deg2rad(2 * $f))- 0.0119 * sin(deg2rad($m + $mprime))- 0.0047 * sin(deg2rad($m - $mprime))+ 0.0003 * sin(deg2rad(2 * $f + $m))- 0.0004 * sin(deg2rad(2 * $f - $m))- 0.0006 * sin(deg2rad(2 * $f + $mprime))+ 0.0021 * sin(deg2rad(2 * $f - $mprime))+ 0.0003 * sin(deg2rad($m + 2 * $mprime))+ 0.0004 * sin(deg2rad($m - 2 * $mprime))- 0.0003 * sin(deg2rad(2 * $m + $mprime));if($phase<0.5)$pt+=0.0028 - 0.0004 * cos(deg2rad($m))+ 0.0003 * cos(deg2rad($mprime));else $pt+=-0.0028 + 0.0004 * cos(deg2rad($m))- 0.0003 * cos(deg2rad($mprime));$apcor=true;}if(!$apcor)return false;return $pt;} private function phasehunt(){$sdate=$this->utctojulian($this->timestamp);$adate=$sdate - 45;$ats=$this->timestamp - 86400 * 45;$yy=(int)gmdate('Y',$ats);$mm=(int)gmdate('n',$ats);$k1=floor(($yy +(($mm - 1)*(1 / 12))- 1900)* 12.3685);$adate=$nt1=$this->meanphase($adate,$k1);while(true){$adate+=$this->synmonth;$k2=$k1 + 1;$nt2=$this->meanphase($adate,$k2);if(abs($nt2 - $sdate)<0.75)$nt2=$this->truephase($k2,0.0);if($nt1<=$sdate&&$nt2>$sdate)break;$nt1=$nt2;$k1=$k2;}$data=array($this->truephase($k1,0.0),$this->truephase($k1,0.25),$this->truephase($k1,0.5),$this->truephase($k1,0.75),$this->truephase($k2,0.0),$this->truephase($k2,0.25),$this->truephase($k2,0.5),$this->truephase($k2,0.75));$this->quarters=array();foreach($data as $v)$this->quarters[]=($v - 2440587.5)* 86400;}private function utctojulian($ts){return $ts / 86400 + 2440587.5;} private function get_phase($n){if(is_null($this->quarters))$this->phasehunt();return $this->quarters[$n];} function phase(){return $this->phase;}function illumination(){return $this->illum;} function age(){return $this->age;} function distance(){return $this->dist;} function diameter(){return $this->angdia;} function sundistance(){return $this->sundist;} function sundiameter(){return $this->sunangdia;} function new_moon(){return $this->get_phase(0);} function first_quarter(){return $this->get_phase(1);} function full_moon(){return $this->get_phase(2);} function last_quarter(){return $this->get_phase(3);} function next_new_moon(){return $this->get_phase(4);} function next_first_quarter(){return $this->get_phase(5);} function next_full_moon(){return $this->get_phase(6);} function next_last_quarter(){return $this->get_phase(7);} function phase_name(){$names=array('New Moon','Waxing Crescent','First Quarter','Waxing Gibbous','Full Moon','Waning Gibbous','Third Quarter','Waning Crescent','New Moon');return $names[ floor(($this->phase + 0.0625)* 8)];} } ?> - -mktime(0, 0, 0, 1, 3),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 4),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 1, 5),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 12),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 28,2018),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 2,2019),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 28,2019),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 2,2020),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 28,2020),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 2,2021),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 28,2021),"event_title"=>"Quadrantids Meteor","event_end"=>mktime(23, 59, 59, 1, 2,2022),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 4, 9),"event_title"=>"Lyrids Meteor","event_end"=>mktime(20, 59, 59, 4, 20),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 4, 21),"event_title"=>"Lyrids Meteor","event_end"=>mktime(23, 59, 59, 4, 22),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 5, 5),"event_title"=>"ETA Aquarids","event_end"=>mktime(23, 59, 59, 5, 6),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 7, 20),"event_title"=>"Delta Aquarids","event_end"=>mktime(23, 59, 59, 7, 28),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 7, 29),"event_title"=>"Delta Aquarids","event_end"=>mktime(23, 59, 59, 7, 30),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 8, 1),"event_title"=>"Perseids Meteor","event_end"=>mktime(23, 59, 59, 8, 10),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 8, 11),"event_title"=>"Perseids Meteor","event_end"=>mktime(23, 59, 59, 8, 13),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 8, 14),"event_title"=>"Perseids Meteor","event_end"=>mktime(23, 59, 59, 8, 18),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 10, 6),"event_title"=>"Draconids","event_end"=>mktime(23, 59, 59, 10, 7),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 10, 20),"event_title"=>"Orionids Meteor","event_end"=>mktime(23, 59, 59, 10, 21),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 4),"event_title"=>"South Taurids","event_end"=>mktime(23, 59, 59, 11, 5),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 11),"event_title"=>"North Taurids","event_end"=>mktime(23, 59, 59, 11, 11),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 13),"event_title"=>"Leonids Meteor","event_end"=>mktime(23, 59, 59, 11, 16),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 17),"event_title"=>"Leonids Meteor","event_end"=>mktime(23, 59, 59, 11, 18),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 19),"event_title"=>"Leonids Meteor","event_end"=>mktime(23, 59, 59, 11, 29),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 11, 30),"event_title"=>"Geminids Meteor","event_end"=>mktime(23, 59, 59, 12, 12),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 13),"event_title"=>"Geminids Meteor","event_end"=>mktime(23, 59, 59, 12, 14),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 16),"event_title"=>"Ursids Meteor","event_end"=>mktime(23, 59, 59, 12, 20),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 21),"event_title"=>"Ursids Meteor","event_end"=>mktime(23, 59, 59, 12, 22),); -$meteor_events[]=array("event_start"=>mktime(0, 0, 0, 12, 23),"event_title"=>"Ursids Meteor","event_end"=>mktime(23, 59, 59, 12, 25),); -$meteorNow=time(); -$meteorOP=false; -foreach ($meteor_events as $meteor_check) {if ($meteor_check["event_start"]<=$meteorNow&&$meteorNow<=$meteor_check["event_end"]) {$meteorOP=true;$meteor_default=$meteor_check["event_title"];}}; +class Moon +{ + public static function calculateMoonTimes($month, $day, $year, $lat, $lon) + { + $utrise = $utset = 0; + $timezone = (int) ($lon / 15); + $date = self::modifiedJulianDate($month, $day, $year); + $date -= $timezone / 24; + $latRad = deg2rad($lat); + $sinho = 0.0023271056; + $sglat = sin($latRad); + $cglat = cos($latRad); + $rise = false; + $set = false; + $above = false; + $hour = 0; + $ym = self::sinAlt($date, $hour, $lon, $cglat, $sglat) - $sinho; + $above = $ym > 0; + while ($hour < 25 && (false == $set || false == $rise)) { + $yz = self::sinAlt($date, $hour, $lon, $cglat, $sglat) - $sinho; + $yp = self::sinAlt($date, $hour + 1, $lon, $cglat, $sglat) - $sinho; + $quadout = self::quad($ym, $yz, $yp); + $nz = $quadout[0]; + $z1 = $quadout[1]; + $z2 = $quadout[2]; + $xe = $quadout[3]; + $ye = $quadout[4]; + if ($nz == 1) { + if ($ym < 0) { + $utrise = $hour + $z1; + $rise = true; + } else { + $utset = $hour + $z1; + $set = true; + } + } + if ($nz == 2) { + if ($ye < 0) { + $utrise = $hour + $z2; + $utset = $hour + $z1; + } else { + $utrise = $hour + $z1; + $utset = $hour + $z2; + } + } + $ym = $yp; + $hour += 2.0; + } + $retVal = new stdClass(); + $utrise = self::convertTime($utrise); + $utset = self::convertTime($utset); + $retVal->moonrise = $rise ? mktime($utrise['hrs'], $utrise['min'], 0, $month, $day, $year) : mktime(0, 0, 0, $month, $day + 1, $year); + $retVal->moonset = $set ? mktime($utset['hrs'], $utset['min'], 0, $month, $day, $year) : mktime(0, 0, 0, $month, $day + 1, $year); + return $retVal; + } + private static function quad($ym, $yz, $yp) + { + $nz = $z1 = $z2 = 0; + $a = 0.5 * ($ym + $yp) - $yz; + $b = 0.5 * ($yp - $ym); + $c = $yz; + $xe = -$b / (2 * $a); + $ye = ($a * $xe + $b) * $xe + $c; + $dis = $b * $b - 4 * $a * $c; + if ($dis > 0) { + $dx = 0.5 * sqrt($dis) / abs($a); + $z1 = $xe - $dx; + $z2 = $xe + $dx; + $nz = abs($z1) < 1 ? $nz + 1 : $nz; + $nz = abs($z2) < 1 ? $nz + 1 : $nz; + $z1 = $z1 < -1 ? $z2 : $z1; + } + return array($nz, $z1, $z2, $xe, $ye); + } + private static function sinAlt($mjd, $hour, $glon, $cglat, $sglat) + { + $mjd += $hour / 24; + $t = ($mjd - 51544.5) / 36525; + $objpos = self::minimoon($t); + $ra = $objpos[1]; + $dec = $objpos[0]; + $decRad = deg2rad($dec); + $tau = 15 * (self::lmst($mjd, $glon) - $ra); + return $sglat * sin($decRad) + $cglat * cos($decRad) * cos(deg2rad($tau)); + } + private static function degRange($x) + { + $b = $x / 360; + $a = 360 * ($b - (int) $b); + $retVal = $a < 0 ? $a + 360 : $a; + return $retVal; + } + private static function lmst($mjd, $glon) + { + $d = $mjd - 51544.5; + $t = $d / 36525; + $lst = self::degRange(280.46061839 + 360.98564736629 * $d + 0.000387933 * $t * $t - $t * $t * $t / 38710000); + return $lst / 15 + $glon / 15; + } + private static function minimoon($t) + { + $p2 = 6.283185307; + $arc = 206264.8062; + $coseps = 0.91748; + $sineps = 0.39778; + $lo = self::frac(0.606433 + 1336.855225 * $t); + $l = $p2 * self::frac(0.374897 + 1325.552410 * $t); + $l2 = $l * 2; + $ls = $p2 * self::frac(0.993133 + 99.997361 * $t); + $d = $p2 * self::frac(0.827361 + 1236.853086 * $t); + $d2 = $d * 2; + $f = $p2 * self::frac(0.259086 + 1342.227825 * $t); + $f2 = $f * 2; + $sinls = sin($ls); + $sinf2 = sin($f2); + $dl = 22640 * sin($l); + $dl += -4586 * sin($l - $d2); + $dl += 2370 * sin($d2); + $dl += 769 * sin($l2); + $dl += -668 * $sinls; + $dl += -412 * $sinf2; + $dl += -212 * sin($l2 - $d2); + $dl += -206 * sin($l + $ls - $d2); + $dl += 192 * sin($l + $d2); + $dl += -165 * sin($ls - $d2); + $dl += -125 * sin($d); + $dl += -110 * sin($l + $ls); + $dl += 148 * sin($l - $ls); + $dl += -55 * sin($f2 - $d2); + $s = $f + ($dl + 412 * $sinf2 + 541 * $sinls) / $arc; + $h = $f - $d2; + $n = -526 * sin($h); + $n += 44 * sin($l + $h); + $n += -31 * sin(-$l + $h); + $n += -23 * sin($ls + $h); + $n += 11 * sin(-$ls + $h); + $n += -25 * sin(-$l2 + $f); + $n += 21 * sin(-$l + $f); + $L_moon = $p2 * self::frac($lo + $dl / 1296000); + $B_moon = (18520.0 * sin($s) + $n) / $arc; + $cb = cos($B_moon); + $x = $cb * cos($L_moon); + $v = $cb * sin($L_moon); + $w = sin($B_moon); + $y = $coseps * $v - $sineps * $w; + $z = $sineps * $v + $coseps * $w; + $rho = sqrt(1 - $z * $z); + $dec = (360 / $p2) * atan($z / $rho); + $ra = (48 / $p2) * atan($y / ($x + $rho)); + $ra = $ra < 0 ? $ra + 24 : $ra; + return array($dec, $ra); + } + private static function frac($x) + { + $x -= (int) $x; + return $x < 0 ? $x + 1 : $x; + } + private static function modifiedJulianDate($month, $day, $year) + { + if ($month <= 2) { + $month += 12; + $year--; + } + $a = 10000 * $year + 100 * $month + $day; + $b = 0; + if ($a <= 15821004.1) { + $b = -2 * (int) (($year + 4716) / 4) - 1179; + } else { + $b = (int) ($year / 400) - (int) ($year / 100) + (int) ($year / 4); + } + $a = 365 * $year - 679004; + return $a + $b + (int) (30.6001 * ($month + 1)) + $day; + } + private static function convertTime($hours) + { + include('settings.php'); + $hrs = (int) ($hours * 60 + 0.5) / 60.0; + $h = (int) ($hrs); + $m = (int) (60 * ($hrs - $h) + 0.5); + return array('hrs' => $h + $moonadj, 'min' => $m); + } +} +$Moon = Moon::calculateMoonTimes($months, $days, $years, $lat, $lon); +$MoonRise = $Moon->moonrise; +$MoonSet = $Moon->moonset; +$MoonRise = date($MoonRise); +$MoonSet = date($MoonSet); +class MoonPhase +{ + private $timestamp; + private $phase; + private $illum; + private $age; + private $dist; + private $angdia; + private $sundist; + private $sunangdia; + private $synmonth; + private $quarters = null; + function __construct($pdate = null) + { + if (is_null($pdate)) + $pdate = time(); + $epoch = 2444238.5; + $elonge = 278.833540; + $elongp = 282.596403; + $eccent = 0.016718; + $sunsmax = 1.495985e8; + $sunangsiz = 0.533128; + $mmlong = 64.975464; + $mmlongp = 349.383063; + $mlnode = 151.950429; + $minc = 5.145396; + $mecc = 0.054900; + $mangsiz = 0.5181; + $msmax = 384401; + $mparallax = 0.9507; + $synmonth = 29.53058868; + $zenith = 90 + (50 / 60); + $this->synmonth = $synmonth; + $lunatbase = 2423436.0; + $this->timestamp = $pdate; + $pdate = $pdate / 86400 + 2440587.5; + $Day = $pdate - $epoch; + $N = $this->fixangle((360 / 365.2422) * $Day); + $M = $this->fixangle($N + $elonge - $elongp); + $Ec = $this->kepler($M, $eccent); + $Ec = sqrt((1 + $eccent) / (1 - $eccent)) * tan($Ec / 2); + $Ec = 2 * rad2deg(atan($Ec)); + $Lambdasun = $this->fixangle($Ec + $elongp); + $F = ((1 + $eccent * cos(deg2rad($Ec))) / (1 - $eccent * $eccent)); + $SunDist = $sunsmax / $F; + $SunAng = $F * $sunangsiz; + $ml = $this->fixangle(13.1763966 * $Day + $mmlong); + $MM = $this->fixangle($ml - 0.1114041 * $Day - $mmlongp); + $MN = $this->fixangle($mlnode - 0.0529539 * $Day); + $Ev = 1.2739 * sin(deg2rad(2 * ($ml - $Lambdasun) - $MM)); + $Ae = 0.1858 * sin(deg2rad($M)); + $A3 = 0.37 * sin(deg2rad($M)); + $MmP = $MM + $Ev - $Ae - $A3; + $mEc = 6.2886 * sin(deg2rad($MmP)); + $A4 = 0.214 * sin(deg2rad(2 * $MmP)); + $lP = $ml + $Ev + $mEc - $Ae + $A4; + $V = 0.6583 * sin(deg2rad(2 * ($lP - $Lambdasun))); + $lPP = $lP + $V; + $NP = $MN - 0.16 * sin(deg2rad($M)); + $y = sin(deg2rad($lPP - $NP)) * cos(deg2rad($minc)); + $x = cos(deg2rad($lPP - $NP)); + $Lambdamoon = rad2deg(atan2($y, $x)) + $NP; + $BetaM = rad2deg(asin(sin(deg2rad($lPP - $NP)) * sin(deg2rad($minc)))); + $MoonAge = $lPP - $Lambdasun; + $MoonPhase = (1 - cos(deg2rad($MoonAge))) / 2; + $MoonDist = ($msmax * (1 - $mecc * $mecc)) / (1 + $mecc * cos(deg2rad($MmP + $mEc))); + $MoonDFrac = $MoonDist / $msmax; + $MoonAng = $mangsiz / $MoonDFrac; + $this->phase = $this->fixangle($MoonAge) / 360; + $this->illum = $MoonPhase; + $this->age = $synmonth * $this->phase; + $this->dist = $MoonDist; + $this->angdia = $MoonAng; + $this->sundist = $SunDist; + $this->sunangdia = $SunAng; + } + private function fixangle($a) + { + return ($a - 360 * floor($a / 360)); + } + private function kepler($m, $ecc) + { + $epsilon = 0.000001; + $e = $m = deg2rad($m); + do { + $delta = $e - $ecc * sin($e) - $m; + $e -= $delta / (1 - $ecc * cos($e)); + } while (abs($delta) > $epsilon); + return $e; + } + private function meanphase($sdate, $k) + { + $t = ($sdate - 2415020.0) / 36525; + $t2 = $t * $t; + $t3 = $t2 * $t; + $nt1 = 2415020.75933 + $this->synmonth * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * sin(deg2rad(166.56 + 132.87 * $t - 0.009173 * $t2)); + return $nt1; + } + private function truephase($k, $phase) + { + $apcor = false; + $k += $phase; + $t = $k / 1236.85; + $t2 = $t * $t; + $t3 = $t2 * $t; + $pt = 2415020.75933 + $this->synmonth * $k + 0.0001178 * $t2 - 0.000000155 * $t3 + 0.00033 * sin(deg2rad(166.56 + 132.87 * $t - 0.009173 * $t2)); + $m = 359.2242 + 29.10535608 * $k - 0.0000333 * $t2 - 0.00000347 * $t3; + $mprime = 306.0253 + 385.81691806 * $k + 0.0107306 * $t2 + 0.00001236 * $t3; + $f = 21.2964 + 390.67050646 * $k - 0.0016528 * $t2 - 0.00000239 * $t3; + if ($phase < 0.01 || abs($phase - 0.5) < 0.01) { + $pt += (0.1734 - 0.000393 * $t) * sin(deg2rad($m)) + 0.0021 * sin(deg2rad(2 * $m)) - 0.4068 * sin(deg2rad($mprime)) + 0.0161 * sin(deg2rad(2 * $mprime)) - 0.0004 * sin(deg2rad(3 * $mprime)) + 0.0104 * sin(deg2rad(2 * $f)) - 0.0051 * sin(deg2rad($m + $mprime)) - 0.0074 * sin(deg2rad($m - $mprime)) + 0.0004 * sin(deg2rad(2 * $f + $m)) - 0.0004 * sin(deg2rad(2 * $f - $m)) - 0.0006 * sin(deg2rad(2 * $f + $mprime)) + 0.0010 * sin(deg2rad(2 * $f - $mprime)) + 0.0005 * sin(deg2rad($m + 2 * $mprime)); + $apcor = true; + } else if (abs($phase - 0.25) < 0.01 || abs($phase - 0.75) < 0.01) { + $pt += (0.1721 - 0.0004 * $t) * sin(deg2rad($m)) + 0.0021 * sin(deg2rad(2 * $m)) - 0.6280 * sin(deg2rad($mprime)) + 0.0089 * sin(deg2rad(2 * $mprime)) - 0.0004 * sin(deg2rad(3 * $mprime)) + 0.0079 * sin(deg2rad(2 * $f)) - 0.0119 * sin(deg2rad($m + $mprime)) - 0.0047 * sin(deg2rad($m - $mprime)) + 0.0003 * sin(deg2rad(2 * $f + $m)) - 0.0004 * sin(deg2rad(2 * $f - $m)) - 0.0006 * sin(deg2rad(2 * $f + $mprime)) + 0.0021 * sin(deg2rad(2 * $f - $mprime)) + 0.0003 * sin(deg2rad($m + 2 * $mprime)) + 0.0004 * sin(deg2rad($m - 2 * $mprime)) - 0.0003 * sin(deg2rad(2 * $m + $mprime)); + if ($phase < 0.5) + $pt += 0.0028 - 0.0004 * cos(deg2rad($m)) + 0.0003 * cos(deg2rad($mprime)); + else + $pt += -0.0028 + 0.0004 * cos(deg2rad($m)) - 0.0003 * cos(deg2rad($mprime)); + $apcor = true; + } + if (!$apcor) + return false; + return $pt; + } + private function phasehunt() + { + $sdate = $this->utctojulian($this->timestamp); + $adate = $sdate - 45; + $ats = $this->timestamp - 86400 * 45; + $yy = (int) gmdate('Y', $ats); + $mm = (int) gmdate('n', $ats); + $k1 = floor(($yy + (($mm - 1) * (1 / 12)) - 1900) * 12.3685); + $adate = $nt1 = $this->meanphase($adate, $k1); + while (true) { + $adate += $this->synmonth; + $k2 = $k1 + 1; + $nt2 = $this->meanphase($adate, $k2); + if (abs($nt2 - $sdate) < 0.75) + $nt2 = $this->truephase($k2, 0.0); + if ($nt1 <= $sdate && $nt2 > $sdate) + break; + $nt1 = $nt2; + $k1 = $k2; + } + $data = array($this->truephase($k1, 0.0), $this->truephase($k1, 0.25), $this->truephase($k1, 0.5), $this->truephase($k1, 0.75), $this->truephase($k2, 0.0), $this->truephase($k2, 0.25), $this->truephase($k2, 0.5), $this->truephase($k2, 0.75)); + $this->quarters = array(); + foreach ($data as $v) + $this->quarters[] = ($v - 2440587.5) * 86400; + } + private function utctojulian($ts) + { + return $ts / 86400 + 2440587.5; + } + private function get_phase($n) + { + if (is_null($this->quarters)) + $this->phasehunt(); + return $this->quarters[$n]; + } + function phase() + { + return $this->phase; + } + function illumination() + { + return $this->illum; + } + function age() + { + return $this->age; + } + function distance() + { + return $this->dist; + } + function diameter() + { + return $this->angdia; + } + function sundistance() + { + return $this->sundist; + } + function sundiameter() + { + return $this->sunangdia; + } + function new_moon() + { + return $this->get_phase(0); + } + function first_quarter() + { + return $this->get_phase(1); + } + function full_moon() + { + return $this->get_phase(2); + } + function last_quarter() + { + return $this->get_phase(3); + } + function next_new_moon() + { + return $this->get_phase(4); + } + function next_first_quarter() + { + return $this->get_phase(5); + } + function next_full_moon() + { + return $this->get_phase(6); + } + function next_last_quarter() + { + return $this->get_phase(7); + } + function phase_name() + { + $names = array('New Moon', 'Waxing Crescent', 'First Quarter', 'Waxing Gibbous', 'Full Moon', 'Waning Gibbous', 'Third Quarter', 'Waning Crescent', 'New Moon'); + return $names[floor(($this->phase + 0.0625) * 8)]; + } +} ?> + + mktime(0, 0, 0, 1, 3), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 4), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 1, 5), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 12), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 28, 2018), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 2, 2019), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 28, 2019), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 2, 2020), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 28, 2020), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 2, 2021), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 28, 2021), "event_title" => "Quadrantids Meteor", "event_end" => mktime(23, 59, 59, 1, 2, 2022), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 4, 9), "event_title" => "Lyrids Meteor", "event_end" => mktime(20, 59, 59, 4, 20), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 4, 21), "event_title" => "Lyrids Meteor", "event_end" => mktime(23, 59, 59, 4, 22), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 5, 5), "event_title" => "ETA Aquarids", "event_end" => mktime(23, 59, 59, 5, 6), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 7, 20), "event_title" => "Delta Aquarids", "event_end" => mktime(23, 59, 59, 7, 28), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 7, 29), "event_title" => "Delta Aquarids", "event_end" => mktime(23, 59, 59, 7, 30), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 8, 1), "event_title" => "Perseids Meteor", "event_end" => mktime(23, 59, 59, 8, 10), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 8, 11), "event_title" => "Perseids Meteor", "event_end" => mktime(23, 59, 59, 8, 13), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 8, 14), "event_title" => "Perseids Meteor", "event_end" => mktime(23, 59, 59, 8, 18), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 10, 6), "event_title" => "Draconids", "event_end" => mktime(23, 59, 59, 10, 7), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 10, 20), "event_title" => "Orionids Meteor", "event_end" => mktime(23, 59, 59, 10, 21), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 4), "event_title" => "South Taurids", "event_end" => mktime(23, 59, 59, 11, 5), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 11), "event_title" => "North Taurids", "event_end" => mktime(23, 59, 59, 11, 11), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 13), "event_title" => "Leonids Meteor", "event_end" => mktime(23, 59, 59, 11, 16), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 17), "event_title" => "Leonids Meteor", "event_end" => mktime(23, 59, 59, 11, 18), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 19), "event_title" => "Leonids Meteor", "event_end" => mktime(23, 59, 59, 11, 29), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 11, 30), "event_title" => "Geminids Meteor", "event_end" => mktime(23, 59, 59, 12, 12), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 13), "event_title" => "Geminids Meteor", "event_end" => mktime(23, 59, 59, 12, 14), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 16), "event_title" => "Ursids Meteor", "event_end" => mktime(23, 59, 59, 12, 20), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 21), "event_title" => "Ursids Meteor", "event_end" => mktime(23, 59, 59, 12, 22), ); +$meteor_events[] = array("event_start" => mktime(0, 0, 0, 12, 23), "event_title" => "Ursids Meteor", "event_end" => mktime(23, 59, 59, 12, 25), ); +$meteorNow = time(); +$meteorOP = false; +foreach ($meteor_events as $meteor_check) { + if ($meteor_check["event_start"] <= $meteorNow && $meteorNow <= $meteor_check["event_end"]) { + $meteorOP = true; + $meteor_default = $meteor_check["event_title"]; + } +} +; //end meteor //begin weather34 eclipse //lunar and solar eclipse 2017-2018-2019-2020 -$eclipse_default=" No Current Weather Alerts "; +$eclipse_default = " No Current Weather Alerts "; //super moon 2019 21st Jan -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 1, 21 , 2019),"event_title"=>"
".$solareclipsesvg." Super Moon Phenomena
-","event_end"=>mktime(23, 59, 59, 1, 21, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 1, 21, 2019), + "event_title" => "
" . $solareclipsesvg . " Super Moon Phenomena
+", + "event_end" => mktime(23, 59, 59, 1, 21, 2019), +); //super moon 2019 19th Feb -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 2, 19 , 2019),"event_title"=>"
".$solareclipsesvg." Super Moon Phenomena
-","event_end"=>mktime(23, 59, 59, 2, 19, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 2, 19, 2019), + "event_title" => "
" . $solareclipsesvg . " Super Moon Phenomena
+", + "event_end" => mktime(23, 59, 59, 2, 19, 2019), +); //leonids 2018 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 11, 17 , 2018),"event_title"=>"
".$meteorsvg." Leonids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 11, 18, 2018),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 11, 17, 2018), + "event_title" => "
" . $meteorsvg . " Leonids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 11, 18, 2018), +); //geminids 2018 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 12, 13 , 2018),"event_title"=>"
".$meteorsvg." Geminids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 12, 14, 2018),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 12, 13, 2018), + "event_title" => "
" . $meteorsvg . " Geminids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 12, 14, 2018), +); //Quadrantids 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 1, 3 , 2019),"event_title"=>"
".$meteorsvg." Quadrantids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 1, 4, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 1, 3, 2019), + "event_title" => "
" . $meteorsvg . " Quadrantids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 1, 4, 2019), +); //5/6 jan solar 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 1, 5, 2019),"event_title"=>"
".$solareclipsesvg."Partial Solar Eclipse
-","event_end"=>mktime(23, 59, 59, 1, 6, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 1, 5, 2019), + "event_title" => "
" . $solareclipsesvg . "Partial Solar Eclipse
+", + "event_end" => mktime(23, 59, 59, 1, 6, 2019), +); //20/21 jan solar 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 1, 20, 2019),"event_title"=>"
".$solareclipsesvg." Partial Lunar Eclipse
-","event_end"=>mktime(23, 59, 59, 1, 21, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 1, 20, 2019), + "event_title" => "
" . $solareclipsesvg . " Partial Lunar Eclipse
+", + "event_end" => mktime(23, 59, 59, 1, 21, 2019), +); //2 jul solar 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 7, 2, 2019),"event_title"=>"
".$solareclipsesvg." Total Solar Eclipse
-","event_end"=>mktime(23, 59, 59, 7, 2, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 7, 2, 2019), + "event_title" => "
" . $solareclipsesvg . " Total Solar Eclipse
+", + "event_end" => mktime(23, 59, 59, 7, 2, 2019), +); //16/17 jul solar 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 7, 16, 2019),"event_title"=>"
".$solareclipsesvg." Partial Lunar Eclipse
-","event_end"=>mktime(23, 59, 59, 7, 17, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 7, 16, 2019), + "event_title" => "
" . $solareclipsesvg . " Partial Lunar Eclipse
+", + "event_end" => mktime(23, 59, 59, 7, 17, 2019), +); //persieds 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 8, 12 , 2019),"event_title"=>"
".$meteorsvg." Perseids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 8, 13, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 8, 12, 2019), + "event_title" => "
" . $meteorsvg . " Perseids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 8, 13, 2019), +); //leonids 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 11, 17 , 2019),"event_title"=>"
".$meteorsvg." Leonids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 11, 18, 2018),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 11, 17, 2019), + "event_title" => "
" . $meteorsvg . " Leonids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 11, 18, 2018), +); //geminids 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 12, 13 , 2019),"event_title"=>"
".$meteorsvg." Geminids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 12, 14, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 12, 13, 2019), + "event_title" => "
" . $meteorsvg . " Geminids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 12, 14, 2019), +); //5/6 dec solar 2019 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 12, 26, 2019),"event_title"=>"
".$solareclipsesvg." Annular Solar Eclipse
-","event_end"=>mktime(23, 59, 59, 12, 26, 2019),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 12, 26, 2019), + "event_title" => "
" . $solareclipsesvg . " Annular Solar Eclipse
+", + "event_end" => mktime(23, 59, 59, 12, 26, 2019), +); //Quadrantids 2020 -$eclipse_events[]=array("event_start"=>mktime(0, 0, 0, 1, 3 , 2020),"event_title"=>"
".$meteorsvg." Quadrantids Meteor Shower
-","event_end"=>mktime(23, 59, 59, 1, 4, 2020),); +$eclipse_events[] = array( + "event_start" => mktime(0, 0, 0, 1, 3, 2020), + "event_title" => "
" . $meteorsvg . " Quadrantids Meteor Shower
+", + "event_end" => mktime(23, 59, 59, 1, 4, 2020), +); -$eclipseNow=time();$eclipseOP=false;foreach ($eclipse_events as $eclipse_check) {if ($eclipse_check["event_start"]<=$eclipseNow&&$eclipseNow<=$eclipse_check["event_end"]) {$eclipseOP=true;$eclipse_default=$eclipse_check["event_title"]; }}; +$eclipseNow = time(); +$eclipseOP = false; +foreach ($eclipse_events as $eclipse_check) { + if ($eclipse_check["event_start"] <= $eclipseNow && $eclipseNow <= $eclipse_check["event_end"]) { + $eclipseOP = true; + $eclipse_default = $eclipse_check["event_title"]; + } +} +; // based on cumulus forum thread https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=2789&sid=77ffab8f6f2359e09e6c58d8b13a0c3c&start=30 -$firerisk = number_format((((110 - 1.373 * $weather["humidity"] ) - 0.54 * (10.20 - $weather["temp"] )) * (124 * pow(10,(-0.0142 * $weather["humidity"] ))))/60,0); - -$Tc =($weather['temp']);$P = $weather['barometer'];$RH = $weather['humidity']; -$Tdc = (($Tc - (14.55 + 0.114 * $Tc) * (1 - (0.01 * $RH)) - pow((2.5 + 0.007 * $Tc) * (1 - (0.01 * $RH)) , 3) - (15.9 + 0.117 * $Tc) * pow(1 - (0.01 * $RH), 14))); -$E = (6.11 * pow(10 , (7.5 * $Tdc / (237.7 + $Tdc)))); -$wetbulbcalc = (((0.00066 * $P) * $Tc) + ((4098 * $E) / pow(($Tdc + 237.7) , 2) * $Tdc)) / ((0.00066 * $P) + (4098 * $E) / pow(($Tdc + 237.7) , 2)); -$wetbulbx =number_format($wetbulbcalc,1); -$software = 'Cumulus Software'; -$designedfor = '
For Cumulus'; +$firerisk = number_format((((110 - 1.373 * $weather["humidity"]) - 0.54 * (10.20 - $weather["temp"])) * (124 * pow(10, (-0.0142 * $weather["humidity"])))) / 60, 0); + +$Tc = ($weather['temp']); +$P = $weather['barometer']; +$RH = $weather['humidity']; +$Tdc = (($Tc - (14.55 + 0.114 * $Tc) * (1 - (0.01 * $RH)) - pow((2.5 + 0.007 * $Tc) * (1 - (0.01 * $RH)), 3) - (15.9 + 0.117 * $Tc) * pow(1 - (0.01 * $RH), 14))); +$E = (6.11 * pow(10, (7.5 * $Tdc / (237.7 + $Tdc)))); +$wetbulbcalc = (((0.00066 * $P) * $Tc) + ((4098 * $E) / pow(($Tdc + 237.7), 2) * $Tdc)) / ((0.00066 * $P) + (4098 * $E) / pow(($Tdc + 237.7), 2)); +$wetbulbx = number_format($wetbulbcalc, 1); +$software = 'Cumulus Software'; +$designedfor = '
For Cumulus'; // K-INDEX & SOLAR DATA FOR WEATHER34 HOMEWEATHERSTATION TEMPLATE RADIO HAMS REJOICE :-) // -if(file_exists('jsondata/kindex.txt')) { - $str = file_get_contents('jsondata/kindex.txt'); - $json = json_decode($str,false); - if(is_array($json)) { - $json = array_reverse($json); - $kp = $json[1][1]; +if (file_exists('jsondata/kindex.txt')) { + $str = file_get_contents('jsondata/kindex.txt'); + $json = json_decode($str, true); + if (is_array($json)) { + $json = array_reverse($json); + $kp = isset($json[1][1]) && is_numeric($json[1][1]) ? (float) $json[1][1] : 0; } else { - $kp = 'n/a'; + $kp = 0; } } else { - $kp = 'n/a'; + $kp = 0; } -$file = $_SERVER["SCRIPT_NAME"];$break = Explode('/', $file);$mod34file = $break[count($break) - 1]; +$file = $_SERVER["SCRIPT_NAME"]; +$break = Explode('/', $file); +$mod34file = $break[count($break) - 1]; diff --git a/webcam.php b/webcam.php index 9943151..aa68e21 100644 --- a/webcam.php +++ b/webcam.php @@ -1,9 +1,9 @@ - + - + .weather34darkbrowser[url]:after { + content: attr(url); + color: #aaa; + font-size: 14px; + position: absolute; + left: 0; + right: 0; + top: 0; + padding: 2px 15px; + margin: 11px 50px 0 90px; + border-radius: 3px; + background: rgba(97, 106, 114, 0.3); + height: 20px; + box-sizing: border-box; + font-family: Arial, Helvetica, sans-serif + } + + .webcam { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + border-radius: 4px; + border: solid RGBA(84, 85, 86, 1.00) 2px; + margin: 2px !important; + padding: 0 !important; + + } + + .camcenter { + text-align: center !important; + display: flex !important; + justify-content: center !important; + align-items: center !important; + height: calc(100vh - 120px) !important; + } + + .camcenter img { + max-height: 100% !important; + max-width: 100% !important; + height: auto !important; + width: auto !important; + object-fit: contain !important; + } + + -
-
  - -
-  -  - - + setTimeout('reloadCamImage()', 1000 * ); + + \ No newline at end of file diff --git a/webcamsmall.php b/webcamsmall.php index 33a7571..0b94d63 100644 --- a/webcamsmall.php +++ b/webcamsmall.php @@ -1,7 +1,16 @@ -weathercam - +weathercam + \ No newline at end of file