Jump to content
Strider

Hubs page module

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?

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

short question why do you use

getRankInfo

what does it return?

think getRankImage is for the image :)

Share this post


Link to post
Share on other sites

change this

<img src="'.RanksData::getRankInfo($pilot->rank).'" />

to this:

<img src="<?php echo RanksData::getRankInfo($pilot->rank);?>" />

Share this post


Link to post
Share on other sites

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

Worked beautifully Thankyou!!

  • Like 1

Share this post


Link to post
Share on other sites

when i click on any off the hubs i get an little box with a cross in and states EGCC as that is my hub is that for pictures of the aurport logo to add and if so where do they go

Share this post


Link to post
Share on other sites

You can have a picture of the airport or the logo they use. Just name the file the same as the airport icao and it should pick it up.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

That fixed the Admin issue, when I added the link to the site I got an error again

Notice: The template file "/home5/uvaairco/public_html//core/templates/hub/index.tpl" doesn't exist in /home5/uvaairco/public_html/core/classes/TemplateSet.class.php on line 248

Share this post


Link to post
Share on other sites

Question, I have hub managers in my system, but for some reason they don't show up listed as Hub Manager for this mod. Any idea what I need to do to get it to show? I don't know what info you may need to help, so let me know and I'll post.

Share this post


Link to post
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

Share this post


Link to post
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...