SP Weather Module - Joomla! Forum - community, help and support
hello everyone,
i getting head around php being self taught, taking while
anyway... have installed sp weather module have come across problem. display wind speed in mph temperature in celcius.
the module allows select imperial or metric settings can't, without editing code, adapt want do.
i've had in code need help. know how can this?
kind regards
james
i getting head around php being self taught, taking while
anyway... have installed sp weather module have come across problem. display wind speed in mph temperature in celcius.
the module allows select imperial or metric settings can't, without editing code, adapt want do.
i've had in code need help. know how can this?
kind regards
james
hi everyone,
just been looking @ again still can't head around it. below code, know how can fix problem?
just been looking @ again still can't head around it. below code, know how can fix problem?
code: select all
<?php
// no direct access
defined( '_jexec' ) or die( 'restricted access' );
$location = (trim($params->get('locationtranslated'))=='') ? $params->get('location') : $params->get('locationtranslated');
$forecast = $data['forecast'];
$data = $data['query']['results']['rss']['channel'];
?>
<div id="weather_sp1_id<?php echo $moduleid; ?>" class="weather_sp1">
<div class="weather_sp1_c">
<div class="weather_sp1_cleft">
<img class="spw_icon_big" src="<?php echo $helper->icon( $data['item']['condition']['code'] ) ?>" title="<?php
echo $helper->txt2lng($data['item']['condition']['text']);
?>" alt="<?php echo $helper->txt2lng($data['item']['condition']['text']); ?>" />
<br style="clear:both" />
<p class="spw_current_temp">
<?php if ($params->get('tempunit')=='f') { ?>
<?php echo $data['item']['condition']['temp']. jtext::_('sp_weather_f'); ?>
<?php } else { ?>
<?php echo $data['item']['condition']['temp']. jtext::_('sp_weather_c'); ?>
<?php } ?>
</p>
</div>
<div class="weather_sp1_cright">
<?php if($params->get('city')==1) { ?>
<p class="weather_sp1_city"><?php echo $location ?></p>
<?php } ?>
<?php if($params->get('condition')==1) { ?>
<div class="spw_row"><?php
echo $helper->txt2lng($data['item']['condition']['text']); ?></div>
<?php } ?>
<?php if($params->get('humidity')==1) { ?>
<div class="spw_row"><?php echo jtext::_('sp_weather_humidity'); ?>: <?php echo $helper->numeric2lang($data['atmosphere']['humidity']); ?>%</div>
<?php } ?>
<?php if($params->get('wind')==1) { ?>
<div class="spw_row"><?php echo jtext::_('sp_weather_wind'); ?>: <?php
$compass = array('n', 'nne', 'ne', 'ene', 'e', 'ese', 'se', 'sse', 's', 'ssw', 'sw', 'wsw', 'w', 'wnw', 'nw', 'nnw', 'n');
$data['wind']['direction'] = $compass[round($data['wind']['direction'] / 22.5)];
echo jtext::_($data['wind']['direction']) . jtext::_('sp_weather_at') . $helper->numeric2lang($data['wind']['speed']) . ' ' . jtext::_(strtoupper($data['units']['speed'])); ?></div>
<?php } ?>
</div>
<div style="clear:both"></div>
</div>
<div style="clear:both"></div>
<?php if ($params->get('forecast')!='disabled') { ?>
<div class="weather_sp1_forecasts">
<?php
$fcast = (int) $params->get('forecast');
$j = 1;
unset($forecast[0]);
foreach($forecast $i=>$value )
{
if($fcast<$j) break;
if ($params->get('tmpl_layout')=='list') { ?>
<div class="list_<?php echo ($i%2 ? 'even' : 'odd') ?>">
<span class="weather_sp1_list_day"><?php
echo $helper->txt2lng($value['day']); ?></span>
<span class="weather_sp1_list_temp"><?php
echo $helper->convertunit( $value['low'], $data['units']['temperature']) . ' ' . $params->get('separator') . ' ' . $helper->convertunit( $value['high'], $data['units']['temperature']); ?></span>
<span class="weather_sp1_list_icon"><img class="spw_icon" src="<?php
echo $helper->icon( $value['code'] ); ?>" align="right" title="<?php
echo $helper->txt2lng( $value['text'] );
?>" alt="<?php echo $helper->txt2lng($value['text']); ?>" /></span>
<div style="clear:both"></div>
</div>
<?php } else { ?>
<div class="block_<?php echo ($i%2 ? 'even' : 'odd') ?>" style="float:left;width:<?php echo round(100/$fcast) ?>%">
<span class="weather_sp1_day"><?php
echo $helper->txt2lng($value['day']); ?></span>
<br style="clear:both" />
<span class="weather_sp1_icon"><img class="spw_icon" src="<?php echo $helper->icon( $value['code'] ); ?>" title="<?php
echo $helper->txt2lng($value['text']);
?>" alt="<?php
echo $helper->txt2lng($value['text']);
?>" />
</span><br style="clear:both" />
<span class="weather_sp1_temp"><?php
echo $helper->convertunit( $value['low'], $data['units']['temperature']) . ' ' . $params->get('separator') . ' ' . $helper->convertunit( $value['high'], $data['units']['temperature']);
?></span>
<br style="clear:both" />
</div>
<?php } ?>
<?php
$j++;
} ?>
</div>
<?php } ?>
<div style="clear:both"></div>
</div>
Comments
Post a Comment