Cricket Moods Readme

Version 1.0.1

Description

Cricket Moods is a WordPress plugin. It allows an author to add one or more "moods" to every post. Each mood can be associated with an image file. The result would be that the author could have an animated happy smiley face next to the words I'm Happy! for every post she wishes.

The difference between this plugin and the ones I know of that are currently available is that Cricket Moods presents you with a list of available moods when you go to create or edit a post. No need to remember your list of moods. The list of available moods is defined in a table in WordPress's database; therefore, it is possible to rename the moods or even change a mood's graphic without modifying every post that uses that mood.

Installation

Cricket Moods currently has no installer script and is not yet available as a "One-Click install" from wp-plugins.net. There are four steps to install:

  1. Place cricket-moods.php into /wp-content/plugins.
  2. Import cricket-moods-table.sql into your WordPress database. This can usually be achieved by using phpMyAdmin.
  3. Add the function cm_the_moods() to your theme (somewhere in The Loop) where you want the moods to be displayed.
  4. Activate the Cricket Moods plugin from the Plugin Management panel of WordPress.

Enjoy!

Usage

In order for this plugin to be useful, you must place cm_the_moods() somewhere inside The Loop. When called with no parameters, cm_the_moods() only prints the mood image followed by the mood name, an ampersand, and any more moods followed by ampersands. For example, on a post with the moods Happy and Bored it will print: <img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy &amp; <img src="/wp-images/smilies/icon_neutral.gif" alt="Bored emoticon" /> Bored If there are no moods for the current post, it will print nothing.

cm_the_moods() can take three parameters: <?php cm_the_moods('separator', 'before', 'after'); ?>

separator
(string) Text to place in between multiple moods. Default is ' &amp; '.
before
(string) Text to place before the first mood. Default is nothing.
after
(string) Text to place after the last mood. Default is nothing.

A good way to implement this would be: <?php cm_the_moods(' and ', '<p>My mood is: ', '.</p>'); ?>

Customization

Currently, the only way to modify the list of moods available is to change it directly in the database. This will be improved in the future.