flyalaska Posted December 10, 2010 Report Posted December 10, 2010 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? Quote
selwynorren Posted December 10, 2010 Report Posted December 10, 2010 Yes please, would this be possible? Quote
Administrators simpilot Posted December 10, 2010 Administrators Report Posted December 10, 2010 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. Quote
selwynorren Posted December 10, 2010 Report Posted December 10, 2010 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 Quote
Administrators simpilot Posted December 11, 2010 Administrators Report Posted December 11, 2010 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. Quote
selwynorren Posted December 12, 2010 Report Posted December 12, 2010 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. Quote
Tylor Eddy Posted June 12, 2011 Report Posted June 12, 2011 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 Quote
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.