Jump to content

Personal Stats


RogerB

Recommended Posts

  • Moderators

Okay, here's what's in the attached file... (All stats are per pilot!)

  • Average Landing Rate
  • Average Hours
  • Average Miles
  • Total Hours
  • Total Flights
  • Total Miles
  • Total Passengers
  • Table with Greased Landings
  • Table with Top Flight Hours
  • Table with Top Flight Time with Year

I'll add more in the file later, maybe release a new module.

Enjoy the good stuff! B)

custom_stats.zip

Link to comment
Share on other sites

  • Moderators

Roger, if I'm not correct, I know you said you were creating custom pages for your site. Did you put the file in the custom .php files?

It should coded in any tpl files in the skins folder.

Link to comment
Share on other sites

i tried it in the profile_stats.tpl and it works great except for it doesn`t limit the results to 15 but gives 100 on the greased landings and top hours. I have copied the code exactly as it is in your .tpl file. Any ideas why it gives 100 instead of just 15?

Link to comment
Share on other sites

  • Moderators

i tried it in the profile_stats.tpl and it works great except for it doesn`t limit the results to 15 but gives 100 on the greased landings and top hours. I have copied the code exactly as it is in your .tpl file. Any ideas why it gives 100 instead of just 15?

Manuel,

In the file I gave, are you sure that you have this code in there with the table as an example I made?

$landingrate = getGreasedLanding(Auth::$userinfo->pilotid, 15);

Link to comment
Share on other sites

  • Moderators

Hey kyle,

Jap it is exactly the same as you posted but it still gives me 100. Thats funny hehe

Sorry, I made a mistake here.

Change this

$landingrate = getGreasedLanding(Auth::$userinfo->pilotid, 15);

To this..

$landingrate = getGreasedLanding(15);

And that will fix the problem, will update the file right away.

In the gettopfliightsmonth section, the coloring of the code in dreamweaver looks like there is a coding mistake...trying to find it if there is..

There should be no errors in my original file. If you want, you can send me your file via PM and I'll have a look at it for you.

Cheers!

Link to comment
Share on other sites

  • 4 months later...

Hello, guys!

The code works only for the logged pilots. But I would like to set it on the pilot_public_profile.tpl. So, basically, I need the "$pilot->pilotid" to pull the data from the DB. I've changed all the queries, but it is not working out. Would you please give me some tips?

As an example, I did this in all queries of all the functions...

$sql = '... p.accepted = 1 AND p.pilotid = '.$pilot->pilotid.' ORDER...'';
return DB::get_results($sql);
}

... instead of...

$sql = '... p.accepted = 1 AND p.pilotid = '.Auth::$userinfo->pilotid.'
ORDER B......'';

return DB::get_results($sql);
}

Link to comment
Share on other sites

  • 1 year later...

Okay, here's what's in the attached file... (All stats are per pilot!)

  • Average Landing Rate
  • Average Hours
  • Average Miles
  • Total Hours
  • Total Flights
  • Total Miles
  • Total Passengers
  • Table with Greased Landings
  • Table with Top Flight Hours
  • Table with Top Flight Time with Year

I'll add more in the file later, maybe release a new module.

Enjoy the good stuff! B)

I can't seem to get this to work. Could you past the EXACT code that i should put into this to get it to list the data in the red part? (The red is what i got from your code). I put that the file in: core/templates/custom_stats.tpl

<td valign="top" width="20%" align="left"><strong>Pax Carried:</strong></td>

<td valign="top" width="30%" align="left"><?php echo getTotalPassengersPilot();?></td>

<td valign="top" width="20%" align="left"><strong>Pax Carried:</strong></td>
<td valign="top" width="30%" align="left"><?php echo getTotalPassengersPilot();?></td>

Link to comment
Share on other sites

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