Jump to content

Hubs page module


Strider

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 :)

  • Like 2
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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).'" />

Link to comment
Share on other sites

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

Hi, I followed the instructions in the readme.txt, when I go to the admin panel and click on Hubs under Addons this comes up...

Notice: The template file "/home5/uvaairco/public_html//admin/templates/hub/hub_index.tpl" doesn't exist in /home5/uvaairco/public_html/core/classes/TemplateSet.class.php on line 248
I tried putting the hub_index.tpl into the /public_html/core/classes/ folder but it made no difference.
Link to comment
Share on other sites

What version of phpvms are you using? The tpl files should never go into the core>classes folder, that error you are getting is saying the hub_index.tpl file is not in the folder hub.If you are using simpilot's version of phpvms the tpl files must be in php format, not tpl

Link to comment
Share on other sites

I am working on getting that working on a solution, it might take a little while. It should take from the hub manager db too, but doesn't seem to be, for the ones you have not added. It will require an edit to some core files. Let me work on it and I will post the code or the update to it.

  • Like 1
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...