Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2013-11-26 09:19:43

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Maybe I’m being dim, but didn’t he want to count the number of characters in the title, not the number of words?

Offline

#32 2013-11-26 14:50:51

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,313
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Bloke wrote:

You can do that yourself. Visit Admin->(Advanced) Prefs and find Article Stats. In the Word count fields and DOM selectors option, add Title -> #title as one of the (comma-separated) items. Job done.

Cool, Stef. It count the number of words into the title (not the number of characters into the “Title_url” + protocol + domain name):

http://www.johnfdoherty.com/lessons-from-google-about-url-lengths/


Patrick.

Github | CodePen | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#33 2013-11-26 20:20:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,787
Website

Re: smd_article_stats: Article stats to count words 'n stuff

douglgm wrote:

Maybe I’m being dim, but didn’t he want to count the number of characters in the title, not the number of words?

Haha, I need my eyes or brain tested. You’re right. Sorry for being a dumbass. Suppose I could add a similar system for counting characters so you could somehow choose which bits you want displayed. Leave it with me and I’ll see if I can come up with anything.

I don’t think counting the domain + protocol + title is very practical though. I mean, it’d have to add up the site_url pref, guess the protocol (one character possible drift), figure out how long the intermediate parts are depending on your permlink scheme and, if necessary, work out how long the section is (remember section names are language dependent). There’s a lot of scope for error. Best advice: tell authors to use common sense and keep article titles short enough :-)

Last edited by Bloke (2013-11-26 20:24:55)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#34 2013-11-30 08:41:14

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,313
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Cool Stef :)

Ok for the “scheme URI” counting: I understand.
Tks for your reply.


Patrick.

Github | CodePen | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#35 2014-02-20 06:41:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,342
Website

Re: smd_article_stats: Article stats to count words 'n stuff

I was wondering if this plugin could help me with this.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#36 2014-02-20 08:46:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,787
Website

Re: smd_article_stats: Article stats to count words 'n stuff

colak wrote #279119:

I was wondering if this plugin could help me with this.

Yes. It has a public tag that can output the word counts from a single article so all you have to do is put it inside a list-building tag like <txp:article> (on a landing page), or <txp:article_custom>. Then you can use something like adi_calc (or roll your own txp:variable addition system) to total the words in the selected field thrown out by smd_article_stats.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#37 2014-02-20 09:15:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,342
Website

Re: smd_article_stats: Article stats to count words 'n stuff

Thanks Stef,

The plugin worked like a charm. No other plugin was needed


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#38 2014-08-28 15:20:17

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: smd_article_stats: Article stats to count words 'n stuff

Hello Stef, ‘cause I’m using Claire’s Swap Body Excerpt your plugin show the number of words in the “wrong” way (first the body words and then the excerpt words).
So, I know, it’s not your fault… hehehe… :P but, can you add a function to swap the counters?

EDIT: didn’t notice the Advanced Prefs: it’s already possible!

The best would be an auto-check if Claire’s plugin is activated and perform as a result… ;)-

… and even the possibility to localize the plugin (“word/s” => “parola/e” in Italian) even in the interface (“Article Stats” => “Statistiche”)

Thank you!!!

Last edited by candyman (2014-08-28 15:40:19)

Offline

#39 2014-08-28 16:00:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,787
Website

Re: smd_article_stats: Article stats to count words 'n stuff

candyman

Glad to be of service :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#40 2018-03-04 11:55:39

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,233
Website

Re: smd_article_stats: Article stats to count words 'n stuff

If there is already a thread for this, the forum is having hella hard time finding it. If so, please point me accordingly and I’ll clean up.

But… I have it installed in 4.7dev and have the front-side tag set like this at top of the article in the same p as the post date:

<txp:smd_article_stats item="body, excerpt" type="word" label="words: " labeltag="b" />

The back-end “Article stats” say, probably accurately: 2227 words ( 2107 / 120 )
But the front-side output says, words: 1991119.

I’m guessing that should be the sum of 1,991 + 119 (the desire) but isn’t getting processed, and the numbers are off.

Franky, I don’t care if the counts are off by a few words, but that’s more than a few. And the summation is troubled.

Stef’s response from a different thread soon to be deleted:

You might want a break=" + " attribute to separate the items :-)

As for the disparity in counts, well, it’s tricky. I think the plugin counts the body text typed on the admin side, which may include tags and headings and Textile codes and stuff. But on the public site, it only counts the rendered HTML, minus tags. So depending how much markup you use there may be some differences. A few hundred words seems a lot, though!

EDIT: I just found an article with over 9K words in it and the difference between public and admin counts was 10 words – that accounted for the ‘h2.’ tags in the admin side body text. Do you have a lot of Textile markup in your article body?

EDIT 2: The plugin doesn’t (currently) do sums. But if you’re running 4.7 you could maybe find a way to run the output through <txp:evaluate> to do the maths.

Thanks!


The text persuades, the *notes prove。

Offline

Board footer

Powered by FluxBB