Hi everybody!
I'm looking for a way to show the files of parent categories in the mydownloads module. In this module the page "index.php" gives a list of "recent files" from all categories. I want the same thing for empty parent categories that only have subcategories.
Example: the index page shows all categories and a list of "recent files". If you click on a category "sports" with no subcategory in it, files from the category will be listed. If the category "sports" has subcategories, lets say football and tennis, the files from these subcategories will not be shown in "sports".
I've been looking around in "viewcat.php", the page that generates categories. At around line 100 I changed the following:
if($numrows>0){
to
if($numrows>=0){
Otherwise "show_links" won't be set to true if you have subcategories, so that your links won't be shown.
Then I wanted to edit this string around line 120:
$q = "SELECT d.lid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE cid=".$cid." AND d.status>0 AND d.lid=t.lid ORDER BY ".$orderby."";
If I understand correctly, this string will only show what's in the current category, but will not know anything about any subcategories, because these are defined in "mydownloads_cat" and this record isn't being called. But how can I make XOOPS look in subcategories?
As I don't know too much about mysql, I'd like to ask a friendly fellow xoopser to help me a bit.
Thanks in advance...
Greets!