Author Topic: Installing Saratoga Scripts  (Read 3778 times)

0 Members and 1 Guest are viewing this topic.

Offline g4mhj

  • Member
  • *
  • Posts: 39
    • WDL from Erith, Kent, UK
Re: Installing Saratoga Scripts
« Reply #25 on: July 22, 2018, 03:51:20 PM »
If it looks like the wind display is in MPH when the page first loads, and then switches to km/h when the AJAX refresh happens, then your Settings.php is correct as-is.  What needs to change is ajaxWDwx.js script
Code: [Select]
var useMPH   = false;       // set to true to force MPH for both English and Metric units
to
Code: [Select]
var useMPH   = true;       // set to true to force MPH for both English and Metric units
  That will keep the rest of the units in metric and force the wind to display in MPH.

This is how it is now but the result is still wrong?  i.e. changing from mph then km/h

// -- begin settings --------------------------------------------------------------------------
var flashcolor = '#00CC00'; // color to flash for changed observations RGB
var flashtime  = 2000;       // miliseconds to keep flash color on (2000 = 2 seconds);
var reloadTime = 10000;       // reload AJAX conditions every 5 seconds (= 5000 ms)
var maxupdates = 12;            // Maxium Number of updates allowed (set to zero for unlimited)
                             // maxupdates * reloadTime / 1000 = number of seconds to update
var clientrawFile = 'clientraw.txt'; // location of clientraw.txt relative to this page on website
var ajaxLoaderInBody = false; // set to true if you have <body onload="ajaxLoader(..."
var imagedir = './ajax-images';  // place for wind arrows, rising/falling arrows, etc.
var condIconType = '.jpg';   // ='.jpg' default, ='.gif' for animated meteotreviglio condition icons
var useunits = 'M';         // 'E'=USA(English) or 'M'=Metric
var decimalComma = false;    // =false for '.' as decimal point, =true for ',' (comma) as decimal point
var useKnots = false;       // set to true to use wind speed in Knots (otherwise
                     // wind in km/hr for Metric or mph for English will be used.
var useMPS   = false;       // set to true for meters/second for metric wind speeds, false= km/h
var useMPH   = true;       // set to true to force MPH for both English and Metric units
var useFeet  = false;       // set to true to force Feet for height in both English and Metric
var usehPa  = false;        // =true to force hPa for baro in both English and Metric
var useinHg = false;        // =true to force baro to inHg for both English and Metric
var showUnits = true;       //  set to false if no units are to be displayed
var thermometer = './thermometer.php'; // script for dynamic thermometer PNG image (optional)

Offline g4mhj

  • Member
  • *
  • Posts: 39
    • WDL from Erith, Kent, UK
Re: Installing Saratoga Scripts
« Reply #26 on: July 22, 2018, 03:55:18 PM »
IGNORE ABOVE:

Seems it was a Cache issue.

Now working correctly

Thanks

Offline g4mhj

  • Member
  • *
  • Posts: 39
    • WDL from Erith, Kent, UK
Re: Installing Saratoga Scripts
« Reply #27 on: July 26, 2018, 10:40:34 AM »
Here is a question about Menu Building using flyout-menu-test.xml from the World set of files.
I am trying to fully understand the syntax but I keep getting errors that nearly always points to the </menu> line.
Firstly, how important is it to keep to what I would call the paragraph structure indent length and is there a correct number of characters for them?
Secondly, I don't fully understand the logic for the default entry of RADAR where there isn't a slash on this line
<item caption="Radar">
Maybe this is why I am not fully understanding things.
I know I will get there eventually!
« Last Edit: July 26, 2018, 11:09:12 AM by g4mhj »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Installing Saratoga Scripts
« Reply #28 on: July 26, 2018, 11:09:20 AM »
Here is a question about Menu Building using flyout-menu-test.xml from the World set of files.
I am trying to fully understand the syntax but I keep getting errors that nearly always points to the </menu> line.
Firstly, how important is it to keep to what I would call the paragraph structure indent length and is there a correct number of characters for them?
Secondly, I don't fully understand the logic for the default entry of RADAR where there isn't a slash on this line
<item caption="Radar">
Maybe this is why I not fully understanding things.
I know I will get there eventually!
General structure look like this
Code: [Select]
<menu>
    <item   caption=value   param=value . . . />  a menu item at the highest level, no flyout
    <item   caption = value  > start of a flyout menu
        <item   caption=value param=value . . ./> a menu item at the second level
        <item   caption=value param=value . . ./> antother menu item at the second level
    </item> end of a flyout menu
</menu>                                                 end of the menu file

So the line with   <item caption="Radar">  enclose all following items until there is an end for that item , which is </item>
A single entry is closed with a   />
Multiple lines are closed with </item>

All those extra spaces / indentations are to make it more human readable, the server just skips them.
Wim

Offline g4mhj

  • Member
  • *
  • Posts: 39
    • WDL from Erith, Kent, UK
Re: Installing Saratoga Scripts
« Reply #29 on: July 26, 2018, 04:11:59 PM »

General structure look like this
Code: [Select]
<menu>
    <item   caption=value   param=value . . . />  a menu item at the highest level, no flyout
    <item   caption = value  > start of a flyout menu
        <item   caption=value param=value . . ./> a menu item at the second level
        <item   caption=value param=value . . ./> antother menu item at the second level
    </item> end of a flyout menu
</menu>                                                 end of the menu file

So the line with   <item caption="Radar">  enclose all following items until there is an end for that item , which is </item>
A single entry is closed with a   />
Multiple lines are closed with </item>

All those extra spaces / indentations are to make it more human readable, the server just skips them.
Wim
[/quote]

This was most informative Wim.  I have now managed to create a menu structure without errors.

Adding images and a webpage to the right side of a new page is still a mystery to me.  I seem to be able to do it but most times they are too big for the space.  Is it a simple task to reduce the size to fit?

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Installing Saratoga Scripts
« Reply #30 on: July 27, 2018, 12:57:33 AM »

This was most informative Wim.  I have now managed to create a menu structure without errors.

Adding images and a webpage to the right side of a new page is still a mystery to me.  I seem to be able to do it but most times they are too big for the space.  Is it a simple task to reduce the size to fit?
For images: always add the height/width with style="height: 1234px;  width:  1234px;"
I do not understand what you want with "a webpage to the right side of a new page"

It would be extremely helpfull if you put a link to such a page with the problem.
It is very difficult to describe how to do that, but easy to explain when there is an example.

Wim



Offline g4mhj

  • Member
  • *
  • Posts: 39
    • WDL from Erith, Kent, UK
Re: Installing Saratoga Scripts
« Reply #31 on: July 27, 2018, 05:47:26 AM »
Hi Wim
Sorry for being so vague.
As I said I am using the suffix ?menu=test as I am still working on the menu structure.
Moving on, I have created a new page that links to the menu Forecast/Metrogram as
http://bobhewitt.co.uk/pictures/WeatherDisplay/wxmetrogram.php?menu=test
I have tried to add a URL from yo.nr as

<tr>
    <td height="0" colspan="4" valign="top"><img src="http://www.yr.no/place/United_Kingdom/England/Erith/avansert_meteogram.png" width="940" height="360"></td>
  </tr>
  <tr>
This was too large widthwise so keeping it to scale I adjusted the size to 627/240.

The code came from my old website as it worked there. 

You will probably comment that the code isn't appropriate for this 'modern' script but is came from my old html based site.  The graphic needs centring at the very least so I would appreciate some help if you have the time.

Once I get to grips with these basics I am sure I should be able to add other pages - but I can see WDL & Steel Gauges will be a challenge for me.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Installing Saratoga Scripts
« Reply #32 on: July 27, 2018, 06:16:41 AM »
Current code
Code: [Select]
<div id="main-copy">
  <tr>
    <td height="0" colspan="4" valign="top"><img src="http://www.yr.no/place/United_Kingdom/England/Erith/avansert_meteogram.png" width="627" height="240"></td>
  </tr>
  <tr>
   
</div><!-- end main-copy -->
Luckily current browser are very intelligent and discard almost all lines they do not understand.
Tags like <tr> that means start new line and <td> start a new column-field should be enclosed within a <table>  </table>
But you do not need them as the only thing you want to display is ONE image.
Code: [Select]
<div id="main-copy">
 <img src="http://www.yr.no/place/United_Kingdom/England/Erith/avansert_meteogram.png" width="100%" />
</div><!-- end main-copy -->
The 100% makes sure that all available width is used.  No need to change anything when you change the width of your pages later.
I assume this website is also for you a hobby. So take it step by step and first learn the basics.
Check this book / pdf about the basics of HTML and CSS, there are numerous others.

Remove errors
When you start the Saratoga template contains zero html errors.
You can check that with the link at the footer => Valid XHTML 1.0
When I click that link on your test-page it already has 6 errors

Checking this every time you change a page, really helps to build better pages faster.

?menu=test
As I said I am using the suffix ?menu=test
That is only needed when you are testing the menu.  All Saratoga pages can be accessed directly without using the menu.  To test this page the link http://bobhewitt.co.uk/pictures/WeatherDisplay/wxmetrogram.php  is correct.

Wim


 

anything