WiltshireAirlines Posted July 10, 2014 Report Posted July 10, 2014 I'm trying to copy over the pilots list page. I am copying from the original pilots list page to a new page which is located in the skin folder. I have copied and pasted successfully but the pilots list doesn't load anything. The if (!$pilots_list) {} statement returns true and the operation to load the pilots is canceled, meaning something is wrong with calling the method. I'm sure that this has something to do with moving the code. Thanks in advance. Quote
Tom Posted July 10, 2014 Report Posted July 10, 2014 $pilots_list is populated by the module, so you will need to ensure you're including the config file (you can find more about running pages outside of phpVMS elsewhere on the forums) and then you'll need to do $pilots_list = PilotData::getAllPilots() for example. Quote
WiltshireAirlines Posted July 10, 2014 Author Report Posted July 10, 2014 I made those changes. First, the page was completely blank. I assumed an error so I deleted $pilots_list = PilotData::getAllPilots() and it said this: Cannot redeclare codon_autoload() (previously declared in /home/vol9_4/byethost8.com/b8_14940267/htdocs/core/classes/autoload.php:42) in/home/vol9_4/byethost8.com/b8_14940267/htdocs/core/classes/autoload.php on line 69 Quote
freshJet Posted July 10, 2014 Report Posted July 10, 2014 Is this external from phpVMS itself? Are you accessing it from site.com/lib/skins/page.php? If you are you'll need to include the config: include('/home/username/public_html/core/codon.config.php'); Then use: $pilots = PilotData::getAllPilots(); Make sure the include() is the first thing on your page to avoid header errors. Quote
WiltshireAirlines Posted July 10, 2014 Author Report Posted July 10, 2014 I am accessing it from where you stated. Instead of doing "include", I use the "require" keyword. Is that also acceptable or must I use the include keyword? Anyway, I can't access it now so I won't be able to test it. Quote
WiltshireAirlines Posted July 10, 2014 Author Report Posted July 10, 2014 OK. Just did that, and it still gives me the same error as before: Fatal error: Cannot redeclare codon_autoload() (previously declared in /home/vol9_4/byethost8.com/b8_14940267/htdocs/core/classes/autoload.php:42) in /home/vol9_4/byethost8.com/b8_14940267/htdocs/core/classes/autoload.php on line 69 Quote
WiltshireAirlines Posted July 10, 2014 Author Report Posted July 10, 2014 Removed the "include" keyword and it works fine! Thanks for the help! 1 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.