I have another script error

My "Nearby Metar " page will not load with the updated script from Saratoga. “wessb.com/weather/wxmetar.php” I even created a new page wxmetar1.php and still get the same error. All I did to the downloaded script was to add my local metars as downloaded from Saratoga as well.
Notepad++ shows line 1 as “<?php”
Any ideas ???

Wess

Here the clue… langtrans() error

Can you post your metar script?

It’s pretty big, but here it is cut and pasted from Notepad++

 
<?php

############################################################################

# A Project of TNET Services, Inc. and Saratoga-Weather.org (Canada/World-ML template set)

############################################################################

#

#   Project:    Sample Included Website Design

#   Module:     sample.php

#   Purpose:    Sample Page

#   Authors:    Kevin W. Reed <[email protected]>

#               TNET Services, Inc.

#

# 	Copyright:	(c) 1992-2007 Copyright TNET Services, Inc.

############################################################################

# This program is free software; you can redistribute it and/or

# modify it under the terms of the GNU General Public License

# as published by the Free Software Foundation; either version 2

# of the License, or (at your option) any later version.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA

############################################################################

#	This document uses Tab 4 Settings

############################################################################

# Version 1.00 - 17-Nov-2011 - initial release

# Version 1.01 - 27-Nov-2011 - display 'Distance to station' mods

#

require_once("Settings.php");

require_once("common.php");

############################################################################

$TITLE = langtransstr($SITE['organ']) . "  -  " .langtransstr('Nearby METAR Reports');

$showGizmo = true;  // set to false to exclude the gizmo

include("top.php");

############################################################################

?>

<style type="text/css">

.bidi {

	unicode-bidi: embed;

}

</style>

</head>

<body>

<?php

############################################################################

include("header.php");

############################################################################

include("menubar.php");

############################################################################

?>



<div id="main-copy">

  

	<h1><?php langtrans('Nearby METAR Reports'); ?></h1>

    <p>&nbsp;</p>



<?php

// Customize this list with your nearby METARs by

// using http://saratoga-weather.org/wxtemplates/find-metar.php to create the list below



$MetarList = array( // set this list to your local METARs 

   // Metar(ICAO) | Name of station | dist-mi | dist-km | direction |
  'KCGS|College Park, Maryland, USA|2|3|S|', // lat=38.9833,long=-76.9167, elev=15, dated=13-FEB-12
  'KFME|Fort Meade, Maryland, USA|10|15|ENE|', // lat=39.0833,long=-76.7667, elev=46, dated=13-FEB-12
  'KDCA|Washington/Natl, Washington D.c., USA|13|20|SSW|', // lat=38.8500,long=-77.0333, elev=18, dated=25-SEP-00
  'KADW|Andrews Afb, Maryland, USA|14|22|SSE|', // lat=38.8167,long=-76.8667, elev=86, dated=13-FEB-12
  'KBWI|Balto/Wash Intl, Maryland, USA|17|27|NE|', // lat=39.1667,long=-76.6833, elev=59, dated=13-FEB-12
  'KGAI|Gaithersburg, Maryland, USA|17|28|NW|', // lat=39.1667,long=-77.1667, elev=165, dated=13-FEB-12
  'KNAK|Annapolis/Naval, Maryland, USA|23|38|E|', // lat=38.9833,long=-76.4833, elev=2, dated=13-FEB-12
  'KDAA|Fort Belvoir/Dav, Virginia, USA|24|39|SSW|', // lat=38.7167,long=-77.1667, elev=21, dated=01-SEP-10
  'KDMH|Baltimore/Dwntwn, Maryland, USA|25|40|NE|', // lat=39.2833,long=-76.6167, elev=5, dated=13-FEB-12
  'KIAD|Wash Dc/Dulles, Virginia, USA|29|47|W|', // lat=38.9333,long=-77.4500, elev=93, dated=01-SEP-10
  'KW29|Stevensville, Maryland, USA|31|51|E|', // lat=38.9833,long=-76.3333, elev=15, dated=13-FEB-12
  'KMTN|Baltimore/Martin, Maryland, USA|34|55|NE|', // lat=39.3167,long=-76.4167, elev=7, dated=13-FEB-12
  'KJYO|Leesburg/Godfrey, Virginia, USA|35|56|W|', // lat=39.0667,long=-77.5667, elev=119, dated=01-SEP-10
  'KFDK|Frederick, Maryland, USA|37|60|NW|', // lat=39.4167,long=-77.3667, elev=92, dated=13-FEB-12
  'KHEF|Manassas Muni, Virginia, USA|38|61|WSW|', // lat=38.7167,long=-77.5167, elev=59, dated=01-SEP-10
  'KNYG|Quantico Mcaf, Virginia, USA|40|65|SSW|', // lat=38.5000,long=-77.2833, elev=4, dated=01-SEP-10
  'KDMW|Carroll Cnty, Maryland, USA|41|66|N|', // lat=39.6000,long=-77.0000, elev=241, dated=13-FEB-12
  'KESN|Easton/Newnam, Maryland, USA|48|77|ESE|', // lat=38.8000,long=-76.0667, elev=22, dated=13-FEB-12

);

$maxAge = 75*60; // max age for metar in seconds = 75 minutes

// end of customizations

#

# Note: you do not need to change the below settings .. your current values from Settings.php

# will be applied and replace what you change below.

#

$condIconDir = './ajax-images/';  // directory for ajax-images with trailing slash

$condIconType = '.jpg'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/

$uomTemp = '&deg;F';

$uomBaro = ' inHg';

$uomWind = ' mph';

$uomRain = ' in';

// optional settings for the Wind Rose graphic in ajaxwindiconwr as wrName . winddir . wrType

$wrName   = 'wr-';       // first part of the graphic filename (followed by winddir to complete it)

$wrType   = '.png';      // extension of the graphic filename

$wrHeight = '58';        // windrose graphic height=

$wrWidth  = '58';        // windrose graphic width=

$wrCalm   = 'wr-calm.png';  // set to full name of graphic for calm display ('wr-calm.gif')

$Lang = 'en'; // default language used (for Windrose display)

?>

<?php

  if(file_exists("include-metar-display.php")) {

	  include_once("include-metar-display.php");

  } else {

	  print "<p>Sorry.. include-metar-display.php not found</p>\n";

  }

?>

    

</div><!-- end main-copy -->



<?php

############################################################################

include("footer.php");

############################################################################

# End of Page

############################################################################

?>

It’s working fine here… http://www.northbendweather.com/test.php

So this script was working before or not? and if so, have you made any other changes to your site lately?

I have been updating all of my scripts, 90% of everything else is working fine.

Where is the link to it in your site? The langtrans function isn’t working when you run the this script as a stand-alone page, it is expecting to be part of a template page which includes reference to the script that includes langtrans, maybe common.php or settings.php.

Update: The langtransstr function is in common.php

Wessb,

Try the attached as wxmetar.php on your site (it has your customization in it). Upload FTP as ASCII.

Best regards,
Ken


wxmetar.php.txt (6.1 KB)

Mine is located at the URL posted n my original post, “wessb.com/weather/wxmetar.php” .
I have already uploaded the common.php as well as all of the others downloaded. I made no modifications to it, but I will take a look at the common file and post it here.
Can’t post the php file as it exceeds the max.

Wess

Don’t know what you changed…but THANK YOU, the file you provided works as it should.