Skip to content

Commit

Permalink
Fixes #17 and closes #18.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacroe committed Oct 7, 2012
1 parent 2df2db0 commit 2462156
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions alice.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ INSERT INTO `a_modules` (`name`, `value`, `lastchanged`) VALUES
('weather_hiTemp', '100', '2012-01-01 06:00:00'),
('weather_loTemp', '0', '2012-01-01 06:00:00'),
('weather_fcastToday', 'Clear', '2012-01-01 06:00:00'),
('weather_fcastTonight', 'Clear', '2012-01-01 06:00:00'),
('weather_fcastTomorrow', 'Clear', '2012-01-01 06:00:00'),
('weather_fcastTomorrowNight', 'Clear', '2012-01-01 06:00:00'),
('weather_fcastNextday', 'Clear', '2012-01-01 06:00:00'),
('weather_fcastNextdayNight', 'Clear', '2012-01-01 06:00:00'),
('weather_icon', 'sunny', '2012-01-01 06:00:00'),
('email_count', '0', '2012-01-01 06:00:00'),
('location_city', 'Hattiesburg', '2012-01-01 06:00:00');
Expand Down
7 changes: 7 additions & 0 deletions inc/templates/weather.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@
<h2>Forecast</h2>
<table class="table table-bordered table-condensed">
<tbody>
{{if $smarty.now|date_format:"%H" < 18}}
<tr><td><strong>Today</strong></td><td>{{$weather.fcastToday}}</td></tr>
{{/if}}
<tr><td><strong>Tonight</strong></td><td>{{$weather.fcastTonight}}</td></tr>
<tr><td><strong>Tomorrow</strong></td><td>{{$weather.fcastTomorrow}}</td></tr>
<tr><td><strong>Tomorrow night</strong></td><td>{{$weather.fcastTomorrowNight}}</td></tr>
{{if $smarty.now|date_format:"%H" >= 18}}
<tr><td><strong>{{$nextDay}}</strong></td><td>{{$weather.fcastNextday}}</td></tr>
{{/if}}
{{* <tr><td><strong>{{$nextDay}} night</strong></td><td>{{$weather.fcastNextdayNight}}</td></tr> *}}
</tbody>
</table>
</div>
Expand Down
7 changes: 5 additions & 2 deletions modules/weather.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ function alice_weather_get($loc)
"hiTemp"=>"{$jsonWeather->forecast->simpleforecast->forecastday[0]->high->fahrenheit}",
"loTemp"=>"{$jsonWeather->forecast->simpleforecast->forecastday[0]->low->fahrenheit}",
"fcastToday"=>"{$jsonWeather->forecast->txt_forecast->forecastday[0]->fcttext}",
"fcastTomorrow"=>"{$jsonWeather->forecast->txt_forecast->forecastday[1]->fcttext}",
"fcastNextday"=>"{$jsonWeather->forecast->txt_forecast->forecastday[2]->fcttext}",
"fcastTonight"=>"{$jsonWeather->forecast->txt_forecast->forecastday[1]->fcttext}",
"fcastTomorrow"=>"{$jsonWeather->forecast->txt_forecast->forecastday[2]->fcttext}",
"fcastTomorrowNight"=>"{$jsonWeather->forecast->txt_forecast->forecastday[3]->fcttext}",
"fcastNextday"=>"{$jsonWeather->forecast->txt_forecast->forecastday[4]->fcttext}",
"fcastNextdayNight"=>"{$jsonWeather->forecast->txt_forecast->forecastday[5]->fcttext}",
"icon"=>$icon);
}
function alice_weather_getRadar($loc)
Expand Down
2 changes: 1 addition & 1 deletion recipes/daily-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$smarty->assign("date", date('l, F j, Y '));
$smarty->assign("city", $l['city']);
$smarty->assign("state", $l['state']);
$smarty->assign("weather", $w['fcastFull']);
$smarty->assign("weather", $w['fcastToday']);
$smarty->assign("clothes", alice_clothes($w));

$body = $smarty->fetch('dailyEmail.tpl');
Expand Down

0 comments on commit 2462156

Please sign in to comment.