Jump to content

Simple InstantWeather Module


Karamellwuerfel

Recommended Posts

Hey guys! I've made a Weather module that shows you real time and

instant weather informations of the current airport where the logged in pilot is.

ZVFcPtc.png

DEMO VIDEO: www.youtube.com/watch?v=Cx0HCaW-a5I

 

#########INSTALLATION#########

1. Copy the "core/modules/InstantWeather"-folder into your "core/modules"-folder of your va
2. Copy the "core/templates/instantweather"-folder into your "core/templates"-folder of your va

3. To show the module in the navigation: <li><a href="<?php echo url('/instantweather'); ?>">InstantWeather</a></li>

USE INFORMATION ON OTHER PAGES (v 1.9) --> More on github project README.md

Use MainController::Run to display all different information of the table on other pages. Available functions:

<?php MainController::Run('InstantWeather', 'metar'); ?>        // example: EDDS 070920Z 26004KT 230V300 9999 FEW012 SCT025 BKN068 18/16 Q1015 NOSIG
<?php MainController::Run('InstantWeather', 'pressure'); ?>     // example: 982 mbar
<?php MainController::Run('InstantWeather', 'wind_speed'); ?>   // example: 4 kts
<?php MainController::Run('InstantWeather', 'wind_degrees'); ?> // example: 260°
<?php MainController::Run('InstantWeather', 'temperature'); ?>  // example: 18.0 °C
<?php MainController::Run('InstantWeather', 'dewpoint'); ?>     // example: 16.0 °C
<?php MainController::Run('InstantWeather', 'visibility'); ?>   // example: 6.21 mile

<?php MainController::Run('InstantWeather', 'skycondition'); ?> 
/* example: Sky condition level 1 FEW 1200 ft 
            Sky condition level 2 SCT 2500 ft (Scattered)
            Sky condition level 3 BKN 6800 ft (Broken)
*/

DOWNLOAD 

(Tested on PHPVMS Version 2.1.936)

Edited by MrDonutButter
+++ UPDATE V1.9 +++
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...
  • 2 months later...
4 minutes ago, LeeCley2017 said:

Hello guy!

I installed your module, but the following occurred, my DOV does not work after the installation via PC, but via Cellular it accesses normally!

my PHPVMS is 5.5

Hi LeeCley2017, I tested it on PHPVMS Version 2.1.936 - Not in the 5.5.

What do you mein with DOV?

Do you cam explain your issue more precise?

Regards

Link to comment
Share on other sites

On 22.9.2017 at 9:54 PM, LeeCley2017 said:

Hello guy!

I installed your module, but the following occurred, my DOV does not work after the installation via PC, but via Cellular it accesses normally!

my PHPVMS is 5.5

Hey LeeCley2017!

I tested it on my computer with the phpvms 5.5.2 and get the warnings at the top of the page:

Warning: Cannot modify header information - headers already sent by [...]

To solve this, you just have to cut out line 1-6 in core > modules > InstantWeather > InstantWeather.php

<!--///////////////////////////////////////////////////////////////
/////InstantWeather Module v1.3 for phpvms by Philipp Dalheimer////
//////////////////////www.philippdalheimer.de//////////////////////
///+ DO NOT EDIT + FOR FREE USE + PHPVMS FORUM: MrDonutButter +////
///////////////////////////////////////////////////////////////-->

<?php

	class InstantWeather extends CodonModule
	{
      [...]
    }

 ?>

 

To make it simple I've uploaded a new version of the module. So you just have to download the version 1.4 and try it again. It could be, that this causes your error with the DOV.

If you've tested it out, please contact me again if it works. Thanks.

Edited by MrDonutButter
Link to comment
Share on other sites

Good afternoon!

I wanted to give you an idea, what would you like to include the track in use?

another thing I have identified is that it takes the current landing location as the current location, but if it jumps to another location it does not identify that change and continues to mark the last landing location if it changes to the current location of the pilot at events it will register correctly, it's just a suggestion!

Link to comment
Share on other sites

  • 11 months later...
On 9/2/2018 at 8:04 AM, ncd200 said:

Hello,

first of all thank you for this module.

I have the following problem, I want to show this tabel with decoded weather in a widget on the frontpage.

How can I achieve this? is this possible with a main controller?

 

Rick

3

Hey Rick, do you mean to show ONLY the complete metar info for the airport?

Link to comment
Share on other sites

yes, I have now the following:

Quote

<div class="card">
                <div class="card-title">
                    <h4>Current weather</h4>
                </div>
                <div class="card-body">

                <table style="width:100% !important;" class="table">
                  <tr>
                    <td class="fat">METAR</td>
                    <td><?php echo $metar;?></td>
                  </tr>
                  <tr>
                    <td class="fat">Pressure (altimeter)</td>
                    <td><?php echo $altim_bar . " mbar";?></td>
                  </tr>
                  <tr>
                    <td class="fat">Wind</td>
                    <td><?php echo $wind_dir_deg;?>&deg; with <?php echo $wind_speed_kt;?> kts</td>
                  </tr>
                  <tr>
                    <td class="fat">Temperature</td>
                    <td><?php echo $temp;?> <?php echo ' '. $temp_indicator;?></td>
                  </tr>
                  <tr>
                    <td class="fat">Dewpoint</td>
                    <td><?php echo $dewpoint;?> <?php echo ' '. $temp_indicator;?></td>
                  </tr>
                  <tr>
                    <td class="fat">Horizontal visibility</td>
                    <td><?php echo $visibility_decrypt;?></td>
                  </tr>
                  
                  <?php MainController::Run('InstantWeather', 'sky_condition', ''); ?>
                    
                </table>

Only where do I give the current location to work with for this module?

Thanks allready for the help!

Rick

Link to comment
Share on other sites

9 hours ago, ncd200 said:

yes, I have now the following:

Only where do I give the current location to work with for this module?

Thanks allready for the help!

Rick

Hi Rick!

The module looks for the pilots last accepted pirep arrival airport. Thats the "current position airport". It took this and show it's weather.

I've implemented a PHP get method that you can set the airports icao. To do this you have the url and you just add ?icao=ICAO_HERE - in my case:

http://phpvms.philippdalheimer.de/index.php/instantweather?icao=eddf

 

To do this, please update the module. There should be a update link in the module. Or just check out the news on github.

Hope it solves your problem, Rick! 🙂

Edited by MrDonutButter
Link to comment
Share on other sites

  • 1 year later...
  • Administrators
2 hours ago, Larsje40 said:

Hello NCD200. Which template is that wich i see on your picture? i really like it.

and can i download it somewhere with explanation how to install it?

THNX

 

gr.

 

larsje

That looks like a customized version of CrewCenter. https://github.com/web541/CrewCenter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...