Example #1
0
$module_name = $module_id = false;
if ($params->get('module_ident','name')=='name') {
    $passed_module_name = JRequest::getString('module');
    if (isset($passed_module_name) && $module->title=="") $module->title = $passed_module_name;
    $module_name = $module->title;
} else {
    $passed_module_id = JRequest::getString('moduleid');
    if (isset($passed_module_id) && $module->id=="") $module->id = $passed_module_id;
    $module_id = $module->id;
}

if (isset($_REQUEST['weather_location'])) {
    $weather_location = JRequest::getString("weather_location");
} elseif (isset($_COOKIE["rokweather_location"])) {
    $weather_location = JRequest::getString("rokweather_location", '', 'COOKIE', 'STRING');
} else {
    $weather_location = $params->get("default_location","New York,NY");
}


$moduleType = ($params->get('module_ident','name')=='name') ? "module=" . $module_name : "moduleid=" . $module_id;
$url = JRoute::_( "index.php?option=com_rokmodule&tmpl=component&type=raw&".$moduleType, true);


$icon_url = JURI::base()."modules/mod_rokweather";
$output = "";

$weather = modRokWeatherHelper::getWeather($weather_location,$icon_url,$params);

require(JModuleHelper::getLayoutPath('mod_rokweather'));
Example #2
0
	                    <span class="low"><?php 
            echo modRokWeatherHelper::getFTemp($day['low'], $weather->units);
            ?>
</span> | 
	                    <span class="high"><?php 
            echo modRokWeatherHelper::getFTemp($day['high'], $weather->units);
            ?>
</span>
	                </div>
	                <div class="degc">
	                    <span class="low"><?php 
            echo modRokWeatherHelper::getCTemp($day['low'], $weather->units);
            ?>
</span> | 
	                    <span class="high"><?php 
            echo modRokWeatherHelper::getCTemp($day['high'], $weather->units);
            ?>
</span>
	                </div>
	            </div>    
	            <?php 
        }
        ?>
	        </div>
	        <?php 
    }
    ?>
        </div>
        <?php 
}
?>
Example #3
0
	        <?php if ($params->get('enable_wind')==1) : ?>
	        <div class="row"><?php echo $weather->current_wind; ?></div>
	        <?php endif; ?>
	        
			<?php if ($params->get('enable_forecast')==1): ?>
	        <div class="forecast">

			<?php
				$weather->forecast = array_slice($weather->forecast, 0, $params->get('forcast_show', 4));
			?>
		
	            <?php foreach ($weather->forecast as $day): ?>
	            <div class="day">
	                <span><?php echo $day['day_of_week']; ?></span><br />
	                   <img src="<?php echo $icon_url."/grey".$day['icon']; ?>" alt="<?php echo $day['condition']; ?>" title="<?php echo $day['condition']; ?>" /><br />
	                <div class="degf" <?php echo $degf_style; ?>>
	                    <span class="low"><?php echo modRokWeatherHelper::getFTemp($day['low'],$weather->units); ?></span> | 
	                    <span class="high"><?php echo modRokWeatherHelper::getFTemp($day['high'],$weather->units); ?></span>
	                </div>
	                <div class="degc" <?php echo $degc_style; ?>>
	                    <span class="low"><?php echo modRokWeatherHelper::getCTemp($day['low'],$weather->units); ?></span> | 
	                    <span class="high"><?php echo modRokWeatherHelper::getCTemp($day['high'],$weather->units); ?></span>
	                </div>
	            </div>    
	            <?php endforeach; ?>
	        </div>
	        <?php endif; ?>	
        <?php endif; ?>
		</div>
    </div>
</div>