Author Topic: NWS-Alerts nws-details.php open in new page  (Read 1887 times)

0 Members and 1 Guest are viewing this topic.

Offline spd2612

  • Member
  • *
  • Posts: 30
    • HurricanePub
NWS-Alerts nws-details.php open in new page
« 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



Ambient Weather WS-5000
Ultrasonic Anemometer
Thermo-Hygrometer Sensor WH31E
Soil Moisture Sensor WH31SM
Lightning Detection WH31L

Offline W5TUX

  • Member
  • *
  • Posts: 5
Re: NWS-Alerts nws-details.php open in new page
« Reply #1 on: February 02, 2023, 12:42:21 AM »
This is an old topic but I have the same needs.

Offline spd2612

  • Member
  • *
  • Posts: 30
    • HurricanePub
Re: NWS-Alerts nws-details.php open in new page
« Reply #2 on: February 02, 2023, 08:05:23 AM »
Just use target="_blank" in your url



Ambient Weather WS-5000
Ultrasonic Anemometer
Thermo-Hygrometer Sensor WH31E
Soil Moisture Sensor WH31SM
Lightning Detection WH31L

Offline W5TUX

  • Member
  • *
  • Posts: 5
Re: NWS-Alerts nws-details.php open in new page
« Reply #3 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.
« Last Edit: February 02, 2023, 06:11:46 PM by W5TUX »

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: NWS-Alerts nws-details.php open in new page
« Reply #4 on: February 03, 2023, 03:38:56 AM »
I think you need a closing double quote on line 49 after style: style="color: #000;"

Offline W5TUX

  • Member
  • *
  • Posts: 5
Re: NWS-Alerts nws-details.php open in new page
« Reply #5 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.

 

anything