Jump to content

PIREP count activated areas


davehardy

Recommended Posts

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.

Link to comment
Share on other sites

  • Administrators

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

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