Post Avatar

A Wordpress plugin simplifies the process of including a picture when writing posts. Authors simply choose from a predefined list of images in the Write Post page to display an image in a post. A template tag displays the image with The Loop. This plugin is similar to Livejournal userpics.

Authors: Vicky Arulsingam and Dominik Menke
Current Version: 1.2.7 (updated: February 26, 2010)
Download: post-avatar.zip
Get Support Here

Translations:


Features
Installation
Usage
Version History (Changelog)
Known Issues

Post Avatar was a finalist at The 2007 Philippine Blog Awards for Best Plugin/Extension.

Features

  1. Easy selection of images in the Write Post screen.
  2. Scans images in sub-directories of the image option folder.
  3. Allows the following file types: .jpg, .jpeg, .gif and .png.
  4. Show avatar automatically in blog or use a template tag to display in themes.
  5. Does not display missing images.

Back to Top

Installation

  1. Upload the “post-avatar” directory to the Wordpress plugin folder (/wp-content/plugins).
  2. Activate the plugin from the Plugin Management screen.
  3. Go to Options » Post Avatar. Set the following options:

    * Path to Images Folder – location of your images folder in relation to your WordPress installation.

    * Show image in Write Post Page – Place a tick mark if you want to see a thumbnail of the post avatar in the Write Post screen.

    * Scan the images directory and its sub-directories – Place a tick mark if you want to list all images including those in sub-directories of the image folder.

    * Show avatar in post – Show avatar automatically on your blog post. Uncheck to use the template tag (see Customizing Avatar Display, below).

Back to Top

Usage

A. UPLOAD IMAGES

Upload the images that you intend to use to the folder defined in the Post Avatar options.

B. ADDING AN AVATAR TO A POST

1. To add an image to a post, go to the Post Avatar section (just below the Save button).
2. Select the image name from the list.
3. Save your entry.

C. CUSTOMIZING AVATAR DISPLAY (Optional)

USING CSS
If you set the option “Show avatar in post”, images will automatically appear in your blog post. Customize the stylesheet inside “wp-content/plugins/post-avatar/head/” if necessary.

You can also set your own css class and html style inside the options page. These settings apply to the automatic avatar display and the default template tag in all templates where the_content() and the_excerpt() tags are used. To define a different HTML/CSS style in each template use the template tag options specified below.

USING THE TEMPLATE TAG “gkl_postavatar”
To customize the display of the avatar further, be sure to uncheck the option, “Show avatar in post”. You can use the template tag: gkl_postavatar.

Add the following within The Loop:

Default Code
<?php if (function_exists('gkl_postavatar')) gkl_postavatar(); ?>

By default, the plugin will show your image with the CSS class, “postavatar”. Customize gkl-postavatar.css inside the head folder.
For example:
<div class=”postavatar”><img src=”http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg” alt=”title of post” style=”width:100px; height:100px; border:none;” /></div>

Define Own CSS Classes
You can also define your own CSS-classes by using a query string. By adding this to The Loop:
<?php if (function_exists('gkl_postavatar')) gkl_postavatar('example', '', ''); ?>

the result will be this:

<img class=”example” src=”http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg” alt=”title of post” style=”width:100px; height:100px; border:none;” />

Define your own HTML
It is also possible to define your own HTML. Then you can use the string-parameters “before” and “after”:
If before = <p class=”mypic”> and after = </p> in this example:

<?php if (function_exists('gkl_postavatar')) gkl_postavatar('', '<p class="mypic">', '</p>'); ?>

will result in:

<p class=”mypic”><img src=”http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg” alt=”title of post” style=”width:100px; height:100px; border:none;” /></p>

Image Without Styling
To show the image without any divs place this in The Loop:

<?php if (function_exists('gkl_postavatar')) gkl_postavatar('', '', ''); ?>

to get:

<img src=”http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg” alt=”title of post” style=”width:100px; height:100px; border:none;” />

Back to Top

Version History (Changelog)

1.2.7 (02/26/2010)

Fixed: IE preview problems when reselecting an image. Thanks spedney at the forums.

Fixed: removed border=”0″ in image display for XHTML compliance. Thanks to Jay August for pointing it out here

1.2.5.4 (08/21/2009)

* Added: Dutch translation. Thanks to Jay August.

1.2.5.3 (08/06/2009)

* Added: Belorussian translation. Thanks to Fat Cower.

1.2.5.2 (06/02/2009)

* Added: Italian translation. Thanks to [Gianni Diurno](http://gidibao.net).

1.2.5 (12/15/2008)

* Fixed: Incorrect display of css class
* Fixed: Bugs in image display (height/width switched up)
* Fixed: “Cannot modify header information” errors when saving posts when plugin is used in conjunction with search unleashed plugin
* Added: Theme developer override option for automatic avatar display
* Added: template tag “gkl_get_postavatar”, to return post avatar data in an array.

1.2.4 (03/31/2008)
Download :: Discuss

*Slideshow effect to navigate for next and previous images (in progress)
*Display of avatar in Write Post page and navigation effects work in IE6+
*Style for WordPress 2.5
*Option to include avatars in RSS feeds

1.2.3 (10/06/2007)
Download :: Discuss

*Role capabilities that allow admins, editors and authors to post avatars
*Define HTML and CSS classes inside the options page
*Include automatic avatar display in post excerpts
*Option to display image dimensions
*Bugfix to stop avatars from displaying in feeds

1.2.2 (02/12/2007)
Download :: Discuss

*Bugfix to stop comment posting from deleting post avatars as identified here
*Bugfix to prevent post avatars from showing up in fields (updated: September 24, 2007)

1.2.1 (01/11/2007)
Download :: Discuss

*Added compatibility for Wordpress 2.1
*Added option to display image automatically without have to use template tag

1.2 (12/09/2006)
Download :: Discuss

*Scan subdirectories for images
*Created external scriptfile to make extending script easier
*Check if PHP_SELF contains substring (for subdomain installations)
*Improved image display in Write Post screen
*Add trailing slash to image directory option
*Check image existence using absolute path instead of url (for those without “Allow_url_fopen”)

1.1(09/06/2006)
Download :: Discuss

*dynamic reload of the post avatar – live preview (tested in Mozilla)
*gkl-postavatar produces now correct (X)HTML
*speed optimization (now it runs a few nanoseconds faster ;-) )
*Improved parameters
*Added l10n support

1.0 (08/26/2006)
Download :: Discuss

* Initial release

Back to Top

Known Issues

Back to Top