Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-06-06 10:56:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

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

philwareham wrote:

shouldn’t the HTML structure be [snip]

OK


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

#14 2011-06-06 11:14:31

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

Ta!

Offline

#15 2011-07-25 18:51:58

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

Hi Stef, would it be easy to have smd_article_stats count all articles & excerpts (separately and summed) by just one given author?

If a publisher wants to get an easy overview on how much he owes to that staff writer, than a word counter like that would be very handy.
The results could be displayed on the Adminstration/User page, in brackets behind the user name – or similar.

I tried hacking your plug into that direction, but my coding skills are too lame (working on it, though)

Last edited by jayrope (2011-07-25 18:52:40)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#16 2012-02-14 15:16:38

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

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

I likes me word counts in the Write zone.

I used to use zem’s word counter, and the thing I liked about it was the position of the stats output under the excerpt, in context of the author and post date. Out of eye’s way and not distracting, but there when you wanted a quick look at it. :}

Am I alone? :{

Offline

#17 2012-02-14 15:47:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

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

Destry wrote:

under the excerpt… Am I alone? :{

Nope. That’s why the plugin allows you to place the panel where you like.

Unfortunately it’s not immediately accessible because the size of the plugin would probably triple if I added the option to set it via the admin interface. So I opted for a hidden pref instead. Paraphrasing the plugin help, grab a copy of smd_prefalizer if you want to make it easy on yourself and add a hidden pref called smd_article_stats_pos then set it to one of the following values:

  • status_above : (default location) above the Status box
  • excerpt_below : Immediately beneath the Excerpt
  • author_below : Beneath the author info (under the Excerpt)
  • title_above : above the Title box
  • textile_help_above : above the Textile Help twisty
  • textile_help_below : below the Textile Help twisty
  • none : disable the panel

You can set the value globally, or per-user.

However, I just noticed that excerpt_below option was broken and didn’t update in realtime so I’ve fixed it in v0.23, as well as adding a zem-compatible option: author_below.

Last edited by Bloke (2012-02-14 15:59:13)


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

#18 2012-04-04 15:06:10

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

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

Hi Bloke,

I’ve tried to add a custom field to the count and got it working on admin side, but client side it won’t include the field to the count.

I have included the the field on the library function (as said it works on admin side) and have also something like this for the client side function:

$out = array();
	$item = do_list($item);
	$out[] = smd_article_info_count($item, $thisarticle['body'], $thisarticle['excerpt'], $thisarticle['title'], $thisarticle['custom_13']);

Then I use a tag:

<txp:smd_article_stats item='body,title,custom_13'/>

Any tips how could I get this working?

Offline

#19 2012-04-04 15:39:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

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

Teemu wrote:

I’ve tried to add a custom field to the count

It’s a bit more involved than that, but since it makes a heap of sense, I’ve just modded the plugin to permit any article field to be counted. Since it’s not fully tested yet, I’ve made a beta of v0.24.

There’s a little (non-harmful) bug if you’re running SVN due to the new AJAXy Write tab but if I fix that I’ll release it, providing it does what you want.

Note: don’t use custom_N but use the actual custom field name in this version. It totals all the words from the things listed in your item attribute.

Hope that helps, and thanks for the idea.

Last edited by Bloke (2012-04-04 15:41:14)


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

#20 2012-04-04 15:48:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

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

Bloke wrote:

There’s a little (non-harmful) bug if you’re running SVN due to the new AJAXy Write tab but if I fix that I’ll release it, providing it does what you want.

Fixed. Download beta again if you’ve already got it. Let me know how it goes and I’ll release it if it scratches the itch.


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

#21 2012-04-04 16:08:49

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

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

Thanks Bloke,

Unfortunately it still doesn’t seem to include the custom field to the count (I used the field name), and actually on admin side it displays only zeros now.

Last edited by Teemu (2012-04-04 16:09:06)

Offline

#22 2012-04-04 16:22:01

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

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

I stand corrected. It does count the custom field, didn’t realize the field name has to be all lowercase. Admin side still shows all zeros though. I use hak_tinymce, if that has any relevance, although the earlier version was displaying ok count after save.

Also I noticed this error is displaying at the bottom of the admin side:

Warning: Invalid argument supplied for foreach() in /home/kiina8/www/textpattern/lib/txplib_misc.php(653) : eval()'d code on line 97

Last edited by Teemu (2012-04-04 16:44:33)

Offline

#23 2012-04-04 18:57:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

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

Teemu wrote:

didn’t realize the field name has to be all lowercase.

Ah yes, Textpattern lower-cases it internally.

Admin side still shows all zeros though.

Weird, works for me. But…

Warning: Invalid argument supplied for foreach()

probably wasn’t helping. Try the new beta I just uploaded which squashes that bug. Thanks for the report.


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

#24 2012-11-22 13:35:28

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,595
GitHub Twitter

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

Hi Stef ;)

You’re looking for, now you’ve got it:

#@admin
#@language fr-fr
smd_artstat => Statistiques d'article
smd_artstat_fields => Champs de décompte et sélecteur du DOM
smd_artstat_pos => Emplacement dans la page
smd_artstat_id => Afficher l'ID de l'article
smd_artstat_singular => Nombre pris au singulier
smd_artstat_pos_below_excerpt => Sous le résumé
smd_artstat_pos_below_author => Sous le nom d'auteur
smd_artstat_pos_above_status => Au dessus des statuts
smd_artstat_pos_above_title => Au dessus du titre
smd_artstat_pos_above_textile => Au dessus de l'aide Textile
smd_artstat_pos_above_textfilter => Au dessus du sélecteur Aide Textile
smd_artstat_pos_below_textile => En dessous de l'aide Textile
smd_artstat_pos_below_textfilter => En dessous du sélecteur Aide Textile
smd_artstat_legend => Statistiques article
smd_artstat_word_singular => Mot 
smd_artstat_word_plural => Mots 

Note: the last 2 words have a space after its.

May I suggest you to add this feature? Estimated reading time

Last edited by Pat64 (2012-11-23 09:35:33)


Patrick.

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

Offline

Board footer

Powered by FluxBB