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

PHP experts I am puzzled!!

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

Moderator: daj

Post Reply
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

PHP experts I am puzzled!!

Post by water01 »

On my webpages I have an include for the credits lines at the bottom of each page. Included in it is a bit of code that displays the Version number and Build of CumulusMX.

Code: Select all

<span style="color: #CC0000">v<?php echo $version?></span> (<span style="color: #CC0000"><?php echo $build?></span>) using <span style="color: #CC0000"><?php echo $tagfilename?></span> (<span style="color: #CC0000"><?php echo $tagversion?></span>)<br>  
The bit that I cannot understand is why does the above code shows this on the main index.php page

Image

but this on every other page.

Image

Where are the extra v and brackets coming from??????? :bash: :bash: :bash:
David
Image
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: PHP experts I am puzzled!!

Post by broadstairs »

I suspect this is because your definition of the $build variable is different on other pages! Without seeing the full php code it is difficult to know for sure.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: PHP experts I am puzzled!!

Post by water01 »

Thanks but that cannot be true as it is an include i.e. all pages say

Code: Select all

            <?php
                include 'includes/credits.php';
            ?>
and here is credits.php

Code: Select all

<p class="credits">
<p style="text-align: center">© <?php echo $year?>, Burnham-on-Sea Weather.&nbsp;&nbsp;
Page updated <?php echo $update?><br>
Powered by
<a href="https://cumulus.hosiene.co.uk/" target="_blank"><span style="color: #CC0000">Cumulus MX</span><img src="https://www.dmjsystems.co.uk/weatherbos/images/cumulussmall.png" width="39" height="16" alt=""></a>
<span style="color: #CC0000">v<?php echo $version?></span> (<span style="color: #CC0000"><?php echo $build?></span>) using <span style="color: #CC0000"><?php echo $tagfilename?></span> (<span style="color: #CC0000"><?php echo $tagversion?></span>)<br>
Never base important decisions on this or any weather information obtained from the Internet.<br>
Copyright &copy; CSS3_photo_dark | <a href="https://www.css3templates.co.uk">design from css3templates.co.uk</a></p>
</p>
So how does it give different results??????
David
Image
User avatar
wurzelmac
Posts: 298
Joined: Mon 03 Jun 2024 5:30 pm
Weather Station: Vantage Pro2 plus w 24/h fan
Operating System: MacOS Sequoia 15.2
Location: Prägraten am Großvenediger, Tyrol, Austria
Contact:

Re: PHP experts I am puzzled!!

Post by wurzelmac »

Code: Select all

<span style="color: #CC0000">v<?php echo $version?></span> (<span style="color: #CC0000"><?php echo $build?></span>)
What happens when you are removing the "v" and the brackets - maybe they are hardcoded by the tag?
Reinhard

Image
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: PHP experts I am puzzled!!

Post by water01 »

Thanks for the suggestion but sorry tried that and they are not hard coded into the webtag.

Code: Select all

$version                    = "4.2.0";  //  version of Cumulus in use 

Code: Select all

$build                      = "4037";  //  build of Cumulus in use
David
Image
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: PHP experts I am puzzled!!

Post by broadstairs »

I've just looked at your website and then viewed the source for the main page which shows the double brackets and double v. Looking at the source the code as

Code: Select all

<span style="color: #CC0000">vv4.2.0</span> (<span style="color: #CC0000">(4037)</span>)
The fact that it shows 'vv4.2.0' and '(4037)' means that the PHP code has the variable set with the extra 'v' and brackets already in place. On another page source shows

Code: Select all

<span style="color: #CC0000">v4.2.0</span> (<span style="color: #CC0000">4037</span>)
with no extra 'v' and no brackets '4037' means that the variable value does not have the 'v' and brackets set.

So sorry but the PHP code to set the variable values must be different. PHP is doing what it is told to do and the fault lies elsewhere. There must be different copies of the PHP code being executed. Code is dumb it does exactly what it is told to do!

Make sure you do not have old PHP versions of it lying around.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: PHP experts I am puzzled!!

Post by water01 »

OK OK OK you are right but not with another version of my code in the include!! So I started looking for other things that might use the same PHP webtags and voila!!

My index.php uses the BT's Global Sager weathercaster viewtopic.php?t=9901 and it also uses the same webtags formatted the same way and since it is called before my code result equals double v's and brackets.

Thank you, you made me go and look elsewhere and find out what was unique to that PHP page that nothing else used!! and up popped BT's Global Sager with the same webtags.

No wonder I couldn't find it I was looking in completely the wrong place!! :bash: :bash: :bash:

All fixed!!
David
Image
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: PHP experts I am puzzled!!

Post by broadstairs »

David if I had a penny for everytime that happened to me I'd be rich. You get so tied up in what you're doing you get blinkered! ;)

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
Post Reply