Administrators ProAvia Posted October 19, 2020 Administrators Report Posted October 19, 2020 Airport lookup update to work with same API as used by phpVMS v7. Restores ability to lookup airports for airport table. Adds additional fields to airport table for use in your templates. I've been sitting on these files for a while to be sure the beta testers didn't have any issues. Read the README_1ST.txt file for info. Works with phpVMS 5.5.2 and 5.5.2.72 - not tested with phpVMS 2.x - will not work with phpVMS v7. You will need to manually update each existing airport in you database after installing this mod to get all the new data in the airports table - use EDIT from airport page, click LOOK UP, click Edit Airport. It will not automatically update all your existing airports. Some lesser known airports are not available in the parsed database - you will have to add those manually. Released as freeware. Shall not be uploaded to other sites without written permission. Thanks to all those who contributed to getting this working. NEW Airport Lookup phpVMS 5.5.2.zip 2 1 Quote
Markanito Posted November 8, 2020 Report Posted November 8, 2020 I have a question regarding this, after reading readme file I didn't find PHPVMS_API inside local.config.php but only in app.config.php and when I add LOOKUP and PHPVMS_API lines and install your module it is stuck at Fetching airport data. What could be wrong here? Quote
Administrators ProAvia Posted November 8, 2020 Author Administrators Report Posted November 8, 2020 app.config.php is where all the base settings are. You never change or add anything to app.config.php. All changes/additions are done to local.config.php. local.config.php overrides any like settings in app.config.php. Steps # 3 and #4 need to be followed to the letter. Quote
cfitz619 Posted January 7, 2021 Report Posted January 7, 2021 Hello. Great feature for my new airline! Does this look right? Followed the directions for install but the Lookup feature is not working for my airports. Is it because the vacentral website is down? Thank You in advance for your assistance. Quote
PaintSplasher Posted January 7, 2021 Report Posted January 7, 2021 I just tested the feature on a fresh install and everything works as it should. Your entry looks correct. Quote
Administrators ProAvia Posted January 7, 2021 Author Administrators Report Posted January 7, 2021 3 hours ago, cfitz619 said: Hello. Great feature for my new airline! Does this look right? Followed the directions for install but the Lookup feature is not working for my airports. Is it because the vacentral website is down? Thank You in advance for your assistance. The vacentral server is up and correctly providing airport data. The entry above looks correct - check your other entries to be sure they are correct. If it still doesn't work.... What phpVMS version? What PHP version? What MySQL or MariaDB version? Have you changed the default admin skin? Quote
cfitz619 Posted January 7, 2021 Report Posted January 7, 2021 (edited) 6 hours ago, ProAvia said: The vacentral server is up and correctly providing airport data. The entry above looks correct - check your other entries to be sure they are correct. If it still doesn't work.... What phpVMS version? What PHP version? What MySQL or MariaDB version? Have you changed the default admin skin? I'm not sure where the other entries are. PHPVMS: 5.5.2.72 MySQL: 10.2 PHP: 7.2 I have updated my scheme with this one: (This scheme is great!) Edited January 7, 2021 by cfitz619 Added Information Quote
Administrators ProAvia Posted January 8, 2021 Author Administrators Report Posted January 8, 2021 That skin is for the frontend. The Airport Lookup is on the backend - admin panel. If you are using the default admin panel skin it should be fine. Did you import the phpvms_airports_update.sql file as indicated in the directions? Do you have error reporting turned on? Check the logs to see if any errors related to Airport Lookup or VACentral are shown - maybe3 a Cross Site Error. Post any errors here. Quote
cfitz619 Posted January 9, 2021 Report Posted January 9, 2021 Yes, I imported the airport sql into the database. I checked the database and KJFK is there but the airport doesn't show up in "all airports" on my site. I also tried fetching the data for KTPA after turning on error reporting. Still a no go. The error in the log is: [09-Jan-2021 01:49:12 UTC] PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 780 Quote
cfitz619 Posted January 9, 2021 Report Posted January 9, 2021 On 1/7/2021 at 7:08 PM, ProAvia said: That skin is for the frontend. The Airport Lookup is on the backend - admin panel. If you are using the default admin panel skin it should be fine. Did you import the phpvms_airports_update.sql file as indicated in the directions? Do you have error reporting turned on? Check the logs to see if any errors related to Airport Lookup or VACentral are shown - maybe3 a Cross Site Error. Post any errors here. Here is the OperationsData.class.php. The problem is on line # 780 (the last line below has a red X) according to the error log. I believe this is my problem. Not sure how to fix it. Thank You for trying to assist me with this. It is greatly appreciated. Quote
cfitz619 Posted January 9, 2021 Report Posted January 9, 2021 I am trying to provide as much information as possible to solve my issue. Here is my local.config file. Quote
Administrators ProAvia Posted January 9, 2021 Author Administrators Report Posted January 9, 2021 Can you post the actual entry from the error log? Quote
cfitz619 Posted January 9, 2021 Report Posted January 9, 2021 9 hours ago, ProAvia said: Can you post the actual entry from the error log? I think this is what your looking for. I can't get the logs to open. Sorry if this is not what you meant. I'm new to coding. Kind of learning as I go. Is this the right log? Here is the path: public_html/core/logs/errors.txt [09-Jan-2021 01:49:12 UTC] PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 780 [09-Jan-2021 01:57:17 UTC] PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 780 [09-Jan-2021 02:13:29 UTC] PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 780 [09-Jan-2021 02:17:10 UTC] PHP Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 780 [09-Jan-2021 02:29:42 UTC] PHP Parse error: syntax error, unexpected '<', expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 781 [09-Jan-2021 02:42:24 UTC] PHP Parse error: syntax error, unexpected '<', expecting function (T_FUNCTION) or const (T_CONST) in /home/u742478123/domains/flymajesticva.com/public_html/core/common/OperationsData.class.php on line 781 Quote
Administrators ProAvia Posted January 9, 2021 Author Administrators Report Posted January 9, 2021 There should be a file called "error_log" in the root of your phpVMS install and possibly another in phpVMS root/admin. Error reporting must be on. Contact me via PM and maybe I can take a look. Quote
xusmcxjasonx Posted January 19, 2021 Report Posted January 19, 2021 (edited) I figured it out for everyone. It's not ProAvia's fault All it needed was an extra } at the end on line 780 Here is the edited file down below! https://drive.google.com/file/d/1u-PYB1-kUy7hOz9Ug9iL0ZG_aU9r9Wuk/view?usp=sharing Edited January 19, 2021 by xusmcxjasonx Quote
Administrators ProAvia Posted January 19, 2021 Author Administrators Report Posted January 19, 2021 Interestingly, some need the extra closing bracket - } - and some don't. I will review the APlookup when I have a chance to see if I may have missed a closing bracket. Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 Has this module been updated? It's not working for me anymore. Thanks. Quote
Administrators ProAvia Posted October 26, 2023 Author Administrators Report Posted October 26, 2023 It's working fine in phpVMS version 5.5.2.72 What version of phpVMS are you using? PHP version? MySQL or MariaDB version? Any error messages in the browser console or error_log file? Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 phpVMS 5.5.2.72 PHP 7.2 MySQL No error logs at all that I could find. Thanks for any help you can provide. Quote
Administrators ProAvia Posted October 26, 2023 Author Administrators Report Posted October 26, 2023 What version of MySQL? Turn on error reporting in the local config and plade an empty "error_log" file in the root of your phpvms install. Try using airport lookup again and then check the error_log. Did you check the browser console? Quote
Administrators ProAvia Posted October 26, 2023 Author Administrators Report Posted October 26, 2023 Disregard - just checked my site and it 's not working there either. I will check tomorrow when I'm on my desktop and can attempt to figure out the issue. The API it gets the data from is working, so it's odd it isn't working thru my site. Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 I've been trying to figure this out all morning. I turned on error reporting and I am not getting any errors at all. I checked the error logs under core/logs and the "error_log.txt" in the phpVMS root folder. Thanks Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 (edited) I don't think this is the issue, but here are the only errors I am getting. Here are the errors I see: [26-Oct-2023 09:52:03 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/domains/public_html/core/common/TouchdownStatsData.class.php on line 89 [26-Oct-2023 09:52:03 UTC] PHP Warning: Division by zero in /home/domains/public_html/core/common/TouchdownStatsData.class.php on line 94 Here is the pertaining section: public static function airline_average() { $stats = self::get_all_stats(); $total = 0; $count = 0; foreach ($stats as $stat) <---------THIS IS LINE # 89 { $total = $total + $stat->landingrate; $count++; } $average = $total / $count; <----------THIS IS LINE # 94 return $average; } Thanks, Chris Edited October 26, 2023 by cfitz619 Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 Another error that just popped up: [26-Oct-2023 10:05:54 UTC] PHP Warning: Use of undefined constant GEONAME_URL - assumed 'GEONAME_URL' (this will throw an Error in a future version of PHP) in /home/domains/public_html/lib/skins/blueIce/core_htmlhead.php on line 28 <script type="text/javascript"> var baseurl = "<?php echo SITE_URL;?>"; var geourl = "<?php echo GEONAME_URL; ?>"; <-----------------THIS IS LINE 28 </script> Quote
Administrators ProAvia Posted October 26, 2023 Author Administrators Report Posted October 26, 2023 Looks to be a CORS policy issue... Access to XMLHttpRequest at 'https://<airport data provider>' from origin 'https://<your doamin>' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. I'm looking for a solution. I haven't messed with this in over 3 years, so it may take a while - unless someone knows an easy fix. Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 54 minutes ago, ProAvia said: Looks to be a CORS policy issue... Access to XMLHttpRequest at 'https://<airport data provider>' from origin 'https://<your doamin>' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. I'm looking for a solution. I haven't messed with this in over 3 years, so it may take a while - unless someone knows an easy fix. I will look into this also. You know I like to try to figure things out myself. I only ask if I can't find a solution. Thanks for looking into this ProAvia. I appreciate it. Quote
Administrators ProAvia Posted October 26, 2023 Author Administrators Report Posted October 26, 2023 15 minutes ago, cfitz619 said: I will look into this also. You know I like to try to figure things out myself. I only ask if I can't find a solution. Thanks for looking into this ProAvia. I appreciate it. If you find a solution, please post it here. Thanks Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 (edited) Here is A temporary fix that I found. It has been tested by me and I can confirm that it 100% works on Google Chrome Version 118.0.5993.118 (Official Build) (64-bit). 1. THIS FIX IS FOR CHROME USERS. 2. Go to the chrome webstore at this link and install the extension. https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf/related 3. The images attached are numbered 1-3. Follow the images to activate the extension. ------3------ ------2------ ------1------ Edited October 26, 2023 by cfitz619 Quote
cfitz619 Posted October 26, 2023 Report Posted October 26, 2023 32 minutes ago, ProAvia said: If you find a solution, please post it here. Thanks Please let me know if the temporary solution works for you. If it doesn't, I will do some more digging. Quote
Administrators ProAvia Posted October 27, 2023 Author Administrators Report Posted October 27, 2023 I was just coming here to let you know about that work-around. Chrome Browser Extension https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf Edge Browser Extension https://microsoftedge.microsoft.com/addons/detail/allow-cors-accesscontro/bhjepjpgngghppolkjdhckmnfphffdag Firefox https://addons.mozilla.org/en-US/firefox/addon/access-control-allow-origin/ Anyone who needs to use the new airport lookup referenced at the top of this post in phpVMS v5 can install the browser extension for their chosen browser. Use at your own risk. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.