alwaysva Posted December 26, 2011 Report Share Posted December 26, 2011 if the script is written who determines the position of the current pilot, based on who made ​​the last flight? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted December 27, 2011 Moderators Report Share Posted December 27, 2011 <?php echo $report->arricao; ?> This will maybe help you ! Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 27, 2011 Author Report Share Posted December 27, 2011 thanks, but can you write whole shall? Please... Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted December 29, 2011 Moderators Report Share Posted December 29, 2011 What do you mean? You can use it on a .tpl file like pilot's profile... Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 29, 2011 Author Report Share Posted December 29, 2011 I know it. But it isn't working. How to use it? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted December 29, 2011 Moderators Report Share Posted December 29, 2011 You can create a row on the personal profile (.tpl file) table and add in on a <td></td>. Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 29, 2011 Author Report Share Posted December 29, 2011 I've got: /core/templates/pilot_list.tlp section where you need to insert: ></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <?php $params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED)); $pirep = PIREPData::findPIREPS($params); $current_location = $pirep[0]->arricao; $current_location2 = $pirep[0]->arrname; ?> <td>Here Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted December 29, 2011 Moderators Report Share Posted December 29, 2011 ></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td><?php echo $report->arricao; ?></td> <?php $params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED)); $pirep = PIREPData::findPIREPS($params); $current_location = $pirep[0]->arricao; $current_location2 = $pirep[0]->arrname; ?> <td>Here I think you can understand what will we do. Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 29, 2011 Author Report Share Posted December 29, 2011 I wanted to give all the code but it is a very modified. Take a look: http://alwaysva.pl/ About Us -> Our staff Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted December 30, 2011 Moderators Report Share Posted December 30, 2011 Do you want to create a new one td (column) which will show the pilot's last location? Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 30, 2011 Author Report Share Posted December 30, 2011 Yes, Is's done. take a look: http://test.alwaysva.pl/index.php/pilots But, i don't know what i should write to that showed. (Current Pilot Position, of course from last pirep) Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 30, 2011 Report Share Posted December 30, 2011 You should be able to do <td><?php echo $report->arricao; ?></td> If you are still having problems, do print_r($report) to see what variables are available to use. Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 30, 2011 Author Report Share Posted December 30, 2011 (edited) It's not working yet. how? to do that? That's my code: <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>PID</th> <th>Rank</th> <th>Flights</th> <th>Hours</th> <th>Current Position</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'); */ // To skip a retired pilot, uncomment the next line: //if($pilot->retired == 1) { continue; } ?> <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 $pilot->vatsim_PID?> </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 $report->arricao; ?></td> <?php } ?> </tbody> </table> Edited December 31, 2011 by alwaysva Quote Link to comment Share on other sites More sharing options...
RogerB Posted December 30, 2011 Report Share Posted December 30, 2011 You know they have to of filed a flight report first for that to work, right? <?php echo ' '.$report->arricao; ?> Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 31, 2011 Author Report Share Posted December 31, 2011 Yes, soo? Quote Link to comment Share on other sites More sharing options...
RogerB Posted December 31, 2011 Report Share Posted December 31, 2011 I am going to assume your trying to use this script outside the pilot profile? Quote Link to comment Share on other sites More sharing options...
alwaysva Posted December 31, 2011 Author Report Share Posted December 31, 2011 Yes, i'm trying. Quote Link to comment Share on other sites More sharing options...
RogerB Posted January 1, 2012 Report Share Posted January 1, 2012 I guess because it is outside that module is the reason the code isn't working. I was trying to display this on the crew page, won't work....I am not that good with code, maybe one of the coding guru's here can help. Quote Link to comment Share on other sites More sharing options...
alwaysva Posted January 4, 2012 Author Report Share Posted January 4, 2012 ok thanks for reply. 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.