Jump to content
flyalaska

Downloads

Recommended Posts

In the downloads section index.php/Downloads is there a way to split the categories so all categories don't show. Have a link for each cat?

Share this post


Link to post
Share on other sites

You could add a column to the downloads table for rank requirement, similar to the aircraft table. Then use something like:

if($category->ranklevel > Auth::$userinfo->ranklevel)
	{
		continue;
	}

within the foreach statement in your downloads.tpl file so it skips the catagories that are above the users rank.

Share this post


Link to post
Share on other sites

Hi Dave

Thanks for that, but we don't want to sort it according to rank. I would just like to show what downloads are available per page in a specific category.

For Example

At present the download pages shows all the downloads for all categories on 1 page, basically listing each download per category loop. I want to be able to split this and show only the FSX Fleet downloads on a page. I have created specific links to each category, but I don't know how to format the links to allow for category filtering.

I hope this makes better sense

Share this post


Link to post
Share on other sites

You can create a new function built around the existing data call.

DownloadsData::GetDownloads($categoryid)

I would build a new module so the function will not get overwritten in an update.

Maybe something like:

core/modules/Mydownloads/Mydownloads.php

<?php

class Mydownloads extends CodonModule    {

function get_category_downloads($categoryid)  {
  $this->set('downloads', DownloadsData::GetDownloads($categoryid));
  $this->show('mydownloads.tpl');
  }
}

Build a template named mydownloads.tpl and display the data as you would like.

<?php
if($downloads)
  {
   foreach($downloads as $download)
     {
       echo $download->name //all the database table columns should be available to you here
     }
  }
else
  { echo 'There are no downloads available';}
?>

Then use a link including your category id;

www.mysite.com/index.php/mydownloads/get_category_downloads/mycategoryid

You could also copy the commands from the admin side for the page that displays the downloads by category and use it to build a display on the pilot side.

Share this post


Link to post
Share on other sites

Hi Dave,

Thank you very much for the platform to start working on. I am happy to say its all done and dusted. Thank you very much for your help.

G'day Selwyn

Would you be able to explain what you did ?

I have this long list of downloads, having a dropdown to display one category at a time would be great, is that what you did ?

Cheers

Tylor

Share this post


Link to post
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...