EntryContents

| | Comments (1)

EntryContents

Download EntryContents 1.3 (1 September 2003)

EntryContents lists the number of words, paragraphs, images, or links in your entries. It's based on Adam Kalsey's WordCount plugin, but will also discount the number of words used in the excerpt, if the excerpt is taken from the entry body. This is good for RSS feeds where you may want to list the word count next to the excerpt but want to only say how much more of an item there is.

Using EntryContents

To install, drop the above file as EntryContents.pl into your plugins directory, then modify your template to call it, e.g.:

<$MTExcerpt$> (<$MTEntryContents word="1" link="1"$>)

The options EntryContents supports are:

word="1"
Show the number of words in the entry (e.g., 372 words). If the entry's excerpt is automatically generated from the first few words of the entry body, EntryContents lists the number of words not in the excerpt (e.g., 352 more words).
no_generate="1"
Don't bother with the excerpt mess above; list the number of words in the entry body, no more and no less.
paragraph="1"
Show the number of paragraphs in the entry (e.g., 7 paragraphs). If the entry contains HTML paragraph tags, EntryContents count those; otherwise it counts the number of blank lines (consecutive pairs of carriage returns).
link="1"
Show the number of a tags in the entry.
image="1"
Show the number of img tags in the entry.
glue="string"
Put string between the above counts when concatenating them. The default is "; ", for a result like 352 more words; 7 links; 1 image.

Future enhancements

  • Only count a hrefs as links.
  • Count object tags as images.

1 Comments

NeoThe1 Author Profile Page said:

Great plugin, but is it possible to sue it somehow to count ALL the words, images and links, in ALL the blog entries, I mean, to add the numbers up?

Leave a comment

About this Entry

This page contains a single entry by markpasc published on January 13, 2006 9:03 PM.

TypeKISS was the previous entry in this blog.

RandomOTDEntry is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories

Tag Cloud