RadioDJ - Free Radio Automation Software Forum

Requests only from one category

Offline JoshTheRadioDude

  • ***
  • 164
  • Jack of all trades. Master of most of them.
Requests only from one category
« on: May 16, 2018, 12:40:11 PM »
I've seen a lot of help requests about subcategories, and given that all of the topics about that date back to an ancient version of the plugin, they're of little help today.

I have a similar but different approach that I'd like to take, but I don't know quite how to get there.  I want to limit my songs available for request not to subcategories, but to just one category.  Currently, the plugin has checkboxes based on track types, but not categories, which are entirely different tables in the database.  Anything in the database that has a "Music" track type will show up in the request form and results list no matter what category it's in.

In my particular case, I want to limit the request function specifically to the category ID "1" (which is the "Music" category by default).  I'm sure this would have something to do with calling up the "category" table somewhere in the request functions of radiodj.class.php, then limiting the results with the IN clause, but I'm not entirely certain what the code needs to be or where in the file it needs to go (one somewhat depends on the other).

I get the feeling this would help a lot of people who want to limit subcategories, as well, because this way, all they'd have to do is move the subcategories they don't want to show up into a category that doesn't get called up by the request function.

If anyone has the answers, I would appreciate it!
"Jimmy James will hereafter, and for the purposes of this contract only, be referred to as 'God.'"
-- the Act of God clause in Bill McNeal's employment contract with WNYX