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
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.
Moderator: daj
-
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
My site at http://weather.ser.id.au is one such site BUT the tags file generated contains more than the data available from Cumulus - but the idea is the same - a single webtags generated file containing all of the necessary variables and then each page uses only what it needs to displ;ay the various pages.
Be aware that that link will re-direct you to my server here at home and, if you are trying from a corporate site (i.e. from work) you may *not* be able to get to it as it is located behind a non-standard port - http normally uses port 80 but I re-direct traffic, depending on the port provided, to 10 different web sites on this IP now).
Be aware that that link will re-direct you to my server here at home and, if you are trying from a corporate site (i.e. from work) you may *not* be able to get to it as it is located behind a non-standard port - http normally uses port 80 but I re-direct traffic, depending on the port provided, to 10 different web sites on this IP now).
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
duke
Re: Web tags in PHP
One small step for man kind.........
I just about had the webtags sorted then you guys threw me another bone by introducing me to a settings / config file.
Do the header, footer and menu code need to be separate files or can they all be produced in one?
I've just deleted the menu from my intended template (http://www.freelayoutsworld.com/free-la ... 974856152/) and put it in a file "sidebar.php" and added the "include" to my test page and it works. I know this is a very small step by your guys standards but seeing it work gives me the encouragement to continue and I understand now why you do it.
Here it is: http://www.nightingaleweather.co.uk/maintemplate.php
Duke
I just about had the webtags sorted then you guys threw me another bone by introducing me to a settings / config file.
Do the header, footer and menu code need to be separate files or can they all be produced in one?
I've just deleted the menu from my intended template (http://www.freelayoutsworld.com/free-la ... 974856152/) and put it in a file "sidebar.php" and added the "include" to my test page and it works. I know this is a very small step by your guys standards but seeing it work gives me the encouragement to continue and I understand now why you do it.
Here it is: http://www.nightingaleweather.co.uk/maintemplate.php
Duke
Last edited by duke on Fri 30 Dec 2011 10:55 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
It's enturely up to you! (how's that for throwing it back at you?
)
Seriosly though - you can have as many or a few include files as you want - it all comes down to how YOU want to manage your web site.
For me - I would rather keep the menu's in one file because then, if I need to change the menuing system, I know straight away where to go to make changes to it - I don't have to think 'Now, which file is it in?' Same with a footer (which includes a call to the menu.php file.
If you find you use the ideabar (for example) on one page but not another but stilll want the menu, then obviously you need to seperate them. It's all a case of deciding what is to be used where and how easy the files are to be for editing etc.
Start off with what you are comfortable with then, as yo progress you will find you will make the changes to suit yourself.
Using a config directory is something you will one day work out - for me it's a case of putting the common elements in a standard location. This way if I want to play around with a new display page I know that all the elements for opening my MySQL database(s) are all in one file (dbconfig.php), the menu in another (menu.php), hyeaders another (header.php), footer yet another (footer.php) along with the calls to record user stats. Then there is the css directory for any and all CSS files needed and, finally, data for any TXT style data files. (Again keep in mind that I use all of my weather data from a MySQL database and NOT TXT based files,m thus my need for a dbconfig style file).
Of I haven't confused you even more
Seriosly though - you can have as many or a few include files as you want - it all comes down to how YOU want to manage your web site.
For me - I would rather keep the menu's in one file because then, if I need to change the menuing system, I know straight away where to go to make changes to it - I don't have to think 'Now, which file is it in?' Same with a footer (which includes a call to the menu.php file.
If you find you use the ideabar (for example) on one page but not another but stilll want the menu, then obviously you need to seperate them. It's all a case of deciding what is to be used where and how easy the files are to be for editing etc.
Start off with what you are comfortable with then, as yo progress you will find you will make the changes to suit yourself.
Using a config directory is something you will one day work out - for me it's a case of putting the common elements in a standard location. This way if I want to play around with a new display page I know that all the elements for opening my MySQL database(s) are all in one file (dbconfig.php), the menu in another (menu.php), hyeaders another (header.php), footer yet another (footer.php) along with the calls to record user stats. Then there is the css directory for any and all CSS files needed and, finally, data for any TXT style data files. (Again keep in mind that I use all of my weather data from a MySQL database and NOT TXT based files,m thus my need for a dbconfig style file).
Of I haven't confused you even more
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
duke
Re: Web tags in PHP
That's very helpful, thank you.
I'm just dividing up my template. When I've done what I think is OK I'll post them here for you guys to to tell me where I've gone wrong if that's ok.
Duke
I'm just dividing up my template. When I've done what I think is OK I'll post them here for you guys to to tell me where I've gone wrong if that's ok.
Duke
-
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
You can never 'go wrong' - what pleases some, will (always) displease others (read some of the threads here and you will understand what I mean
)
The bottom line is 'does it work'? and 'Can I understand what I have done'? If you answer yes to both, then you have achieved what you want and, as time goes on, you will find you will tweak things a bit more, start to play around with the code and eventually (in a hundred years time) say 'I'm finished!'
One thing to also consider trying - install al local web server (WAMPP or XAMPP) on your PC and use it to experiment with. You won't necessarily be able to get the web tags file updated automatically but you can use a local version and see what the page(s) look like before you deploy them on your web site. That way it doesn't matter if everything gets messed up locally - you can fix it and THEN post it to your web site were it appears that you are a master programmer who gets it right first time, every time
The bottom line is 'does it work'? and 'Can I understand what I have done'? If you answer yes to both, then you have achieved what you want and, as time goes on, you will find you will tweak things a bit more, start to play around with the code and eventually (in a hundred years time) say 'I'm finished!'
One thing to also consider trying - install al local web server (WAMPP or XAMPP) on your PC and use it to experiment with. You won't necessarily be able to get the web tags file updated automatically but you can use a local version and see what the page(s) look like before you deploy them on your web site. That way it doesn't matter if everything gets messed up locally - you can fix it and THEN post it to your web site were it appears that you are a master programmer who gets it right first time, every time
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
duke
Re: Web tags in PHP
Another boneinstall al local web server (WAMPP or XAMPP) on your PC and use it to experiment with
Thanks Serowe.
Duke
-
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
It's the marrow in the bones that make them worthwhile though - not just the outsideduke wrote:Another bone.
Good luck and, as before, drop me a PM if you need any further help.
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
Indeed, installing a local server is a requirement to easy/good page design - with a local server one can make some modifications to a template, save the modified file, click on the browser's refresh button, and immediately see the results of the modifications.serowe wrote:One thing to also consider trying - install al local web server (WAMPP or XAMPP) on your PC and use it to experiment with. You won't necessarily be able to get the web tags file updated automatically but you can use a local version and see what the page(s) look like before you deploy them on your web site.
As for the wet tag file not being updated - I have no such problem! I just setup Cumulus to read and process the web tag template and to save the resulting PHP script into the drive/directory where all my working web page templates are located - thus it is always up-to-date.
Duke, I am looking at the source code of the template you are working (experimenting) on...
- 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);
Remember, for each opening '<div...' you use, you must have a closing </div> - the total number of opening and closing 'div' must be equal.
Before you get too 'entrenched' into the language, I prefer to direct you in the proper way of writing the code...
You are doing good - keep experimenting, this is how you are going to learn more. And, remember there is a lot of documentation on the Internet, so do not be afraid or reading and trying...
The pages on my site (link in my signature) are created from PHP templates and JavaScript - all the code on the templates is static and variables (or web tags) are used whereever a value needs to be replace by changing data.
-
duke
Re: Web tags in PHP
Duke, I am looking at the source code of the template you are working (experimenting) on...
- 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);
Page now here (renamed it). http://www.nightingaleweather.co.uk/index2.php
Duke
EDIT:
Just looked at the files on the web server and the extra items are being added to the PHP files when I upload them
You do not have the required permissions to view the files attached to this post.
-
duke
Re: Web tags in PHP
Sorted those out, now I have similar at the start of the forecast script i added (just to give the page some content during experiments).Duke, I am looking at the source code of the template you are working (experimenting) on...
- 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);
So, why's that happening?
Duke
-
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
Without seeing your actual code, my presumption would be you have them in each of the 'included' files (as I can't see them this may be wrong).
Just make sure ANY file you include ONLY includes the snippets of code you want placed in the file - it shouldn't be a complete web page (by complete I mean having a !DOCTYPE, <html></html> set of tags etc etc.
This owuld seem to be the likely culprit but may ot - just something to look out for.
Just make sure ANY file you include ONLY includes the snippets of code you want placed in the file - it shouldn't be a complete web page (by complete I mean having a !DOCTYPE, <html></html> set of tags etc etc.
This owuld seem to be the likely culprit but may ot - just something to look out for.
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
- 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
Presumeably there is a setting in the forecast script to include / exclude headers ?
......................Imagine, what you will KNOW tomorrow !
-
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
Ummm he is experimenting with includes so wouldn't/shouldn't be using whole scripts...
Duh!
Duh!
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
duke
Re: Web tags in PHP
Correct.Without seeing your actual code, my presumption would be you have them in each of the 'included' files (as I can't see them this may be wrong).
Just make sure ANY file you include ONLY includes the snippets of code you want placed in the file - it shouldn't be a complete web page (by complete I mean having a !DOCTYPE, <html></html> set of tags etc etc.
This owuld seem to be the likely culprit but may ot - just something to look out for.
And correct. More importantly, I've corrected my mistake and learned a lesson.Ummm he is experimenting with includes so wouldn't/shouldn't be using whole scripts...
Duh!
I have a further question. not PHP or tag related but I'll put it here anyway.
When you use the zoom function in the browser I've noticed that rather than enlarge the page background, text and graphics together it only enlarges the text and totally screws up the layout of it. Is this caused by the template I am using?
Here:
http://www.nightingaleweather.co.uk/index2.php
and
http://www.nightingaleweather.co.uk/7dayforecast.php
Duke
-
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
Now you're in an area I don;t know enough about
But....what browser are yo using? I use IE9 and if I zoom either of those two pages, they zoom/enlarge exatly as I would expect them to - so not sure if you are seeing something different to me or not.
The only comment I would make about the second link - I presume you are grabbing the forecast from 'somewher' (official Met Office??). You might want to check out their usage T&C's as I don't see any reference or credit to the originators. This implies you are making the forecast and it is possible, in todays litigious society (and definately not saying I agree with it) leaving yourself open to all sorts of potential law suits (not the least being from the actual site the forecasts come from). Just a point to ponder.
Oh - and for those yet to experience it - Happy New Year - just hope wherever you are you don't have the same problem theyt had here in Melbourne where a mid-night foreworks display went wrong when one of the fireworks didn't release properly and set the spire it was being fired from on fire!
http://news.ninemsn.com.au/national/839 ... tches-fire
The only comment I would make about the second link - I presume you are grabbing the forecast from 'somewher' (official Met Office??). You might want to check out their usage T&C's as I don't see any reference or credit to the originators. This implies you are making the forecast and it is possible, in todays litigious society (and definately not saying I agree with it) leaving yourself open to all sorts of potential law suits (not the least being from the actual site the forecasts come from). Just a point to ponder.
Oh - and for those yet to experience it - Happy New Year - just hope wherever you are you don't have the same problem theyt had here in Melbourne where a mid-night foreworks display went wrong when one of the fireworks didn't release properly and set the spire it was being fired from on fire!
http://news.ninemsn.com.au/national/839 ... tches-fire
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'