Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2004-11-24 23:41:37
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mdn_count
“Everytime Remillard updates a plugin, an angel gets its wings.”
(This is getting to be a pretty silly thread, between this and the needle counting.)
Offline
#14 2004-11-25 10:20:09
- humanoid
- Member
- Registered: 2004-06-24
- Posts: 17
Re: mdn_count
Hi, a small question – could this be called iteratively? So that you get a list of all your categories with the numbe rof posts in it?
Offline
#15 2004-11-25 14:07:14
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: mdn_count
> Remillard wrote:
> I’m back. Currently the file at the link is version 1.1, and contains the following modification.
> If section or category are marked as “#”, then the current section or category will be used for counting.
> See if that helps.
With YellowDuck’s changes it works perfectly, thank you again!
Offline
#16 2004-11-25 15:23:25
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mdn_count
whups… I’ll go fix that… Duck is right, it needs to be a double = for comparison.
As far as iteratively, I’m not sure what you mean precisely. You can call it multiple times, sure. It doesn’t iterate by itself though over categories. you would have to have a tag instance for each category you wanted counted.
Okay, well off to fix that comparison. 1.2 will be up in short order.
Done. Hope it’s okay now.
Last edited by Remillard (2004-11-25 15:26:56)
Offline
#17 2004-11-25 15:28:56
- humanoid
- Member
- Registered: 2004-06-24
- Posts: 17
Re: mdn_count
—-
As far as iteratively, I’m not sure what you mean precisely. You can call it multiple times, sure. It doesn’t iterate by itself though over categories. you would have to have a tag instance for each category you wanted counted.
—-
yeah I know I can just call the plugin repeatedly (once for every section). Hmm, maybe I should just do that, it is too complex for me to dive into the php and change it so it gives bac a whole list of all cat’s + numbers.
Thanks for the answer anyway.
Offline
Re: mdn_count
my impression of what humanoid suggested in terms of ‘iteratively’ as a list of categories, is that it’s the same thing as what i’m suggesting here
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#19 2004-11-25 16:14:23
- humanoid
- Member
- Registered: 2004-06-24
- Posts: 17
Re: mdn_count
You are absolutely right. It would be great to combine the two you mention. I will have a go at it myself maybe, but chance I will not succeed is pretty high (no php knowledge etc).
Offline
#20 2004-11-25 16:24:20
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mdn_count
Well almost the same.
A few ideas:
It might be interesting to write a category iterator plugin. It doesn’t necessarily do anything by itself but it would process what’s enclosed for every category. The same for section.
However, the main difference is that you asked for categories IN a section. That’s not hard, just different. The count plugin currently doesn’t care about cross-associations between category and section. It just counts.
humanoid: That’s the best way to learn. I didn’t know a stitch of PHP or MySQL until working on these things (as is readily apparant from missing the equal sign comparison earlier…sheesh, I’m still kicking myself for that one).
It’s a holiday weekend, so we’ll see what happens, but maybe I can work on an iterator plugin for fun with various options with respect to section and category.
Offline
Re: mdn_count
honestly, it woud be useful to know the count of articles in a whole category, as well as a category within a particular section..
it seems like an ambitious project to me, though… maybe you’d like to rest your head sometime :)
anyway, we’ve lived without it so far, so while it would be nice to see either Remillard or humanoid or some other brave soul take it on, i think we can be patient for however long it takes.
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#22 2004-11-25 16:43:33
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: mdn_count
The more I think about it, I think it would be pretty easy to do this with the current plugin. I’ll take a peek.
Offline
#23 2004-11-25 16:52:30
- humanoid
- Member
- Registered: 2004-06-24
- Posts: 17
Re: mdn_count
Go Remillard Go :-)
In the meantime I was heavily looking at
==
if ($section) $section_q = “AND Section=’$section’”;
print “<!— section_q=$section_q —>\n”;
$rs = getRows(“SELECT DISTINCT c.name FROM “.PFX.“txp_category c, “.PFX.“textpattern t WHERE (t.Category1=c.name OR t.Category2=c.name) AND t.Status=4 $section_q ORDER BY c.name ASC”);
==
But I couldn;t understand it at all :-(
Offline