PIREP count activated areas

Hi folks

Is there an addon that will give pilots access to pages/areas of my choosing only after they have filed say 5 successful PIREPS?

I have a discount deal with a top scenery developer and dont want members joining up just to get the code, so i need to limit access to this code.

I’m no good with php but I’m assuming a line or 2 could check a pilots total pireps against the required amount and grant access?

Hope someone can help, Dave.

You could group together a couple of IF commands at the start of the page, first see if they are logged in, if not display a message stating they need to be logged in to see the page, and if that requirement is met then continue to a second if command and use the totalflights variable out of $userinfo to check the number of flights filed. Maybe something like this…

<?php
if(!Auth::LoggedIn())
      {
            echo 'You must be logged in to view this page!';
            return;
      }
if (Auth::$userinfo->totalflights <= 5)
      {
            echo 'You must file over 5 flights before you can access this page!';
            return;
      }
?>

//Page content goes here

May have to clean it up a little, just an idea… 

You could also do (for instance, right in a template)

if (Auth::$userinfo->totalflights <= 5)
{
      echo 'license key information';
}