Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 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

changing colour and other things in saratoga template

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
mino98
Posts: 10
Joined: Sat 10 Mar 2012 7:19 pm
Weather Station: PCE-FWS 20
Operating System: Windows 7 Service Pack 1
Location: Italy

changing colour and other things in saratoga template

Post by mino98 »

Hello, I'm Giacomo and I use the italian-world-cumulus version of Saratoga Template. I would like to resolve 3 problems, but i don't know how.

1st)I would like to change the colours of the minimal and maximal temperatures in index.php(both "today" and "yesterday")respectively in blue and red.

2nd)The pressure is rising, the arrrow is correct and green, but below i can read "stabile", which is the correct translation of "steady", but the problem is that the pressure is "rising slowly". I think this happens only when the pressure is rising "slowly", when it is "rapidly" the error doesn't occur, but I'm not really sure about this.How can i do?

Last but not least) I have one googlead in the upper part, other two in the lower part, a histat counter, and a donation button.
This is my current website:
Image

I would like to have the site as the image below,please:
Image


Thank you in advance, these things are very important for me!
PS: my site is www.meteoacquavivaba.altervista.org or www.meteoacquaviva.it.
Good evening from Italy!
User avatar
saratogaWX
Posts: 1203
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: changing colour and other things in saratoga template

Post by saratogaWX »

Hi Giacomo, I also posted this answer to the same questions you posed on WXForum.net :)
mino98 wrote: Hello, I'm Giacomo and I use the italian-world-cumulus version of Saratoga Template. I would ask you 3 little things.

1st)I would like to change the colours of the minimal and maximal temperatures in index.php(both "today" and "yesterday")respectively in blue and red.
You would need to change the ajax-dashboard.php script to insert inline CSS directives for the colors you want.

Change ajax-dashboard.php

Code: Select all

                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('High:'); ?></strong></td>
                      <td style="text-align: center;">
					    <span class="ajax" id="ajaxtempmax">
                        <?php echo strip_units($maxtemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($maxtempt); ?>
					  </td>
                      <?php if(isset($maxtempyest)) { ?>
                      <td style="text-align: center;"><?php 
			            echo strip_units($maxtempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($maxtempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('Low:'); ?></strong></td>
                      <td style="text-align: center;">
					    <span class="ajax" id="ajaxtempmin">
                        <?php 
			               echo strip_units($mintemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($mintempt); ?>
					  </td>
                      <?php if(isset($mintempyest)) { ?>
                      <td style="text-align: center;"><?php 
			               echo strip_units($mintempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($mintempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                  </table>
				</td>
              </tr>
to

Code: Select all

                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('High:'); ?></strong></td>
                      <td style="text-align: center; color: red">
					    <span class="ajax" id="ajaxtempmax">
                        <?php echo strip_units($maxtemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($maxtempt); ?>
					  </td>
                      <?php if(isset($maxtempyest)) { ?>
                      <td style="text-align: center; color: red;"><?php 
			            echo strip_units($maxtempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($maxtempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('Low:'); ?></strong></td>
                      <td style="text-align: center; color: blue;">
					    <span class="ajax" id="ajaxtempmin">
                        <?php 
			               echo strip_units($mintemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($mintempt); ?>
					  </td>
                      <?php if(isset($mintempyest)) { ?>
                      <td style="text-align: center; color: blue;"><?php 
			               echo strip_units($mintempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($mintempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                  </table>
				</td>
              </tr>
mino98 wrote:
2nd)The pressure is rising, the arrrow is correct and green, but below i can read "stabile", which is the correct translation of "steady", but the problem is that the pressure is "rising slowly". I think this happens only when the pressure is rising "slowly", when it is "rapidly" it doesn't happen, but I'm note sure about this last thing.how can i do?
When the page first loads, the dashboard displays the values of $baro, $trend and $pressuretrendname variables. These are set in the CU-defs.php file using

Code: Select all

$baro = $WX['press'];
$trend = $WX['presstrendval'];
$pressuretrendname = $WX['presstrend'];
so it is the Cumulus values for those variables that are used.

When the ajaxCUwx.js script begins execution, the realtime.txt is read and uses

Code: Select all

		//Pressure...
		var pressure = convertBaro(realtime[10]);
		set_ajax_obs("ajaxbaro",pressure.toFixed(dpBaro) + uomBaro);
...
		var pressuretrend = convertBaro(realtime[18]);
		pressuretrend = pressuretrend.toFixed(dpBaro+1);
		if (pressuretrend > 0.0) {pressuretrend = '+' + pressuretrend; } // add '+' to rate
		set_ajax_obs("ajaxbarotrend",pressuretrend + uomBaro);
...

		var barotrendtext = ajax_get_barotrend(realtime[18]);
		set_ajax_obs("ajaxbarotrendtext",barotrendtext);

...

var langBaroTrend = new Array (
 "Steady", "Rising Slowly", "Rising Rapidly", "Falling Slowly", "Falling Rapidly");


function ajax_get_barotrend(inbtrnd) {
// routine from Anole's wxsticker PHP (adapted to JS by Ken True)
// input: trend in hPa or millibars
//   Barometric Trend(3 hour)

// Change Rates
// Rapidly: =.06 inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02 inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb

// 5 conditions
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly

// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf
// figure out a text value for barometric pressure trend
   var btrnd = cBaroToHPA(inbtrnd);
   
   if ((btrnd >= -0.7) && (btrnd <= 0.7)) { return(langBaroTrend[0]); }
   if ((btrnd > 0.7) && (btrnd < 2.0)) { return(langBaroTrend[1]); }
   if (btrnd >= 2.0) { return(langBaroTrend[2]); }
   if ((btrnd < -0.7) && (btrnd > -2.0)) { return(langBaroTrend[3]); }
   if (btrnd <= -2.0) { return(langBaroTrend[4]); }
  return(btrnd);
}
to update the page with values from realtime.txt and a computed phrase for the trend text based on realtime[18] (barometer change last hour). Your current display has 1017.9 and a rate of +0.2hPa/hr with text of (untranslated) "Rising slowly".
Based on the +0.2hPa/hr rate, the JavaScript function would have to see a rate of more than 0.7hPa/hr to have anything but "Steady".



mino98 wrote:
Last but not least) I have one googlead in the upper part, other two in the lower part, a histat counter, and a donation button.

I would like the site as the image below please.

[img width=893 height=1024]http://www.meteoacquavivaba.altervista.org/dopo.jpg[/img]
Thank you in advance, these things are very important for me!
PS: my site is www.meteoacquavivaba.altervista.org or www.meteoacquaviva.it
This may be a bit more complicated to do correctly, but based on your snapshot, you want stuff before the header and after the footer, but still within the page. For the header stuff, change header.php in this area

Code: Select all

<div id="page"><!-- page wrapper -->
<!-- header -->
to

Code: Select all

<div id="page"><!-- page wrapper -->
<!-- insert stuff here -->
<!-- header -->
and for footer.php change

Code: Select all

    </div><!-- end id="footer" -->
  </div><!-- end id="page" wrapper -->
to

Code: Select all

    </div><!-- end id="footer" -->
<!-- insert stuff here -->
  </div><!-- end id="page" wrapper -->
Hope this helps...

Best regards,
Ken
mino98
Posts: 10
Joined: Sat 10 Mar 2012 7:19 pm
Weather Station: PCE-FWS 20
Operating System: Windows 7 Service Pack 1
Location: Italy

Re: changing colour and other things in saratoga template

Post by mino98 »

saratogaWX wrote:Hi Giacomo, I also posted this answer to the same questions you posed on WXForum.net :)
mino98 wrote: Hello, I'm Giacomo and I use the italian-world-cumulus version of Saratoga Template. I would ask you 3 little things.

1st)I would like to change the colours of the minimal and maximal temperatures in index.php(both "today" and "yesterday")respectively in blue and red.
You would need to change the ajax-dashboard.php script to insert inline CSS directives for the colors you want.

Change ajax-dashboard.php

Code: Select all

                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('High:'); ?></strong></td>
                      <td style="text-align: center;">
					    <span class="ajax" id="ajaxtempmax">
                        <?php echo strip_units($maxtemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($maxtempt); ?>
					  </td>
                      <?php if(isset($maxtempyest)) { ?>
                      <td style="text-align: center;"><?php 
			            echo strip_units($maxtempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($maxtempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('Low:'); ?></strong></td>
                      <td style="text-align: center;">
					    <span class="ajax" id="ajaxtempmin">
                        <?php 
			               echo strip_units($mintemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($mintempt); ?>
					  </td>
                      <?php if(isset($mintempyest)) { ?>
                      <td style="text-align: center;"><?php 
			               echo strip_units($mintempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($mintempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                  </table>
				</td>
              </tr>
to

Code: Select all

                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('High:'); ?></strong></td>
                      <td style="text-align: center; color: red">
					    <span class="ajax" id="ajaxtempmax">
                        <?php echo strip_units($maxtemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($maxtempt); ?>
					  </td>
                      <?php if(isset($maxtempyest)) { ?>
                      <td style="text-align: center; color: red;"><?php 
			            echo strip_units($maxtempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($maxtempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                    <tr>
                      <td style="text-align: right;"><strong><?php langtrans('Low:'); ?></strong></td>
                      <td style="text-align: center; color: blue;">
					    <span class="ajax" id="ajaxtempmin">
                        <?php 
			               echo strip_units($mintemp) . $uomTemp; ?>
                        </span><br />
                        <?php echo fixup_time($mintempt); ?>
					  </td>
                      <?php if(isset($mintempyest)) { ?>
                      <td style="text-align: center; color: blue;"><?php 
			               echo strip_units($mintempyest) . $uomTemp; ?>
                        <br />
                        <?php echo fixup_time($mintempyestt); ?>
					  </td>
                      <?php } ?>
                    </tr>
                  </table>
				</td>
              </tr>
mino98 wrote:
2nd)The pressure is rising, the arrrow is correct and green, but below i can read "stabile", which is the correct translation of "steady", but the problem is that the pressure is "rising slowly". I think this happens only when the pressure is rising "slowly", when it is "rapidly" it doesn't happen, but I'm note sure about this last thing.how can i do?
When the page first loads, the dashboard displays the values of $baro, $trend and $pressuretrendname variables. These are set in the CU-defs.php file using

Code: Select all

$baro = $WX['press'];
$trend = $WX['presstrendval'];
$pressuretrendname = $WX['presstrend'];
so it is the Cumulus values for those variables that are used.

When the ajaxCUwx.js script begins execution, the realtime.txt is read and uses

Code: Select all

		//Pressure...
		var pressure = convertBaro(realtime[10]);
		set_ajax_obs("ajaxbaro",pressure.toFixed(dpBaro) + uomBaro);
...
		var pressuretrend = convertBaro(realtime[18]);
		pressuretrend = pressuretrend.toFixed(dpBaro+1);
		if (pressuretrend > 0.0) {pressuretrend = '+' + pressuretrend; } // add '+' to rate
		set_ajax_obs("ajaxbarotrend",pressuretrend + uomBaro);
...

		var barotrendtext = ajax_get_barotrend(realtime[18]);
		set_ajax_obs("ajaxbarotrendtext",barotrendtext);

...

var langBaroTrend = new Array (
 "Steady", "Rising Slowly", "Rising Rapidly", "Falling Slowly", "Falling Rapidly");


function ajax_get_barotrend(inbtrnd) {
// routine from Anole's wxsticker PHP (adapted to JS by Ken True)
// input: trend in hPa or millibars
//   Barometric Trend(3 hour)

// Change Rates
// Rapidly: =.06 inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02 inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb

// 5 conditions
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly

// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf
// figure out a text value for barometric pressure trend
   var btrnd = cBaroToHPA(inbtrnd);
   
   if ((btrnd >= -0.7) && (btrnd <= 0.7)) { return(langBaroTrend[0]); }
   if ((btrnd > 0.7) && (btrnd < 2.0)) { return(langBaroTrend[1]); }
   if (btrnd >= 2.0) { return(langBaroTrend[2]); }
   if ((btrnd < -0.7) && (btrnd > -2.0)) { return(langBaroTrend[3]); }
   if (btrnd <= -2.0) { return(langBaroTrend[4]); }
  return(btrnd);
}
to update the page with values from realtime.txt and a computed phrase for the trend text based on realtime[18] (barometer change last hour). Your current display has 1017.9 and a rate of +0.2hPa/hr with text of (untranslated) "Rising slowly".
Based on the +0.2hPa/hr rate, the JavaScript function would have to see a rate of more than 0.7hPa/hr to have anything but "Steady".



mino98 wrote:
Last but not least) I have one googlead in the upper part, other two in the lower part, a histat counter, and a donation button.

I would like the site as the image below please.

[img width=893 height=1024]http://www.meteoacquavivaba.altervista.org/dopo.jpg[/img]
Thank you in advance, these things are very important for me!
PS: my site is www.meteoacquavivaba.altervista.org or www.meteoacquaviva.it
This may be a bit more complicated to do correctly, but based on your snapshot, you want stuff before the header and after the footer, but still within the page. For the header stuff, change header.php in this area

Code: Select all

<div id="page"><!-- page wrapper -->
<!-- header -->
to

Code: Select all

<div id="page"><!-- page wrapper -->
<!-- insert stuff here -->
<!-- header -->
and for footer.php change

Code: Select all

    </div><!-- end id="footer" -->
  </div><!-- end id="page" wrapper -->
to

Code: Select all

    </div><!-- end id="footer" -->
<!-- insert stuff here -->
  </div><!-- end id="page" wrapper -->
Hope this helps...

Best regards,
Ken
I answered in "WXFORUM".
Post Reply