Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[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
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
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
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
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
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
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
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