Gossip: Paul Simon not pretentious, defends Garfunkel

Damn lies and statistics

n: smd_article_stats | v: 0.21 | d: 541 | f: /

Plugin documentation follows this short message from our sponsor ;-)

If you like my code and find it useful, feel free to show your appreciation with something from my UK Amazon wish list (or US) or donate to the Stef Dawson community coding pot by following the Donate button below to PayPal. Thanks!

Plugin list buttonDownload buttonCompressed download button

smd_article_stats

Put this tag in your article form to display info about the current article. Tags are ignored. Note that it only displays the actual number of words entered in the article itself — if some of the content is derived from other forms, it will not be included.

Attributes

  • item : list of items you want to display. Currently choose from body, excerpt or title to get the number of words in the relevant fields
  • label : label text to output before the requested info
  • labeltag : (X)HTML tag without brackets to wrap around the label
  • wraptag : (X)HTML tag without brackets to wrap around the output
  • class : CSS classname to apply to the wraptag

Admin side

On the Write tab, the number of words in the body / excerpt are displayed in a stats panel. It is updated in real time as words are entered. The article ID is also displayed; hyperlinked to the article itself if it is live or sticky.

If you wish to move the panel to a different location on the Write tab you can manipulate a hidden preference (you could use the smd_prefalizer plugin for this task). Create a Hidden preference for your user name called smd_article_stats_pos and give it one of the following values:

  • status_above : (default location) above the Status box
  • excerpt_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

Changelog

  • 24 Aug 09 | 0.1 | Initial release
  • 07 Nov 09 | 0.2 | Improved counting to ignore tags and added real-time admin-side counter (both thanks speeke)
  • 22 Feb 10 | 0.21 | Prevented error message if step mangled

Credits

Thanks to both zem and iblastoff for the original works that this plugin borrows as its foundation.

Experimental software

If you’re feeling brave, or fancy trying something new, you can test out some of my beta code. It can be found on the plugin beta page.

Legacy software

If, for some inexplicable reason, you need an old version of a plugin, it can probably be found on the plugin archive page.

Stef wears devil horns. Wrongly

It's rude to point