Guest Posted October 8, 2005 Posted October 8, 2005 Hi, Would someone be so kind as to let me know how to have a box in column right but for it to be transparent, ie with no blue background? I dont want to do it for all of the boxes just one. Any help would be appreciated. Thanks in advance.
yamthief Posted October 8, 2005 Posted October 8, 2005 Hi,Would someone be so kind as to let me know how to have a box in column right but for it to be transparent, ie with no blue background? I dont want to do it for all of the boxes just one. Any help would be appreciated. Thanks in advance. it sounds like a css thing, please can u give a little more info, maybe a link to the page or some source code?
Guest Posted October 8, 2005 Posted October 8, 2005 it sounds like a css thing, please can u give a little more info, maybe a link to the page or some source code? Sure the code im trying to include is a weather contrib ive hacked about a bit to remove stuff I dont need... <?php /* weather.php,v 1.4 2005/01/10 JeanLuc Friez Released under the GNU General Public License */ function good_char($string, $left, $right){ $debut = strpos($string, $left) + strlen($left); $longueur = strpos($string, $right) - strlen($left); $new_string = trim( substr($string, $debut, $longueur) ); return $new_string; } ?> <!-- weather //--> <tr> <td> <?php // array for texts and icones $climat = array ( "Partiellement nuageux/Vent"=>array( "english"=>"Clouds and Wind", "icone"=>"vent.gif", "iconeNight"=>"vent.gif") , "Soleil/Vent"=>array( "english"=>"Sun and Wind", "icone"=>"vent.gif", "iconeNight"=>"vent.gif") , "Faibles pluies"=>array( "english"=>"Light Rain", "icone"=>"lightRainShower.gif", "iconeNight"=>"showersNight.gif") , "Averses de pluie"=>array( "english"=>"Showers", "icone"=>"lightRainShower.gif", "iconeNight"=>"showersNight.gif") , "Thundershowers/Wind"=>array( "english"=>"Thundershowers/Wind", "icone"=>"lightRainShower.gif", "iconeNight"=>"showersNight.gif") , "Pluies d'orage"=>array( "english"=>"Rain and Thunderstorms", "icone"=>"lightRainShower.gif", "iconeNight"=>"showersNight.gif") , "Pluie/Tonnerre"=>array( "english"=>"Rain and Thunderstorms", "icone"=>"rain.gif", "iconeNight"=>"showersNight.gif") , "Averses"=>array( "english"=>"Showers", "icone"=>"showers.gif", "iconeNight"=>"showersNight.gif") , "Averses/Vent"=>array( "english"=>"Showers and Wind", "icone"=>"windShowers.gif", "iconeNight"=>"showersNight.gif") , "Quelques averses"=>array( "english"=>"Scattered Showers", "icone"=>"showers.gif", "iconeNight"=>"showersNight.gif") , "Showers in the Vicinity"=>array( "english"=>"Showers in the Vicinity", "icone"=>"scatteredShowers.gif", "iconeNight"=>"showersNight.gif") , "Averses passag鑽es"=>array( "english"=>"Scattered Showers", "icone"=>"scatteredShowers.gif", "iconeNight"=>"showersNight.gif") , "Scattered Showers"=>array( "english"=>"Scattered Showers", "icone"=>"showers.gif", "iconeNight"=>"showersNight.gif") , "Averses orageuses passag鑽es"=>array( "english"=>"Scattered Thundershowers", "icone"=>"scatteredThundershowers.gif", "iconeNight"=>"thunderstormsNight.gif") , "L馮鑽es averses de neige"=>array( "english"=>"Light Snow Showers", "icone"=>"lightSnowShowers.gif", "iconeNight"=>"snowNight.gif") , "Faible neige"=>array( "english"=>"Light Snow Showers", "icone"=>"SnowShowers.gif", "iconeNight"=>"snowNight.gif") , "Averses de gr麝e"=>array( "english"=>"Hail", "icone"=>"hail.gif", "iconeNight"=>"hail.gif") , "Averses de neige"=>array( "english"=>"Snow Showers", "icone"=>"snowShowers.gif", "iconeNight"=>"snowNight.gif") , "Averses de neige intermittentes"=>array( "english"=>"Snow Showers", "icone"=>"snowShowers.gif", "iconeNight"=>"snowNight.gif") , "Averses neigeuses"=>array( "english"=>"Snow Showers", "icone"=>"mixedRainAndSnow.gif", "iconeNight"=>"snowNight.gif") , "Snow Showers/Wind"=>array( "english"=>"Snow Showers/Wind", "icone"=>"windSnow.gif", "iconeNight"=>"windSnow.gif") , "Pluie/Chutes de neige"=>array( "english"=>"Mixed Rain and Snow", "icone"=>"mixedRainAndSnow.gif", "iconeNight"=>"mixedRainAndSnow.gif") , "Pluie/Neige/Vent"=>array( "english"=>"Wind, Rain and Snow", "icone"=>"windSnow.gif", "iconeNight"=>"windSnow.gif") , "Pluie/Neige"=>array( "english"=>"Mixed Rain and Snow", "icone"=>"mixedRainAndSnow.gif", "iconeNight"=>"mixedRainAndSnow.gif") , "Neige"=>array( "english"=>"Snow", "icone"=>"snow.gif", "iconeNight"=>"snowNight.gif") , "Pluie vergla軋nte"=>array( "english"=>"Showers Ice", "icone"=>"showersIce.gif", "iconeNight"=>"showersIce.gif") , "Orages isol駸"=>array( "english"=>"Isolated Thunderstorms", "icone"=>"isolatedThunderstorms.gif", "iconeNight"=>"thunderstormsNight.gif") , "Tonnerre"=>array( "english"=>"Isolated Thunderstorms", "icone"=>"isolatedThunderstorms.gif", "iconeNight"=>"thunderstormsNight.gif") , "Orages"=>array( "english"=>"Thunderstorms", "icone"=>"thunderstorms.gif", "iconeNight"=>"thunderstormsNight.gif") , "Orages intermittents"=>array( "english"=>"Thunderstorms", "icone"=>"thunderstorms.gif", "iconeNight"=>"thunderstormsNight.gif") , "L馮鑽e bruine"=>array( "english"=>"Light Drizzle", "icone"=>"lightDrizzle.gif", "iconeNight"=>"lightDrizzle.gif") , "Nuages 駱ars"=>array( "english"=>"Partly Cloudy", "icone"=>"partlyCloudy.gif", "iconeNight"=>"partlyCloudyNight.gif"), "Assez nuageux"=>array( "english"=>"Mostly Cloudy", "icone"=>"mostlyCloudy.gif", "iconeNight"=>"mostlyCloudyNight.gif") , "Nuageux"=>array( "english"=>"Cloudy", "icone"=>"cloudy.gif", "iconeNight"=>"mostlyCloudyNight.gif") , "Nuages et vent"=>array( "english"=>"Mostly Cloudy", "icone"=>"mostlyCloudy.gif", "iconeNight"=>"mostlyCloudyNight.gif") , "Ensoleill・"=>array( "english"=>"Sunny", "icone"=>"sunny.gif", "iconeNight"=>"clearNight.gif") , "Beau temps"=>array( "english"=>"Mostly Sunny", "icone"=>"mostlySunny.gif", "iconeNight"=>"clearSkyNight.gif"), "Beau temps avec du vent"=>array( "english"=>"Mostly Sunny", "icone"=>"mostlySunny.gif", "iconeNight"=>"clearSkyNight.gif"), "Pluie"=>array( "english"=>"Rain", "icone"=>"rain.gif", "iconeNight"=>"showersNight.gif") , "Fortes pluies"=>array( "english"=>"Rain", "icone"=>"rain.gif", "iconeNight"=>"showersNight.gif") , "Pluie/Vent"=>array( "english"=>"Rain and Wind", "icone"=>"rain.gif", "iconeNight"=>"showersNight.gif") , "Brouillard"=>array( "english"=>"Fog", "icone"=>"fog.gif", "iconeNight"=>"fog.gif") , "Brume"=>array( "english"=>"Misty", "icone"=>"fog.gif", "iconeNight"=>"fog.gif") , "Brume s鐵he"=>array( "english"=>"Misty", "icone"=>"misty.gif", "iconeNight"=>"misty.gif") , "Vent"=>array( "english"=>"Windy", "icone"=>"windy.gif", "iconeNight"=>"windy.gif") , "Showers Early"=>array( "english"=>"Showers Early", "icone"=>"showers.gif", "iconeNight"=>"showersNight.gif") , "Showers Late"=>array( "english"=>"Showers Late", "icone"=>"showers.gif", "iconeNight"=>"showersNight.gif") , "Ciel d馮ag・"=>array( "english"=>"Clear Sky", "icone"=>"sunny.gif", "iconeNight"=>"clearSkyNight.gif") , "D馮ag・"=>array( "english"=>"Clear Night", "icone"=>"sunny.gif", "iconeNight"=>"clearNight.gif") , "Widespread Dust"=>array( "english"=>"Widespread Dust", "icone"=>"widespreadDust.gif", "iconeNight"=>"widespreadDust.gif") , ); // array of the US towns and their "YAHOO-M騁駮" code // Modify to have others towns (see the code in http://fr.weather.yahoo.com/meteo/) //$US_towns_array = array("London"=>array("url"=>"UKXX/UKXX0085","hour"=>"CST"), //); // The array of the US towns re-arrange for the dropdown menu //$US_towns = array(); //foreach ($US_towns_array as $key => $value) { //$US_towns[] = array('id' => $value['url'], 'text' => $key ); //} // We get the parameters of URLs of the page we are $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') && ($key != 'choix_ville') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } // Check if a town has been choose and if the 'weather_session' exists else we choose the default town (Washington, DC below) - Change it if you want other if(!isset($choix_ville) && !tep_session_is_registered('weather_session')) $choix_ville = 'UKXX/UKXX0085'; // if there is an other form working than 'weather' if(!isset($choix_ville) && tep_session_is_registered('weather_session')) $choix_ville = $weather_session['choix_ville_session']; // get the hour code of the choosen town (EST, PST, AKT, MST...) foreach ($US_towns_array as $key => $value) { if ( $value['url'] == $choix_ville) { $hour_code = $value['hour']; } } if ( tep_session_is_registered('weather_session') && $choix_ville == $weather_session['choix_ville_session'] ) { // If no changes in the weather_box, we take the data in the session (So just 1 query by session in the Yahoo site if the visitor doesn't choose another town in the box) $info_box_contents = array(); //$info_box_contents[] = array('text' => BOX_HEADING_WEATHER_BOX . $weather_session['ville']); //new infoBoxHeading($info_box_contents, false, false); $weather_string = $weather_session['ville'] . ':'; //$weather_string .= $weather_session['etat'][$language] . '<br>'; if ($weather_session['night'] == false) { //Test to know which icone we must take (day or night) $weather_string .= tep_image(DIR_WS_IMAGES . 'weather/' . $weather_session['etat']['icone'], $weather_session['etat'][$language]) . '<br>'; } else { $weather_string .= tep_image(DIR_WS_IMAGES . 'weather/' . $weather_session['etat']['iconeNight'], $weather_session['etat'][$language]) . '<br>'; } $weather_string .= $weather_session['temperature'] . ''; $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('weather', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'), 'align' => 'center', 'text' => $weather_string. $hidden_get_variables . tep_hide_session_id()); new infoBox($info_box_contents); }else{ //Not yet a session OR choice of a new town in the weatherbox $filename="http://fr.weather.yahoo.com/".$choix_ville."/index_f.html"; $fp=@file_get_contents($filename,"r"); $chaine = $fp; # -------------------- Town --------------------# $left = "<font face=Arial><big><b>Yahoo! M騁駮 - "; $right = '</b></big></font></td><td align=right'; if (strstr($chaine, $left) && strstr($chaine, $right)){ $chaine = strstr($chaine, $left); $ville = good_char($chaine, $left, $right); } # -------------------- TEMPERATURE --------------------# $left = '<tr><td align=center nowrap><font size=+2 face=Arial><b>'; $right = "</b></font></td></tr>"; if (strstr($chaine, $left)){ $chaine = strstr($chaine, $left); $C = round((good_char($chaine, $left, $right)-32)/1.8,0); $temperature = good_char($chaine, $left, $right) .'F/'.$C .'C'; } # -------------------- THE MOMENT THE TEMPERATURES ARE MESURED--------------------# $left = "<tr><td align=center><font size=-2 face=Arial>"; $right = $hour_code."<br>"; if (strstr($chaine, $left)){ $chaine = strstr($chaine, $left); $moment = good_char($chaine, $left, $right); } # -------------------- THE SKY --------------------# $left = '<font size=-2 face="Arial,Helvetica">'; $right = "</font></td> <td align=center"; if (strstr($chaine, $left)){ $chaine = strstr($chaine, $left); $etat = good_char($chaine, $left, $right); } # -------------------- NIGHT/JDAY --------------------# $left = "Leverdusoleil:</font></td><td><font size=-1>"; $right = "</font></td></tr>"; if (strstr($chaine, $left)) { $chaine = strstr($chaine, $left); $leverSoleil = good_char($chaine, $left, $right); } $left = "Coucherdusoleil</font></td><td><font size=-1>"; $right = "</font></td></tr>"; if ( strstr($chaine, $left) ) { $chaine = strstr($chaine, $left); $coucherSoleil = good_char($chaine, $left, $right); } // Was there night or day when the temperatures were mesured if ( (array_key_exists($etat, $climat) ) && ( $leverSoleil != '' || $coucherSoleil != '' ) ) { $leverSoleilNumeric = 0 + str_replace(":", ".", $leverSoleil); $coucherSoleilNumeric = 0 + str_replace(":", ".", $coucherSoleil); $momentNumeric = 0 + str_replace(":", ".", $moment); // Depending the moment, we choose the night or day icone. if ( ($momentNumeric > $leverSoleilNumeric) && ($momentNumeric < $coucherSoleilNumeric) ) { $icone = $climat[$etat]['icone']; $night = false; } else { $icone = $climat[$etat]['iconeNight']; $night = true; } } if ( $leverSoleil=='' || $coucherSoleil=='' ) { // Sometimes, the hours are not given... $icone = $climat[$etat]['icone']; // so default day icone... $night = false; } tep_session_register('weather_session'); $weather_session = array(); $weather_session = array ("choix_ville_session"=>$choix_ville, "ville"=>$ville, "temperature"=>$temperature, "etat"=>$climat[$etat], "night"=>$night); $info_box_contents = array(); //$info_box_contents[] = array('text' => BOX_HEADING_WEATHER_BOX . $ville); //new infoBoxHeading($info_box_contents, false, false); $weather_string = $ville . ':'; //$weather_string .= $climat[$etat][$language] . '<br>'; $weather_string .= tep_image(DIR_WS_IMAGES . 'weather/' . $icone, $climat[$etat][$language]) . '<br>'; $weather_string .= $temperature . ''; $info_box_contents = array(); //$info_box_contents[] = array('form' => tep_draw_form('weather', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'), //'align' => 'center', //'text' => $weather_string.tep_draw_pull_down_menu('choix_ville', $US_towns, '', 'onchange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id()); //new infoBox($info_box_contents); } ?> </td> </tr> <!-- weather_eof //--> Is what the code looks like. I think its something to do with $info_box_contents in the code. Attached is what the above gives, whilst im here I might as well ask a few more things about it. How do I create an if statement to replace Londres by London and how can I insert the degrees symbol without it causing issues in internet explorer, eg not showing correctly? Thanks in advance for anyones help here.
Guest Posted October 9, 2005 Posted October 9, 2005 Degree symbol is now sorted :) ..... and after MUCHO searching of this forum, I finally found it in the KB :P http://www.oscommerce.info/kb/osCommerce/C..._and_Layout/263 One if statement left to go and im sorted :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.