You can go up to about 20 or so. If there is no tide data for that number of days ahead, it will simply show nothing.
Tides and sun & moon rise/set are completely separate, so they can be displayed on separate pages if you wish, but can also be shown on the same page, or in the same table cell.
Additional Settings
If your tide file contains the year in the date e.g. Saturday 2008-10-11, you must set the $yearDate variable to "yes". This script only works with the standard date formats that WD/xtides produces which are "Saturday 10-11" or "Saturday 2008-10-11".
If your tide file contains rising & falling times as well as high and low times, you can convert the output to not display rising & falling times by setting the $convertRF variable to "yes".
You can translate the output to another language by changing the tide words, day names and month names in the translations section of the script. Just replace the default words with those of your preferred language, making sure not to inadvertently change the syntax.
You can turn off the moon phase icons if you want to. Some users have reported that the moon phases in wxtides are inaccurate for their location. This can be done independently for both tides and for sun and moon rise/set.
Extra Features
In the rare event that someone visits your tides page at the same moment that WD is uploading the tide file, rather than show missing file errors, and blank tides, the script will display a message saying that the tide data is being updates, and ask the visitor to reload the page.
Dates are converted to a more presentable format.
You can actually use this script even if you don't have WD uploading a tide file to your site! The script can be used to get the tides from another site on another server (providing your server's PHP settings support it), and display the tides (as explained above) on your site. If you use that feature though you should probably get permission from the other site owner first!
Subscribe to the Weather Tech Email below to be notified about updates to this, and other scripts, and to be the first to hear about new scripts when they become available.
If you want to further process the tide data that this script outputs using your own php code, you can do so by getting it to return the output instead of echoing it. This is done by adding ",1" in the tag after the day number. Example;
The same can be done with sun and moon rise/set, but slightly different;
<? sunmoon(12,date,1); ?>
|
The second variable in this function is to show or hide the date. The variable to return instead of echo the data is the third one.
Trouble Shooting
If you get a blank instead of tides, it's possible there is no tide information available in the tideprediction.html file for that particular day. That's possible if you use a higher number in the code tag. The script is designed to return nothing if there is nothing to return, so that it will collapse table rows for a neater appearance. Remember that each code tag only displays the tides for a single day, and that the number corresponds to the number of days ahead from today. For example, putting 10 in the tag will only display day 10, and wont display ten days worth of tides.
The sun and moon rise/set will only work if that information is available in the tideprediction.html file. This can be set in the xtide application.
The script has been designed to work with popular date formats that the tideprediction.html file uses. It will work with the following date formats only "Sunday 10-11" (dayname month-day) and "Sunday 2008-10-11" (dayname year-month-day). If the date format in your tideprediction.html file is different to the standard ones, you may need to reconfigure it in the wxtide software.
If you keep seeing a message telling you to refresh the page where your tides should be displayed, this would indicate that you have set the path to tideprediction.html incorrectly, or have put the wrong file name. The path must also include the name of your tide file. The script is designed to show the refresh message in the event that your visitor opens your tide page at the same moment that WD is uploading it, which would mean that the tide file is unavailable at that moment and your visitor would otherwise see nothing.
Subscribe to the Weather Tech Email below to be notified about updates to this, and other scripts, and to be the first to hear about new scripts when they become available.
|