mw308 Posted December 3, 2009 Report Posted December 3, 2009 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 Quote
Administrators simpilot Posted December 3, 2009 Administrators Report Posted December 3, 2009 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"; Quote
mw308 Posted December 3, 2009 Author Report Posted December 3, 2009 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. Quote
Administrators simpilot Posted December 3, 2009 Administrators Report Posted December 3, 2009 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 = ' ';} 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. Quote
mw308 Posted December 4, 2009 Author Report Posted December 4, 2009 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 Quote
Administrators Nabeel Posted December 4, 2009 Administrators Report Posted December 4, 2009 The name that's entered in the admin Quote
mw308 Posted December 5, 2009 Author Report Posted December 5, 2009 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. Quote
Administrators simpilot Posted December 5, 2009 Administrators Report Posted December 5, 2009 If you can put your code up at pastebin.org and leave the link I will look at it... Quote
mw308 Posted April 30, 2010 Author Report Posted April 30, 2010 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 Quote
Administrators Nabeel Posted April 30, 2010 Administrators Report Posted April 30, 2010 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. Quote
mw308 Posted April 30, 2010 Author Report Posted April 30, 2010 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! Quote
Administrators Nabeel Posted April 30, 2010 Administrators Report Posted April 30, 2010 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 Quote
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.