davehardy Posted September 15, 2009 Report Share Posted September 15, 2009 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. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted September 15, 2009 Administrators Report Share Posted September 15, 2009 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... Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted September 16, 2009 Administrators Report Share Posted September 16, 2009 You could also do (for instance, right in a template) if (Auth::$userinfo->totalflights <= 5) { echo 'license key information'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.