Newton Ferrers and Noss Mayo weather
Newton Ferrers and Noss Mayo
Home : Weather : Tides : About : Contact
 


.
 Weather Tech
 
BBC Video Forecast
Spotlight News/Weather
Met Office Local Forecast
Met Office Shipping Forecast
 

Weather Tech

This tech. section is for users of WD (Weather Display), weather web site developers & webmasters. Click here for our weather section!

 

WD PHP Tags

Note this system replaces our WD Tags Converted To PHP system.
4 Dec 2008 - New Version 1.02

What does the WD PHP Tags system do?
In short, this system enables your web site for working directly with Weather Display data. It takes every piece of weather data from your Weather Display software, uploads it to your web site regularly, and makes over 2000 individual pieces of weather data available to you to display anywhere, on any page of your web site, or process it further with your own php scripts (examples included). You don't need to be a php guru to use this system. It's very simple to install, and setup, and will give you complete freedom to design your site, and present your weather data how ever you like. Adding more data or pages to your site in the future, or building detailed weather history reports is now a cinch! This is probably one of those "must have" scripts, especially if you enjoy the web design process, and not having to use default layouts, or cloned template systems.

How Does WD PHP Tags system work?
There are over 2000 custom tags that Weather Display produces which makes it very powerful when it comes to building a weather web site. However, Weather Display produces these tags in static html pages, which make it very rigid, and limited in use. The WD PHP Tags system makes these tags dynamic so that they can be used in any way you wish. This gives you complete freedom in designing your web site, and processing, and presenting your weather data.

Weather Display is used to generate just one formatted file (included) which it uploads to your web site according to your required schedule. The raw tags file contains every single Weather Display custom tag.

To enable your web site to work with this system, you simply past some code into your php web page, or site template, and upload the main script file to your server. There are only two settings that need to be made.

Then you just put the required php tags on your web page to show any up to date weather data you wish. Each tag has a unique ID number. The ID numbers can be found very easily by using our tags reference page. If you are using this script, you can also view the tags reference page with your own weather data. The tag ID for "current average wind speed" for example, is 636. So to show this data on a web page you simply insert the following code;
<?php tags(636); ?>
. So here's my current average wind speed right now; 0.0 kts .

The php tags have several options that can be easily set within each tag. These options can be used to change the case of text (First Letter Of Every Word Upper Case, First letter of first word upper case, ALL LETTERS OF ALL WORDS UPPER CASE), remove text from numbers, and return values for processing the data with your own php codes if you require. For example, we can add an option to the tag used above, to make kts all upper case like this;
<?php tags(636,uc); ?>
. With my weather data it will now look like this; 0.0 KTS .
Or we can strip away "kts" to just show the number like this;
<?php tags(636,strip); ?>
. So my wind speed now looks like 0 .

As you can see from the examples above, you can very easily put tags anywhere on your web site to display a particular piece of weather data. This means that you are not limited to using WD's html page layouts, or specially designed weather web site template systems. Instead, you have complete freedom to design your own unique weather web site, and lay everything out how and where you want.

This script has a built in error handling system too. When WD is uploading your raw tags file, the file becomes unavailable at that moment, and you would get blank data and php errors all over the place. Although it's not often that your visitors will open a page at the exact moment WD is updating your tags, when it does happen, it's a mess. So the script prevents this by reloading the page. By the time the page has reloaded (2 seconds) the raw tags file is available again, and your visitor didn't see anything messy. If you were using Weather Display to upload your web pages in the normal way, your visitor would have got a 404 page missing error - not nice!

The package contains full, comprehensive instructions, and sample code for switching between heat index and wind chill etc. (readme.html), the main script file, code to past in your pages or site template to make them work with the script, and the raw tags file that you give to Weather Display to generate and upload.

Setup is simple, with only two settings to be made, so it's suitable for users of all abilities!

Requirements
Web server/web hosting with php 4.x or higher.

Download
WD PHP Tags Package (zip)

If you were previously using our WD Tags Converted To PHP system, you can convert to this much improved version with out too much difficulty if you wish to, or you can use it in addition to your current method. After installation you will have to convert the old tags in your pages to the new tags. They use the same ID numbers! The raw tags file that you get WD to generate and upload is the same so it does not need to be replaced. You don't need to update to this version if you do not plan to continue developing your site, and are happy with the way it is right now.

Trouble Shooting

My web page just keeps reloading?
This is the fail safe kicking in. If it keeps refreshing, it means that the script can not find the raw tags file that WD is generating and uploading (wxlocal2.php). There can be several reasons for this. 1. Check that WD is uploading the file to your web site according to your schedule. 2. Check that you have entered the correct path to where WD is uploading the raw tags file on your server, and that the raw tags file name is also correct in the script settings (wd_php_tags.php).

You can use a relative path in the script settings, however, if you do, tags will not work on pages that are spread across different directories, so I recommend using the full server path. The full server path is normally the path from the root server directory. For example, "/home/user_name/public_html/some_directory/file_name.php" If you don't know the server path, your web host will be able to tell you. You may also be able to find out by logging into your web host control panel.

I'm seeing the actual tags in my page, and not the data?
Firstly make sure your server supports php. This script should work with php 4.x and up. Make sure that your page is a php enabled page i.e. it has the .php extension. Make sure WD is generating and uploading your tags file, and that you have not mistakenly uploaded the raw tags file your self. Make sure you have put php tags around the tag code i.e. <? tags(123); ?>. On some servers you may need to actually put "php" in the opening tag i.e. <?php tags(123); ?>. If you are using the tags within your own php code make sure your syntax is correct. echo "tags(123)"; will display the tag, but not the data. echo tags(123,no,ret); will display the data. The tags are setup to echo the data unless the ret option is used, so they don't have to be used with "echo".

I have added options to a tag, but they don't work?
Options have to be in order, and separated by a comma. You can think of the tag ID and each option type as having it's own column separated by a comma. The tag ID is always in column 1. The case & strip options are always in column 2, and the return option is always in column 3. You can not leave an in between column blank. So tags(123,ret) will not return the data, as the ret option has been put in the wrong column. You need to specify the case/strip option too, like this tags(123,no,ret).

How can I get Weather Display's generated images and graphics on my pages?
Weather Display may already be uploading your weather graphics to your web site if it has already been setup to do so. In this case you just need to use basic HTML in your pages to display the images e.g;
<img src="/some_directory/some_image.gif" width="100" height="100" />

If Weather Display isn't already uploading the graphics, you will need to set it up to do so. This is mostly done through the "Internet File Creation & Upload" option which you can find by going to Weather Display's control panel. Here you can setup creation and upload times for individual graphics, and enable them etc. Once they are being created and uploaded, you should find local copies of the files in the web files directory within the main Weather Display directory on your computer. Obviously you don't want to link to the local files in your page as no one else will see them! However, you can get name and size info from the local files. If you use an editor such as Dreamweaver, you might find it easier to download the graphics files from your server via Dreamweaver's FTP, to your local site directory, so you can use the built in features to put the images in your pages.

My tag ID numbers seem to be out according to what the tags reference page says they should be?
The tags file is pipe ( | ) delimited. So the system splits the tags when ever it finds a " | ". If you have any text or html, such as javascripts that contain pipes, that is being generated within a tag, it will cause your tags IDs to be off. The easiest way to find the problem is to load your tags file into the tags reference page using the "show your tags" feature, then scroll down to the point where your tag IDs become offset, and make note of what is being generated in the tag preceding it. The solution is to avoid using any pipes in text or html that will be generated within a tag.


Subscribe to our Weather Tech Email!

Not only can I keep you up to date with my own new scripts, script updates, and top tips, but I'm hoping to get other weather script and software developers to share their news and updates too. Use the form on the right to subscribe!

If you develop weather web scripts or software, we would like to feature your news in the Weather Tech email too! Please contact me for details.

Weather Tech Email
Stay up to date!
Email
First Name
Location




Horse Riding

Enjoy horse & pony riding at Newton Ferrers Equestrian Centre. Learn to ride at a fully equipped riding school. We also offer hacks, livery and we run a quarter horse stud.

Newton Ferrers Equus

Equestrian Classified Ads

Local gardens wanted for hedgehog release


N&N Email Service
W/E forecast & tides ..?
Daily forecast & tides ..?
Site Updates ..?
Your Email
Your First Name

You can cancel your subscription at any time.
The RYA Shorebased courses are starting next week at The Parish Rooms, Yealmpton.  We have 5 spaces left on the Day Skipper shorebased, Tues eve 7 - 9.30.  and 3 spaces left on the RYA Coastal Skipper/Yachtmaster class on Thursday eve.  Price £245.00 inclusive of books etc.  Please book on line at www.sail-westmarinechandlery.com or phone 01548 810917.. 

Under Construction!
This is part of a larger site that is currently in development. More info will be available soon.

 
   
Page loaded in 0.0073 secs.


© NewtonAndNoss.com 2001 - 2018