Daniboi Posted June 4, 2020 Report Share Posted June 4, 2020 Hello people, so I want to make a custom MainController::Run like this example here: <?php MainController::Run('PIREPS' 'RecentFrontPage', 5); ?> so that will go and insert the 5 newest flights, but I want to make a custom one, How could I do that? Quote Link to comment Share on other sites More sharing options...
web541 Posted June 4, 2020 Report Share Posted June 4, 2020 Just create a module (or add to an existing module) in core/modules/MODULE NAME/MODULE NAME.php and inside it add a function with your data in it. See the example here (the code for what you provided) https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/modules/PIREPS/PIREPS.php#L517 Then you can use <?php MainController::Run('MODULE NAME' 'FUNCTION NAME', ADDITIONAL PARAMETERS); ?> 1 Quote Link to comment Share on other sites More sharing options...
Strider Posted June 4, 2020 Report Share Posted June 4, 2020 I got code working, but not correctly. It is just showing 5 in sequence by flight number. And I think I know why, when you add a schedule there is no date associated with the entry in the db But there is in the PIREPS table. I will work on it and try to get it to work. When I do I will upload the code to my github account. 1 Quote Link to comment Share on other sites More sharing options...
Daniboi Posted June 4, 2020 Author Report Share Posted June 4, 2020 Okay, Thank you, I will try now! Quote Link to comment Share on other sites More sharing options...
Strider Posted June 4, 2020 Report Share Posted June 4, 2020 I haven't finished it yet. 1 Quote Link to comment Share on other sites More sharing options...
Daniboi Posted June 4, 2020 Author Report Share Posted June 4, 2020 Oh, Yeah, I just said that I will try what Web541 said Quote Link to comment Share on other sites More sharing options...
Daniboi Posted June 4, 2020 Author Report Share Posted June 4, 2020 Thank you, I got it working and is looking very cool now Picture Quote Link to comment Share on other sites More sharing options...
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.