Jump to content

Editing the "Pilot" list


Kalo

Recommended Posts

hello,

I was wondering how I could edit my pilot list, so instead of categorizing pilots by their Pilot ID, it would categorize pilots by "Hours". I want it so that it shows the pilots with the most hours at the top of the list.

I am familiar with editing php files and what not. here is my list: http://www.msflights.net/pilots/phpvms/index.php/pilots

Basically I just need to know what file to edit and what to put in it.

Thanks alot!

-Kalo-

Link to comment
Share on other sites

  • Moderators

You need to create a PHP file in common folder then address the tpl to use the created PHP file. Now inside that PHP you need to write a query from DB to get all pilots and sort them by their hours and finally show that in a table If you know what I mean.

Link to comment
Share on other sites

do you guys by any chance know where the file is located to edit rank?

so far the closest thing I have found is the "pilot_list" template located in: "phpvms\core\templates"......however I don't see anything in this template about ordering by Pilot ID.

For instance in this template I see for the "Pilot ID" column:

<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>

</td>

but I don't see where this code tells it to categorize by ID?

Forgive my lack of knowledge on the subject...but I can't seem to find the file that orders the pilot list.

thanks.

Link to comment
Share on other sites

  • Moderators

do you guys by any chance know where the file is located to edit rank?

so far the closest thing I have found is the "pilot_list" template located in: "phpvms\core\templates"......however I don't see anything in this template about ordering by Pilot ID.

For instance in this template I see for the "Pilot ID" column:

<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>

</td>

but I don't see where this code tells it to categorize by ID?

Forgive my lack of knowledge on the subject...but I can't seem to find the file that orders the pilot list.

thanks.

The reason is that you're in the wrong place. Looking at the function in modules/pilots/index(), I tried to see if I can order pilots by total hours but I think a lot of parts need to be changed if you want to go that way. I think creating a common php file for this and edit the template would be a much easier solution without having to change the file system.

Link to comment
Share on other sites

hmm thanks for your response parkho, but I don't have a index file in the modules/pilots folder. I just have a pilots.php. I wonder if anyone else has tried to do this in the past....can't find any while searching. It seems like most people would rather have it categorized by hours instead of Pilot ID.

Link to comment
Share on other sites

  • Moderators

Well! as I mentioned in my first post you'll need a class file in common folder that pulls out the data sorted by pilot total hour then edit the pilot's list to call that function and show the data in a table. Keep in mind that doing so will results in a table with all the pilots sorted based on hours and not showing the pilots in HUB sections any more.

Link to comment
Share on other sites

ok thanks, I will try but this is a little more complicated then I thought..or may be-able to do :) (I thought it would be as easy as editing 1 line :P )

It's actually perfect that it would not show pilots per hub, that's exactly what I wanted! I'd rather for people to be-able to look at 1 list and see who is the most active, rather then scrolling down to look at each hub separately.

Link to comment
Share on other sites

thanks! worked like a charm!

I made a change but I am not sure if I did it the best way: to display all of my pilots instead of just 2 like the default template you gave me, I put 100 in the parenthesis instead of the standard 2: "$pilots = PilotListData::pilotlist(100);"

Is there another command that would list all pilots? Or is it OK to just put a number much higher then the actual pilots in your database?

Thanks parkho!

Link to comment
Share on other sites

  • 2 weeks later...

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