Gossamer Forum
Home : Products : DBMan : Customization :

Problem with List Categories and Display Count Mod

Quote Reply
Problem with List Categories and Display Count Mod
I just added the List Categories and Display Count mod and it displays categories nicely and the links work accurately (i.e., those with records display the records); however, all categories (even those with records) display a (0) for the count. What am I missing? Thanks!

Melanie
Quote Reply
Re: Problem with List Categories and Display Count Mod In reply to
Try taking out the lines

Code:
unless ($count{$option}) {
$count{$option} = '0';
}

See what happens.


------------------
JPD






Quote Reply
Re: Problem with List Categories and Display Count Mod In reply to
That resulted in all categories ending in ( ) with no count at all.

BTW, if it matters, I'm using the version with the Category as a select field. And my category happened to be named Category, and I'm not using the Validate mod.

Thanks,

Melanie
Quote Reply
Re: Problem with List Categories and Display Count Mod In reply to
Okay, played around with it a bit, and finally got it working.

I had to change

Code:
++$count{$fields[$i]};

to

Code:
++$count{$fields[$fieldnum]};

Now it's displaying AND counting correctly.

Melanie
Quote Reply
Re: Problem with List Categories and Display Count Mod In reply to
Thank you!!!! Smile I don't know what I was thinking when I wrote that. It's fixed in the mod now.

I really appreciate your letting me know. Smile


------------------
JPD