piper338 Posted January 10, 2010 Report Posted January 10, 2010 Could someone help me out please I am trying to get the vatsim id to be displayed here http://flyvva.org/index.php/pilots The custom field is this Vatsim ID and here is the .tpl I have <h3><?php echo $title?></h3> <?php if(!$allpilots) { echo 'There are no pilots!'; return; } ?> <table width="100%" class="tablesorter" id="tabledlist"> <thead> <tr> <th>Pilot ID</th> <th>Name</th> <th>Vatsim ID</th> <th>Rank</th> <th>Flights</th> <th>Hours</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { if($pilot->confirmed != 1) continue; /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ ?> <tr> <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID'); ?></td> <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <?php } ?> </tbody> </table> Quote
Guest CableGuy Posted January 10, 2010 Report Posted January 10, 2010 What is the Exact Col um for Vatsim Id named? Quote
mw308 Posted January 10, 2010 Report Posted January 10, 2010 I too had an issue getting the Vatsim ID field to show. Mine is named "vatsimid". In the end I had to add an extra field into the Pilot table, manually add vatsim ids from their registration, and call it within the pilot roster - not a good workaround, but works nonetheless. Quote
markusr Posted January 10, 2010 Report Posted January 10, 2010 Hi Piper, you need also declare a new varible in the beginning: <tr> <th>Pilot ID</th> <th>Name</th> <th>Vatsim ID</th> <th>Rank</th> <th>Flights</th> <th>Hours</th> <th>VATSIM ID</th> </tr> it should work then. But i have another question. I want to connect the vatsim id with the vataware website: http://www.vataware.com/pilot.cfm?cid= after the = there should be the vatsim id from the database. Like i did it always in php it wouldn't work here. Has anyone an idea how to link a variable to an URL. Thanks alot. Mark Quote
mw308 Posted January 10, 2010 Report Posted January 10, 2010 Hi Mark With my silly fix above lol, my code is: <td><a href="http://www.vataware.com/pilot.cfm?cid=<?php echo $pilot->vatsimid?>"><?php echo $pilot->vatsimid?></a></td> Change $pilot->vatsimid to whatever you use to display the vatsim id on the page. Quote
markusr Posted January 10, 2010 Report Posted January 10, 2010 Hi Will, i got it now running with this: <td><a href="http://www.vataware.com/pilot.cfm?cid=<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?>" target=_blank><?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');?></a></td> and the standard custom fields. Thanks alot for the hint. Mark Quote
mw308 Posted January 10, 2010 Report Posted January 10, 2010 Hi Mark That'll do it . Thanks as well for reminding me about the missing "target=_blank" on mine! Quote
piper338 Posted January 10, 2010 Author Report Posted January 10, 2010 Hey guys thanks for trying to help me, but I still cant get it through my head what/Where I need to Edit the following. I added <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID')?></td> as that is what is commented to do... <h3><?php echo $title?></h3> <?php if(!$allpilots) { echo 'There are no pilots!'; return; } ?> <table id="tabledlist" class="tablesorter"> <thead> <tr> <th>Pilot ID</th> <th>Name</th> <th>Rank</th> <th>Flights</th> <th>Hours</th> <th>VATSIM ID</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ ?> <tr> <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'Vatsim ID')?></td> </tr> <?php } ?> </tbody> </table> Quote
piper338 Posted January 10, 2010 Author Report Posted January 10, 2010 Hey guys, here is what the field looks like inside phpMyadmin if it helps http://i49.tinypic.com/1zpi2jt.jpg Also where are the actual numbers stored I cant find it.. maybe that is the problem? Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 Try it with all caps, you're doing: "Vatsim ID" Which won't match "VATSIM ID". Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 Hey Nabeel, I have tried that before I just did it again for giggles and no joy :-( in the admin center it is "Vatsim ID" Quote
Administrators simpilot Posted January 11, 2010 Administrators Report Posted January 11, 2010 Check in the phpvms_fieldvalues table and see if there are any values with fieldid 7 that have any data in the value column. That is where the code will ultimatly pull the data from. Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 How about trying VATSIM_ID? Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 simpilot, thats what I was looking for 7 doesn't even exist in there so that must be my problem goes from 6 to 8 Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 Well in the fields table look up the ID for vatsim id Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 It's 7 Hey guys, here is what the field looks like inside phpMyadmin if it helps http://i49.tinypic.com/1zpi2jt.jpg Also where are the actual numbers stored I cant find it.. maybe that is the problem? Quote
M-Queiroz Posted January 11, 2010 Report Posted January 11, 2010 <h3><?php echo $title?></h3> <h5>O Piloto só aparecera na lista Abaixo, Após ter completado 01:00 Hs (UMA HORA) de voo na VA, dúvidas contate um Staff !!!<h5> <h5> <?php if(! $allpilots ) { echo 'There are no pilots!' ; return; } ?> </h5> <table id="tabledlist" class="tablesorter" width="800"> <tbody> <tr> <td width="23%" height="0" colspan="2" align="CENTER"><table id="tabledlist2" class="tablesorter" width="800"> <thead> <tr> <th width="60" align="center">Piloto ID</th> <th width="30" align="center">Pais</th> <th width="138" align="center">Nome</th> <th width="69" align="center">Rank</th> <th width="40" align="center">Voos</th> <th width="50" height="0" align="center">Horas</th> <th width="181" height="45" align="CENTER">IVAO ID</th> <th width="192" height="45" align="CENTER">VATSIM ID</th> </tr> </thead> <tbody> <?php foreach( $allpilots as $pilot ) { ?> <tr> <td width="60" align="center" nowrap><a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a></td> <td width="30" align="center"><img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /></td> <td width="138" align="center"><?php echo $pilot->firstname.' '.$pilot->lastname?></td> <td width="69" align="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td width="40" align="center"><?php echo $pilot->totalflights?></td> <td width="50" height="0" align="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td width="181" height="45" align="CENTER"><?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'IVAO ID' ); if( $fieldvalue != '' ) { echo '<a href="http://www.ivao.aero/members/person/details.asp?ID='. $fieldvalue . '" target="_blank"><img src="http://status.ivao.aero/'. $fieldvalue .'.png" width="180" height="45" border="0" alt="Ivao ID" /></a>' ; } ?> <div align="center"></div></td> <td width="192" height="45" 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="http://online.vatsimindicators.net/'. $fieldvalue .'/3453.png" width="180" height="45" border="0" alt="Ivao ID" /></a></a>' ; } ?> <?php } ?></td> </tr> </tbody> </table> </tbody> </table> en good luck br boa sorte Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 It's 7 Ok so look like no values have been saved. What if you goto your profile now and save a value for that field, do you see it show up in phpmyadmin? Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 Not still no joy, I am able to view the pilots Vatsim ID in the admin center... but I don't understand how if it's not saving it to the database. Quote
Administrators Nabeel Posted January 11, 2010 Administrators Report Posted January 11, 2010 Can you enable DEBUG_MODE (set to true), and then try saving the field, and see if there's anything in core/logs/log.txt? Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 tried it, log.txt is still empty Quote
piper338 Posted January 11, 2010 Author Report Posted January 11, 2010 It's showing on the users profile just not the list. I tried to manually add my vatsim id in phpmyadmin using 7,7,2, 855360 still didn't display anything on the pilot list, but in my profile it showed my vatsim id 2 times. Quote
Administrators Nabeel Posted January 12, 2010 Administrators Report Posted January 12, 2010 Hmm that's weird. Can you pastebin the entire template? Quote
piper338 Posted January 12, 2010 Author Report Posted January 12, 2010 VATSIM ID is how it is in the field, I changed it from Vatsim ID to VATSIM ID <h3><?php echo $title?></h3> <?php if(!$allpilots) { echo 'There are no pilots!'; return; } ?> <table id="tabledlist" class="tablesorter"> <thead> <tr> <th>Pilot ID</th> <th>Name</th> <th>Rank</th> <th>Flights</th> <th>Hours</th> <th>Vatsim ID</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ ?> <tr> <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td><?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?></td> <?php } ?> </tbody> </table> Quote
Administrators Nabeel Posted January 12, 2010 Administrators Report Posted January 12, 2010 After this: echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); Can you put (just right after it, before the ?>: DB::debug(); And refresh the page with the output Quote
shiljo Posted January 13, 2010 Report Posted January 13, 2010 I have also put the field same way, and also nothing... I put IVAO id inside ADMIN panel, and i have it on my pilots profile, but in pilot list only table IVAO id, nothing under...cant get the number i guess...how can i fix that? Quote
shiljo Posted January 13, 2010 Report Posted January 13, 2010 Guys finally got it...just put one field in pilots database, in my example IVAO...Add that field also in admin panel...and add like in previous pilot_list.php everything only line in below shpuld look like this <td><?php echo $pilot->IVAO?></td> I have no knowledge of coding but after 2 hours trying, it was worth it I hope this helps somebody hehe... Quote
FlyingMachine Posted May 28, 2020 Report Posted May 28, 2020 Hi all, I am trying to show cutom filed in Pending PIREPS, using the following code, any help in foreach code ? I got one issue where to put this and correct way to add it : <?php foreach($pilot_list as $pilot) { ?> <?php } ?> Because in pending PIREPs i call for : foreach ( pireps as pirep ! Thank you <tbody> <?php foreach($pireps as $pirep) { if($pirep->accepted == PIREP_PENDING) $td_class = 'pending'; else $td_class = ''; $error = false; ?> <tr class="<?php echo $class?> pirep_list" id="row<?php echo $pirep->pirepid;?>"> <td align="center" valign="top" nowrap="nowrap" style="width: 27px;" class="<?php echo $td_class;?>"> <img height="25px" width="25px" src="<?php echo PilotData::GetPilotAvatar($pirep->pilotid);?>" align="left" /> </td> <td align="left" valign="top" nowrap class="<?php echo $td_class;?>"> <strong><a href="<?php echo SITE_URL?>/admin/index.php/pilotadmin/viewpilots?action=viewoptions&pilotid=<?php echo $pirep->pilotid;?>"> <?php echo PilotData::GetPilotCode($pirep->pcode, $pirep->pilotid) . ' - ' .$pirep->firstname .' ' . $pirep->lastname;?></a> <!-- Here i would like to show VATSIM or IVAO ID using the following code --> l <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM CID or IVAO VID'); ?> </strong> <strong>Flight:</strong> <?php echo $pirep->code . $pirep->flightnum; ?></div> <strong>Dep/Arr: </strong><?php echo $pirep->depicao; ?>/<?php echo $pirep->arricao; ?> <strong>Flight Time: </strong><?php echo $pirep->flighttime; ?> <br /> <strong>Submit Date: </strong><?php echo date(DATE_FORMAT, $pirep->submitdate); ?> <strong>Current Status: </strong> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM CID or IVAO VID');?> <?php if($pirep->accepted == PIREP_ACCEPTED) echo 'Accepted'; elseif($pirep->accepted == PIREP_REJECTED) echo 'Rejected'; elseif($pirep->accepted == PIREP_PENDING) echo 'Approval Pending'; ?> <?php # If there was an error, don't allow the PIREP to go through if($pirep->aircraft == '') { $error = true; } ?> <table width="100%" style="border: none;"> Quote
web541 Posted May 28, 2020 Report Posted May 28, 2020 Have you tried this? <?php echo PilotData::GetFieldValue($pirep->pilotid, 'VATSIM CID'); ?> 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.