Tides

I would like to put the tide tables onto my site. I have been able to get wxtide32 to work in WD and upload to webfles. I have adapted the menu to reflect the topic (Tide) but am uncertain how to actually display the data. Any ideas?

Rod
www.wanakaweather.co.nz/weather2

http://discourse.weather-watch.com/t/35719

Thanks for that. I will have to be better at search as I tried tide but not tides so never saw this.

Rod

yw

The regular search function for this forum is not very smart. You will get much better results if you always use Advanced Search which you access by clicking on the magnifying glass icon at the left of the regular search box.

It has not gone well fro me as my ignorance of programming haunts me. I have uploaded the script but get and error that I cannot shake. Any more clever folk able to have a look? www.wanakaweather.co.nz/weather2 and under Tide Times. still am not sure I have the directory path right but whatever I try ends with: Fatal error: Call to undefined function tides() in /home/wanakaw1/public_html/weather2/inc/wsTideTimes.php on line 61

Hi, have you also uploaded the tides_processor.php script?

and do you have

<?php
require_once("tides_processor.php");
?>

in your tides page code?

Martyn,

Thank-you. I had put that in but it had not done anything so i started again with no success having forgot it. Placed it and happy days. Now to work on the fact that it is asking me to refresh and update. I will pay closer attention to the post regarding that to see if I can trouble shoot.

Is WD uploading tideprediction.html ?

WD is uploading and i can see the tables there at tideprediction.html but I cannot get the wsTideTime.php to see it.

Check the path to the tideprediction.html is set correctly in tides_processor.php.

line 33 in weather2/inc/tides_processor.php should be changed from

$tidefile = "../[email protected]/public_html/data/tideprediction.html";  

to

$tidefile = "../data/tideprediction.html";  

But then you will get an empty array as the dates in tideprediction.html are very strange and different then expected by the script.
Please can some other person compare this part with his / her own tideprediction.html and for testing / comparing put their file online?

Saturday Sat 05-02   
Sunrise 0745, Sunset 1741
Moonset 0521, Moonrise 1651
  High Tide:  0037   2.6
   Low Tide:  0649   0.9
  High Tide:  1255   2.7
   Low Tide:  1909   0.9

The script expects dates such as Saturday 05-02 not Saturday Sat 05-02
Also the times are missing :

Wim

Yes Wim,
I remember someone else having that strange date format.
The settings in WxTide32 itself need to be changed.
File → preferences
In the tabs for realtime, graph, overview and clock, untick the box that says “add weekday name to dates”
(the times do not need a colon)

I had set the path as you describe Wim with no result so had tried the one you found. i have reset back and changed the wxtides in WD all I get now is a blank table. Thanks for your assistance.

Rod

I have changed wxtides and got rid of the double day issue and I can see the tables when I open tideprediction.html but not able to propagate the table on my site as yet.

http://www.wanakaweather.co.nz/weather2/index.php?p=90&lang=en#data-area

  1. The red error "Tide data is being updated. Please refresh the page. " is only displayed by tides() when the tideprediction.html file can not be found by the script.
  2. http://www.wanakaweather.co.nz/data/tideprediction.html is the file
  3. The scripts are executed at the weather2/ level.
  4. To get to the file we have to go down one stewp to the root ‘…/’ and then up to data.
    So the line should be set as:
$tidefile = '../data/tideprediction.html';  

You get a blank table when the tides() functon returns a blank field when it can not locate the date.

I will test your current tideprediction.html to see what it returns.

Wim

I think it should be

$tidefile = "../../data/tideprediction.html"; 

as the path in tides_processor.php (which is in a subdirectory “inc” of weather2)

When I had …/ I got blank table with …/…/ I get the red refresh boxes. I really appreciate the effort on this as it is proving interesting.

Rod

No the path is correct. All scripts are executed and loaded by index.php and index.php is in weather2.

This is the output at my place with the file from http://www.wanakaweather.co.nz/data/tideprediction.html

But the year should be removed from the settings in tides_processor.php at line 39 as the dates have no year.

$yearDate = "yes"; 

should be

$yearDate = "no"; 

That is why everything is blank in Yendor’s page.

Wim


OK I will bow out. Hope you get it sorted. :slight_smile: