Esempio n. 1
0
        $pos_index = strpos($string_url, 'index');
        if ($pos_index > 0) {
            $last_pos = $pos_end;
            continue;
        }
        // skip urls to other parts, we only need urls to areas
        $string_url = str_replace('<a class="" href="', '', $string_url);
        list($url, $name) = explode('">', $string_url);
        # echo '<pre> $url= '.$url.' $name= '.$name."</pre> \n ";
        $arrLocation[] = array('location' => $name, 'url' => $url);
        $last_pos = $pos_end;
    }
    if (!file_put_contents($cacheFileName, serialize($arrLocation))) {
        exit('ERROR FATAL module ec_print_aqhi.php (' . __LINE__ . '): Could not save ' . $cacheFileName . '. Please make your cache directory writable.<br />Program ended.');
    } else {
        ws_message('<!-- module ec_print_aqhi.php (' . __LINE__ . '): ' . $cacheFileName . ' saved to cache-->');
    }
}
$url = '';
for ($n = 0; $n < count($arrLocation); $n++) {
    $location = $arrLocation[$n]['location'];
    $compare = mb_strtolower($location, 'UTF-8');
    if ($aqhiArea == $compare || $aqhiArea_f == $compare) {
        $page = 'http://weather.gc.ca' . $arrLocation[$n]['url'];
        break;
    }
}
/*
echo '<pre>
$location       = '.$location.'
$compare        = '.$compare.'
Esempio n. 2
0
        $string2 = '';
        // the immages
        foreach ($sideArrHwSw as $key => $arr) {
            $string1 .= '<td ' . $styleTd . '><p>' . $arr['name'] . '<br />' . $arr['alt'] . '</p></td>' . PHP_EOL;
            $string2 .= '<td ' . $styleTd . '><p>
  <a href="' . $arr['link'] . '" target="_blank">';
            if ($doIcons == 'yes') {
                if ($arr['icon'] != '') {
                    $string2 .= '
   <img ' . $styleImg . ' src="' . $arr['icon'] . '" title="' . $arr['alt'] . '" alt="' . $arr['alt'] . '"/>';
                }
            }
            $string2 .= '
  </a>
</p></td>' . PHP_EOL;
        }
        // eo for
        echo '<h3 class="blockHead">' . $headString . '</h3>
<table class="genericTable">
<tr>' . PHP_EOL . $string1 . '</tr>
<tr>' . PHP_EOL . $string2 . '</tr>
</table>' . PHP_EOL;
        unset($sideArrHwSw);
        echo '</div>' . PHP_EOL;
    } else {
        ws_message('<!-- module wsBottom.php (' . __LINE__ . '): no equipment found to display -->');
    }
}
// end equipment
# ----------------------  version history
# 3.20 2015-09-12 release 2.8 version
Esempio n. 3
0
<script type="text/javascript" src="javaScripts/swfobject.js"></script>
<div class="blockDiv" style="overflow:hidden; ">
<h3 class="blockHead"><?php 
echo langtransstr('Live Data') . ' ' . langtransstr('from Weather-Underground') . '. ' . $link;
?>
</h3>
<div style= "width: <?php 
echo $wulWidth;
?>
; padding: 5px; margin: 0px auto;">
  <div id="wulContent">
<?php 
if (!isset($flash_replaced) && !isset($conflictSteel)) {
    $flash_replaced = true;
    $script = 'gauges/gauge_no_flash.php';
    ws_message('<!-- module WU_Live.php (' . __LINE__ . '): loading ' . $script . ' -->');
    include $script;
    echo '</br />
<p style="text-align: center;"><small>No FLASH-support found in your browser.   Weather-Underground-live display is replaced with Steelseries</small></p>
';
} else {
    echo '<b>Weather-Underground</b><br />can not be run, no Flash support available';
}
?>
  </div>
</div>
   <script type="text/javascript">
    swfobject.embedSWF("<?php 
echo $myUrl;
?>
", "wulContent", "<?php 
Esempio n. 4
0
# generate the td's to output later.
$max_cities = 1;
foreach ($my_metars as $key => $arr) {
    $line1 .= '<th class="blockHead" style="width:' . $width . '; "><small>' . $my_metars[$key]['name'] . '</small> ';
    if ($link_forecast != false) {
        $line1 .= '
<a href="' . $link_forecast . '&amp;lang=' . $lang . '&amp;city=' . $my_metars[$key]['key'] . $skiptopText . '">
<span style="float: right;"><img src="./img/submit.png" style="margin:1px; vertical-align: middle;" alt="more information" title="more information">&nbsp;</span></a> ';
    }
    $line1 .= '</th>' . PHP_EOL;
    $line2 .= '<td style="text-align: center;">' . ws_commontemp_color($my_metars[$key]['temp']) . '&nbsp;&nbsp;<img src="./' . $my_metars[$key]['iconurl'] . '" alt=" " style="width: 28px; vertical-align: bottom;"/></td>' . PHP_EOL;
    $line3 .= '<td style="text-align: center;">' . $my_metars[$key]['desc'] . '</td>' . PHP_EOL;
    $max_cities++;
    if ($max_cities > $number_cities) {
        break;
    }
}
# echo all data now
echo '<!-- dash_metar.php -->
<div class="blockDiv">
<h3 class="blockHead">', langtransstr('The weather in interesting cities nearby') . '</h3>' . PHP_EOL;
ws_message('<!-- module dash_metar.php (' . __LINE__ . '): loaded ' . $number_cities . ' ccn using METAR in ' . $seconds_metar . ' seconds -->', true);
echo '<table class="" style="width: 100%;">
<tr>' . PHP_EOL . $line2 . '</tr>
<tr style="">' . PHP_EOL . $line3 . '</tr>
<tr style="height: 16px;">' . PHP_EOL . $line1 . '</tr>
</table>
</div>
<!-- end of dash_metar.php -->' . PHP_EOL;
# ----------------------  version history
# 3.20 2015-08-26 release 2.8 version
Esempio n. 5
0
$uomBackup = array();
$uomBackup['uomTemp'] = $SITE['uomTemp'];
$uomBackup['uomBaro'] = $SITE['uomBaro'];
$uomBackup['uomWind'] = $SITE['uomWind'];
$uomBackup['uomRain'] = $SITE['uomRain'];
$uomBackup['uomSnow'] = $SITE['uomSnow'];
$uomBackup['uomDistance'] = $SITE['uomDistance'];
$uomBackup['uomPerHour'] = $SITE['uomPerHour'];
$uomBackup['uomHeight'] = $SITE['uomHeight'];
if (!isset($SITE['fctOrg'])) {
    $SITE['fctOrg'] = 'yahoo';
}
$SITE['fctOrgBackup'] = $SITE['fctOrg'];
#
if ($SITE['cookieSupport'] == true) {
    ws_message('<!-- module wsLoadSettings.php (' . __LINE__ . '): loading wsCookie.php   -->', false, $pathString);
    include 'wsCookie.php';
}
$uomTemp = $SITE['uomTemp'];
$uomBaro = $SITE['uomBaro'];
$uomRain = $SITE['uomRain'];
$uomSnow = $SITE['uomSnow'];
$uomDistance = $SITE['uomDistance'];
$uomWind = $SITE['uomWind'];
$uomPerHour = $SITE['uomPerHour'];
$uomHeight = $SITE['uomHeight'];
# set the Timezone abbreviation automatically based on $SITE['tz'];
if (!function_exists('date_default_timezone_set')) {
    putenv("TZ=" . $SITE['tz']);
} else {
    date_default_timezone_set($SITE['tz']);
Esempio n. 6
0
$ecForecast = $weather->getWeatherData($SITE['caProvince'], $SITE['caCityCode']);
#
# echo '<pre>'; print_r($ecForecast); echo '</pre>'; exit;
#
if (!isset($ecForecast['warnings']['maxType'])) {
    ws_message('<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): no warnings  retrieved -->');
    return;
}
if ($ecForecast['warnings']['maxType'] == -1) {
    $warnings = false;
} else {
    $warnings = true;
}
if (!$warnings && !$SITE['warningGreen']) {
    // there are no warnings more severe than green and we do not display them either
    ws_message('<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): no warnings in order and no green box needed  -->');
    return;
}
if (!$warnings && $SITE['warningGreen']) {
    // there are no warnings more severe than green but we need to display them
    $wrnStrings .= '<!-- module ' . $warnScriptName . ' (' . __LINE__ . '): no warnings in order -->
<div class="warnBox" style="background-color:  ' . $wrn_green_color . '">			
	<p style="font-weight: bold; margin: 2px 0px 2px 0px; min-height: 0px;">' . langtransstr('There are no warnings in order') . '</p>
</div>
<!-- end warnings -->' . PHP_EOL;
    return;
}
if (!isset($SITE['pages']['ec_print_warn'])) {
    $warn_link = '<a href="' . $ecForecast['warnings']['url'] . '" target="_blank">';
} else {
    if (!isset($skiptopText)) {
# load the settings
$script = 'ec_settings.php';
ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): loading ' . $script . ' -->');
include $script;
# get the data from the weather class
if (!isset($ecForecast)) {
    // check first if the script is already loaded (for warnings) so the class = OK
    $script = 'ec_fct_create_arr.php';
    ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): loading ' . $script . ' -->');
    include_once $script;
    $weather = new ecPlainWeather();
}
$ecForecast = $weather->getWeatherData($caProvince, $caCityCode);
if (!is_array($ecForecast)) {
    ws_message('<!-- module ec_fct_generate_html.php (' . __LINE__ . '): no good data returned, script ends -->', true);
    ws_message('Module ec_fct_generate_html.php (' . __LINE__ . '): No good data - ending script');
    return false;
}
#echo '<pre>'; print_r ($ecForecast); echo '</pre>';
#-------------------------------------------------------------------------------
# now we generate the html to be used for output to the screen
#
$fileTime = $ecForecast['information']['fileTimeStamp'];
$line1 = 'Environment Canada ' . langtransstr('forecast for') . ':&nbsp;' . $yourArea;
$line2 = '&nbsp;&nbsp;' . langtransstr('Updated') . ':&nbsp;' . ecLongDate($fileTime) . ' - ' . date($timeFormat, $fileTime);
# These are the first  line(s) on the one page city forecast
$stringTop = '<div style="text-align: center;">' . $line1 . $line2 . '</div>';
#
# the icons
$tdWidth = floor(100 / $topCount) . '%';
$daypart = $icon = $PoP = $desc = $tempLow = $tempHigh = '    <tr>' . PHP_EOL;
Esempio n. 8
0
            echo $echo . '</div>';
            return;
            // back to index.php as there is a fatal error
        }
        if ($count_errors == 0) {
            $this_grp = $next_grp;
            // display next step as there are no errors
        } else {
            $already_loaded = true;
            // because of errors display same step again
        }
    }
}
if ($already_loaded != true) {
    // load settings  for this step
    ws_message('<!-- module configure_page.php (' . __LINE__ . '): loading ' . $configure_load . ' -->');
    $result = (include $configure_load);
    if ($result == false) {
        echo $echo . '</div>';
        return;
        // back to index.php as there is a fatal error
    }
}
#
if ($generate == false) {
    # print a group of questions
    if ($conf_debug) {
        echo '<pre>' . print_r($form, true) . '</pre>';
    }
    #
    $footer = 'Settings for' . ':&nbsp;' . $organ . '&nbsp;&nbsp;(region: ' . $region . ' -  program: ' . $wp . ') Questions: ' . $process;
Esempio n. 9
0
$this_datasource = $SITE['meteowareFile'] . '?lang=' . $lang . '&wp=' . $SITE['WXsoftware'] . '&refresh=' . $this_time . '&key=nokey';
# ---------------------------------------------------------------------------------------
?>
<div class="blockDiv">
<h3 class="blockHead"><?php 
echo langtransstr('Live weatherdata from');
?>
 Meteoware</h3> 
<div style="background-color: #FAFAFA; height: 500px; overflow: hidden;"> 
	<div id="mwlwidget" style="">
<?php 
if (!isset($flash_replaced) && !isset($conflictSteel)) {
    $flash_replaced = true;
    echo '<br />' . PHP_EOL;
    $script = 'gauges/gauge_no_flash.php';
    ws_message('<!-- module wsMWlive_v3.php (' . __LINE__ . '): loading ' . $script . ' -->');
    include $script;
    echo '</br /></br />
<p style="text-align: center;"><small>No FLASH-support found in your browser.  Meteoware display is replaced with Steelseries</small></p>
';
} else {
    echo '<b>Meteoware</b><br />can not be run, no Flash support available';
}
?>
	</div>
</div>
</div>
<script type="text/javascript" src="javaScripts/swfobject.js"></script>
<script type="text/javascript">
        var flashVars = {  
        	datasource:  "<?php 
Esempio n. 10
0
 private function makeRequest()
 {
     global $SITE;
     $test = false;
     if ($test) {
         ws_message('<!-- module ec_fct_create_arr.php (' . __LINE__ . '): test file ./canada/test2.xml loaded ', true);
         $this->rawData = file_get_contents('./canada/test2.xml');
         return;
     }
     ws_message('<!-- module ec_fct_create_arr.php (' . __LINE__ . '):  CURL will be executed for: ' . $this->weatherApiUrl . ' -->');
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_URL, $this->weatherApiUrl);
     curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
     curl_setopt($ch, CURLOPT_TIMEOUT, 60);
     #		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $SITE['curlFollow']);
     $this->rawData = curl_exec($ch);
     curl_close($ch);
     #		echo '<!-- '.$this->weatherApiUrl .' -->'.PHP_EOL;
     #		echo '<!-- '.$this->rawData .' -->'.PHP_EOL; exit;
     if (empty($this->rawData)) {
         return false;
     }
     $search = array('Service Unavailable', 'Error 504', 'Error 503', 'HTTP Error 404', 'Page Not Found');
     $error = false;
     for ($i = 0; $i < count($search); $i++) {
         $int = strpos($this->rawData, $search[$i]);
         if ($int > 0) {
             $error = $search[$i];
             break;
         }
     }
     if ($error === false) {
         return true;
     } else {
         ws_message('<h3> module ec_fct_create_arr.php (' . __LINE__ . '): ERROR ' . $error . '  when loading forecast from url: ' . $this->weatherApiUrl . '</h3>', true);
         return false;
     }
 }
Esempio n. 11
0
                $long_text .= langtransstr('Calm') . ' ';
                $dirlabel = 'calm';
            }
            // eo wind_speed
            if (isset($mtr['gust_speed'])) {
                $speed = round(wsConvertWindspeed($mtr['wind_speed_kt'], 'kts', $SITE["uomWind"]), $SITE["decWind"]);
                $long_text .= '<br />' . langtransstr('Gust to') . ' ' . $speed . $SITE["uomWind"];
            }
            // eo gust
            $mtr['wind_text'] = $long_text;
            ws_message('<!-- module metarDisplay.php (' . __LINE__ . '):' . ' ' . $key . '  = ' . $long_text . ' -->');
        }
        // eo wind
    }
    // end clean up, translate etc
    ws_message('<!-- module metarDisplay.php (' . __LINE__ . '):' . print_r($mtr, true) . '  -->');
    // time to format the output for display
    if ($thisCol >= $maxCols) {
        echo '</tr>' . PHP_EOL;
        echo '<tr><td colspan="' . $maxCols . '"></td></tr>' . PHP_EOL;
        echo '<tr>' . PHP_EOL;
        $thisCol = 0;
    }
    echo '<td style="vertical-align:top; text-align: center; ">
<table  class="genericTable">
  <tr class="row-dark"><th colspan="2" class="blockHead">' . $mtrICAO . ' - ' . $mtrName;
    if ($mtrDistanceM != '' and $mtrDistanceK != '') {
        echo '<br/>' . langtransstr('Distance from station') . ': ';
        if ($direction != '') {
            echo ' ' . langtransstr($direction) . ' ';
        }
Esempio n. 12
0
    // file with userdata
    if (file_exists($file)) {
        // if file was found
        $filestring = file_get_contents($file);
        ws_message('<!-- module wsFooter.php (' . __LINE__ . '): visited pages (' . $file . ') loaded -->');
        $arrVisits = unserialize($filestring);
    }
    $page = $SITE['pageRequest'];
    if (!isset($arrVisits[$page])) {
        $arrVisits[$page] = 0;
    }
    $arrVisits[$page]++;
    $filestring = serialize($arrVisits);
    file_put_contents($file, $filestring, LOCK_EX);
    ws_message('<!-- module wsFooter.php (' . __LINE__ . '): visited pages (' . $file . ') saved -->');
    ws_message('<!-- module wsFooter.php (' . __LINE__ . '): ' . print_r($arrVisits, true) . ' -->');
}
// eo pages visited
#---------------------------------------------------------------------------
$credit = langtransstr('Scripts from') . ': <a href="http://leuven-template.eu/index.php?lang=' . $lang . '" target="_blank">Leuven-Template</a>  (' . $versionFooter . ') | ' . PHP_EOL;
$program = langtransstr('Weather program') . ': <a href="' . $SITE['WXsoftwareURL'] . '" target="_blank">' . $SITE['WXsoftwareLongName'] . '</a>' . PHP_EOL;
# now we generate the foorter html as a string
#
$strFooter = '<div id="footer" class="blockDiv" >
<div style="float: left;" >
  <a href="#' . $back_top . '" title="Goto Top of Page"><img src="ajaxImages/toparrow.gif" alt=" " style="border: 0px;"></a>
</div>
<!--  copyright - links to software used    -->
&copy; ' . gmdate("Y", time()) . ' ' . $SITE['organ'] . ' | ' . $credit . $program;
#
if (isset($ws['wsVersion']) && $ws['wsVersion'] != '' && $ws['wsVersion'] != '--' && $ws['wsVersion'] != '---' && trim($ws['wsVersion']) != '') {
Esempio n. 13
0
# 3.20 2015-07-19 release 2.8 version
#-------------------------------------------------------------------------------
if (!isset($SITE)) {
    echo "<h3>invalid call to script {$pageName}</h3>";
    exit;
}
$SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
$pageFile = basename(__FILE__);
// check to see this is the real script
if ($pageFile != $pageName) {
    $SITE['wsModules'][$pageFile] = 'this file loaded instead of ' . $pageName;
}
ws_message('<!-- module ' . $pageFile . ' ==== ' . $SITE['wsModules'][$pageFile] . ' -->');
#-----------------------------------------------------------------------
$arrFct = array();
$arrFct['metno'] = 'ws_metno_page';
$arrFct['yahoo'] = 'yahooForecast2';
$arrFct['wu'] = 'wu_fct_page';
$arrFct['wxsim'] = 'wsWxsimPrintFull';
$arrFct['yrno'] = 'ws_yrno_page';
$arrFct['noaa'] = 'noaa_full_page';
$arrFct['ec'] = 'ec_print_fct';
$arrFct['hwa'] = 'hwaFullPage';
# yowindow
$fct_org = $SITE['fctOrg'];
$fct_page = $arrFct[$fct_org];
$fct_link = $menuArray[$fct_page]['link'];
ws_message('<!-- module wsForecast.php (' . __LINE__ . '): loading ' . $fct_link . ' -->');
include $fct_link;
# ----------------------  version history
# 3.20 2015-07-19 release 2.8 version
Esempio n. 14
0
}
$graphHumMin = $graphHumMax - $graphNrLines * $graphhumStep;
$humMax = $humMax + $graphhumStep;
$humMin = $humMin - $graphhumStep;
$stringY .= 'hum max: ' . $graphHumMax . ' hum min: ' . $graphHumMin . PHP_EOL;
#
if ($graphWindMax < $graphNrLines) {
    $graphWindMax = $graphNrLines;
}
$graphWindStep = ceil($graphWindMax / $graphNrLines);
$graphWindMax = $graphNrLines * $graphWindStep;
$windMax = $graphWindMax;
$graphWindMax = $graphWindMax * 2;
$graphWindStep = $graphWindStep * 2;
$stringY .= 'wind max: ' . $graphWindMax . ' wind step: ' . $graphWindStep . PHP_EOL;
ws_message('<!-- module wuforecast3.php (' . __LINE__ . '): ' . PHP_EOL . $stringY . '-->');
#
$graphDaysString = '{';
$daysShort = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
$daysLong = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
for ($i = 0; $i < count($daysShort); $i++) {
    $graphDaysString .= "'{$daysShort[$i]}':'" . wswufcttransstr($trans . $daysLong[$i]) . "',";
}
$graphDaysString = substr($graphDaysString, 0, strlen($graphDaysString) - 1);
$graphDaysString .= '}';
$graphsStart = 1000 * ($graphsStart + 6 * 3600 + $utcDiff);
$graphsStop = 1000 * ($graphsStop + 18 * 3600 + $utcDiff);
$n = $end - 1;
$ddays = '';
#
for ($i = 0; $i < count($graphsDays); $i++) {
Esempio n. 15
0
function yrnobeaufort($wind, $usedunit = '')
{
    global $wsDebug;
    $beaufort = array();
    // return array with nr - color - text
    $colors = array("transparent", "transparent", "transparent", "transparent", "transparent", "transparent", "#FFFF53", "#F46E07", "#F00008", "#F36A6A", "#6D6F04", "#640071", "#650003");
    $texts = array("Calm", "Light air", "Light breeze", "Gentle breeze", "Moderate breeze", "Fresh breeze", "Strong breeze", "Near gale", "Gale", "Strong gale", "Storm", "Violent storm", "Hurricane");
    if ($usedunit != '' && $usedunit != 'kts') {
        // convert windspeed
        $wind = yrnoconvertwind($wind, $usedunit, 'kts');
    }
    $windkts = $wind * 1.0;
    #
    switch (TRUE) {
        // return a number for the beaufort scale based on wind in knots
        case $windkts < 1:
            $beuafortnr = 0;
            break;
        case $windkts < 4:
            $beuafortnr = 1;
            break;
        case $windkts < 7:
            $beuafortnr = 2;
            break;
        case $windkts < 11:
            $beuafortnr = 3;
            break;
        case $windkts < 17:
            $beuafortnr = 4;
            break;
        case $windkts < 22:
            $beuafortnr = 5;
            break;
        case $windkts < 28:
            $beuafortnr = 6;
            break;
        case $windkts < 34:
            $beuafortnr = 7;
            break;
        case $windkts < 41:
            $beuafortnr = 8;
            break;
        case $windkts < 48:
            $beuafortnr = 9;
            break;
        case $windkts < 56:
            $beuafortnr = 10;
            break;
        case $windkts < 64:
            $beuafortnr = 11;
            break;
        default:
            $beuafortnr = 12;
            break;
    }
    // eo switch
    $beaufort[] = $beuafortnr;
    $beaufort[] = $colors[$beuafortnr];
    $beaufort[] = $texts[$beuafortnr];
    ws_message('<!-- module yrnosettings.php (' . __LINE__ . '): yrnobeaufort in = windspeed: ' . $wind . ' , unitFrom: ' . $usedunit . ',  nr = ' . $beaufort[0] . ' color =' . $beaufort[1] . ', text = ' . $beaufort[2] . ' -->');
    return $beaufort;
}
Esempio n. 16
0
#-------------------------------------------------------------------------------
if (!isset($SITE)) {
    echo "<h3>invalid call to script {$pageName}</h3>";
    exit;
}
$SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
$pageFile = basename(__FILE__);
// check to see this is the real script
if ($pageFile != $pageName) {
    $SITE['wsModules'][$pageFile] = 'this file loaded instead of ' . $pageName;
}
ws_message('<!-- module ' . $pageFile . ' ==== ' . $SITE['wsModules'][$pageFile] . ' -->');
# -------------------------------------Settings:      --------------------------
if (!isset($ws['img_lightning'])) {
    $script = '_my_scripts/set_links.php';
    ws_message('<!-- module thunderRadar.php (' . __LINE__ . '): loading ' . $script . ' -->');
    include $script;
}
$img_lightning = $ws['img_lightning'] . '?t=' . time();
#
$imgWidth = '925px';
// natural size 925px
$imgWidth = '100%';
#
$imgStyle = 'style="width:' . $imgWidth . '; vertical-align: bottom;"';
#
#-------------------------------------------------------------------------------
#
echo '<div class="blockDiv" style="text-align: center;">
  <h3 class="blockHead">' . langtransstr('Thunderstorms') . '<br />' . langtransstr('Go to the blitzortung.org site with a lot of extra information') . '
   <a href="http://www.blitzortung.org/Webpages/index.php?lang=' . $lang . '" target="_blank">
Esempio n. 17
0
	  <span class="ajax" id="ajaxsolarmaxtime"><?php 
    echo $vars['ajaxsolarmaxtime'];
    ?>
</span>
	</p>
<?php 
}
?>
	</div> <!-- col-solar -->
	<div class="colMiddle">
<?php 
if (!$SITE['UV']) {
    echo '	<h3 class="ajaxHead">' . langtransstr('UV Index Forecast') . '&nbsp;<a href="' . $SITE['pages']['printUV'] . '&amp;lang=' . $lang . $extraP . $skiptopText . '"><img src="./img/submit.png" style="margin:1px; vertical-align: middle;" alt="' . $more_info . '" title="' . $more_info . '"></a>' . '</h3>' . PHP_EOL;
    $skipUVhtml = true;
    $script = $SITE['uvScript'];
    ws_message('<!-- module wsAjaxDashboard_v3.php (' . __LINE__ . '): loading ' . $script . ' -->');
    include_once $script;
    if (isset($uvarray[0])) {
        echo '  <p class="rTxt" style="padding: 15px;">' . $uvarray[0]['img'] . '</p>' . PHP_EOL;
        echo '	<p class="mTxt" >';
        echo langtransstr(date('l', $uvarray[0]['unixtime']));
        echo '</p>' . PHP_EOL . '<hr />' . PHP_EOL;
        echo '	<p class="mTxt">';
        echo '<b>' . $uvarray[0]['uv'] . '</b>&nbsp;&nbsp;' . wsGetUVword($uvarray[0]['uv']);
        echo '</p>' . PHP_EOL;
    }
} else {
    if (!isset($skiptopText)) {
        $skiptopText = '#data-area';
    }
    echo '	<h3 class="ajaxHead">' . langtransstr('UV Index') . '&nbsp;<a href="' . $SITE['pages']['printUV'] . '&amp;lang=' . $lang . $extraP . $skiptopText . '"><img src="./img/submit.png" style="margin:1px; vertical-align: middle;" alt="' . $more_info . '" title="' . $more_info . '"></a>' . '</h3>' . PHP_EOL;
Esempio n. 18
0
#
# END of user SETTINGS
#-------------------------------------------------------------------------------
$caProvince = trim($SITE['caProvince']);
$caCityCode = trim($SITE['caCityCode']);
$yourArea = $SITE['yourArea'];
#
$ec_page = 'ec_print_fct';
// script name of the full page  forecast
#
if (!isset($SITE['pages'][$ec_page])) {
    $fullpage_link = false;
}
#
$script = 'ec_fct_generate_html.php';
ws_message('<!-- module ec_print_dash_fct.php (' . __LINE__ . '): loading ' . $script . ' -->');
include $script;
#
echo '<div class="blockDiv">' . PHP_EOL;
#
if ($fullpage_link == true) {
    $link = $SITE['pages'][$ec_page] . '&amp;lang=' . $lang . $extraP . $skiptopText;
    // pagenumber for full forecast page
    $javascript = '';
} else {
    $link = 'javascript:ec_hideshow(document.getElementById(\'ec_extra\'))';
    $javascript = '<script type="text/javascript">
  function ec_hideshow(which){
    if (!document.getElementById)
    return
    if (which.style.display=="block")
Esempio n. 19
0
    echo 'selects: ' . PHP_EOL;
    print_r($select_list);
    echo ' -->' . PHP_EOL;
}
#echo '<pre>areas:'.PHP_EOL; print_r($areas); echo 'selects: '.PHP_EOL; print_r($select_list); echo ''.PHP_EOL; exit;
if (isset($_GET['ec-city']) && 1.0 * $_GET['ec-city'] < $end_areas) {
    $default = 1.0 * $_GET['ec-city'];
}
list($none, $caProvince, $caCityCode, $yourArea) = explode('|', $areas[$default]);
#echo "<pre>$areas[$default] \n caProvince = $caProvince -caCityCode= $caCityCode -default= $default -yourArea = $yourArea"; exit;
#
$script = 'ec_fct_generate_html.php';
ws_message('<!-- module ec_print_fct.php (' . __LINE__ . '): loading ' . $script . ' -->');
$return = (include $script);
if ($return == false) {
    ws_message('<br />Module ec_print_fct.php (' . __LINE__ . '): No good data - ending script');
    return;
}
#
echo '<div class="blockDiv">' . PHP_EOL;
echo '<div class="blockHead" style="">';
if ($end_areas > 1) {
    echo '<div class="blockHead">
<table class="genericTable"><tr><td style="text-align: left;">
<form action="" method="get">
<fieldset style="border: 0px;">
<legend>' . langtransstr('Choose another area here') . '</legend>                
<select name="ec-city">';
    for ($n = 0; $n < $end_areas; $n++) {
        if ($n == $default) {
            $extra = 'selected="selected"';
Esempio n. 20
0
}
ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): loading fresh image -->');
$im = LoadPNG($retCodeOK, $yrTotalPng);
// load picture
if (!$retCodeOK) {
    // something went wrong, probably loading url
    ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): no good return code, up cache time 5* -->');
    if (file_exists($cacheFile) && $diff < 5 * $cacheAllowed) {
        // if it is not tooooooo old, try cache
        ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): cached image not to old -->');
        $im = $cacheFile;
        return;
    }
    ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): no good image load, returned url = ' . $im . ' -->', true);
    $im = $yrTotalPng;
    return;
}
// we correctly loaded a new picture
ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): try to save image in cache -->');
$return = imagepng($im, $cacheFile);
// than save it in the cache
if ($return) {
    $im = $cacheFile;
    ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '): image returned = ' . $im . ' -->');
    return;
}
ws_message('<!-- module yrnoavansert4.php (' . __LINE__ . '):Save to cache error - returned url = ' . $im . ' -->', true);
$im = $yrTotalPng;
return;
# ----------------------  version history
# 3.20 2015-08-02 release 2.8 version
Esempio n. 21
0
function wsChangeIcon($provider, $iconIn, &$iconOut, $iconUrlIn, &$iconUrlOut, $headerClass = '')
{
    global $SITE, $wsDebug, $pageFile, $arrLookupWU, $arrLookupYrno, $arrLookupYA, $arrLookupWorld, $arrLookupHwa, $arrLookupWd, $arrLookupNoaa, $arrLookupKDE, $arrIconsWXSIM, $arrLookupEC;
    #	default no icon change
    $iconOut = $iconIn;
    $iconUrlOut = $iconUrlIn;
    #	if we do not find the icon in the icon set we output a dunno icon
    $iconOwn = 'dunno';
    #
    switch ($provider) {
        case 'default':
            $iconOwn = $iconIn;
            $iconUrlOut = $SITE['defaultIconsDir'] . $iconIn . '.png';
            break;
        case 'hwa':
            if (isset($arrLookupHwa[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupHwa[$iconIn];
            }
            if (isset($SITE['hwaIconsOwn']) && $SITE['hwaIconsOwn'] == false) {
                // use hwa icons from cache (true) or our template icons (false)
                $iconOut = $iconOwn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            }
            break;
        case 'yahoo':
            if (isset($arrLookupYA[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupYA[$iconIn];
            }
            if (isset($SITE['yahooIconsOwn']) && $SITE['yahooIconsOwn'] == false) {
                // use yahoo icons (true) or our template icons (false)
                $iconOut = $iconOwn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            }
            break;
        case 'wu':
            if (isset($arrLookupWU[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupWU[$iconIn];
            }
            if (isset($SITE['wuIconsCache']) && $SITE['wuIconsCache'] == true) {
                // use wu icons from our cache (true) or our wu icons from wu url (false)
                $iconUrlOut = $SITE['wuIconsDir'] . $iconIn . '.gif';
            }
            if (isset($SITE['wuIconsOwn']) && $SITE['wuIconsOwn'] == false) {
                // use wu icons (true) or our template icons (false)
                $iconOut = $iconOwn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            }
            break;
        case 'yrno':
            if (isset($arrLookupYrno[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupYrno[$iconIn];
            }
            if (isset($SITE['yrnoIconsOwn']) && $SITE['yrnoIconsOwn'] == false) {
                // use yrno icons (true) or our template icons (false)
                $iconOut = $iconOwn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            } else {
                $iconUrlOut = $SITE['yrnoIconsDir'] . $iconOut . '.png';
            }
            break;
        case 'wxsim':
            if (isset($SITE['wxsimIconsOwn']) && $SITE['wxsimIconsOwn'] == true) {
                $iconOwn = $iconOut = $arrIconsWXSIM[$iconIn];
                $iconUrlOut = $SITE['wxsimIconsDir'] . $iconOut . '.png';
            } else {
                $iconOwn = $iconOut = $iconIn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOut . '.png';
            }
            break;
        case 'world':
            if (isset($arrLookupWorld[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupWorld[$iconIn];
            }
            if (isset($SITE['worldIconsOwn']) && $SITE['worldIconsOwn'] == false) {
                // use worldweather icons (true) or our template icons (false)
                $iconOut = $iconOwn;
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            }
            break;
        case 'wd':
            if (isset($arrLookupWd[$iconIn])) {
                // do we find the specified icon in our table for this iconset
                $iconOwn = $arrLookupWd[$iconIn];
            }
            // we do not use the wd icons for output as we could not find the correct icons
            $iconOut = $iconOwn;
            $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            break;
        case 'noaa':
            if (isset($arrLookupNoaa[$iconIn])) {
                $iconOwn = $arrLookupNoaa[$iconIn];
            } else {
                $iconOwn = '901';
            }
            $iconOut = $iconOwn;
            $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            break;
        case 'ec':
            if (isset($SITE['ecIconsOwn']) && $SITE['ecIconsOwn'] == true) {
                $iconOwn = $iconOut = $iconIn;
                $iconUrlOut = 'canada/ec-icons/' . $iconOut . '.gif';
            } else {
                $iconOwn = $iconOut = $arrLookupEC[(int) $iconIn];
                $iconUrlOut = $SITE['defaultIconsDir'] . $iconOut . '.png';
            }
            break;
            # kde is only used on icons page, not in other scripts
        # kde is only used on icons page, not in other scripts
        case 'kde':
            if (isset($arrLookupKDE[$iconIn])) {
                $iconOwn = $arrLookupKDE[$iconIn];
            }
            $iconOut = $iconOwn;
            $iconUrlOut = $SITE['defaultIconsDir'] . $iconOwn . '.png';
            break;
    }
    // eo switch
    #
    if ($iconOwn == 'dunno' || $wsDebug == true) {
        // if we did not find the icon we echo debug-type information
        if ($iconOwn == 'dunno') {
            $message = 'WARNING - icon unknown';
        } else {
            $message = '';
        }
        ws_message('<!-- module wsIconUrl.php (' . __LINE__ . ') function wsChangeIcon: ' . $message . ' ' . $provider . '  -  ' . $iconIn . '  -  ' . $iconOut . '  -  ' . $iconUrlIn . '  -  ' . $iconUrlOut . '  - ' . $headerClass . '     -->', true);
    }
    #
}
Esempio n. 22
0
    if ($dashboard[$iDash] == 'soil') {
        if (!$SITE['soilUsed']) {
            continue;
        }
        $script = 'soil/wsDashSoil.php';
        ws_message('<!-- module wsStartPage.php (' . __LINE__ . '): loading ' . $script . ' -->');
        include $script;
        continue;
    }
    #
    if ($dashboard[$iDash] == 'earth') {
        $script = 'wsDashEarth.php';
        ws_message('<!-- module wsStartPage.php (' . __LINE__ . '): loading ' . $script . ' -->');
        include $script;
        continue;
    }
    if ($dashboard[$iDash] == 'metars') {
        $script = 'metar/dash_metar.php';
        ws_message('<!-- module wsStartPage.php (' . __LINE__ . '): loading ' . $script . ' -->');
        include $script;
        continue;
    }
    if ($dashboard[$iDash] == 'yahoos') {
        $script = 'forecasts/dash_yahoo.php';
        ws_message('<!-- module wsStartPage.php (' . __LINE__ . '): loading ' . $script . ' -->');
        include $script;
        continue;
    }
}
# ----------------------  version history
# 3.20 2015-09-22 release 2.8 version
Esempio n. 23
0
    }
}
$end_areas = count($areas);
#
ws_message('<!-- areas:' . PHP_EOL . print_r($areas, true) . 'selects: ' . PHP_EOL . print_r($select_list, true) . ' -->');
#
# check if we have to generate a forecast for another city as the default.
if (isset($_GET['city']) && 1.0 * $_GET['city'] < $end_areas) {
    $default = 1.0 * $_GET['city'];
    $yourArea = langtransstr($select_list[$default]);
    list($none, $myLatitude, $myLongitude, $area) = explode('|', $areas[$default]);
}
#echo "<pre>$areas[$default] \n latitude = $myLatitude -longitude= $myLongitude -default= $default - area = $myArea".'<br /></pre>';
# --------------- END OF SETTINGS ----------------------------------------
$script = $myfolder . 'wuforecast3.php';
ws_message('<!-- module wu_fct_page.php (' . __LINE__ . '): loading ' . $script . ' -->');
if (!(include $script)) {
    return;
}
#
echo '<div class="blockDiv">' . PHP_EOL;
#-----------------------------------------------------------------------
if ($end_areas > 1) {
    $multi_link = $SITE['pages']['wu_fct_page'] . '&amp;lang=' . $lang . $extraP . $skiptopText;
    echo '<div class="blockHead">
<table class="genericTable"><tr><td style="text-align: left;">
<form action="' . $multi_link . '" method="get">
<fieldset style="border: 0px;">' . langtransstr('Choose another city here') . ':                
<select name="city">';
    for ($n = 0; $n < $end_areas; $n++) {
        if ($n == $default) {
Esempio n. 24
0
function load_config($Config)
{
    global $MapImage, $myLat, $myLong, $Buoys, $ImageH, $ImageW, $LegendX, $LegendY, $maxDistance, $ControlX, $ControlY;
    $rawconfig = file($Config);
    // read file into array
    if ($rawconfig == false) {
        return false;
    }
    ws_message('<!-- module ws_buoy_generate.php (' . __LINE__ . '): loading config from ' . $Config . ' -->');
    # strip comment records, build $Stations indexed array
    foreach ($rawconfig as $rec) {
        $rec = preg_replace("|\n|", "", $rec);
        $len = strlen($rec);
        if ($rec and substr($rec, 0, 1) == "#") {
            continue;
        }
        //only take non-comments
        #
        $rec .= '||||||||';
        // null defaults for missing arguments
        list($BuoyID, $BuoyName, $Coords, $Offsets, $COffsets) = explode("|", $rec . '|||');
        if ($BuoyID == 'MAPIMAGE') {
            // MAPIMAGE|Monterey_Bay.jpg|550,485|50,225|
            $MapImage = trim($BuoyName);
            $arr = explode(",", $Coords . ',');
            $ImageH = 1.0 * trim($arr[1]);
            $ImageW = 1.0 * trim($arr[0]);
            $arr = explode(",", $Offsets . ',');
            $LegendX = 1.0 * trim($arr[0]);
            $LegendY = 1.0 * trim($arr[1]);
            $arr = explode(",", $COffsets . ',');
            $ControlX = trim($arr[0]);
            $ControlY = trim($arr[1]);
            ws_message('<!-- module ws_buoy_generate.php (' . __LINE__ . '): image = ' . $MapImage . ' w=' . $ImageW . ' h=' . $ImageH . ' LX=' . $LegendX . ' LY=' . $LegendY . ' CX=' . $ControlX . ' CY=' . $ControlY . ' -->');
        } elseif ($BuoyID == 'LOCATION') {
            // LOCATION|37N|122W|750|
            $myLat = $BuoyName;
            $myLong = $Coords;
            if ($Offsets) {
                $maxDistance = $Offsets;
            }
            ws_message('<!-- module ws_buoy_generate.php (' . __LINE__ . '): location myLat=' . $myLat . ' myLong=' . $myLong . ' maxDist=' . $maxDistance . ' -->');
        } else {
            list($Left, $Top, $Right, $Bottom) = explode(",", $Coords);
            // PCOC1|Port Chicago, CA|364,155,401,170|39,-15|
            if ($Bottom) {
                // look like a coord set?
                $Buoys["{$BuoyID}"] = "{$BuoyName}\t{$Coords}\t{$Offsets}";
                // prepare for sort
                ws_message('<!-- module ws_buoy_generate.php (' . __LINE__ . '): buoy=' . $BuoyID . ' name=' . $BuoyName . ' coord=' . $Coords . ' offsets=' . $Offsets . ' -->');
            }
        }
    }
    // eo for each
    return true;
}
Esempio n. 25
0
include $script;
$weather = new yrnoDetailWeather();
$returnDetails = $weather->getWeatherDetailData($yrnoID);
unset($weather);
if (!isset($returnDetails['forecast'])) {
    $end_forecast = 0;
    ws_message('<h3>ERROR module yrnoGenerateHtml.php (' . __LINE__ . '): invalid data returned - forecast not possible </h3><br />', true);
    if (isset($returnDetails)) {
        ws_message('<pre>' . print_r($returnDetails, true) . '</pre>');
    }
    return false;
} else {
    $end_details = count($returnDetails['forecast']);
    if ($end_details < 3) {
        ws_message('<h3>ERROR module yrnoGenerateHtml.php (' . __LINE__ . '): incomplete data returned for part / all of the forecast data</h3>', true);
        ws_message('<pre>' . print_r($returnDetails, true) . '</pre>');
        return false;
    }
}
#
$rowColor = 'row-dark';
$yrnoDetailTable = '<table class="genericTable" style="width: 100%;"><tbody>' . PHP_EOL;
$yrnoDetailHead = '<tr class="table-top">
<td>' . yrnotransstr('Period') . '</td><td colspan="2">' . yrnotransstr('Forecast') . '</td>
<td>' . yrnotransstr('Temperature') . '</td><td>' . yrnotransstr('Precipitation') . '</td>
<td>' . yrnotransstr('Wind') . '</td><td>' . yrnotransstr('Pressure') . '</td>
</tr>' . PHP_EOL;
#
$now = time();
$oldDay = '';
#echo '<pre>'; print_r($returnDetails); exit;
Esempio n. 26
0
function wu_makeRequest()
{
    global $rawData, $weatherApiUrl, $errors, $wuKey;
    $string = str_replace($wuKey, '_key_', $weatherApiUrl);
    ws_message('<!-- module wuforecast3.php (' . __LINE__ . '): retrieving wu: ' . $string . ' -->');
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $weatherApiUrl);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    $rawData = curl_exec($ch);
    curl_close($ch);
    $dataOK = true;
    $pos = strpos($rawData, '<description>this key does not exist</description>');
    if ($pos != false) {
        $errors .= '<h3>Error reported by WU: this key does not exist<br />' . $weatherApiUrl . '<h3>' . PHP_EOL;
        return false;
    }
    $pos = strpos($rawData, '<error>');
    $string = substr($rawData, $pos + 8, 20);
    if ($pos != false) {
        $errors .= '<h3>Error reported by WU with text: ' . $string . '<br />' . PHP_EOL . $weatherApiUrl . '<br /> can not process more - sorry <h3>' . PHP_EOL;
        return false;
    }
    $pos = strpos($rawData, 'Internal Server Error');
    if ($pos != false) {
        $errors .= '<h3>Errors reported by WU - can not process any more - sorry <h3>' . PHP_EOL;
        $errors .= $rawData;
        return false;
    }
    $rawData = str_replace('333333', '', $rawData);
    if (trim($rawData) == '') {
        return false;
    } else {
        return true;
    }
}
Esempio n. 27
0
// #### change to exact page name
$pageVersion = '3.20 2015-09-17';
#-------------------------------------------------------------------------------
# 3.20 2015-08-26 release 2.8 version
#-------------------------------------------------------------------------------
if (!isset($SITE)) {
    echo "<h3>invalid call to script {$pageName}</h3>";
    exit;
}
$SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
$pageFile = basename(__FILE__);
// check to see this is the real script
if ($pageFile != $pageName) {
    $SITE['wsModules'][$pageFile] = 'this file loaded instead of ' . $pageName;
}
ws_message('<!-- module ' . $pageFile . ' ==== ' . $SITE['wsModules'][$pageFile] . ' -->');
#-------------------------------------------------------------------------------
# Settings:
#
$frameHeight = '1600px';
#
#-------------------------------------------------------------------------------------------------
$wnCode = $SITE['mesoID'];
//  Here the code of your Weather Network is inserted
$wnName = $SITE['mesoName'];
// and here the name of your Weahter Network
$wnScript = '../' . $SITE['mesoID'] . '-mesomap/' . $SITE['mesoID'] . '-mesomap-testpage.php';
#
if (file_exists($wnScript)) {
    $script_ok = true;
} else {
Esempio n. 28
0
} elseif ($yrnoDetailTable && $tableInTabs) {
    $tabber_needed = true;
}
#
# print version of script in the html of the generated page
#
#
if ($SITE['uomTemp'] == '&deg;C') {
    $metric = true;
} else {
    $metric = false;
}
#
#
$script = $scriptDir . 'yrnoGenerateHtml.php';
ws_message('<!-- module wsDashYrno.php (' . __LINE__ . '): loading ' . $script . ' -->');
if (!(include $script)) {
    return;
}
$styleborder = '';
$margin = ' margin: 10px 0px;';
$topWidth = ' width: ' . $defaultWidth . ';';
if ($chartsMeteogramHeight != '') {
    $chartsMeteogramHeight = 'height: ' . $chartsMeteogramHeight . ';';
}
if ($tableHeight != '') {
    $tableHeight = 'height: ' . $tableHeight . ';';
}
echo '<!-- output of wsDashYrno -->
<div class="blockDiv" style="">' . PHP_EOL;
echo '<div class="blockHead" >' . langtransstr('Weather Forecast') . ' (' . langtransstr('summary') . ')&nbsp;&nbsp;';
Esempio n. 29
0
# 3.20 2015-07-17 release 2.8 version (latest highcharts version)
#-------------------------------------------------------------------------------
if (!isset($SITE)) {
    echo "<h3>invalid call to script {$pageName}</h3>";
    exit;
}
$SITE['wsModules'][$pageName] = 'version: ' . $pageVersion;
$pageFile = basename(__FILE__);
// check to see this is the real script
if ($pageFile != $pageName) {
    $SITE['wsModules'][$pageFile] = 'this file loaded instead of ' . $pageName;
}
ws_message('<!-- module ' . $pageFile . ' ==== ' . $SITE['wsModules'][$pageFile] . ' -->');
#---------------------------------------------------------------------------------------
$script = '_my_texts/us_aqhi.php';
ws_message('<!-- module us_aqhi_dash_map.php (' . __LINE__ . '): loading ' . $script . ' -->');
include $script;
#---------------------------------------------------------------------------------------
#
# pleasae do not change below this line
#
$arr_width = array(40, 40, 40, 30, 22);
$img_html = '';
$img_height = '';
#'max-height: 180px;';
$i = 0;
$img = array();
if (isset($url_img_usa) && $url_img_usa != '' && $url_img_usa != false) {
    $now_ymd = date('Ymd', time());
    $arr = explode('*', $url_img_usa);
    $last_part = count($arr) - 1;
Esempio n. 30
0
 private function makeRequest()
 {
     global $scriptDir;
     $test = false;
     if ($test) {
         $this->rawData = file_get_contents($scriptDir . 'testDetail.xml');
         ws_message('<!-- module yrnoCreateDetailArr.php (' . __LINE__ . '): test file testDetail.xml loaded -->', true);
     } else {
         ws_message('<!-- module yrnoCreateDetailArr.php (' . __LINE__ . '): curl for: ' . $this->weatherApiUrl . ' -->');
         $this->rawData = yrnoCurl($this->weatherApiUrl);
     }
     if (empty($this->rawData)) {
         return false;
     }
     # lets check if good forecast data is retrieved
     $search = array('<weatherdata>', '<forecast>');
     for ($i = 0; $i < count($search); $i++) {
         $int = strpos($this->rawData, $search[$i]);
         if (!$int > 0) {
             return false;
         }
         // one of the needed data tags is not found => not good
     }
     # lets check for known errors
     $search = array('<message>Not found</message>', '<span><H1>Server Error', 'Service Unavailable', 'Error 504', 'Error 503');
     $error = false;
     for ($i = 0; $i < count($search); $i++) {
         $int = strpos($this->rawData, $search[$i]);
         if ($int > 0) {
             return false;
         }
     }
     return true;
 }