Meteotemplate - new free website template

I got that when was setting mine up found I did not have the right url in the index file try "http://www.tide-forecast.com/locations/Southampton-England/tides/latest" for yours
Harold that is the url I have, just double checked but still getting data N/A

strange
Try mine on your site and see if you get the same
http://www.tide-forecast.com/locations/Douglas/tides/latest

works ok on my template http://www.hc-iom.co.uk/template/index.php go to other tab for tides

Harold

did you try clearing the cache

Just tried with Harolds url but still not working, looking at the cache it seems my hosts servers are blocking the url. I had this issue with another plugin, can’t remember what now, I may have to do with out this page for a while till I can speak to the tech team at the host.

On another issue, I updated my version of WD earlier this evening which meant my station status showed as offline, but now all is updating as normal (and has been for over an hour) but status still shows offline. Will this change in time or do I need to do something?

Phil

is you cron job still active may have become inactive due to failed attempts

Hi Phil,

Im sorry to hear that. I just checked on my test server and the location is working fine, it must be a problem with your server.

The only thing I can suggest you try is on line 54, try replacing this:

$htmlRaw = getData($url);

with

$htmlRaw = file_get_contents($url);

Though I think it probably wont make much difference. The original is usually even safer and works, it uses the CURL, but still it is worth a try. Let me know if it helped.

Brian:
It is global so has locations all around the world :slight_smile: I originally wanted to use one site which has a very good API, extremely easy to use, lots of locations, no API key, good data consistency etc. Well, it was all good until I noticed all the times for all countries are completely off.

I then thought about the NWS, but that is impossible to do with PHP script because you can only request a token and this way download it as a text file, not to mention the fact this would then be only “tides US” not “tides”. This site I then found is great, times seem ok, available for the whole world. But it was slightly more difficult to parse the data and I also needed to ask if I can use their data at all, in their terms it says no, but I was granted special permission for Meteotemplate users.
So you could use for example: http://www.tide-forecast.com/countries/New-Zealand :smiley:

Phil I have also just sent you a modified log file you sent me yesterday that did not work for you. I think I found the problem, there were some hidden characters inserted which messed up the whole format of the file, though you could not see them. This often happens when you work with these files with the built-in Windows Notepad - so I really strongly recommend never to use this SW.

Let me know if it helped. I emailed it to you because it is too big to attach here.

Jachym
Thanks for doing that I will give it a go in the morning.
Phil

Hi
is there a way to reduce the WD log files from 1 minute values to 5 minute values only prior to importing to the data base
I get the impression the reformat database should only be ran once not sure what would happen if ran several times.
at the moment the only way I can think of, is going though each file and deleting lines between the 5 minute values.

Harold

OK, the idea was this:

When you first install the template, you do the files import. You import all your one-minute files and so create a db with one-minute intervals.

Then you run the reformat.php script to reduce it and average it to 5 minute intervals.

And then you set up your updates to 5 minutes.

So you don’t need to run it more than once, simply upload all your 1minute files, create a 1 minute db and then reformat that whole db.

Phil I have also just sent you a modified log file you sent me yesterday that did not work for you. I think I found the problem, there were some hidden characters inserted which messed up the whole format of the file, though you could not see them. This often happens when you work with these files with the built-in Windows Notepad - so I really strongly recommend never to use this SW.

Let me know if it helped. I emailed it to you because it is too big to attach here

Unfortunately that file still wants to put itself as a 1970 year. Not worry its only the one file from all the files going back to 2008. I don’t remember trying to alter it at all in notepad or any other editor.
Phil

Hi Phil,

Im sorry to hear that. I just checked on my test server and the location is working fine, it must be a problem with your server.

The only thing I can suggest you try is on line 54, try replacing this:

Code: [Select]

$htmlRaw = getData($url);

with

Code: [Select]

$htmlRaw = file_get_contents($url);

Jachym, as you suspected changeing that line did not make any difference :frowning:
On the plus side having seen Harolds post about reformatting the data base I realised I had not done that. I have now reformatted to 5 minute intervals and lo and behold things like Trends are now working :slight_smile:

Phil

Great, I also guess your page now runs much faster

Jachym yes it is faster.
Just tried changing the indexMobile to a single column with some multiple blocks but I am now getting this error

Parse error: syntax error, unexpected 'homepage' (T_STRING), expecting ')' in /web1/user53995/website/meteotemplate/indexMobile.php on line 57
What have I done wrong? Phil

Hi Phil,

you probably deleted some apostrophe or quotation mark. Can you copy your settings for that page here?

here’s a copy of the settings section

# HOMEPAGE SETTINGS
############################################################################
# DESIGN
// Select the design theme. There are two themes: light and dark. You can either set this to one particular or you can make it variable.
// Options:
// "dark" - default, sets the theme to dark all the time
// "light" - light theme all the time
// "sun" - this will set the theme based on the time of the day - dark theme before sunrise and after sunset, light theme during day time
// "variable" - if you select this you can define fixed hours when the design should change - i.e. define specific hour in the morning when light theme will appear and specific hour in the evening when it changes to dark again. So it is more or less same thing as the sun option, but this time it does not change during the year.
$theme = "dark";
	$morningSwitch = 7; // if you selected "variable" above, then here you specify the hour in the morning for the switch. If you used any other option, you can ignore this parameter. The number should be given in the 24h format - in other words a number from 0 to 23
	$eveningSwitch = 19; // if you selected "variable" above, then here you specify the hour in the evening for the switch back to dark theme. If you used any other option, you can ignore this parameter. The number should be given in the 24h format - in other words a number from 0 to 23

$blockColor = $design; // choose whether you want the blocks to have color1 or color2 of your design combination for the template. For color 1 use "design", for color 2 use "design2"
$blockRadius = 3; // The following parameter sets the "roundedness" (border-radius) of the blocks. You can specify the number of pixels for the radius. 0 means the borders will not be rounded at all, the higher the number, the more rounded the block borders will be.
############################################################################

# BLOCKS - see documentation at http://www.meteotemplate.com/web/wiki/wikiHomepage.php

$columnWidths = array(100);
$column1 = array("multipleBlock(greeting,50;stationStatus,50)","current","forecast","multipleBlock(rain,33;location,33;baroTrend33)","stationData","multipleBlock(calendar,33;cloudHeight,33;riset,33)","interactiveGraph","multipleBlock(astroEvents,33;dayNight,33;meteors,33));



$columns = array($column1);

############################################################################</blockquote>

Hi Phil,

computers are unfortunately (so far hopefully) really dumb, so even just one typo can screw things up:

multipleBlock(rain,33;location,33;baroTrend33)

missing a comma there

Doh, still didn’t work till I spotted missing " after the last multiple block !! OK now thanks

Oh yes, I see it now too…

I will give you a tip - use some text editor such as Notepad++ (I highly recommend that one, 100% of all CSS, HTML, JS and PHP of Meteotemplate has been written in this SW…), because these text editors have built-in syntax highlighting, What that means is that for example text inside " " has a different color etc. So you immediately spot when you accidentally delete some semi-colon, comma etc.

I took your advice from the beggining of starting to use meteitemplate and have been using notepad++ all the way through, and most of the typing errors I have made have been highlighted by it, very useful for a novice like me.
Phil

Hi
i just downloaded the twitterFeed block. Shoud there be a settings.php file with it? because I don’t see one
Phil