Author Topic: Saratoga template NOAA Reports  (Read 647 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Saratoga template NOAA Reports
« on: July 13, 2019, 12:39:56 AM »
Team I am using noaa reports script to gather my data and display a report.

If you go here you can see that it works just fine: https://www.txweather.org/wxsunhoursdetail.php
BUT (allways a but lol)

When I see any other details it wont display any past data except the current day IE: https://www.txweather.org/wxtempdetail.php

What is different? Why one works and the other one does not?

TIA!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Re: Saratoga template NOAA Reports
« Reply #1 on: July 13, 2019, 01:40:37 AM »
I think I know what is different.
Is this line: $filename = get_noaa_filename($year,$m,$SITE['WXsoftware'],$current_month);

This will overwrite the declaration I have for the noaa files. This makes the script thinks is not running in a Saratoga template and brakes.
If I run standalone all of the data shows correctly BUT... All I get is one wide page and not the template.

How can I overwrite that line so it can ignore SITE and WXsoftware?

To be precise here is why wxsunhourdetail works:

Code: [Select]
// Check for current year and current month

           if ($year == date("Y") && $m == ( date("n") - 1) && ((date("j") != 1 ) OR $show_today)) {

                $filename = "climatedataout.html";
                $current_month = 1;
            } else {
                $filename = "climatedataout" . ( $m + 1 ) . $year . ".html";
                $current_month = 0;
            }

            if ($current_month AND $show_today AND date("j")==1){
                $raw[$m][0][0] = $hours_today;
            } else {
                $raw[$m][0] = getclimatefile($locmc . $filename,'Sun Hours',$year,$m);
            }
                if ($current_month AND $show_today){
                    $raw[$m][0][date("j")-1] = $hours_today;                                             

            }

            }

        }

Where in wxtempdetail looks like this:

Code: [Select]
// Check for current year and current month

           if ($year == date("Y") && $m == ( date("n") - 1) && ((date("j") != 1 ) OR $show_today)) {
                $current_month = 1;
            } else {
                $current_month = 0;
            }

            $filename = get_noaa_filename($year,$m,$SITE['WXsoftware'],$current_month);

            if ($current_month AND $show_today AND date("j")==1){
                $raw[$m][0][0][8] = strip_units($dayrn);
            } else {
                $raw[$m][0] = getnoaafile($locmc . $filename,$year,$m);
            }
                if ($current_month AND $show_today){
                    $raw[$m][0][date("j")-1][8] = strip_units($dayrn);
            }
            if ($current_month AND (date("j")==2) AND ('WDxxx' == $SITE['WXsoftware'])){  // Fix for WD rain on first day of month not listed in NOAA report until the 3rd day of the month.
                if ((strip_units($yesterdayrain))>0){
                    $raw[$m][0][date("j")-2][8] = strip_units($yesterdayrain);
                }

            }
        }

sundetail has no declaration of $SITE['WXsoftware']

Ideas?

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 202
    • test site
Re: Saratoga template NOAA Reports
« Reply #2 on: July 13, 2019, 08:24:40 AM »
Idea = goto Murray for latest version http://weather.wildwoodnaturist.com/downloads.php
Imagine what you will KNOW tomorrow !

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Re: Saratoga template NOAA Reports
« Reply #3 on: July 13, 2019, 09:24:18 AM »
Idea = goto Murray for latest version http://weather.wildwoodnaturist.com/downloads.php

This is the latest version :(

Fixed. I declared: $SITE['WXsoftware']  = 'WD'; on the settings file.
« Last Edit: July 13, 2019, 09:34:57 AM by txweather.org »

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7630
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga template NOAA Reports
« Reply #4 on: July 13, 2019, 09:58:48 PM »
The $SITE['WXsoftware'] is already declared in Settings-weather.php based on the main site's weather software used (you're using Meteobridge).  Murray's scripts are for Weather-Display and use the dailynoaareport*.htm and climatedataout*.html files for data , or for Cumulus, VWS, Weatherlink, or wview (using the NOAA style text reports) -- by including it on the individual pages that use his scripts.

In any event, the proper place to 'fake' which weather software you're using is in the page that loads the scripts using the non-main software files for data. i.d. in the wx*detail.php files.
« Last Edit: July 13, 2019, 10:03:41 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Re: Saratoga template NOAA Reports
« Reply #5 on: July 13, 2019, 10:26:01 PM »
The $SITE['WXsoftware'] is already declared in Settings-weather.php based on the main site's weather software used (you're using Meteobridge).  Murray's scripts are for Weather-Display and use the dailynoaareport*.htm and climatedataout*.html files for data , or for Cumulus, VWS, Weatherlink, or wview (using the NOAA style text reports) -- by including it on the individual pages that use his scripts.

In any event, the proper place to 'fake' which weather software you're using is in the page that loads the scripts using the non-main software files for data. i.d. in the wx*detail.php files.

Thanks Ken. :) for what ever reason doing it on the detail page just wouldn't work. Maybe I didn't place it properly  but it wouldn't take hence why I came here looking for help. I have several pages I fool this way but like you say I declare it on the actual page. Once again, thanks a million Ken.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1526
    • Texas Weather
Re: Saratoga template NOAA Reports
« Reply #6 on: July 14, 2019, 01:22:40 AM »
Just to clarify I put the declaration on the noaa reports setting files not Settings.php :)

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

 

anything