1
jayjay
Show "recent files" of every category in mydownloads
  • 2004/4/1 13:56

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


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!

2
Catzwolf
Re: Show "recent files" of every category in mydownloads
  • 2004/4/1 14:24

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


The next version of My_downloads has this now, so wait a little while and you will have it

3
jayjay
Re: Show "recent files" of every category in mydownloads
  • 2004/4/2 8:44

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


Hi catzwolf,

Thanks for your quick response! I'm quite happy with the current version (hacked mydownloads rc1), though I'm looking forward to the new one.

Still i wish to have this functionality in the current version, because it is running stable now and it cost me some time to get it that way.

I read this thread which could bring a solution:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=17767&forum=4#forumpost77273

I understand I have to call the parent id or "pid" record in "xoops_mydownloads_cat". Every "pid" has a bunch of "cid" records under it. Can I group these "cid" records so that when you call a parent category, all subcategory files are listed?

This is the code which is mentioned in the thread:

SELECT lidcidtitledatehits
FROM mydownloads_downloads 
AS d
LEFT JOIN mydownloads_cat 
AS c ON c.pid d.cid


Somehow I think this code can help me, but I don't know how to implement it.

Any help would be appreciated...

Greets!

Login

Who's Online

277 user(s) are online (132 user(s) are browsing Support Forums)


Members: 0


Guests: 277


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits