Jump to content

Recommended Posts

Posted

Hi everyone

I've added in a pilot field for peoples VATSIM ID in the admin panel, and it is showing in the table as "vatsimid".  I've then copied the text in the pilots_list.tpl that pertains to the addition of a custom field, and where it pulls the field name based on the pilotid, I've called it both "VATSIM ID" and "vatsimid", and neither are getting any results.  I've added "<th>VATSIM ID</th> to the table headings, so the column is showing, but the dashed lines don't stretch across into the new column and it is completely blank.  I'm obviously doing something wrong but I can't figure it out!  Any ideas anyone?

Also, how can I sort the pilot list by descending ID rather than ascending?  Since I'm 0001 I don't like being at the bottom of the list :)

Many thanks

Will

  • Administrators
Posted

You should be using something like this to make the info display in the table

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

To change how the pilots are sorted find line 85 in PilotData.Class.php ->

Should be:

ORDER BY p.pilotid DESC";

Change it to:

ORDER BY p.pilotid ASC";

Posted

Hi Simpilot

The 2nd one worked a treat thanks I'd have never thought to look in there!

The 1st one though is exactly what I have and still nothing - even the dashed lines still arent going across into the column (presumably as there's no data there).  Can't work that one out.

  • Administrators
Posted

My guess is that your field is not VATSIM ID but maybe Vatsim Id or some variant. They have to match in all respects. If they do, then check and see if there is any data in the table column. One thing you could do to avoid the table not being right when the variable is empty is something like this ->

<?php
$customfield = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');
if(!$customfield)
    {$customfield = '&nbsp';}
      echo '<td>';
          echo $customfield;
      echo '</td>';
?>

That will just put  blank space in the table cell which will make it bring the line across or complete the frame.

Posted

Will try that out when I can.  Does the name entered have to be the name that's listed in the admin panel custom fields area, or the name of the field in the database, as they are different?

Thanks

Posted

Hi Nabeel I've managed to get the dashed lines all the way across as above by the blank carriage return, but it's not pulling the data from the database.  I've even changed the name of the field in the admin panel to match the field name in the database and still nothing.  I've checked that there is data in the field.

  • 4 months later...
Posted

Hi all

Sorry to bump this, but the same problem is occuring on 2.1.933. I've worked out why too, but can't think of a solution yet. The problem is that the custom field code is looking under "phpvms_customfields" rather than my own table prefix. Is there any quick way of changing this?

Thanks

  • Administrators
Posted

Hi all

Sorry to bump this, but the same problem is occuring on 2.1.933. I've worked out why too, but can't think of a solution yet. The problem is that the custom field code is looking under "phpvms_customfields" rather than my own table prefix. Is there any quick way of changing this?

Thanks

Ah, I wish you posted that earlier. I'll have a fix in about 5 minutes for 934.

  • Administrators
Posted

Lol sorry Nabeel just updated to the latest - very nice work by the way - and the error log sprang into action. 1st time I've seen where the fault lies!

No prob! :) It's up now with the fix

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