Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Web tags in PHP & other PHP items.

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Web tags in PHP

Post by gemini06720 »

Duke, you are doing quite well - you are learning at a good paste... ;)

Stephen, Duke is using the 'WU-forecast.php' template to produce the 'WeatherUnderground 7-Day Weather Forecast' - that template is part of the 'AJAX-PHP Saratoga templates for VWS, Cumulus, WeatherLink, WD' package.

Duke, are you working with multiple templates (such as 'top', 'header', 'footer', etc.) to produce the pages? If you do not, you should seriously should think about it... ;)

As explained previously, to create a page, such as, for example, the '7dayforecast.php', you would start with a 'clean' template named '7dayforecast.php'; at the top of the '7dayforecast.php' template, you would use 'require' to include the 'top.php' template, then, another 'require' to include the 'header' template, then an 'include' to include the 'WU-forecast.php' script, and finally, another 'require' to include the 'footer' template.

You only need one 'top.php' template, one 'header.php' template and one 'footer.php' template - all three templates will be used for each pages.

Duke, do not forget to check your private mail folder... :mrgreen:
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: Web tags in PHP

Post by serowe »

gemini06720 wrote:Stephen, Duke is using the 'WU-forecast.php' template to produce the 'WeatherUnderground 7-Day Weather Forecast' - that template is part of the 'AJAX-PHP Saratoga templates for VWS, Cumulus, WeatherLink, WD' package.
Credit should still be given for the forecats though :)
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Web tags in PHP

Post by gemini06720 »

Stephen, I must be seeing something that you are not (or you are seeing something that I am not) ... the header produced by the 'WU-forecast.php' template (script) displays that it is 'WeatherUnderground 7-Day Weather Forecast:...' and at the footer displays 'Forecast from WeatherUnderground for...' with a link to the Weather Underground page for the station - so, which credit(s) should be given to what/whom? :?
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: Web tags in PHP

Post by serowe »

The second link, when I first viewed the page, had nothing to show where the forecasts were oming from. Yes I note now (revisiting the page) it does.

Going slightly off topic here though - I question the use of non-official forecasts that are becoming prolofic - I can' speak for the UK or US, but here in Oz we have the Weather Channel which a number of TV station like to use (maybe they have shares in it??? Who knows...) The problem here is that many of these 'non-official' sites use data from their countries Met Bureeau's (whatever they are called) and simply rehash the data and call it their own - quite often at odds with the official version (and just as often wrong as well).

In the case of WU personally I wouldn;t touch it with a barge pole - for the simple reason I have seen what it does to the data I upload. Example -- for whatever reason I have lost my data file for April 2009. I still have the web page FreeWx generated for that period (and, sorry to say, this is one area that FreeWx has over ALL other weatyher software packages in that it retained old display pages) so I can compare daily highs/lows/rain etc. If I DL the data for this month from QU and then compare it to this generated page here, conversion routines put in place by WU mean I have siginificantly differing rain and pressure readings and temperatures that can be as much as 3 degrees out on max/mins (both higher AND lower). This can't even be accouinted for by suggesting QU has a midnight rollover whilst I use 9am - rainfall over 3 or more days, for example, should be the same when totalled up - but WU seems, somehow, to invent rain when there is none.

So - use WU at your own risk. Check if you want, but I have seen this issue now for 10 years and only continue to contribute because of the longevity of the data retention.
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
duke

Re: Web tags in PHP

Post by duke »

Ok, firstly, I just want to say thanks to you all for helping me with this. Webtags was the original subject but now we are into web page design, etc (title changed to help others :) ). Although I am a frequent visitor here http://www.w3schools.com/ there is no replacement for seeing a posted sample here to gain knowledge.

1/I've had to abandon my original template as when it was enalarged by the vierer it went all out of shape :o . After a quick search I believe this is something to do with "fluid style templates". I have now moved onto a fixed style.

2/ I have now cleared up these
- the '<!DOCTYPE...' should appear only once in a page, at the top of the page (you have 3 of them);
- the '<html...' should also appear only once in a page, at the top of the page, below the '<!DOCTYPE...' (you have 2 of them);
- the '</html>' should also appear only once in a page, at the bottom of the page (you have 2 of them);
3/ And the same with the weather script. After reading Ken's notes (thank you for script) I note I was "include" the wrong part. (I'm not sure why you did not see the credits but they were there when I viewed and I have now also added my own credit ;) ).

Ray, PM sent.

Duke
duke

Re: Web tags in PHP & other PHP items.

Post by duke »

Carrying on from the webtags theme....Various web tags in Cumulus return a "0" or "1". How do you turn this into an output of saying (example) yes or no / online or offline. I'm assuming there is a simple script in use here but that is something I have no knowledge of....yet ;) .

Duke
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Web tags in PHP & other PHP items.

Post by beteljuice »

if($condition) == 0 {
do something;
}else{
do the other;
}
Image
......................Imagine, what you will KNOW tomorrow !
duke

Re: Web tags in PHP & other PHP items.

Post by duke »

I wanted to add a page to my site for testing PHP so I simply put:

Code: Select all

<?php
 phpinfo( );
 ?>
But it plays havoc with the back ground and some text at the bottom is corrupt :? .

Page here: REMOVED

Simply, why?

Duke
Last edited by duke on Tue 21 Feb 2012 11:01 am, edited 1 time in total.
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: Web tags in PHP & other PHP items.

Post by serowe »

Not sure what you are trying to do but the phpinfo() function call is usually made in a file with absolutely noting else in it - no background, no formatting, colours etc. Also - do NOT leave this file on your site as it can be used/run by anyone - it can contain informaiton you do not usually want others to see (paths, variables, versions etc)
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
duke

Re: Web tags in PHP & other PHP items.

Post by duke »

serowe wrote:Not sure what you are trying to do but the phpinfo() function call is usually made in a file with absolutely noting else in it - no background, no formatting, colours etc. Also - do NOT leave this file on your site as it can be used/run by anyone - it can contain informaiton you do not usually want others to see (paths, variables, versions etc)
Deleted, got a bit lost for a minute there with what i was trying to do :bash: .

Sure I'll wake up some time soon :) .

Duke
duke

Re: Web tags in PHP & other PHP items.

Post by duke »

I want to convert my XHTML pages to HTML5 to take advantage of the new features. The main failure at W3C is the PHP webtag. How do I alter my webtag to be accepted in HTML5.

Here is an example of a current tag:
<?php echo $wchill; ?>
And here is the failure:
Error Line 34, Column 4: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.)

<?php
Duke
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Web tags in PHP & other PHP items.

Post by steve »

Are you trying to validate the page before it's been processed by the server? PHP would normally never be seen in a web page, it gets processed by the server to generate HTML. It's the generated HTML that you should be trying to validate.
Steve
duke

Re: Web tags in PHP & other PHP items.

Post by duke »

Steve,

I think you are correct. I was using the checking function built into Webuilder which connects to W3C and it failed miserably. But, after uploading to the server and rechecking all PHP passed :D .

Just a few minor things to sort now.

Thanks

Duke
Post Reply