NAdams Posted December 1, 2010 Report Share Posted December 1, 2010 I think this topic has been brought up before, but I have searched the forums up and down and couldn't find it anywhere... Is there a way to tie the downloads to rank, so the pilot can't download a certain plane until he reaches a certain rank. Even though the dowloads are there, they can't access them until they reach the rank that the download is attached to. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 1, 2010 Administrators Report Share Posted December 1, 2010 Something like if(Auth::$userinfo->ranklevel > your required rank level) { //give em the download } This would be based on the numerical value of your ranking system. 1 Quote Link to comment Share on other sites More sharing options...
NAdams Posted December 13, 2010 Author Report Share Posted December 13, 2010 here is my code for the downloads_list.tpl, where would be the best place to insert the code above? or does it go somewhere else also, for the numerical value of the ranking list, if i had 8 ranks, then it would be rank level - 1, rank level-2, and so on.... <div class="mcright"> <br> <p><img alt="" src="http://x-usairways.com/images/downloads.png" /></p> <?php if(!$allcategories) { echo 'There are no downloads available!'; return; } foreach($allcategories as $category) { ?> <p><h2><strong><?php echo $category->name?></strong></h2></p> <ul> <?php # This loops through every download available in the category $alldownloads = DownloadData::GetDownloads($category->id); if(!$alldownloads) { echo 'There are no downloads under this category'; $alldownloads = array(); } foreach($alldownloads as $download) { ?> <li> <a href="<?php echo url('/downloads/dl/'.$download->id);?>"> <?php echo $download->name?></a><br /> <?php echo $download->description?><br /> <em>Downloaded <?php echo $download->hits?> times</em></li> <?php } ?><br /> </ul> <?php } ?> </div> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 13, 2010 Administrators Report Share Posted December 13, 2010 It would go after this: foreach($alldownloads as $download) { Quote Link to comment Share on other sites More sharing options...
Mysterious Pilot Posted December 14, 2010 Report Share Posted December 14, 2010 Something like if(Auth::$userinfo->ranklevel > your required rank level) { //give em the download } This would be based on the numerical value of your ranking system. That would work if ALL downloads are reachable after a certain rank is achieved. I suppose what he actually meant was to restric the download of certain items depending on the rank level which sounds logical to me. For example, if your fleet has Turboprops and Jets, the Jets packages/liveries wouldn't be available for download until the user achieved the rank appropriate for flying the jets. Another issue (???) is that once the download link is known, a "privileged" (in terms of rank achieved) user can pass the download link (or post it) to a lower "pilot". Anyways, that isn't important. Quote Link to comment Share on other sites More sharing options...
NAdams Posted December 14, 2010 Author Report Share Posted December 14, 2010 yep, that's exactly what i'm trying to do I want to control what downloads they can get at certain ranks. so pilots don't sign up for the VA and download all the stuff and then jump ship i'm not sure how it works in the FS world, but we all run xplane and it happens pretty often, pilots just see what they can get and then leave we maintain our own fleet and design our own scenery, so we only want to make that available to pilots who are commited to the VA and actually have to "fly" to rank up and get more stuff Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 14, 2010 Administrators Report Share Posted December 14, 2010 You can split it by category. Something like: // This is that foreach line from above: foreach($allcategories as $category) { // If this is the category turboprops, and their rank level is less than 2, then don't show this if ($category->name == 'Turboprops' && Auth::$userinfo->ranklevel < 2) { continue; } ... } Quote Link to comment Share on other sites More sharing options...
Mysterious Pilot Posted December 15, 2010 Report Share Posted December 15, 2010 You can split it by category. Something like: // This is that foreach line from above: foreach($allcategories as $category) { // If this is the category turboprops, and their rank level is less than 2, then don't show this if ($category->name == 'Turboprops' && Auth::$userinfo->ranklevel < 2) { continue; } ... } Possible and quite valid but in some airlines (like mine-to-be) you don't want them to download the Dash 8-Q400 until they have enough rank and many hours of flight (per rank), otherwise they are stuck with a smaller Turboprop like the delicious Twin Otter. I think what the other VA guy wants can be done with adding a new column to the Downloads table "minrank" and then if it is 0 it has no restriction, otherwise the rank level has to be at least that. Anyway, that is how I would do it but the software isn't mine. He can do the change in the database but in an upgrade it would be gone or probably cause problems. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 15, 2010 Administrators Report Share Posted December 15, 2010 Possible and quite valid but in some airlines (like mine-to-be) you don't want them to download the Dash 8-Q400 until they have enough rank and many hours of flight (per rank), otherwise they are stuck with a smaller Turboprop like the delicious Twin Otter. I think what the other VA guy wants can be done with adding a new column to the Downloads table "minrank" and then if it is 0 it has no restriction, otherwise the rank level has to be at least that. Anyway, that is how I would do it but the software isn't mine. He can do the change in the database but in an upgrade it would be gone or probably cause problems. It's open source, you can change it to work exactly how you'd like it to work. 1 Quote Link to comment Share on other sites More sharing options...
NAdams Posted December 16, 2010 Author Report Share Posted December 16, 2010 quick question.... i almost got this thing working...is the "rank level" based on hrs that the pilot has, or is that the ranks that i have, i.e., i have 8 ranks, so the rank level would be 1 - 8? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 17, 2010 Administrators Report Share Posted December 17, 2010 Yes, it is the order of your ranks and will change if you add or remove ranks to the system. lowest would be 1 and go up from there. Quote Link to comment Share on other sites More sharing options...
NAdams Posted December 17, 2010 Author Report Share Posted December 17, 2010 alright, i got everything working like it should in addition to controlling the categories, i just used the same code and changed it for the downloads, now i can control the individual downloads based in rank also thanks so much for the help guys - nick <div class="mcright"> <br> <p><img alt="" src="http://x-usairways.com/images/downloads.png" /></p> <br> <br> <?php if(!$allcategories) { echo 'There are no downloads available!'; return; } foreach($allcategories as $category) { // If this is the category scenery, and their rank level is less than 2, then don't show this if ($category->name == 'Scenery' && Auth::$userinfo->ranklevel < 2) { continue; } // If this is the category add-ons, and their rank level is less than 2, then don't show this if ($category->name == 'Add-Ons' && Auth::$userinfo->ranklevel < 2) { continue; } ?> <p><h2><strong><?php echo $category->name?></strong></h2></p> <ul> <?php # This loops through every download available in the category $alldownloads = DownloadData::GetDownloads($category->id); if(!$alldownloads) { echo 'There are no downloads under this category'; $alldownloads = array(); } foreach($alldownloads as $download) { // If this is the download a319, and their rank level is less than 2, then don't show this if ($download->name == 'A319' && Auth::$userinfo->ranklevel < 4) { continue; } ?> <li> <a href="<?php echo url('/downloads/dl/'.$download->id);?>"> <?php echo $download->name?></a><br /> <?php echo $download->description?><br /> </li> <?php } ?><br /> </ul> <?php } ?> </div> 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.