ok got it work
To get it working in the nav bar use the following code:
<?php $hubs = HubData::get_hub(); foreach($hubs as $hub) { ?><?php echo $hub->icao .' - '. $hub->name;?> <?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 }?>
Amazing, thank you! But..
Warning: Invalid argument supplied for foreach() in /home/public_html/core/templates/hub/hubview.tpl on line 85
That error usually happens when no pilots are in the hub. I will see about getting it to not show that error if no pilots are in the hub.
That error usually happens when no pilots are in the hub. I will see about getting it to not show that error if no pilots are in the hub.
Oh.
think we need else if statements here
if it has something to return echo the pilots in Hub
else echo we have no pilots in this Hub! or something similar
but unsure how the statement has to look exactly;)
in the hubview.tpl file bellow where it has:
if($pilot->totalhours == '0'){continue;}
put:
if(!$pilot){echo "Sorry, no pilot allocated to this hub yet.";}
and let me know if that helps.
I have updated the module now, it has fixed that error, also the way the url to the hubview is called has changed now.
Hi all great module,
I have got it all working as it should but I have got the hubs on a dropdown menu on the homepage and the hubs writing overlap (see image) not sure how to fix it any help would be great.
Thanks in advance.
<?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
I have installed this very nice plugin, but having issues with displaying the rank pictures.
I have set this: <td><img src=β<?php echo $pilot->rankimage?>β alt=β<?php echo $pilot->rank;?>β width=β50β height=β21β /></td> (taken from the default Pilot Roster page in the templates folder)
It show the rank name, but not the picture. Any idea how I can fix that?
It has problems, it happens to me too, just play around with the code until it shows.
<?php $hubs = HubData::get_hub(); foreach($hubs as $hub) { ?><?php echo $hub->hubicao .' - '. $hub->hubname;?> <?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
I have tried that but unfortunately It did not work I will keep playing with the code to get it to work.
Another problem I have is I cant seem to enter any info in the admin section of the module, I add the info in the fields and press save but does not store the info, I will try an upload all files again and if that helps if not I am stuck.
The way it is coded it no longer needs anything to be added through the admin part now, as it looks at the airport db and gets which one is the hub airport. where it has <?php echo $hub->hubid;?> in your code change the hubid to icao, as it now looks for the icao not the id in the db. It looks like a style in your css that is having trouble with the long names of the airports you have.
replace:
<img src=β<?php echo $pilot->rankimage?>β alt=β<?php echo $pilot->rank;?>β
with:
<img src=β<?php echo RanksData::getRankImage($pilot->rank);?>β
did the trick for displaying the rankimage in the hubview page.
all credits to Cor de Bruin /vbird
The way it is coded it no longer needs anything to be added through the admin part now, as it looks at the airport db and gets which one is the hub airport. where it has <?php echo $hub->hubid;?> in your code change the hubid to icao, as it now looks for the icao not the id in the db. It looks like a style in your css that is having trouble with the long names of the airports you have.
works great now Thankyou!!
still trying to figure out dropdown
replace:
<img src=β<?php echo $pilot->rankimage?>β alt=β<?php echo $pilot->rank;?>β
with:
<img src=β<?php echo RanksData::getRankImage($pilot->rank);?>β
did the trick for displaying the rankimage in the hubview page.
all credits to Cor de Bruin /vbird
Tried the change of code and still no ranks showing
I think I know why the rank images are still not working for you, dont put the entire img link in php tags, just the part inside the src=ββ part.
I think I know why the rank images are still not working for you, dont put the entire img link in php tags, just the part inside the src=ββ part.
From this
<img src="'.RanksData::getRankInfo($pilot->rank).'" />
to this
<img src="<'.RanksData::getRankInfo($pilot->rank).'" />
I have this
<td align="center"><img src="<?php echo RanksData::getRankImage($pilot->rank);?>" alt="<?php echo $pilot->rank;?>" /></td>
which works on my site