Author Topic: Ken's Template  (Read 2585 times)

0 Members and 1 Guest are viewing this topic.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Ken's Template
« on: December 12, 2015, 06:06:56 AM »
I was going to try out Ken's USA template for WD, a school I work with got a $3000 grant for a weather station, webcam, and lightning detection system, and I'm going to help them get setup.

I had an old version of the template running on a placeholder domain I have... up until yesterday. I thought I would re-download all of the new template and start over. Great idea you say? :-) Only if it worked. :-)

I've started over several times now to get rid of an error I'm getting and I can't figure out why I'm getting it. First, I will not be using any language other than English, and no CSS swap.

The error I get when I try to go to the page is" "Parse error: syntax error, unexpected T_FUNCTION in /hsphere/local/home/bruecksteve/gwinnettweather.com/common.php on line 95"

The website is here: http://www.gwinnettweather.com/

Right now, everything in the files should be generic and the way it came in the template, but I'm obviously missing something. I had made changes that didn't work, so I re-extracted all the files again and re-uploaded. I'm sure it's probably something stupid..

Thanks in advance!

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1773
    • Echo Valley Weather
Re: Ken's Template
« Reply #1 on: December 12, 2015, 06:38:15 AM »
Hi Steve,

I believe I came across this error before and the only way I could get rid of it was to remove the words "langtrans" and "langtransstr" from the PHP functions in the various files, but I won't swear on it. That's been a couple of years ago. I had made sure the language settings in Settings.php were set to false, etc. and was still receiving the error.

Hope that helps, although I'm not sure at this hour.

John
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline mkutche

  • Forecaster
  • *****
  • Posts: 859
    • GosportWx.com
Re: Ken's Template
« Reply #2 on: December 12, 2015, 06:38:47 AM »
Are you upgraded to the latest version of PHP 5+? I had this same problem thinking the server i had was 5+.. until he upgraded.
« Last Edit: December 12, 2015, 06:40:42 AM by mkutche »
Mike K.
WS2080 - Cumulus MX b3043
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportINWX
-----------------------------------------------------------

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #3 on: December 12, 2015, 06:39:21 AM »
Thanks John... My old common files had all of that removed as well.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #4 on: December 12, 2015, 06:43:07 AM »
Are you upgraded to the latest version of PHP 5+? I had this same problem thinking the server i had was 5+.. until he upgraded.
Quoted the wrong post! :-)
Yes, 5.2.17

Offline mkutche

  • Forecaster
  • *****
  • Posts: 859
    • GosportWx.com
Re: Ken's Template
« Reply #5 on: December 12, 2015, 06:45:48 AM »
Are you upgraded to the latest version of PHP 5+? I had this same problem thinking the server i had was 5+.. until he upgraded.
Quoted the wrong post! :-)
Yes, 5.2.17

Try 5.4.45 that's what I use, otherwise I'm not sure how to fix it.
Mike K.
WS2080 - Cumulus MX b3043
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportINWX
-----------------------------------------------------------

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8590
    • Meteotemplate
Re: Ken's Template
« Reply #6 on: December 12, 2015, 10:14:39 AM »
Could you attach the PHP that is causing this? Just by looking at the error there is not much I can do to try to help you because I need to see how the error was generated. Just see if you can attach the actual script, or any other scripts that it "includes" and contain functions referenced by this script.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ken's Template
« Reply #7 on: December 12, 2015, 10:32:32 AM »
It's the statement
Code: [Select]
      $text = preg_replace_callback('!\.\s+([a-z])!s',
  function ($matches) { return('.  ' . strtoupper($matches[1]) ); }
  ,$text);
that causes the issue.  That was done (where a /e PCRE_modifier on the regex used to be)
Quote
e (PREG_REPLACE_EVAL)
Warning
This feature has been DEPRECATED as of PHP 5.5.0 and REMOVED as of PHP 7.0.0.

The use of an anonymous callback function was enabled in PHP 5.3, so your PHP version must be 5.3 or above.
PHP 5.2.17 also had some annoying issues with JSON decoding which affected the quake-json.php and WU-forecast scripts.

So... you have to use a PHP version of 5.3+ to run the template now...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #8 on: December 12, 2015, 10:34:23 AM »
Great... let's see if the hosting people want to do that. :-)

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ken's Template
« Reply #9 on: December 12, 2015, 10:35:48 AM »
Most hosters offer an option (either by cPanel or .htaccess entry) to specify the PHP handler version..
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline virusdunil

  • Forecaster
  • *****
  • Posts: 388
    • Station Meteo Hebertville
Re: Ken's Template
« Reply #10 on: December 12, 2015, 10:48:25 AM »
just for the fun of it,ive just chekcked mine (Rapidenet) via DirectAdmin/Select php version  and the choices are from 5.1 to 5.6

 ;)
Cabled Vantage pro2 + Solar / Stevensen screen
Weather Display latest version + Boltek PCI-NexStorm-StormVue NGX / NSDisplay


http://www.meteolacstjean.com/weather28/index.php
Meteotemplate : http://www.meteolacstjean.com/hebert/index.php

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8590
    • Meteotemplate
Re: Ken's Template
« Reply #11 on: December 12, 2015, 10:59:13 AM »
I would say that 5.4 is the standard today, it has been around for quite some time, has been tested thoroughly and I seriously doubt your hosting provider did not offer this or at least the 5.4 version. Especially the change from 5.2 to 5.3 brought some important new functions. My template is also compatible with only versions 5.3 or higher and even 5.3 was problematic and I had to make some changes after I first released it because I myself use 5.4. Btw., version 7 is just behind the corner :D

Also, I recommended upgrading to several of the Meteotemplate users and there was never a single problem associated with the change - other than it started working as it should :-)

So in case you have to option to upgrade (which I am 99% sure you will have), then I would personally go for 5.4 or maybe even 5.6.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #12 on: December 12, 2015, 03:18:16 PM »
I'm at 5.3.29 now and it's working. Guess I need to do my other domains as well.
Thanks Ken!

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #13 on: December 12, 2015, 04:36:18 PM »
Ken, one more question. Why am I getting this in place of the dashboard?

"Note: ajax-dashboard not included since weather station not yet specified."

Not sure where it's looking for that. I am reading the testtags file with no issue.

Offline mkutche

  • Forecaster
  • *****
  • Posts: 859
    • GosportWx.com
Re: Ken's Template
« Reply #14 on: December 12, 2015, 05:19:09 PM »
I'm at 5.3.29 now and it's working. Guess I need to do my other domains as well.
Thanks Ken!

Glad it's working :) yw
Mike K.
WS2080 - Cumulus MX b3043
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ken's Template
« Reply #15 on: December 12, 2015, 06:37:08 PM »
Ken, one more question. Why am I getting this in place of the dashboard?

"Note: ajax-dashboard not included since weather station not yet specified."

Not sure where it's looking for that. I am reading the testtags file with no issue.
That's the message shown on wxindex.php (and some other pages) if no Settings-weather.php is on the website .. that's the file that determines what tags/dashboard/etc. to use based on the weather station.  The Settings-weather.php is in the *-plugin.zip distributions, and all those files have to be uploaded for the template to work correctly with a given weather software program.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2185
  • Yeah, I'm hugging my traffic light.
    • http://www.cnyweather.com
Re: Ken's Template
« Reply #16 on: December 12, 2015, 06:42:26 PM »
Looking good Steve. How many fancy webcams you going to get?  :-)
Tony




Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #17 on: December 12, 2015, 07:13:40 PM »
Ken, one more question. Why am I getting this in place of the dashboard?

"Note: ajax-dashboard not included since weather station not yet specified."

Not sure where it's looking for that. I am reading the testtags file with no issue.
That's the message shown on wxindex.php (and some other pages) if no Settings-weather.php is on the website .. that's the file that determines what tags/dashboard/etc. to use based on the weather station.  The Settings-weather.php is in the *-plugin.zip distributions, and all those files have to be uploaded for the template to work correctly with a given weather software program.
The file is up there Ken.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #18 on: December 12, 2015, 09:22:01 PM »
Looking good Steve. How many fancy webcams you going to get?  :-)
The site I'm having trouble with... none. Actually, it will have my webcams on it, but no new ones. The school site will have one.
 

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: Ken's Template
« Reply #19 on: December 12, 2015, 09:27:39 PM »
Fixed. I was missing a section in the Settings-weather file

 

anything