Jump to content

Recommended Posts

Posted

have any of you messed around with or customized the personal stats page? It's very boring, was hoping to get some ideas thrown around so it can be made more interesting ....

  • Moderators
Posted

I have done that for my last VA. I added average landing rate, their top landings, their top flight #'s flown in month, all of that kind of detailed stats.

  • Moderators
Posted

(smacks head self) - I'll get onto it tonight. I'm working on the same one for Patriot Virtual, I might add new stuff in there and share here. :D

  • Moderators
Posted

I'm going to put the codes in the tpl file. It'll be too big to paste the code. There's some good stuff...Oh Good Stats Stuff! B)

  • Moderators
Posted

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

  • Moderators
Posted

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.

Posted

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?

  • Moderators
Posted

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);

  • Moderators
Posted

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!

  • 4 months later...
Posted

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);
}

  • 1 year later...
Posted

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>

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