Bonjour à tous, je commence à mettre le nez dans le php, un peut d'aide ne serait pas de refus.
Dans le fichier sidebar.php j'ai (entre autres) :
<h2 title="Météo à 10 jours"><a title="Meteo a 10 jours" href="http://fr.weather.com/weather/local/FRXX0294">Ma Meteo</a></h2><?php weathersb(''); ?>
Dans le fichier weather.php, j'ai (entre autres) :
function weathersb() {
$locid = get_option('weather_locid');
$parid = get_option('weather_parid');
$key = get_option('weather_key');
$ut = get_option('weather_unit');
$hum = get_option('weather_hum');
$wind = get_option('weather_wind');
$uv = get_option('weather_uv');
$icon = get_option('weather_icon');
$weather = new Weather($locid, $parid, $key);
if ($icon == 'y') { echo '<img src="wp-content/plugins/weather/'.addWeatherTerm($weather->Icon).'.png" alt="Weather Icon " align="left" />'.'<br /><br />'; }
echo $weather->Dnam . "<br />\n<span title=\"Temperature\">" . $weather->Temperature . "°".$weather->UnitTemp."</span>";
if($hum == 'y') { echo '<li>Humidite : '. $weather->Humidity. '</li>'; } #<span title="Humidity"> </span>
if($wind == 'y') { echo '<li>Vent : '. $weather->Wind . $weather->UnitSpeed .' '. $weather->Direction .'</li>'; }
if($uv == 'y') { echo '<li>Indice UV : '. $weather->UVIndex . ' ' . $weather->UVStatus .'</li><br />'; }
}
locid contient FRXX0294. Je voudrai faire appel à la fonction weathersb() pour que FRXX0294 ne soit pas inscrit en dur dans le code.
Je suis sûr que la réponse tient en une ligne, aidez moi...
Merci d'avance.