2 Mar 08, 2005 03:52
I would propose that ANYTHING is possible. However, the reason you probably haven't found much on this subject is that it isn't a very straightforward modification.
First, you would have to define "active" and I see one of two ways ... either a certain number of posts within a time period - or - just ANY post within a time period.
But you said active subcategories. So there are no posts in the main categories? Are there subcategories within the subcategories, or is it simply a 2-level category tree? (i.e. Main 1, which has sub1a and sub1b, Main2 which has sub2a, sub2b, sub2c). THis may have some bearing on the general methodology.
I could see that you would need to write some php to define a date range. (i.e. - get today's date, subtract a week/14days or whatever you deem necessary for being "active"). Then a SQL query, which would require a JOIN statement to get the evo_categories table talking to the evo_posts categories, so that you could get posts with a post_issue_date inside the date range and (b) COUNT the posts within that range for each subcategory (if that's part of your criteria).
The files that you would probably need to modify include the _categories.php file in your particular skins directory (and maybe a file of the same name in the directory right above that, depending on how your _categories.php file is constructed). That will be evident by looking at the first one. And a core file - _functions_cats.php, in the b2evocore folder.
Keep in mind that in one of your _categories.php files, you will see the following:
* WARNING: the category list is displayed recursively.
* This is a little tricky. Don't modify below unless you really know what you're doing!
I don't mean to put you off. I DO want to let you know that I'm sure it's possible and if you're a php/SQL dude, point you in the right direction. However, changing the order of the category listing & coming up with a method of defining a unique class name for each category (so I can format my entries by category) is about as deep into categories as I have gotten.
Perhaps someone here with more experience has a more intimate knowledge of monkeying with those recursive cat displays lists can help you more.