Jump to content

Hubs page module


Strider

Recommended Posts

I have created another module, but this time for displaying the hubs you have in your VA. It uses Tom Sterritt's HubStats addon which will need to be downloaded and installed if you do not already have it.You can get it here. This module is currently at Version 1.0. To view what it does, click here. If you are wondering why the roster for the hub looks shorter then the amount of pilots in the hub, that is because there is code to hide all pilots with 0 flight hours. Once they filed a pirep and it is accepted they will show.

I have now since added a gcmap to show the location of the hub.

You can download this module here Enjoy it.

  • Like 2
Link to comment
Share on other sites

That is a problem with the hubstats, as the code is looking for the function in the hubstats.class.php file, but not finding it. I did not create that file, Tom Sterritt did, so he is the person to have to go to to get support for his file. You can try downloading it from his github page. The link is in the readme file. Also the hub must be already listed as a hub in the airports database. If you just put in an airport, it will give out errors. So go into your airports section of the admin panel, and click on the airport, and chech the hub checkbox, and it should work fine then.

Link to comment
Share on other sites

That is a problem with the hubstats, as the code is looking for the function in the hubstats.class.php file, but not finding it. I did not create that file, Tom Sterritt did, so he is the person to have to go to to get support for his file. You can try downloading it from his github page. The link is in the readme file. Also the hub must be already listed as a hub in the airports database. If you just put in an airport, it will give out errors. So go into your airports section of the admin panel, and click on the airport, and chech the hub checkbox, and it should work fine then.

Actually your template is calling a function that does not exist in my code. You must have a modified version. Feel free to make a pull request but until then I'll provide no support for functions that don't exist in there.

Link to comment
Share on other sites

That is a problem with the hubstats, as the code is looking for the function in the hubstats.class.php file, but not finding it. I did not create that file, Tom Sterritt did, so he is the person to have to go to to get support for his file. You can try downloading it from his github page. The link is in the readme file. Also the hub must be already listed as a hub in the airports database. If you just put in an airport, it will give out errors. So go into your airports section of the admin panel, and click on the airport, and chech the hub checkbox, and it should work fine then.

airports are listed as hubs in Airport database

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

To get it working in the nav bar use the following code:

<?php $hubs = HubData::get_hub();
foreach($hubs as $hub)
{
?>
<li><a href="<?php echo url('/Hub/HubView/');?><?php echo $hub->id;?>"><?php echo $hub->icao .' - '. $hub->name;?></a></li>
<?php }?>

where exactly does that need to be?

Link to comment
Share on other sites

To get it working in the nav bar use the following code:

<?php $hubs = HubData::get_hub();
foreach($hubs as $hub)
{
?>
<li><a href="<?php echo url('/Hub/HubView/');?><?php echo $hub->id;?>"><?php echo $hub->icao .' - '. $hub->name;?></a></li>
<?php }?>

Strange in my website I put this to work

<?php $hubs = HubData::get_hub();
foreach($hubs as $hub)
{
?>
<li><a href="<?php echo url('/Hub/HubView/');?><?php echo $hub->hubid;?>"><?php echo $hub->hubicao .' - '. $hub->hubname;?></a></li>
<?php }?>

Link to comment
Share on other sites

  • 3 weeks later...

<?php $hubs = HubData::get_hub();
foreach($hubs as $hub)
{
?>
<li class="level-2"><a href="<?php echo url('/Hub/HubView/');?><?php echo $hub->icao;?>"><?php echo $hub->hubicao .' - '. $hub->hubname;?></a></li>
<?php }?>

take the <li class="level-2"> you typed in and paste that in where the code for the drop down is, and it should work

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...