Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2004-11-05 02:50:57

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

Re: Plugin idea: Word Count?

Wait wait wait. All this time there has been a php function called str_word_count?

Offline

#50 2004-11-05 03:03:02

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

Re: Plugin idea: Word Count?

Yep :)

And it might do an pretty good job if the input is run through strip_tags() and then all things that look like html entities are striped out with something like preg_replace().

I was just too lazy and non regex clued to strip out all the html entities.

Offline

#51 2004-11-05 03:19:14

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

Re: Plugin idea: Word Count?

You know, I had noticed that yesterday as well while browsing string functions, but had just assumed there was a logical reason everyone had passed it up. D.Oh.

Offline

#52 2004-11-10 10:54:11

fantasylit
New Member
From: Australia
Registered: 2004-09-24
Posts: 2
Website

Re: Plugin idea: Word Count?

Oooer! Who knew I could cause so much trouble!

I’ve noticed that I tend not to use many tags so ramanan’s plugin is pretty accurate. Its only been a few words out for each post so far (I checked in a couple of regular word processors).

And thanks again for writing it, ramanan – its really come in handy.

Carla


I Elaborate
http://www.ielaborate.info

Offline

#53 2004-11-10 11:12:06

nishark
New Member
From: Melbourne, Australia
Registered: 2004-06-02
Posts: 9
Website

Re: Plugin idea: Word Count?

> ramanan wrote:

> Wait wait wait. All this time there has been a php function called str_word_count?

hehe, that function is mentioned in both the 3rd and 4th posts in this thread :)

Offline

#54 2006-08-02 02:29:05

datumax
Member
Registered: 2005-01-12
Posts: 16

Re: Plugin idea: Word Count?

Sweet! But has anyone thought to, or is it possible to use the output of this plugin dictate behavior? Like…

If wordcount >= 200
then truncate post

Can we build around this?

Offline

Board footer

Powered by FluxBB