We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14647
    • 13 Posts
    Hello there.

    I am using the WeatherX snippet in one of my MODx projects and I have a peculiar problem.

    All the placeholders work fine, I have a key from weather.com that works perfectly and all data is showing correctly. Except for one.

    I can’t get the image icons to display properly. When I looked at the source code properties for the .png icons I noticed that the php code is generating this as the base path to where the icons are called from:

    //assets/snippets/WeatherX/graphics//.png


    I don’t know where the double forward slashes are coming from. The only thing I changed in the code was to put my licence key and user id from Weather.com along with the specifications of what information I wanted to display. I made sure to create the correct file paths to where the icons are and the text file.

    Does anyone know why the snippet is calling for a incorrect path to the icons ?

    Regards,

    /Jon Hnefill
      • 36592
      • 970 Posts
      Which version are you using ?
      It’s ver 1.0.0 in the repository, but you can find ver 1.0.2 here.

      And what is the content of assets/snippets/WeatherX/weather.txt ?

      I personally don’t have partner ID & Key for weather.com, so I did not checked it by myself.
      But it seems you have to put this line
      $icon = setIconDay($conditions, $offSet, $nightTime);

      before
      $wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';
        • 14647
        • 13 Posts
        I tried to ugrade to the latest version but with no luck. I still get an invalid path for the icons, even though it’s the system default like mentioned in the snippet guideline. I also added in the extra line you suggestes but still no luck sad

        My weather.txt looks like this:

        1162430470|/sandbox/modx/weather/31.png|6:23AM|4:57PM|Wednesday, November 1st 2006|4|Clear|38|NNW


        I did try to change the file path in the .txt file in the hope that it would display the correctly. Which it did until I hit refresh. Then I got the invalid path again.

        The full path I get when I click the property of the image is this one:

        http://www.jamdigital.dk/alexandra//assets/snippets/WeatherX/graphics//.png


        The two extra forward slashes plus the missing number of the icon is a big puzzle to me. I tried to create my own weather widget by using as3 but I found out that the security settings in Flash Player 9 were too much for me so I stumbled into this very nice snippet which is working perfectly except for the image properties.

        /Johnny
          • 36592
          • 970 Posts
          1162430470|/sandbox/modx/weather/31.png|6:23AM|4:57PM|Wednesday, November 1st 2006|4|Clear|38|NNW

          This is strange... Where comes ’/sandbox/modx/weather’ from ?
          What is the setting of $wxIcons at the beginning of WeatherX snippet ?
          It is originally like this.
          $wxIcons = 'assets/snippets/WeatherX/graphics';    // Path to Weather Icons


          And what is your template below the WeatherX snippet call ?
          The snippet just replace the [+wxIcon+] placeholder with the value in weather.txt.
          (In your case it is ’/sandbox/modx/weather/31.png’)
            • 14647
            • 13 Posts
            As I understand it the path sandbox/modx/weather/31.png is the orignal path in the weather.txt file. I did try to change path manually and then ftp to my server but the path is overwritten by the snippet file when I hit refresh, indicating that all permissions are set correctly at least.

            The problem is that somewhere in the snippet is a wrong configuration somewhere that is writing an invalid path to the weather.txt file and the outputting it. The result is that all the statistical information is correct. It’s only the icon path that comes out incorrectly.

            I did replace the icons with another icon set, which are stored in the same folder as requested in the snippet install instructions. I gave the icons the same filename and ending so that in theory there shouldn’t be any problems. I also tried it with the orginal icons (the one from weather.com) but I still got the same error.

            I will copy paste all the snippet file as I have it on my server. If you see any mis-configuration, then please let me know. All help is greatly appreciated.

            The path to $wxIcons is exactly as the orginal path:
            $wxIcons = 'assets/snippets/WeatherX/graphics';			// Path to Weather Icons


            the template below the snippet call is as follows:
            [!weather?&zipcode=`DAXX0009`&units=`metric`&provider=`blah`&clock=`12`!]
            <div>
            <img src="[+wxIcon+]"><br />
              <p>Temp: [+wxTemp+]</p>
            </div>


            I use the call {{weather}} to call for the snippet.

            The WeatherX.inc.php that is located in the include folder (can be found in version 1.02) is as follows:
            <?php
            //********Helper Functions*************
            
            
            ////This takes two parallel arrays and sets the placeholders with them.
            function setPlaceholders ($array1, $array2) {
            	$i = 0;
            	foreach ($array1 as $v) {
            		global $modx;
            		$modx->setPlaceholder($array1[$i], $array2[$i]);
            		$i++;
            		}
            	return;
            }
            
            ////Find the string in the middle of two points
            function get_middle($source, $beginning, $ending, $init_pos) {
            	$beginning_pos = strpos($source, $beginning, $init_pos);
            	$middle_pos = $beginning_pos + strlen($beginning);
            	$ending_pos = strpos($source, $ending, $beginning_pos + 1);
            	$middle = substr($source, $middle_pos, $ending_pos - $middle_pos);
            	return $middle;
            }
            
            ////Parse XML
            function parseXML ($file) {
            	if (function_exists('curl_init')) {
            		$ch = curl_init($file); /// initialize a cURL session
            		curl_setopt($ch, CURLOPT_HEADER, 0);
            		curl_setopt($ch, CURLOPT_FAILONERROR, 1);
                    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
                    $data = curl_exec ($ch);
                    curl_close ($ch);
            
            		if (!is_string($data) || !strlen($data)) {
            			return FALSE;
            		}
            	} else {
            		$fp = fopen($file,'r');
            		while(!feof($fp)){
            			$data = $data . fread($fp, 1024);
            		}
            		fclose($fp);
            	}
            	$xml_parser = xml_parser_create();
            	xml_parse_into_struct( $xml_parser, $data, $vals, $index );
            	xml_parser_free( $xml_parser );
            	return $vals;
            }
            
            function setIconDay ($conditions, $offSet, $nightTime) {
            	if ($offSet >= $nightTime){
            		if ($conditions == 'Overcast') {
            		$icon = 26;
            		} elseif ($conditions == 'Clear') {
            		$icon = 31;
            		}elseif ($conditions == 'Scattered Clouds') {
            		$icon = 29;
            		}elseif ($conditions == 'Mostly Cloudy') {
            		$icon = 27;
            		}elseif ($conditions == 'Heavy Rain') {
            		$icon = 45;
            		} elseif ($conditions == 'Light Rain') {
            		$icon = 45;
            		} else {
            		$icon = 99;
            		}
            	} else {
            		if ($conditions == 'Overcast') {
            		$icon = 26;
            		} elseif ($conditions == 'Clear') {
            		$icon = 32;
            		}elseif ($conditions == 'Scattered Clouds') {
            		$icon = 34;
            		}elseif ($conditions == 'Mostly Cloudy') {
            		$icon = 28;
            		}elseif ($conditions == 'Heavy Rain') {
            		$icon = 32;
            		} elseif ($conditions == 'Light Rain') {
            		$icon = 11;
            		} else {
            		$icon = 99;
            		}	
            	}
            	return $icon;
            }
            
            function writeToFile ($wxUpdateFile, $wxWrittenInfo) {
            
            		// Let's make sure the file exists and is writable first.
            		if (is_writable($wxUpdateFile)) {
            
            		   if (!$handle = fopen($wxUpdateFile, 'w')) {
            		         exit;
            		   }
            
            		   // Write content to our opened file.
            		   if (fwrite($handle, $wxWrittenInfo) === FALSE) {
            		       exit;
            		   }   
            		   fclose($handle);
            		}
            		return;
            }
            ?>


            and finally the code for the snippet is as follows:
            <?php
            // Resource Name: WeatherX
            // Author: Jesse Rochman
            // Forum Alias: jesster444
            // Version: 1.0
            // Compatible with .95Beta5
            // Released: 11/8/2006
            // Created from Nick Schaffner's WEATHER.COM XML PARSER
            // Template Placeholders: wxIcon, wxSunr, wxSuns, wxWindSpeed, wxWindir, wxTemp, wxConditions, wxDate
            
            
            //Require the included helper functions
            require_once($modx->config['base_path'] . 'assets/snippets/WeatherX/include/WeatherX.inc.php');
             
            //////// Some Constants
            $wxUrl	 = 'http://xoap.weather.com/weather/local/';	// URL to xoap.weather
            $wxUPDATE_CONSTANT = 600; //This is how often the weather will be updated.  DON'T CHANGE!
            $wxNow = time(); //This allows us to see if we need to update variables
            $wxWunderUrl = 'http://rss.wunderground.com/auto/rss_full/';
            
            
            //////// Set Varibles Below
            $wxZipcode = 'DAXX0009';				// Zipcode
            $wxUnits = 'english';				// Set to 'english' or 'metric' (Celsius & KMH)
            $dateFormat = 'l, F jS Y g:i';			// check http://us2.php.net/date
            ///////Set only if using Weather.com
            $partner = 'xxxxxxxxx';			// Partner ID
            $license = 'xxxxxxxxxxxxxxxx';		// License Key
            $wxIcons = 'assets/snippets/WeatherX/graphics';			// Path to Weather Icons
            $wxClock = 12;		// Set to '12' or '24' hour format
            $wxUpdateFile = $modx->config['base_path'] . 'assets/snippets/WeatherX/weather.txt'; //location of Text File
            
            /////Set all the placeholders so you can output the format in a template or chunk!
            
            //Parameter overrides
            if (isset($zipcode)) {
            	$wxZipcode = $zipcode;
            	}
            if (isset($clock)) {
            	$wxClock = $clock;
            	}
            if (isset($units)) {
            	$wxUnits = $units;
            	}
            if (!isset($provider)) {
            	$provider = 'wunder';
            	}
            
            if (!isset($offSet)) {
            	$offSet = 0 + date('G');
            	} else {
            	$offSet = $offSet + date('G');
            	}
            
            if (!isset($nightTime)) $nightTime = 19;
            
            /////Read the file and establish all the output variables (For Weather.com)
            $handle = fopen($wxUpdateFile, 'r');
            $contents = fread($handle, filesize($wxUpdateFile));
            fclose($handle);
            $contents = explode('|', $contents);
            
            if ($provider != 'wunder') { 
            	$wxLastUpdate = $contents[0] + $wxUPDATE_CONSTANT;
            	$wxIcon = $contents[1];
            	$sunr = $contents[2];
            	$suns = $contents[3];
            	$date = $contents[4];
            	$s = $contents[5];
            	$conditions = $contents[6];
            	$tmp = $contents[7];
            	$windir = $contents[8];
            	$r = $contents[9];
            	$hmid = $contents[10];
            	$flik = $contents[11];
            	
            	$arr1 = array('wxFeelsLike','wxHumidity','wxPressure','wxIcon','wxSunr','wxSuns','wxDate','wxWindSpeed','wxConditions','wxTemp','wxWindDir');
            	$arr2 = array($flik,$hmid,$r,$wxIcon,$sunr,$suns,$date,$s,$conditions,$tmp,$windir);
            	setPlaceholders($arr1, $arr2);
            	
            	//Check to see if we need to update the variables otherwise we are done.
            	if ($wxLastUpdate < $wxNow) {
            
            		//////// Parse XML
            		$file = $wxUrl . $wxZipcode . '?cc=*&&prod=xoap&par=' . $wxPartner. '&key=' . $wxLicense;
            		$vals = parseXML($file);
            		if ($vals) {    
            			$t = true;
            
            			foreach ($vals as $key => $i) {
            
            			if ($vals[$key]['value'] != false) {
            
            				if ($vals[$key]['tag'] == 'VIS') break;
            				if ($vals[$key]['tag'] != 'T') { 
            				
            					$temp = strtolower($vals[$key]['tag']);
            					$$temp = $vals[$key]['value'];
            
            				} elseif ($t == true) { 
            
            					if ($vals[$key]['level'] == 3) $conditions = $vals[$key]['value']; 
            					else { $windir = $vals[$key]['value']; $t = false;}
            
            				} 
            			}
            
            		}
            
            		//////// Make sense of the varibles
            
            		$sunr = str_replace (' ','',$sunr);
            		$suns = str_replace (' ','',$suns);
            		$date = date($dateFormat);
            		$hmid .= '%';
            		
            		if ($wxUnits == 'metric') { // Set Metric
            			$tmp = round((($tmp - 32)/9) * 5).'°C';
            			$flik = round((($flik - 32)/9) * 5).'°C';
            			$s = round($s * 1.609).'km/h';
            			$r .= round(($r * 3386.388640341)/100). 'hPa';
            		} else {
            			$tmp .= '°F';
            			$flik .= '°F';
            			$s .= 'mph';
            			$r .= 'in';
            			
            		}
            
            		if ($wxClock == 24)  {
            			$sunr = date('H:i',strtotime($sunr));
            			$suns = date('H:i',strtotime($suns));
            			
            		}
            
            		if ($s == 'calm') $wind = 'Calm';
            
            		$wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';
            
            		$wxWrittenInfo = $wxNow . '|' . $wxIcon . '|' . $sunr . '|' .$suns . '|' . $date . '|' . $s . '|' . $conditions . '|' . $tmp . '|' . $windir . '|' . $r . '|'. $hmid . '|' . $flik;
            
            		writeToFile($wxUpdateFile,$wxWrittenInfo);
            		}
            	}
            	
            } else {
            	
            	$wxLastUpdate = $contents[0] + $wxUPDATE_CONSTANT;
            	$tmp = $contents[1];
            	$humidity = $contents[2];
            	$pressure = $contents[3];
            	$conditions = $contents[4];
            	$windir = $contents[5];
            	$s = $contents[6];
            	$date = $contents[7];
            	$wxIcon = $contents[8];
            	
            	$arr1 = array('wxIcon','wxHumidity','wxPressure','wxWindSpeed','wxConditions','wxTemp','wxWindDir','wxDate');
            	$arr2 = array($wxIcon,$humidity,$pressure,$s,$conditions,$tmp,$windir,$date);
            	setPlaceholders($arr1, $arr2);
            	
            	//Parse XML
            	$file = $wxWunderUrl . $wxZipcode . '?units=' . $wxUnits;
            	$vals = parseXML($file);
            	if ($vals) {   
            		foreach ($vals as $key => $i) {
            
            			if ($vals[$key]['tag'] == 'DESCRIPTION' && $vals[$key]['level'] == 4) { 
            				$temp = $vals[$key]['value'];
            				$tmp = trim(get_middle($temp, 'Temperature:', '|',0));
            				$humidity = trim(get_middle($temp, 'Humidity:', '|',12));
            				$pressure = trim(get_middle($temp, 'Pressure:', '|',21));
            				$conditions = trim(get_middle($temp, 'Conditions:', '|',30));
            				$windir = trim(get_middle($temp, 'Wind Direction:', '|',41));
            				$s = trim(substr($temp, strpos($temp,'Wind Speed')+11));
            				$date = date($dateFormat);
            				$icon = setIconDay($conditions, $offSet, $nightTime);
            				$wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';
            				
            				$wxWrittenInfo = $wxNow.'|'.$tmp.'|'.$humidity.'|'.$pressure.'|'.$conditions.'|'.$windir.'|'.$s.'|'.$date.'|'. $wxIcon;
            
            				writeToFile($wxUpdateFile,$wxWrittenInfo);
            				
            				return '';
            			}
            		}
            	}
            }
            ?>


            All help would be greatly appreciated smiley

            /Jon Hnefill
              • 36592
              • 970 Posts
              Quote from: JonHnefill at Oct 16, 2008, 04:21 PM

              As I understand it the path sandbox/modx/weather/31.png is the orignal path in the weather.txt file. I did try to change path manually and then ftp to my server but the path is overwritten by the snippet file when I hit refresh, indicating that all permissions are set correctly at least.
              Are you sure that the content of weather.txt on your server after refleshed by MODx is like that ?

              And as I already wrote, insert this code
              $icon = setIconDay($conditions, $offSet, $nightTime);

              in your weather snippet. I can not find it in your code.
              Search a following line in the snippet.
              $wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';

              You can find 2 lines in the snippet.
              The position the code above must be inserted is before the first line.
                • 14647
                • 13 Posts
                The content of the weather.txt file after the snippet has sent the information is as follows:
                1223325669|/alexandra//assets/snippets/WeatherX/graphics//.png|6:23AM|4:57PM|Monday, October 6th 2008 10:41|10km/h|Clear|-16°C|NNW|0hPa0hPa|%%|-28°C


                As can be seen the snippet inserts double forward slashes on two occasions in the text file.  This is what has been giving me endless headaches since I can’t figure out where in snippet file the information is being sent.

                I did insert the line you asked me to do.  I inserted after the second time though but that has been fixed now.  There is no change on the end result though.

                But my snippet file now looks like this
                <?php
                // Resource Name: WeatherX
                // Author: Jesse Rochman
                // Forum Alias: jesster444
                // Version: 1.0
                // Compatible with .95Beta5
                // Released: 11/8/2006
                // Created from Nick Schaffner's WEATHER.COM XML PARSER
                // Template Placeholders: wxIcon, wxSunr, wxSuns, wxWindSpeed, wxWindir, wxTemp, wxConditions, wxDate
                
                
                //Require the included helper functions
                require_once($modx->config['base_path'] . 'assets/snippets/WeatherX/include/WeatherX.inc.php');
                 
                //////// Some Constants
                $wxUrl	 = 'http://xoap.weather.com/weather/local/';	// URL to xoap.weather
                $wxUPDATE_CONSTANT = 600; //This is how often the weather will be updated.  DON'T CHANGE!
                $wxNow = time(); //This allows us to see if we need to update variables
                $wxWunderUrl = 'http://rss.wunderground.com/auto/rss_full/';
                
                
                //////// Set Varibles Below
                $wxZipcode = 'DAXX0009';				// Zipcode
                $wxUnits = 'english';				// Set to 'english' or 'metric' (Celsius & KMH)
                $dateFormat = 'l, F jS Y g:i';			// check http://us2.php.net/date
                ///////Set only if using Weather.com
                $partner = 'xxxxxxxxxx';			// Partner ID
                $license = 'xxxxxxxxxxxxxxxx';		// License Key
                $wxIcons = 'assets/snippets/WeatherX/graphics';			// Path to Weather Icons
                $wxClock = 12;		// Set to '12' or '24' hour format
                $wxUpdateFile = $modx->config['base_path'] . 'assets/snippets/WeatherX/weather.txt'; //location of Text File
                
                /////Set all the placeholders so you can output the format in a template or chunk!
                
                //Parameter overrides
                if (isset($zipcode)) {
                	$wxZipcode = $zipcode;
                	}
                if (isset($clock)) {
                	$wxClock = $clock;
                	}
                if (isset($units)) {
                	$wxUnits = $units;
                	}
                if (!isset($provider)) {
                	$provider = 'wunder';
                	}
                
                if (!isset($offSet)) {
                	$offSet = 0 + date('G');
                	} else {
                	$offSet = $offSet + date('G');
                	}
                
                if (!isset($nightTime)) $nightTime = 19;
                
                /////Read the file and establish all the output variables (For Weather.com)
                $handle = fopen($wxUpdateFile, 'r');
                $contents = fread($handle, filesize($wxUpdateFile));
                fclose($handle);
                $contents = explode('|', $contents);
                
                if ($provider != 'wunder') { 
                	$wxLastUpdate = $contents[0] + $wxUPDATE_CONSTANT;
                	$wxIcon = $contents[1];
                	$sunr = $contents[2];
                	$suns = $contents[3];
                	$date = $contents[4];
                	$s = $contents[5];
                	$conditions = $contents[6];
                	$tmp = $contents[7];
                	$windir = $contents[8];
                	$r = $contents[9];
                	$hmid = $contents[10];
                	$flik = $contents[11];
                	
                	$arr1 = array('wxFeelsLike','wxHumidity','wxPressure','wxIcon','wxSunr','wxSuns','wxDate','wxWindSpeed','wxConditions','wxTemp','wxWindDir');
                	$arr2 = array($flik,$hmid,$r,$wxIcon,$sunr,$suns,$date,$s,$conditions,$tmp,$windir);
                	setPlaceholders($arr1, $arr2);
                	
                	//Check to see if we need to update the variables otherwise we are done.
                	if ($wxLastUpdate < $wxNow) {
                
                		//////// Parse XML
                		$file = $wxUrl . $wxZipcode . '?cc=*&&prod=xoap&par=' . $wxPartner. '&key=' . $wxLicense;
                		$vals = parseXML($file);
                		if ($vals) {    
                			$t = true;
                
                			foreach ($vals as $key => $i) {
                
                			if ($vals[$key]['value'] != false) {
                
                				if ($vals[$key]['tag'] == 'VIS') break;
                				if ($vals[$key]['tag'] != 'T') { 
                				
                					$temp = strtolower($vals[$key]['tag']);
                					$$temp = $vals[$key]['value'];
                
                				} elseif ($t == true) { 
                
                					if ($vals[$key]['level'] == 3) $conditions = $vals[$key]['value']; 
                					else { $windir = $vals[$key]['value']; $t = false;}
                
                				} 
                			}
                
                		}
                
                		//////// Make sense of the varibles
                
                		$sunr = str_replace (' ','',$sunr);
                		$suns = str_replace (' ','',$suns);
                		$date = date($dateFormat);
                		$hmid .= '%';
                		
                		if ($wxUnits == 'metric') { // Set Metric
                			$tmp = round((($tmp - 32)/9) * 5).'°C';
                			$flik = round((($flik - 32)/9) * 5).'°C';
                			$s = round($s * 1.609).'km/h';
                			$r .= round(($r * 3386.388640341)/100). 'hPa';
                		} else {
                			$tmp .= '°F';
                			$flik .= '°F';
                			$s .= 'mph';
                			$r .= 'in';
                			
                		}
                
                		if ($wxClock == 24)  {
                			$sunr = date('H:i',strtotime($sunr));
                			$suns = date('H:i',strtotime($suns));
                			
                		}
                
                		if ($s == 'calm') $wind = 'Calm';
                
                $icon = setIconDay($conditions, $offSet, $nightTime);
                
                		$wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';
                
                		$wxWrittenInfo = $wxNow . '|' . $wxIcon . '|' . $sunr . '|' .$suns . '|' . $date . '|' . $s . '|' . $conditions . '|' . $tmp . '|' . $windir . '|' . $r . '|'. $hmid . '|' . $flik;
                
                		writeToFile($wxUpdateFile,$wxWrittenInfo);
                		}
                	}
                	
                } else {
                	
                	$wxLastUpdate = $contents[0] + $wxUPDATE_CONSTANT;
                	$tmp = $contents[1];
                	$humidity = $contents[2];
                	$pressure = $contents[3];
                	$conditions = $contents[4];
                	$windir = $contents[5];
                	$s = $contents[6];
                	$date = $contents[7];
                	$wxIcon = $contents[8];
                	
                	$arr1 = array('wxIcon','wxHumidity','wxPressure','wxWindSpeed','wxConditions','wxTemp','wxWindDir','wxDate');
                	$arr2 = array($wxIcon,$humidity,$pressure,$s,$conditions,$tmp,$windir,$date);
                	setPlaceholders($arr1, $arr2);
                	
                	//Parse XML
                	$file = $wxWunderUrl . $wxZipcode . '?units=' . $wxUnits;
                	$vals = parseXML($file);
                	if ($vals) {   
                		foreach ($vals as $key => $i) {
                
                			if ($vals[$key]['tag'] == 'DESCRIPTION' && $vals[$key]['level'] == 4) { 
                				$temp = $vals[$key]['value'];
                				$tmp = trim(get_middle($temp, 'Temperature:', '|',0));
                				$humidity = trim(get_middle($temp, 'Humidity:', '|',12));
                				$pressure = trim(get_middle($temp, 'Pressure:', '|',21));
                				$conditions = trim(get_middle($temp, 'Conditions:', '|',30));
                				$windir = trim(get_middle($temp, 'Wind Direction:', '|',41));
                				$s = trim(substr($temp, strpos($temp,'Wind Speed')+11));
                				$date = date($dateFormat);
                				$wxIcon = $modx->config['base_url'] . $wxIcons . '/' . $icon . '.png';
                				
                				$wxWrittenInfo = $wxNow.'|'.$tmp.'|'.$humidity.'|'.$pressure.'|'.$conditions.'|'.$windir.'|'.$s.'|'.$date.'|'. $wxIcon;
                
                				writeToFile($wxUpdateFile,$wxWrittenInfo);
                				
                				return '';
                			}
                		}
                	}
                }
                ?>


                Any clue as to where I might be doing things wrong ?

                /Jon Hnefill