Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2011-01-13 18:23:09

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

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

You had it switched around. Yours had it not excerpting if the word count was greater than 100. Just switched it, now it does exactly what it says on the tin:

<txp:smd_if field='<txp:smd_article_stats item="body" />' operator="gt" value="100">
  <txp:rss_auto_excerpt yah-de-yah/>
<txp:else />
   <txp:body />
</txp:smd_if>

Offline

#12 2011-06-06 09:52:05

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,092
Website

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

Hi Stef,
Just a minor thing, but to be consistent with Textpattern layout shouldn’t the HTML structure be:

<fieldset>
<legend></legend>
<p></p>
</fieldset>

At the moment it’s missing the paragraph <p> tags. Makes it harder for custom admin themes to style the plugin if it’s not there.
Cheers,
Phil

Offline

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

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

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: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,092
Website

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: 635
Website

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, though only when there’s gravity.

Offline

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

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,020
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? :{


The text persuades, the *notes prove。

Offline

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

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

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: 8,458
Website

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: 8,458
Website

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

Board footer

Powered by FluxBB