CPC900 Posted December 5, 2010 Report Share Posted December 5, 2010 Ok, I have been looking through the forums and tinkering with my site, and I need to try to wrap my head around it.... For adding the vatsim link info to my site, I need to: 1. Add a text column to the phpvms_pilots table in the sql database, called Vatsim ID?! 2. Add a box for the inclusion of the Vatsim ID in the registration_mainform.tpl file?! 3. Change the pilots.tpl file to include the vstsim info already mentioned many times in the forum?! Is that basically correct. I find reading so many posts about this topic, has only messed up my head Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted December 5, 2010 Moderators Report Share Posted December 5, 2010 Nope, you need to edit PilotData.class to edit it and Pilots.php module too. Really Tricky and requires good knowleage. But why not use custom fields? Quote Link to comment Share on other sites More sharing options...
CPC900 Posted December 5, 2010 Author Report Share Posted December 5, 2010 Ok, so that is in addition to what I said above, correct?! Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted December 5, 2010 Moderators Report Share Posted December 5, 2010 Yup, Quote Link to comment Share on other sites More sharing options...
CPC900 Posted December 5, 2010 Author Report Share Posted December 5, 2010 Thanks, Vansers! Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted December 5, 2010 Moderators Report Share Posted December 5, 2010 Welcome! Quote Link to comment Share on other sites More sharing options...
CPC900 Posted December 5, 2010 Author Report Share Posted December 5, 2010 Sorry, I see I am not done yet So, in the Pilots.php and PilotData.class, what am I adding? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 5, 2010 Administrators Report Share Posted December 5, 2010 Your best and easiest bet in my opinion is to add custom fields in your registration section. Goto admin -> Site & Settings -> Profile fields Add a profile field you would like - ie Vatsim, and it will be available in all pilot profiles and the registration form. There is no need to edit any core files with this method. You can go into individual pilot profiles and edit the field for those that were in the system prior to adding it. Quote Link to comment Share on other sites More sharing options...
Alex Posted February 2, 2011 Report Share Posted February 2, 2011 Once this is done this way, is there a way to make the id a link? to say a pilots vataware stats? currently the only options are text/drop down or text area? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 2, 2011 Administrators Report Share Posted February 2, 2011 You need to make it a text area and then in your template make it a link. That is what I have done. Quote Link to comment Share on other sites More sharing options...
Alex Posted February 2, 2011 Report Share Posted February 2, 2011 so would that be something like: <a href="http://www.vataware.com/flight.cfm?id=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>"</a> Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 2, 2011 Administrators Report Share Posted February 2, 2011 so would that be something like: <a href="http://www.vataware.com/flight.cfm?id=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>"</a> That looks close, I think you will want to change flight.cfm?id= to pilot.cfm?cid= Quote Link to comment Share on other sites More sharing options...
Alex Posted February 2, 2011 Report Share Posted February 2, 2011 Cheers Dave Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 2, 2011 Moderators Report Share Posted February 2, 2011 Sorry guys i have just read this thread, this is more complex than it need be. Add another field on registration VatsimID, IVAO ID etc or what you like then you can call that field in the pilots list or where ever you like, Examples, http://www.easyjetva.com/index.php/pilots You can then output the id's as a link variable. <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank"><img src="/images/charticon.jpg" width="28" height="28" border="0" alt="Vatsim ID" /></a></a>' ; } else { echo '<img src="/images/nonreg.png" width="20" height="18" border="0" alt="Not Listed" /></a>' ; } ?> </div></td> Quote Link to comment Share on other sites More sharing options...
Alex Posted February 2, 2011 Report Share Posted February 2, 2011 Excellent thanks Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 2, 2011 Moderators Report Share Posted February 2, 2011 The code above presumes you have a field value in registration called Vatsim ID That is a line from my pilots list tpl Quote Link to comment Share on other sites More sharing options...
Alex Posted February 3, 2011 Report Share Posted February 3, 2011 Actually, what do i need to change to just have the pilot cid shown linking to the VATAWARE stats? i have tried all the methods but can't get it to show. Mark your way works fine but rather than images just the id number is what im after. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 3, 2011 Moderators Report Share Posted February 3, 2011 Ah ok just change the image part to the variable $fieldvalue I have not tested but should be OK Quote Link to comment Share on other sites More sharing options...
Alex Posted February 3, 2011 Report Share Posted February 3, 2011 <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; } else { echo '<img src="/images/nonreg.png" width="20" height="18" border="0" alt="" /></a>' ; } ?> </div></td> That works a treat, thanks Mark... Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 3, 2011 Moderators Report Share Posted February 3, 2011 Great, Just check that line echo '<a href="http://www.vataware.com/pilot.cfm?cid=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; Dont think it needs 2 closing tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.