Example #1
0
function curweather_network_mod_init(&$fk_app, &$b)
{
    if (!intval(get_pconfig(local_user(), 'curweather', 'curweather_enable'))) {
        return;
    }
    $fk_app->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $fk_app->get_baseurl() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n";
    // the getweather file does all the work here
    // the $rpt value is needed for location
    // which getweather uses to fetch the weather data for weather and temp
    $rpt = get_pconfig(local_user(), 'curweather', 'curweather_loc');
    $wxdata = GetWeather::get($rpt);
    $temp = $wxdata['TEMPERATURE_STRING'];
    $weather = $wxdata['WEATHER'];
    $rhumid = $wxdata['RELATIVE_HUMIDITY'];
    $pressure = $wxdata['PRESSURE_STRING'];
    $wind = $wxdata['WIND_STRING'];
    $curweather = '<div id="curweather-network" class="widget">
                <div class="title tool">
                <h4>' . t("Current Weather") . '</h4></div>';
    $curweather .= "Weather: {$weather}<br />\n                 Temperature: {$temp}<br />\n\t\t Relative Humidity: {$rhumid}<br />\n\t\t Pressure: {$pressure}<br />\n\t\t Wind: {$wind}";
    $curweather .= '</div><div class="clear"></div>';
    $fk_app->page['aside'] = $curweather . $fk_app->page['aside'];
}
Example #2
0
 <?php 
require_once 'getweather.php';
$rpt = "KHVN";
$wxdata = GetWeather::get($rpt);
var_dump($rpt, $wxdata);