Very nice plugin, is there a way to count numers of entries in open category?
Something like this?
{exp:catcount cat_id="{segment_3}" status="open|close"}
{segment_3} = C16 ?
so without using exp:weblog:categories and :entries? I need to show something like this “this category has 35 entries”
Maybe there is a better way to do that, but cant remember :(
thanx again
Hi Zac
sorry, yes, I need to use segment id, but as he has that “C” letter, I’m already using it to other custom query with SEGMENT operation to split it, but I get error when need to use it with your plugin, as I’m not so good at php, do you think or know what is best way to use category that is open, only one.
thanx
Hey Davor,
I might not have the time to add this patch to the official plugin, but here is a patch that will work.
Open up the pi.catcount.php file and on line number 25 and 26 you should see the following:
$cat_id = $TMPL->fetch_param('cat_id');
$status = $TMPL->fetch_param('status');
Insert the following in between the two lines so it looks like this:
$cat_id = $TMPL->fetch_param('cat_id');
$cat_id = substr($cat_id ,1);
$status = $TMPL->fetch_param('status');
Note that this will only work now if you pass it a url segment that has the C at the front of it.
When I get some more time I will post a solution that can automatically figure out if the C is at the front of the parameter value.
Please let me know if this works for you!
Zac
Hey Zac -
Thanks for the effort on this plugin.
Before I throw out all my custom code (see here) and switch to this I’ve got a question and an idea.
First, I’m wondering if it includes future dated posts in the category count? Ideally not, but figured I’d ask.
Also, not sure if you’re planning any upgrades, but one thing I’ve done with my code is allowed for a minimum posts threshold so it’ll only show categories with more than a certain number of posts. That way you can use it for a “popular categories” type sidebar item.
Thanks for considering these ideas and again for the effort.
TL
Hi Zac G.
Just put this into play counting cats in an EE 2.0 site and it works like a charm.
*pun intended… and too good to pass up.
Thanks so much!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.