jDownloadsownloads.com

Author Topic: I made a little hack to filter yours downloads by tags directly in Jdownloads  (Read 232 times)

0 Members and 1 Guest are viewing this topic.

Offline rikoooo

  • Newbie
  • *
  • Posts: 32
    • Rikoooo
Hi,

If someone is interested, I have made a little hack of Jdownloads v3.9 in order to filter your downloads by tags directly from Jdownloads.

OPEN : /components/com_jdownloads/models/downloads.php

Look for this line  :

            
Code: [Select]
$query->from('#__jdownloads_files AS a');            
Add this code just after :

Code: [Select]
if(isset($_GET['tag']) && !empty($_GET['tag'])){
        $query->join('INNER', '#__contentitem_tag_map AS t on a.id = t.content_item_id');
        $query->where('(t.tag_id = '.$_GET['tag'].') AND (t.type_alias = \'com_jdownloads.download\')');
}

How it works ? From the 'All Downloads' page, append this argument tag= to your URL
Example : www.exemple.com/downloads/all/?tag=5 (where 5 is your Joomla tag ID).

Now you can create a button link with your favorites tags in your Jdownloads layout.

Offline ColinM

  • Moderator
  • *
  • Posts: 4.072
Rikooo
Sound interesting.  Could you please send a pic of what the output looks like please.
Presently Tags are shown with the Download, if you click on a tag then it lists all the Downloads with that tag using the Tags Component.
Colin

Offline rikoooo

  • Newbie
  • *
  • Posts: 32
    • Rikoooo
Hi Colin,

The output is the normal outpout of JDownloads, try my hack you will see. (It's not the output of com_tags)

It will output on this page like any other downloads : index.php?option=com_jdownloads&view=downloads

Thank you

Offline ColinM

  • Moderator
  • *
  • Posts: 4.072
Rikoo
Are you saying it effectively turns it into a "list Downloads by Tag"?Colin

Offline rikoooo

  • Newbie
  • *
  • Posts: 32
    • Rikoooo
Yes absolutely,

It even make the categories obsolete, because now you can use tags instead.

Offline ColinM

  • Moderator
  • *
  • Posts: 4.072
Hi
Will talk with Arno about this as really it would need to be a new option with its own menu item etc. It would be a good addition I think as "List Downloads by Tags"  - Iwill move the topic to 'Suggestions'

Colin