New - WD PHP Tags System. Over 2000 bits of weather data.

need more information
(i.e like running the debug version)

I’ve never ran the debug program before.
Do you shut down your WD just like a regular update?

yes
then it should create a file called WeatherD.elf
in c:\ or where wd is installed
and email me that
(but I have to head out soon)

Ran update as usual. Started the process to upload PHP tags file to server and WD crashed.

Spent 10 minutes so far looking for the file and can’t find it anywhere in my Wdisplay file.
I can find WeatherD.exe & WeatherD.ini but no .elf

I’ve checked my root C:, C:\Wdisplay, C:\Wdisplay\webfiles cannot find it.

Maybe the file isn’t showing up because I guess the program isn’t technically “crashing”.
The CPU usage skyrockets to 100% when the PHP tags file is trying to upload, and everything in WD stalls.
Regular updates, clientraw, etc… After about 10-15 minutes of this, I kill the program through Task Manager.

what speed pc, memory, etc?

2G ram
AMD 2500+ 1.83Ghz

Using Windows XP
Internet connection is 13-14M download - 1.3 to 1.4M Upload speeds.

try removing custom tags from the list until the problem stops maybe (and so then you can pin point the culprit(s)

Hi Rick, sorry to hear about your problem. When the tags file is being generated, it’s normal for the CPU load to go up for a short time while the tags are generated. How long it takes depends on the CPU speed. For most people this causes no problems and only takes a few seconds. It may just be that your CPU is not powerful enough, and can’t cope with the load. I’m running this system with a P4 3.4Ghz CPU, and have had no problems.

FYI… I am running WD 10.37M (with this wx-file) with XP on an old 1GHz PentiumIII with 320MB of memory, and as far as I can see… No problems here.

First and foremost: What a tremendous amount of work has been done in order to make this script. Props and kudos and stuff like that :slight_smile:

But I do believe I found an error…
wxlocal2.php contains this tag: %mrecordlhighuvday%
There’s one L too much in there. Just so you all know this tag won’t work like this.

One other thing maybe someone can help me out with.

Tag 381:
-2.4

I suggest you globally turn off units in tags and then you have complete control.

Control Panel > Web Files/Web Page > Custom webpage setup

Checkbox for “Include the units used”

Hi beun.net. I will look into the problems you have pointed out. I’m afraid to say that spelling errors in tags such as %mrecordlhighuvday% are spelling errors in the original tags within WD. I copied and pasted these tags from a recent version of WD, and found and fixed a few errors like this. I will fix these errors in the script as they get reported. You can fix this by editing the raw tag in the ungenerated tags file.

Removing spaces from tags 381 and similar, is not a built in feature, but it can be done very simply by adding PHP code to your tags using the “ret” option. Here’s how you can remove the space and have a capital C in tag 381;

<? echo str_replace(" ", "",tags(381,cap,ret)); ?>

Use cap instead of uc, and use PHP’s string_replace to replace the space with nothing as in the example above. Use the ret option to return the output in PHP and add the echo to print the final result in your page.

You shouldn’t have to add a } to the code at the top of the page. That would suggest that you forgot to add the other code to the bottom of the page! You should check this. There is part 1 and part 2 of the setup code to put in your pages.

Niko also has a good point. You can turn off units and add them manually. Using this method you could use less php code to calculate and display a Fahrenheit equivalent if you wanted to - you wouldn’t have to add extra PHP to strip out the raw number before calculating it. It would also give you more flexability to format the output (remove spaces, capitalise the C etc) with out adding extra PHP code.

%mrecordlhighuvday%

fixed that in the tagslist for the next update

Just to confirm, it should be %mrecordhighuvday% - with no “L” is that right?

I’ll correct it in the tags file for the next version of the script. If you are using the script in the mean time, you can correct it your self in the raw (ungenerated) tags file (wxlocal2.php) - it’s on line 1232.

That is a very good suggestion. Thanks. I wasn’t aware of that option.

First of all. I’m not blaming no-one for the typo. I just thought I’d let you all know about the L, and that the tag’ll work just fine once the L is removed :slight_smile:

Thanks a lot for the suggestion to use the str_replace option. Good one.

And about the } I said I had to add… The second part at the bottom of the page is there allright. But maybe the way I’m doing this creates the need for the extra }.
What I do is this: In order to prevent having to add several lines of text to several files, I saved the first part of the code and the second part of the code to their own files. I then include these with PHP, which makes I only have to add two lines of text to every webpage file. (Furthermore this might be handy when having to change a setting. I would only have to make the change once.)
This is how I include the files:

<?php include("wd-php-tags-start.php"); ?>
<?php include("wd-php-tags-end.php"); ?>

The first one at the very top of the page.
The second one at the bottom, just before the closing body tag.
Could it be that this has “created the need” for the extra }? Would you recommend against including the code like I did? For the record, the data seems to be coming through just fine.
Your opinion on this would be greatly appreciated :slight_smile:

Yea no one’s to blame for the spelling error. There are over 2000 tags, and I would not like to have to write them all!!! :slight_smile:

Including the page setup scripts in your pages is not a good idea. It is indeed why you are having to add a }, and that will break the way the script is meant to work. In particular, it will break the fail safe feature. You can copy and past the 2 parts of page code from page to page, or put them in a site template. Copying and pasting is easier and quicker than typing a line of code any way.

There is now a new version of WD PHP Tags available from the tech area of my site. It fixes the spelling error, and ads a new feature. The new feature is that you can now add “def” to the caps option to display the data exactly as WD created it. In other words it will not change the case of text from the original. This is especially useful for blocks of text such as your weather warnings which have capital letters at the start of sentences.

Example;

<? tags(123,def); ?>

Updating to the latest version (1.02) is very easy. Just unzip the dowoaded zip file, edit the path setting in wd_php_tags.php to match the old one. Upload it to your server, overwriting the old one. Then just replace your local copy of wxlocal2.php in your wd webfiles folder with the new one. You do not need to change the 2 part page setup script, as this has not changed.