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>