text.php.tmpl 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head itemscope itemtype="http://schema.org/Website">
  4. <?php
  5. //Gets file name from url
  6. if(empty(\$_REQUEST["report"])) {
  7. //if empty then grab the latest years report
  8. \$year = date("Y");
  9. \$report = "NOAA/NOAA-".\$year.".txt";
  10. } else {
  11. \$report = filter_var(\$_REQUEST["report"],FILTER_SANITIZE_URL);
  12. }
  13. //Get labels for meta and page titles
  14. \$labels = preg_split("/[-.]/", \$report);
  15. \$count = count(\$labels);
  16. if (\$count == 3){
  17. \$title = \$labels[1];
  18. }
  19. if (\$count == 4){
  20. \$title = date("F Y", mktime(0, 0, 0, \$labels[2], 1, \$labels[1]));
  21. }
  22. ?>
  23. <meta charset="utf-8">
  24. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  25. <meta http-equiv="Refresh" content="180">
  26. #if $Extras.has_key('cwop')
  27. <meta name="description" content="$station.location Weather Station ($Extras.cwop) Climate Summary. This web site is powered by WeeWX">
  28. #else
  29. <meta name="description" content="$station.location Weather Station Climate Summary. This web site is powered by WeeWX">
  30. #end if
  31. <meta name="viewport" content="width=device-width, initial-scale=1">
  32. <link rel="profile" href="http://gmpg.org/xfn/11" />
  33. #if $Extras.has_key('web_url')
  34. <link rel="canonical" href="$Extras.web_url/summary.html"/>
  35. #end if
  36. #if $Extras.has_key('cwop')
  37. <?php
  38. echo"<title>$station.location ($Extras.cwop) Climate Summary for \$title </title>";
  39. ?>
  40. #else
  41. <?php
  42. echo"<title>$station.location Climate Summary for \$title </title>";
  43. ?>
  44. #end if
  45. <!-- Open Graph -->
  46. <meta property="og:site_name" content="$station.location Weather Station Climate Summary. This web site is powered by WeeWX." />
  47. <meta property="og:title" content="$station.location Weather Station Climate Summary"/>
  48. #if $Extras.has_key('web_url')
  49. <meta property="og:url" content="$Extras.web_url/summary.html"/>
  50. #end if
  51. <meta property="og:description" content="$station.location Weather Station Climate Summary. This web site is powered by WeeWX." />
  52. <meta property="og:type" content="$station.location Weather Station Climate Summary" />
  53. <!-- FavIcons -->
  54. <link rel="icon" href="favicon.ico" type="image/png">
  55. <link rel="apple-touch-icon" href="touch-icon.png"/>
  56. <!-- Styles -->
  57. <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
  58. <link rel="stylesheet" href="css/main.css">
  59. <!-- Font Awesome CDN links for 5.12.0-->
  60. <!-- If you have a pro license -->
  61. <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.12.0/css/all.css" integrity="sha384-ekOryaXPbeCpWQNxMwSWVvQ0+1VrStoPJq54shlYhR8HzQgig1v5fas6YgOqLoKz" crossorigin="anonymous">
  62. <!-- Free license -->
  63. <!-- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css" integrity="sha384-REHJTs1r2ErKBuJB0fCK99gCYsVjwxHrSU0N7I1zl9vZbggVJXRMsv/sLlOAGb4M" crossorigin="anonymous"> -->
  64. <!-- Script -->
  65. <script src="js/modernizr-2.6.2.min.js"></script>
  66. <script src="js/checkdiff.js"></script>
  67. </head>
  68. <body>
  69. <!-- Menu navbar -->
  70. <header>
  71. <div class="container-fix" >
  72. <div class="h-left" >
  73. <h1><i class="fas fa-cloud" ></i> $station.location </h1>
  74. <p>$station.latitude[0]&deg; $station.latitude[1]' $station.latitude[2] | $station.longitude[0]&deg; $station.longitude[1]' $station.longitude[2] | $station.altitude | <a href="https://www.google.com/maps/?q=$station.latitude[0]&deg;%20$station.latitude[1]%20$station.latitude[2],$station.longitude[0]&deg;%20$station.longitude[1]%20$station.longitude[2]" target="_blank" ><i class="fas fa-map-marker-alt" ></i> Show on map</a></p>
  75. <?php
  76. echo "<h2>Climate Summary for \$title</h2>";
  77. ?>
  78. <p><i class="far fa-clock" ></i> $current.dateTime $current.dateTime.format("%Z")</p>
  79. <p id="freshweather" class="m-orange"></p>
  80. <script>
  81. window.onload = checkDiff("$current.dateTime ($current.dateTime.format('%Z'))");
  82. </script>
  83. </div>
  84. <div class="h-right" >
  85. <table>
  86. <tr><td><b>Station:</b></td><td>$station.hardware</td></tr>
  87. <tr><td><b>Software:</b></td><td><a href="http://weewx.com/" target="_blank" >WeeWX v$station.version</a></td></tr>
  88. <tr><td><b>Weewx uptime:</b></td><td>$station.uptime</td></tr>
  89. <tr><td><b>Server uptime:</b></td><td>$station.os_uptime</td></tr>
  90. </table>
  91. </div>
  92. <nav>
  93. <ul class="topnav" id="myTopnav">
  94. <li class="icon"><a href="javascript:void(0);" onclick="myFunction()"><i class="fas fa-bars" ></i></a></li>
  95. <li><a href="/" >Current</a></li>
  96. <li><a href="week.html" >Week</a></li>
  97. <li><a href="month.html" >Month</a></li>
  98. <li><a href="year.html" >Year</a></li>
  99. <li class="active" ><a href="summary.html" >Summaries</a></li>
  100. <li><a href="about.html" >About</a></li>
  101. <li><a href="RSS/weewx_rss.xml" ><i class="fas fa-rss" ></i></a></li>
  102. </ul>
  103. </nav>
  104. </div>
  105. </header>
  106. <!-- Main container -->
  107. <div class="main" >
  108. <div class="container" >
  109. <div class="center" >
  110. <div class="card">
  111. <?php
  112. if(file_exists(\$report)){
  113. echo "<pre class=\"noaareport\">";
  114. echo file_get_contents(\$report);
  115. echo "</pre>";
  116. }
  117. ?>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <footer>
  123. <div style="text-align:center">
  124. #if $Extras.has_key('you')
  125. <i class="fab fa-pied-piper-pp"> </i><a href=mailto:$Extras.email> $Extras.you</a>
  126. #end if
  127. &sdot;
  128. Copyright <i class="far fa-copyright"></i> $latest.dateTime.format("%Y")
  129. <br>
  130. Sofaskin by <a href="http://neoground.com">Neoground</a>
  131. &sdot;
  132. CW9009 Version by <a href="http://cw9009.x10host.com">JDS</a>
  133. &sdot;
  134. Powered by<i class="fas fa-cog fa-spin fa-fw" aria-hidden="true"></i><a href="http://weewx.com/" target="_blank">WeeWX</a>
  135. </div>
  136. </footer>
  137. #if $Extras.has_key('googleAnalyticsId')
  138. <!-- Google Analytics -->
  139. <script>
  140. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  141. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  142. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  143. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  144. ga('create', '$Extras.googleAnalyticsId', 'auto');
  145. ga('send', 'pageview');
  146. </script>
  147. #end if
  148. <!-- Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon -->
  149. <script>
  150. function myFunction() {
  151. var x = document.getElementById("myTopnav");
  152. if (x.className === "topnav") {
  153. x.className += " responsive";
  154. } else {
  155. x.className = "topnav";
  156. }
  157. }
  158. </script>
  159. </body>
  160. </html>