I think you will need to add some custom code to the menu.php to get the other filtering working. In your menu.php, you should have two record sets, open the second record sets which you already probably modified to get the sub categories working, and then add another custom filter to it, so your final query would probably look something like this:
SELECT categories_name, categories_id, languageID, sort_order FROM menu WHERE categories_id=%s AND languageID = 1 ORDER BY sort_order ASC
Let me know if you have any other questions.