text.php.tmpl 7.2 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 Icon links -->
  60. <!-- Free license -->
  61. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css" integrity="sha384-vSIIfh2YWi9wW0r9iZe7RJPrKwp6bG+s9QZMoITbCckVJqGCCRhc+ccxNcdpHuYu" crossorigin="anonymous">
  62. <!-- Script -->
  63. <script src="js/modernizr-2.6.2.min.js"></script>
  64. <script src="js/checkdiff.js"></script>
  65. </head>
  66. <body>
  67. <!-- Menu navbar -->
  68. <header>
  69. <div class="container-fix" >
  70. <div class="h-left" >
  71. <h1><i class="fas fa-cloud" ></i> $station.location </h1>
  72. <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>
  73. <?php
  74. echo "<h2>Climate Summary for \$title</h2>";
  75. ?>
  76. <p><i class="far fa-clock" ></i> $current.dateTime $current.dateTime.format("%Z")</p>
  77. <p id="freshweather" class="m-orange"></p>
  78. <script>
  79. window.onload = checkDiff("$current.dateTime ($current.dateTime.format('%Z'))");
  80. </script>
  81. </div>
  82. <div class="h-right" >
  83. <table>
  84. <tr><td><b>Station:</b></td><td>$station.hardware</td></tr>
  85. <tr><td><b>Software:</b></td><td><a href="http://weewx.com/" target="_blank" >WeeWX v$station.version</a></td></tr>
  86. <tr><td><b>Weewx uptime:</b></td><td>$station.uptime</td></tr>
  87. <tr><td><b>Server uptime:</b></td><td>$station.os_uptime</td></tr>
  88. </table>
  89. </div>
  90. <nav>
  91. <ul class="topnav" id="myTopnav">
  92. <li class="icon"><a href="javascript:void(0);" onclick="myFunction()"><i class="fas fa-bars" ></i></a></li>
  93. <li><a href="/" >Current</a></li>
  94. <li><a href="week.html" >Week</a></li>
  95. <li><a href="month.html" >Month</a></li>
  96. <li><a href="year.html" >Year</a></li>
  97. <li class="active" ><a href="summary.html" >Summaries</a></li>
  98. <li><a href="about.html" >About</a></li>
  99. <li><a href="RSS/weewx_rss.xml" ><i class="fas fa-rss" ></i></a></li>
  100. #if $Extras.has_key('twitter_url')
  101. <li><a href=$Extras.twitter_url><i class="fab fa-twitter" ></i></a></li>
  102. #end if
  103. </ul>
  104. </nav>
  105. </div>
  106. </header>
  107. <!-- Main container -->
  108. <div class="main" >
  109. <div class="container" >
  110. <div class="center" >
  111. <div class="card">
  112. <?php
  113. if(file_exists(\$report)){
  114. echo "<pre class=\"noaareport\">";
  115. echo file_get_contents(\$report);
  116. echo "</pre>";
  117. }
  118. ?>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <footer>
  124. <div style="text-align:center">
  125. #if $Extras.has_key('you')
  126. <i class="fab fa-pied-piper-pp"> </i><a href=mailto:$Extras.email> $Extras.you</a>
  127. #end if
  128. &sdot;
  129. Copyright <i class="far fa-copyright"></i> $latest.dateTime.format("%Y")
  130. <br>
  131. Sofaskin by <a href="http://neoground.com">Neoground</a>
  132. &sdot;
  133. CW9009 Version by <a href="http://www.centuryfarmweather.com">Century Farm Weather</a>
  134. &sdot;
  135. Powered by<i class="fas fa-cog fa-spin fa-fw" aria-hidden="true"></i><a href="http://weewx.com/" target="_blank">WeeWX</a>
  136. </div>
  137. </footer>
  138. #if $Extras.has_key('googleAnalyticsId')
  139. <!-- Global site tag (gtag.js) - Google Analytics -->
  140. <script async src="https://www.googletagmanager.com/gtag/js?id=$Extras.googleAnalyticsId"></script>
  141. <script>
  142. window.dataLayer = window.dataLayer || [];
  143. function gtag(){dataLayer.push(arguments);}
  144. gtag('js', new Date());
  145. gtag('config', '$Extras.googleAnalyticsId');
  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>