Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-11-06 05:41:03

kelp
Archived Plugin Author
From: Seattle WA
Registered: 2004-07-05
Posts: 20
Website

[plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

This is a rewrite of a plugin originally written by ramanan”> and discussed here

I’ve made it more accurate so it only counts the actual words and not html tags or entities.

It is very accurate for my site, as compared to counting by hand or using wc. But there may be a few edge cases that it doesn’t cover properly.

If you have a use for such a thing get the plugin.

To use it just put <txp:klp_word_count /> in an article form template and it should print the right thing.

Let me know what you think.

I’m very new to php, so there may be better ways of doing this that I’m not aware of, I would love to hear them.

Last edited by kelp (2004-11-06 05:42:06)

Offline

#2 2004-11-08 04:39:36

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

Excellent. I think I’ll make the jump. When I wrote my plugin it was done quite quickly in response to a query. You seem to have put a lot more thought into this one.

Offline

#3 2004-11-08 05:40:40

kelp
Archived Plugin Author
From: Seattle WA
Registered: 2004-07-05
Posts: 20
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

> ramanan wrote:

> Excellent. I think I’ll make the jump. When I wrote my plugin it was done quite quickly
> in response to a query. You seem to have put a lot more thought into this one.

Hehe, i hate to admit it, but I probably went through about 4 or 5 revisions, and quite a few hours before I got it to this version.

Learned some php and a lot more about textpattern though.

Thanks a lot of the inspiration.

Offline

#4 2004-11-15 16:53:00

Irganox
New Member
From: Gothenburg, Sweden
Registered: 2004-11-05
Posts: 9
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

When I view the txt file, all I get is a bunch of strange letters…
Is that what it should look like? It seems wrong to me, since everything is just in one long row of random letters… Help me… I want a word count even if im stupid…

Offline

#5 2004-11-15 17:06:48

PeterS
Member
From: Cleveland, Ohio
Registered: 2004-03-06
Posts: 38
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

Irganox -

That’s the actual plugin itself. Go to Admin>Plugins, and paste that file into the plugin box, and click install. If that doesn’t work, upload the plugin, and install.

To activate, click on the “No” under the “Active” column. That will make it so TXP will parse your tags.

-Pete


The following is true
The above statement is false.

Offline

#6 2004-11-15 17:22:06

Irganox
New Member
From: Gothenburg, Sweden
Registered: 2004-11-05
Posts: 9
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

YTo4OntzOjQ6Im5hbWUiO3M…

is the only thing it displays after I click the install button… Hmmm…

Offline

#7 2004-11-15 17:36:18

Irganox
New Member
From: Gothenburg, Sweden
Registered: 2004-11-05
Posts: 9
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

I got it to work, I don’t know how I did it, but… It seems to work now… Thanks…

Offline

#8 2004-12-06 21:22:39

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

For those of you feeling adventurous, this is a perfect candidate for utilizing the Sparkline PHP Graphing Library. An explanation of Sparklines can be found on Edward Tufte’s website

Offline

#9 2005-06-11 18:55:03

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [plugin] [ORPHAN] klp_word_count - counts the words in the body of a post

gonan try this, thanks to andrew for hihglighting it.

kelp can you add the option to the pluign to give a complete word count of words from all entries?

Cheers

Offline

Board footer

Powered by FluxBB