Adding Extra Links in Menu [Informational ]

Wim,

I’ve researched the forum and have tried a few methods, but have been unsuccessful in getting these to work when modifying frames.php. I added the following lines, by it won’t appear in the menu:

# ================================================# # ADD BY MTH # ================================================# $show = true; #$show = false; # if ($show == true) { $frame = 'ForecastDiscussion'; $frm_ttls[$frame] = 'NWS Discussion'; // name in menu $frm_src[$frame] = 'https://forecast.weather.gov/product.php?site=LWX&issuedby=LWX&product=AFD&format=txt&version=2&glossary=1&highlight=off'; $frm_wdth[$frame] = 1500; // optional set this to the width if resizing is to ugly #$frm_type[$frame] = 'img'; } // set this to 'img' if you want to display an image only # # ================================================#

Can you point me it the right direction?

Regards,
Michael

There was a small typo, the end } of the if statement was commented.

#$frm_type[$frame] = ‘img’; } // set this to ‘img’ if you want to display an image only

So change your page to something like this:

if ($show == true) {
$frame                  = 'ForecastDiscussion';
$frm_ttls[$frame]       = 'NWS Discussion';  // name in menu
$frm_src[$frame]        = 'https://forecast.weather.gov/product.php?site=LWX&issuedby=LWX&product=AFD&format=txt&version=2&glossary=1&highlight=off';
$frm_hgth[$frame]       = 1500; 
}      

@ALL Although we could remove the check if ($show == true) { . . . } that is not wise.
Sometimes there is a problem and we want to remove the page from the meny for a short period. You can then set the $show = false; and the page will disappear. And then $show = true; when the problem is solved.

Success,
Wim

Hi Wim,

I’ve tried adding the code to the bottom of “_my_settings\frames.php” without any luck:

# # $show = true; #$show = false; if ($show == true) { $frame = 'ForecastDiscussion'; $frm_ttls[$frame] = 'NWS Discussion'; // name in menu $frm_src[$frame] = 'https://forecast.weather.gov/product.php?site=LWX&issuedby=LWX&product=AFD&format=txt&version=2&glossary=1&highlight=off'; $frm_hgth[$frame] = 1500; }

The menu still has the standard six links in the extras section. Am I doing something incorrectly?

Regards,
Michael

This link displays the contents on your webserver of the script:

There is no “ForecastDiscussion” anywhere to be found.
Are you sure you are updating the scripts on your server, maybe you only update a local backup-copy?
Does your server maybe need a restart after changing scripts?

Wim

Wim,

:oops: :oops: :oops:

It would’ve helped if I uploaded to the correct folder :lol:

All appears to be working!

Thanks for the support,
Michael
http://www.relayweather.net

Hi Wim,

After success on the previous message in this thread, I’m baffled to why I can’t get another one to show. New code below in RED font in frames.php

# # $show = true; #$show = false; if ($show == true) { $frame = 'PublicStatement'; $frm_ttls[$frame] = 'NWS Statement'; // name in menu $frm_src[$frame] = 'https://forecast.weather.gov/product.php?site=NWS&issuedby=LWX&product=PNS&format=txt&version=1&glossary=0'; $frm_hgth[$frame] = 1500; } [color=red][b]# # $show = true; #$show = false; if ($show == true) { $frame = 'BWIClimateReport'; $frm_ttls[$frame] = 'BWI Climate Report'; // name in menu $frm_src[$frame] = 'https://tgftp.nws.noaa.gov/data/raw/cd/cdus41.klwx.cli.bwi.txt'; $frm_hgth[$frame] = 1500; }[/b][/color]

The last link, BWI Climate Report, does not appear on my menu, but it does appear in the code after upload: Welcome relayweather.net - BlueHost.com

Any assistance you can provide to where I’m going wrong.

Thanks!
Michael

Click on the link in your menu
The page with the frame will open but with the “invalid / broken link” symbol
Use f.i. Chrome => right click => inspect => console => errors

Refused to display ‘https://tgftp.nws.noaa.gov/data/raw/cd/cdus41.klwx.cli.bwi.txt’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.

So that link can not be displayed in a fram as it is not allowed by tgftp.nws.noaa.gov

Wim

If you want to load a textfile and display it, this is a smal script to do that.
Unzip and place in the _my_settings/ folder

Add the following lines to the _my_settings/frames.php (@mtholden remove current line for the menu entry)

$show   = true; 
#
if ($show == true) {
$frame                  = 'BWIClimateReport';
$frm_ttls[$frame]       = lang('BWI Climate Report');  // name in menu
$frm_src[$frame]        = './_my_settings/display_text.php';
$frm_type[$frame]       = 'div'; 
}

Wim


display_text.php.zip (1.71 KB)

Wim,

Many thanks! Your support is always appreciated! :occasion5:

Michael

Wim,

I noticed on a few of my extra links that a grey bar appears at the top (similar to an indication that something is still processing). This bar never goes away. How do I get this to stop and disappear?

Regards,
Michael


The loading gif is diplayed in the background continuously.
It should not be visible when the page is loaded if the background op the page has a color.

This is the page in your screenshot as displayed without an iFrame. Welcome relayweather.net - BlueHost.com
The tag has no css.
If you change it to

<body style="background-color: silver;">

it has a back-ground color and the .gif will disappear.

A link to the exact page you are talking about,would be helpful to see why that loading gif is still visible.
Another visitor found it for me.

Wim


Hi Wim,

Something strange occurred lately. The added menu links all worked perfectly until the last week or so. I’m not 100% certain when it stopped working, but I have been updating my site with the latest updates regularly.

On the menu bar, the link “Detail Climate Summary” stopped working. Instead, it links directly to the top level page. All of the other added links work perfectly. Any ideas?

Regards,
Michael

It is one of your own links which can not be started.
This is the URL for that page [font=courier][b]Welcome relayweather.net - BlueHost.com

There were a few “script-kids” who were testing our links with SQL injection and or fakes pasword entries.
We are not using SQL in the dashboard, but it is sometimes annoying in the logs.
So I added a check that the length of the “frame=” variable should be less then 20 characters.
All longer entries are discarded and in that case the normal dashboard is started.

If you shorten the length of the name from exact 20 characters to a shorter name, that page will work also.
Script: _my_settings/frames.php line 166 to f.i.

$frame                  = 'DetailClimateSum';

Wim

Wim,

Thanks for the thorough explanation. Working well again!

Cheers,
Michael

Hi Wim,

I’m wanting to expand the width of a frame with the following code in frames.php

#
#
$show   = true; 
#$show   = false; 
if ($show == true) {
$frame                  = 'Area Mesomap';
$frm_ttls[$frame]       = 'Central Maryland Mesomap';  // name in menu
$frm_src[$frame]        = 'https://mesowest.utah.edu/cgi-bin/droman/mesomap.cgi?lat=39.23950&lon=-76.70783&radius=25&rawsflag=290&site=C3783&unit=0&time=LOCAL&product=&year1=&month1=&day1=00&hour1=00&currTimeChecked=';
$frm_wdth[$frame]       = 1000;   // optional set this to the width if resizing is to ugly
$frm_hgth[$frame]       = 1500;
}  
#
#

Adding the following code doesn’t seem to have any affect on the width of the frame. Can you point me in the right direction?

$frm_wdth[$frame]       = 1000;

Cheers!
Michael

You want to set the width of a frame to 1000px.
But the width of the dashboard area for “3 blocks wide” is 956px.
So it will show not 1000px as the code can not “enlarge” the dashboard.

If you were running with 4 blocks wide the frame width would have been 1000px
If you would not set the width the width would be 100% = all available width.

You can see the effect when you make the browser weindow smaller.
The mesonet page will get smaller also.

Hope my-english is clear enough to see the effect of this setting
Wim

Hi Wim,

Yes, I completely understand your explanation and how the dashboard functions concerning width. It makes perfect sense. As always, your assistance is greatly appreciated!

Regards,
Michael

adding your body tag has worked.
I will try to remember that the pages must have this to work correctly.

Thank you