Jump to content

skylineVirtual

Members
  • Posts

    59
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by skylineVirtual

  1. Hi guys, I have a question on the live map today. We have added a way to display the true flight path of a pilot on our live map. here http://web.skyline-va.de/live Once you click on a plane in inflight, everything is as it should be for a few moments and you can see the true flight path (green) of the pilot as well as a line plotted from the current position to the arrival airport (white) and another one from departure to arrival (red, the default one). Now as soon as you wait for one or two minutes the data get's updated a few times and only the plane moves on, leaving you with an old flightpath and a new position of the plane icon. As this doesn't look very nice I would love to have the flightpath update with the plane. The code required for this feature is all inside the populateMap(data) function inside this tag: google.maps.event.addListener(flightMarkers[flightMarkers.length - 1], 'click', function() The solution would probably be to somehow simulate a click on the selected plane when the data refreshes. Does someone know how to do this? Or is there another way of achieving this result? Thanks in advance! Lauritz
  2. Looks really nice! We are thinking about ordering a cAcars Advanced Tracker but there is one question. Would it be possible to remove some of the features and change them with others as we don't need the Position Tracking because we solved this with our own module and swap this with the Cityscape Layout for example? That would be great!
  3. Or you can use this script here: http://forum.phpvms.net/topic/19785-livemap-and-inair/#entry105167 to make the 360 different images
  4. Hello, I've been searching for a way to solve this problem a while now. We have a custom style acarsmap, which doesn't contain any terrain or satellite data. So if there is only one pilot flying the autozoom zooms in there and you only see the icon and gray surface, which isn't very helpful unless you scroll out. Is there a way to reduce the zoom level so you know immediately what's around that plane? Thanks in advance!
  5. Try to use: <?php echo round(Auth::$userinfo->totally, 2); ?>
  6. Hello, I thought I'd take some time to introduce our small virtual airline here in the forums. Since November 2012 we operate a fleet of Boeing 737-800, Boeing 737-700 and later on when we were ready steadily increased our variety of aircraft types to meanwhile Airbus Boeing 737-800, Boeing 737-700, A320-200, Airbus A330-300, Dash 8Q-400 and Boeing 777-200LR. We mainly operate holiday and business schedules throughout Europe but recently expanded our network to operate flights to American, Asian and other parts of the world. With our subsidiary sky GO! flying with a fleet of B737s we are home to a low-cost carrier fleet as well providing a perfect mix while still following our aim and motto to simulated as realistically as possible without losing the fun. Here no one is forced to fly specific aircraft types before acquiring a higher typerating later on, everyone is welcome to join in if he can contribute a minimum of two flights a month, that's all we ask for. Since the launch we have constantly tried to improve our system and website and now feature a modern website accompanied by our system skylink., which was introduced in last October and is based on phpVMS with lots of modifications, as our whole User Interface is custom coded and includes OFP's, charters, a flightplan suggestion form etc. Here are some images of our livery: If you would like to know what the layout of our system looks like then you can have a look here: http://skyline-va.de/pic/ofp/pic.php So if you know a little German and are interested in flying through Europe and eventually the world in blue and white airplanes you are more than welcome to stop by and have a look. skyline-va.de forum.skyline-va.de
  7. Glad to hear you got it working But please do us a favor if you plan on creating a custom inair icon don't use the one we created. I came across this once or twice now. If you have created your own image then just ignore this
  8. I don't know if this would be possible but it would maybe work if VA owners were able to add registered users on simBrief to a VA account or something along with their pilotid so when the request gets sent by the VA Website it checks if this pilot is part of the airline and then uses his Airac to generate the briefing. If the API can't find the pilot to be matching with the database entries it opens up the login window so non VA projects can still use it the other way. Just a thought, the way it is right now is OK with us but this would be my suggestion how you could maybe solve this. People obviously would still need a simBrief account but wouldn't have to log in.
  9. It doesn't only look very nice, it is very nice The fact that every member has to be registered isn't to bad - many VAPilots already have a simBrief account so we figured out this wouldn't really be a big deal. The possibilities you get are great. We were able to modify and improve our briefing to a high realism level in only two days. The pilots get realistic fuel calculations, route and weather information as well as maps and downloads in not time. And you are free to design this however you want. As an example, screenshots of our briefing page: http://skyline-va.de/pic/ofp/pic.php
  10. Try to use data.flightnum.substring(0,3); instead of data.code
  11. Try to use data.flightnum.substring(0,3); instead of data.code I couldn't check it if it works as I'm on the phone at the moment but using substring should work
  12. Do you have your inair pictures sorted the way this piece of code needs to have it? In your case you would need two folders in your lib/images/inair folder. One would be VLI and the other FEV. Your icons need to go in there.
  13. I can't even access your website. But by the way: There is one thing missing in these instructions. After you have followed the steps I mentioned above you have to use this else command for the one in line 74 of the index.php (phpvms root folder): else { # It's a template sammich! if (strpos($page_content,'html { height: 100% } body { height: 100%; margin: 0; padding: 0 }') !== false) { $BaseTemplate->ShowTemplate('header2.tpl'); echo $page_content; } else { $BaseTemplate->ShowTemplate('header.tpl'); echo $page_content; $BaseTemplate->ShowTemplate('footer.tpl'); } } Then you should get a fullscreen live map. Happy Christmas!
  14. PM'd you, I've probably found the solution now
  15. Ok, I've coded the full screen module for you Put this in your ACARS.php Module: public function viewmapbig() { $this->set('acarsdata', ACARSData::GetACARSData()); $this->render('acarsmapbig.tpl'); } Then you have to create a new template file in your "phpvms/lib/skins/YOURSKINFOLDER/" folder named acarsmapbig.tpl which contains the following stuff: <head> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } </style> </head> <?php /** * These are some options for the ACARS map, you can change here * * By default, the zoom level and center are ignored, and the map * will try to fit the all the flights in. If you want to manually set * the zoom level and center, set "autozoom" to false. * * You can use these MapTypeId's: * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId * * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive * * Also, how to style the acars pilot list table. You can use these style selectors: * * table.acarsmap { } * table.acarsmap thead { } * table.acarsmap tbody { } * table.acarsmap tbody tr.even { } * table.acarsmap tbody tr.odd { } */ ?> <script type="text/javascript"> <?php /* These are the settings for the Google map. You can see the Google API reference if you want to add more options. There's two options I've added: autozoom: This will automatically center in on/zoom so all your current flights are visible. If false, then the zoom and center you specify will be used instead refreshTime: Time, in seconds * 1000 to refresh the map. The default is 10000 (10 seconds) */ ?> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=weather&sensor=false"> </script> <script type="text/javascript"> var acars_map_defaults = { autozoom: false, zoom: 4, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT')?>", "<?php echo Config::Get('MAP_CENTER_LNG')?>"), mapTypeId: google.maps.MapTypeId.SATELLITE, refreshTime: 10000 }; </script> <div id="acarsmap" style="margin: 0; width: 100%; height: 100%; position: absolute;"></div> </div> <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script> <?php /* This is the template which is used in the table above, for each row. Be careful modifying it. You can simply add/remove columns, combine columns too. Keep each "section" (<%=...%>) intact Variables you can use (what they are is pretty obvious) Variable: Notes: <%=flight.pilotid%> <%=flight.firstname%> <%=flight.lastname%> <%=flight.pilotname%> First and last combined <%=flight.flightnum%> <%=flight.depapt%> Gives the airport name <%=flight.depicao%> <%=flight.arrapt%> Gives the airport name <%=flight.arricao%> <%=flight.phasedetail%> <%=flight.heading%> <%=flight.alt%> <%=flight.gs%> <%=flight.disremaining%> <%=flight.timeremaning%> <%=flight.aircraft%> Gives the registration <%=flight.aircraftname%> Gives the full name <%=flight.client%> FSACARS/Xacars/FSFK, etc <%=flight.trclass%> "even" or "odd" <%=flight.realid%> <%=flight.percomplete%> <%=flight.onlineimage%> You can also use logic in the templating, if you so choose: http://ejohn.org/blog/javascript-micro-templating/ */ ?> <script type="text/html" id="acars_map_row"> <tr height="10px" class="<%=flight.trclass%>"> </tr> </script> <?php /* This is the template for the little map bubble which pops up when you click on a flight Same principle as above, keep the <%=...%> tags intact. The same variables are available to use here as are available above. */ ?> <script type="text/html" id="acars_map_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <b><%=flight.pilotid%> - <%=flight.pilotname%></b><br /> <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br /> <strong>Aircraft: </strong><%=flight.aircraftname%><br /> <strong>Status: </strong><%=flight.phasedetail%><br /> <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br /> </span> </script> The map should be accessible with a link looking like this: http://www.YOURLINK/YOURPHPVMSFOLDER/index.php/acars/viewmapbig or if you have installed phpvms into your root folder http://www.YOURLINK/index.php/acars/viewmapbig You will only have to put a normal button or link to your default livemap linking to the fullscreen one. I have a live demo here if you want to check it out: http://skyline-va.de/phpvms/index.php/acars/viewmapbig Hope this helps
  16. Ok, then I didn't quite understand what you wanted at first. It's possible of course. I'm going to look at that tomorrow.
  17. I'm not very experienced with javascript and there are probably better ways to solve this problem (maybe with jquery or stuff like that) but I got it to work like this: Just add these lines of code to the end of your acarsmap.tpl file: <script type="text/javascript"> function makebig(){ var button = document.getElementById("button"); var buttoncontent = button.value; if (buttoncontent == "Make big"){ var elem = document.getElementById("acarsmap"); elem.style.width = "800px"; elem.style.height = "800px"; button.value = "Make small"; } else { var elem = document.getElementById("acarsmap"); elem.style.width = "<?php echo Config::Get('MAP_WIDTH');?>"; elem.style.height = "<?php echo Config::Get('MAP_HEIGHT')?>"; button.value = "Make big"; } }; </script> <input type="button" id="button" onclick="makebig()" value="Make big"> Then change these lines according to your needs: elem.style.width = "800px"; elem.style.height = "800px"; If you want to change the values then you have to really be careful to change every value that comes up in those lines. For example if you want to change "Make big" to "Big" you will have to change it if (buttoncontent == "Make big"){ here and button.value = "Make big"; here and <input type="button" id="button" onclick="makebig()" value="Make big"> here If anyone has some suggestion on how to improve the code then I'd be happy to know. -Lauritz
  18. I think he meant a full screen livemap
  19. Go into your acarsmap.js file around line 100 you should find this: var pos = new google.maps.LatLng(lat, lng); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: pos, map: map, icon: url+"/lib/images/inair/"+data[i].heading+".png", flightdetails: data[i], infowindow_content: detailed_bubble }); Now you can modify this a bit. If you have two airlines with the defined airline codes SLN and SLK for example then your code you would have to exchange with the part I mentioned above would look like this: if (data[i].code == "SLN"){ var pos = new google.maps.LatLng(lat, lng); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: pos, map: map, icon: url+"/lib/images/inair/"+data[i].heading+".png", flightdetails: data[i], infowindow_content: detailed_bubble }); } else if (data[i].code == "SLK"){ var pos = new google.maps.LatLng(lat, lng); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: pos, map: map, icon: url+"/lib/images/inair2/"+data[i].heading+".png", flightdetails: data[i], infowindow_content: detailed_bubble }); } Notice that you will have to change the line containing this (data[i].code == "SLK") and add customize the airline code. Then you have to change this line: icon: url+"/lib/images/inair2/"+data[i].heading+".png", so that the right icon get's selected. This code would use the images from the folder "inair" for the airline SLN and the images from folder "inair2" for the airline SLK. Hope this helps and don't forget to backup the file before you change something so if something get's messed up you will be able to recover the original status.
  20. You can simply create the 360 images with an easy php script: <?php $count = 0; while ($count < 360){ $filename = 'orig.png'; $rotang = -$count; // Rotation angle $source = imagecreatefrompng($filename) or die('Error opening file '.$filename); imagealphablending($source, false); imagesavealpha($source, true); $rotation = imagerotate($source, $rotang, imageColorAllocateAlpha($source, 0, 0, 0, 127)); imagealphablending($rotation, false); imagesavealpha($rotation, true); header('Content-type: image/png'); imagepng($rotation, "rotate/{$count}.png"); imagedestroy($source); imagedestroy($rotation); $count = $count + 1; } ?> Put this php file into a directory and add a folder called rotate and name your original image orig.png and make sure it is oriented this way: (PLEASE! Don't just use our inair icon Be creative and create one of your own. It isn't that hard) Upload it to the directory you have saved the folder the php file is in and run the script. If everything worked out as it should you will have 360 images in your rotate folder, already named according to the phpvms way . You only have to put these into the innair folder. This is how everything worked out for me.
  21. We are about two months in service now and the average pirep graph still isn't working as it probably should, now showing an average of one flight per day for every day.
  22. Hi, we are only using the database and Admin Panel from phpvms and designed our own structure for the user interface. Because of this the link in vaCentral doesn't direct the visitor to our homepage as you have to enter the main phpvms installation path. My question is, if I can put a normal redirect into the frontpage_main.tpl so that visitors will automatically get redirected to our main page when visting http://skyline-va.de/phpvms ? Or will this mess up communication with kAcars or vaCentral? -Lauritz
  23. Okay this is the Code to display the online status for flights of your VA (how I got it working): The first thing you have to do is to add some columns into your phpvms tables. Into the table phpvms_acarsdata you have to add a column named "network". Type is int(11), I don't have any standards set. You need the same column in your table phpvms_pireps. (note: your table prefix may vary) The second step is in the file PIREPData.class.php In the function fileReport (around line 560) put this just before the query: /* Online Flight check */ $sql = "SELECT network FROM ".TABLE_PREFIX."acarsdata WHERE pilotid='{$pirepdata['pilotid']}' "; $ret = DB::get_row($sql); $network = $ret->network; Then edit the query so it looks like this: /* File query */ $sql = "INSERT INTO ".TABLE_PREFIX."pireps( `pilotid`, `code`, `flightnum`, `depicao`, `arricao`, `route`, `route_details`, `distance`, `aircraft`, `flighttime`, `flighttime_stamp`, `landingrate`, `submitdate`, `accepted`, `log`, `load`, `fuelused`, `expenselist`, `source`, `exported`, `rawdata`, `network` ) VALUES ( {$pirepdata['pilotid']}, '{$pirepdata['code']}', '{$pirepdata['flightnum']}', '{$pirepdata['depicao']}', '{$pirepdata['arricao']}', '{$pirepdata['route']}', '{$pirepdata['route_details']}', '{$pirepdata['distance']}', '{$pirepdata['aircraft']}', '{$pirepdata['flighttime']}', '{$flighttime_stamp}', '{$pirepdata['landingrate']}', NOW(), ".PIREP_PENDING.", '{$pirepdata['log']}', '{$pirepdata['load']}', '{$pirepdata['fuelused']}', '0', '{$pirepdata['source']}', {$pirepdata['exported']}, '{$pirepdata['rawdata']}', '{$network}' )"; Next step is to edit the file ACARS.php. You will have to add some stuff to the function viewmap so it looks like this: public function viewmap() { $cflights = ACARSData::GetACARSData(); if ($cflights != ""){ Foreach ($cflights as $flight){ //get new file from Vatsim if the existing one is more than 5 minutes old if(!file_exists('vatsimdata.txt') || time()-filemtime('vatsimdata.txt') > 300) { //choose a random download location per Vatsim policy $random = (rand(1, 2)); if ($random == 1) {$url = 'http://fsproshop.com/servinfo/vatsim-data.txt';} if ($random == 2) {$url = 'http://info.vroute.net/vatsim-data.txt';} //get the file $file = new CodonWebService(); $contents = @$file->get($url); //save new file to server $newfile="vatsimdata.txt"; $file = fopen ($newfile, "w"); fwrite($file, $contents); fclose ($file); } //get new file from Ivao if the existing one is more than 5 minutes old if(!file_exists('ivaodata.txt') || time()-filemtime('ivaodata.txt') > 300) { //choose a random download location per Ivao policy $random = (rand(1, 2)); if ($random == 1) {$url = 'http://de1.www.ivao.aero/whazzup.txt';} if ($random == 2) {$url = 'http://eu20.ivan.ivao.aero/whazzup.txt';} //get the file $file = new CodonWebService(); $contents = @$file->get($url); //save new file to server $newfile="ivaodata.txt"; $file = fopen ($newfile, "w"); fwrite($file, $contents); fclose ($file); } $contents_Vatsim = file_get_contents('vatsimdata.txt'); $contents_Ivao = file_get_contents('ivaodata.txt'); if (strpos($contents_Vatsim,$flight->flightnum) !== false) { $sql = 'UPDATE '.TABLE_PREFIX.'acarsdata SET network =2 WHERE pilotid='.$flight->pilotid ; DB::query($sql); } else if (strpos( $contents_Ivao,$flight->flightnum) !== false) { $sql = 'UPDATE '.TABLE_PREFIX.'acarsdata SET network =1 WHERE pilotid='.$flight->pilotid ; DB::query($sql); } else { $sql = 'UPDATE '.TABLE_PREFIX.'acarsdata SET network =0 WHERE pilotid='.$flight->pilotid ; DB::query($sql); }; } }; $this->set('acarsdata', ACARSData::GetACARSData()); $this->render('acarsmap.tpl'); } The last step is to add this code to the function "data" in the ACARS.php module. I put it before the "Normalize the data" part. if($flight->network== '0') { $c['onlineimage'] = "Offline"; } elseif($flight->network== '2') { $c['onlineimage'] = "<div style='align: center'><img style='height: 18px;' src='http://www.skyline-va.de/phpvms/lib/skins/crystal/images/vatsim.png'></div>"; } elseif($flight->network== '1') { $c['onlineimage'] = "<div style='align: center'><img style='height: 18px;' src='http://www.skyline-va.de/phpvms/core/lib/skins/crystal/images/ivao.png'></div>"; } Note: You should change the image link to a path on your server. Be careful that you don't put the things into if structures where the code doesn't belong. Thanks to mseiwald and Vangelis for their help! Lauritz (It's probably not the best solution as I probably mixed up some class/module stuff but this is how I got it working)
×
×
  • Create New...