Author Topic: Carter Lake Ajax/PHP template problem  (Read 2267 times)

0 Members and 1 Guest are viewing this topic.

Offline Arthurhh

  • Senior Contributor
  • ****
  • Posts: 266
  • IT Fixer
    • Tokoroa Weather Live
Carter Lake Ajax/PHP template problem
« on: June 19, 2008, 05:10:37 AM »
I have been having a play with these and have struck something that has me stumped.
I get this error
Parse error: syntax error, unexpected '%', expecting ')' in C:\wamp\www\tok\testtags.php on line 306 when loading the index page.
I am using the testtags.txt from the world distribution of the templates and when I examing testtags.php my editor shows line 306 as a blank (below
<tr class="column-light">
<td>Month</td>
<td><?php echo unUnit('%mrecordhightemp%').' '.$uomTemp; ?> on
<?php echo formatDateYMD(%mrecordhightempyear%,%mrecordhightempmonth%,%mrecordhightempday%); ?></td>
// this is line 306
<td><span style="font-size: 10px;">Warmest day</span></td>
<td><?php echo reformatRecord('%mwarmestdayonrecord%'); ?></td>
</tr>

Anyone got any hints

Offline Anole

  • Forecaster
  • *****
  • Posts: 585
    • http://pineislandweather.com
Re: Carter Lake Ajax/PHP template problem
« Reply #1 on: June 19, 2008, 09:19:29 AM »
When you get these types of errors it can often be an indication of something missing (a quote for example) in a previous line:

Should the variables in line 305 be quoted?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Carter Lake Ajax/PHP template problem
« Reply #2 on: June 19, 2008, 10:03:13 AM »
Would you mind showing an URL to the page with the problem?  I can have a look at the setup.

Based on the
Quote
Parse error: syntax error, unexpected '%', expecting ')' in C:\wamp\www\tok\testtags.php on line 306 when loading the index page.
it sounds like the testtags.txt hasn't been processed by Weather-Display into testtags.php.  That is, the WD variables (%tag%) haven't been substituted by WD for the weather condition, so yields a PHP error.   You should have both testtags.txt and trends-inc.txt processed by WD into testtags.php and trends-inc.html in order for the templates to work.

Best regards,
Ken
« Last Edit: June 19, 2008, 10:06:35 AM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Arthurhh

  • Senior Contributor
  • ****
  • Posts: 266
  • IT Fixer
    • Tokoroa Weather Live
Re: Carter Lake Ajax/PHP template problem
« Reply #3 on: June 19, 2008, 05:00:31 PM »
Quote
it sounds like the testtags.txt hasn't been processed by Weather-Display into testtags.php.  That is, the WD variables (%tag%) haven't been substituted by WD for the weather condition, so yields a PHP error.   You should have both testtags.txt and trends-inc.txt processed by WD into testtags.php and trends-inc.html in order for the templates to work.

Thats what i figured. The text file is being renamed and uploaded via the appropiate section of WD but is that all that is required to popluate that file. Have I (RTFM) missed a step somewhere in my WD setup