
phpdreams |
You would need a recursive function, that is, a function that can call itself.
function categoryCount($thisCat) {
global $catCount;
// loop thru $thisCat counting listings
// if the listing has sub-categories, call categoryCount() again for it.
// when you're done, $catCount will have the total count in it.
}
call it initially with the ID of the category you want a count from.
A bit rough, but hopefully it'll give you the idea.
Friday, 9th October 2009
| Votes: |
|
26 |
|
13 |
|