EntryContents
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
atags in the entry. image="1"- Show the number of
imgtags in the entry. glue="string"- Put string between the above counts when concatenating them. The default is "
;", for a result like352 more words; 7 links; 1 image.
Future enhancements
- Only count
a hrefs as links. - Count
objecttags as images.
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?