Jump to content

Recommended Posts

Posted

Just touching up my pilots list page and wanted to be able to click on Vatsim (mainly) or ivao ID on pilot profile to bring up their flight histories on relevant stats page.. 

<td>
<div align="center">
<a href="<?php echo url('https://vatstats.net/flights/?pilot='.$pilot->pilotid, 'VATSIM ID');?>">
<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
</a></td>

 

This is displaying their vatsim ID correctly as a clickable link, however its bringing up "http://www.susiairvirtual.com/index.php/https://vatstats.net/flights/?pilot=1" rather than the vatstats page, and its also using the pilot Id rather than vatsim ID.. 

This is a 2 second job for somone who knows the keywords to use, however im not that guy... can someone please help with which $variable to use for the single line posted above to get it to create the correct link address

 

much appreciated

 

Posted

Hi topher2880,

Try this code, it should work.

<td>
<div align="center">
<a href="https://vatstats.net/flights/?pilot=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?>">
<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
</a></td>

Cheers,

Obi Onyemaobi

Posted
2 hours ago, ObiOnyemaobi said:

Hi topher2880,

Try this code, it should work.

<td>
<div align="center">
<a href="https://vatstats.net/flights/?pilot=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?>">
<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
</a></td>

Cheers,

Obi Onyemaobi

fantastic.. that is spot on. 

 

thanks so much

Topher

 

Posted
1 hour ago, flyalaska said:

He will also need to make a custom profile field in admin.

Hi mate

the custom profile field is called VATSIM ID, so it came up, if i changed the field, i would need to change this text also. Thanks to both of you for your help. 

Posted
3 hours ago, topher2880 said:

Hi mate

the custom profile field is called VATSIM ID, so it came up, if i changed the field, i would need to change this text also. Thanks to both of you for your help. 

I know, I referring it to you. Incase you were not aware that you had to create it.

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