WXforum.net

Weather Software => Other Weather Software => Topic started by: spd2612 on December 15, 2020, 08:55:53 AM

Title: NWS-Alerts nws-details.php open in new page
Post by: spd2612 on December 15, 2020, 08:55:53 AM
I am running NWS-Alerts Version 1.43 on stand alone pages, I have stopped the summary page from being used but want the nws-details page to open in a new page when clicked on in the alerts box preferably in a resized window . Can anyone tell me how and what to edit to do that ?
I hope this is posted in the right place
Title: Re: NWS-Alerts nws-details.php open in new page
Post by: W5TUX on February 02, 2023, 12:42:21 AM
This is an old topic but I have the same needs.
Title: Re: NWS-Alerts nws-details.php open in new page
Post by: spd2612 on February 02, 2023, 08:05:23 AM
Just use target="_blank" in your url
Title: Re: NWS-Alerts nws-details.php open in new page
Post by: W5TUX on February 02, 2023, 04:27:47 PM
Thanks for the reply. The URL in the file "new-alerts-summary-inc.php" line 47 is generated by the PHP script. I did indeed add the "target="_blank" tag into the code on line 49. It's not throwing any errors but is not exhibiting the desired behavior.

I had previously added the onclick="window.open()" in the iframe code and that worked on a previous version of the scripts package. That is not working. Tested on multiple browsers.

Code: [Select]
47    $alerts .= '   &nbsp;&nbsp;'.$aav[$i][10].'&nbsp;<a href="'.$alertURL.'?a='
         48          .$aav[$i][14].'#WA'.$aav[$i][13].'" title=" &nbsp;Details for '.$aav[$i][12]
         49          .' '.$aav[$i][0].'" style="color: #000; target="_blank">'.$aav[$i][0].'</a> - <br>Expires: '
         50          .$expires."<br />\n";
    }

I am wondering:
1. If I am using the correct file.
2. The line(s) of code are the right place to edit.
Title: Re: NWS-Alerts nws-details.php open in new page
Post by: davidefa on February 03, 2023, 03:38:56 AM
I think you need a closing double quote on line 49 after style: style="color: #000;"
Title: Re: NWS-Alerts nws-details.php open in new page
Post by: W5TUX on February 04, 2023, 08:10:36 PM
Good eye. Thank you! That was the problem. It's odd that it didn't throw an error.

That was indeed the correct file and lines of code to edit.

For those that want to do the same, the URL for "noAlerts" also needs the same code additions at line number 67.