Module: Uploads manager

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
blackrain
Forum Members
Forum Members
Posts: 98
Joined: Wed Feb 20, 2008 4:33 pm

Module: Uploads manager

Post by blackrain »

I am using version 1.25.8 of the Uploads module and was wondering how to display the category name of the file list. I can see how its done in the details view but not the summary view.

Many thanks

Mark
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Module: Uploads manager

Post by Rolf »

A few years ago I made a website where I needed this too. As far as I remember I could not find a available feature back then... So I created a UDT. Perhaps in the year 2018 there is a better way, but if not here my solution.

User Defined Tag, named uploads_category_name

Code: Select all

$id = isset($params['id']) ? $params['id'] : '';
                
$db = cmsms()->GetDb();
$query = 'SELECT upload_category_name FROM '.cms_db_prefix().'module_uploads_categories WHERE upload_category_id='.$id;

$result = $db->Execute($query);
if ($result) { echo $result->Fields('upload_category_name'); }
In the template I use:

Code: Select all

{uploads_category_name id=$entry->category}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”