Post Avatar 1.0

This is a WordPress plugin that allows you to easily include previously uploaded images with a post. Similar in concept to Livejournal Userpics

Download: post-avatar1.0.zip


Since I wanted Livejournal functionality on my blog, I went in search of some plugins that could help me display an image with a post.

I tried the Post Image plugin but that meant I had to upload a picture for every time I made a new post. I found that wasteful since I tend to re-use images in my posts.

Next I tried just placing in the link to the image in the Custom Fields section of the Write Post screen but I have difficulty remembering the image names and I spent too much time checking on the different pictures.

So I decided to create a plugin that would display a list of images I had already uploaded, for me to select when adding a post.

Features

* Easy selection of images in the Write Post screen.
* Allows the following file types: .jpg, .jpeg, .gif and .png.
* Template tag to display in themes.
* Does not display missing images.

Installation

  1. Download Post Avatar. Unzip the contents and upload gkl-postavatar.php 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 – Set to “Y” if you want to see a thumbnail of the post avatar in the Write Post screen. If not set to N.

Usage

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

B. Display post avatars in your theme
Add the following within The Loop;

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

The plugin will show your image encased within a <div> with the CSS class, “postavatar”. You may want to add a style for this in your stylesheet.
Example:

<div class="postavatar"><img src="http://www.garinungkadol.com/wp-content/images/icons/messer01.jpg" alt="post title" height="100" width="100" border="0" /></div>

C. Adding Post Avatars

  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.

Version History

1.0 (08/25/2006)

  • Initial release

Support

Please use the comments section to submit bugs, get help or leave feedback.

This entry was posted in Post Avatar. Bookmark the permalink. Both comments and trackbacks are currently closed.

50 Comments

  1. Posted August 28, 2006 at 4:06 pm | Permalink

    The zip is faulty. I tried to download it using Firefox 1.5 and IE 7.

    Your plugin looks interesting I will have a look at it when the zip is working. Thanks in advance!

  2. bobby
    Posted August 31, 2006 at 3:32 am | Permalink

    i cant get this to work. when i click on the options page, its blank and i cant do anything

  3. Vix
    Posted August 31, 2006 at 1:44 pm | Permalink

    Bobby: Could you be more specific about what the problem is?

    Did you activate the plugin and on the Post Avatar options page there’s nothing to see?

    In any case, I’ve sent you an e-mail.

  4. Posted September 7, 2006 at 5:40 am | Permalink

    Kudos! This plugin works like a charm. I love it. Thanks for this.

  5. Posted September 15, 2006 at 9:58 am | Permalink

    It works great for me. Thank you very much for your hard work.

  6. Posted September 29, 2006 at 10:10 pm | Permalink

    I am using dreamhost to host my site and they have disabled allow_url_fopen. Is there any solution that will allow me to use the plugin? Using cURL instead perhaps? I am completely dumb when it comes to programming so if cURL will work I would need step by step instructions on how to fix it. Thanks a lot in advance.

  7. Posted October 3, 2006 at 11:52 pm | Permalink

    hey this plugin looks perfect for what i am trying to do. however when i activate the plugin and go to Options>Post Avatar it says:

    Fatal error: Call to undefined function: wp_nonce_field() in /www/amplifico.net/www/amplificoblog/wp-content/plugins/gkl-postavatar.php on line 208

    Can you help? Thanks so much!

  8. Posted October 4, 2006 at 12:04 am | Permalink

    ah found the update! it works. thanks!

  9. Posted October 17, 2006 at 4:42 am | Permalink

    This plug-in is very nice..
    Thank you.^^
    But I have some problem.
    This messege is shown :
    Warning: getimagesize(): URL file-access is disabled in the server configuration in /home/heeya7420/html/wordpress/wp-content/plugins/post-avatar/gkl-postavatar.php on line 144

    Warning: getimagesize(http://heeya7420.dothome.co.kr/wordpress/wp-content/uploads/icons/ellensleeping.gif): failed to open stream: no suitable wrapper could be found in /home/heeya7420/html/wordpress/wp-content/plugins/post-avatar/gkl-postavatar.php on line 144

    Help Me~~~

  10. Vix
    Posted October 17, 2006 at 10:06 am | Permalink

    If you are getting the error URL file-access is disabled in the server configuration or you are hosted with Dreamhost, please download the latest version of Post Avatar here

  11. Posted October 19, 2006 at 1:56 pm | Permalink

    Hello,

    First of all, many thanks for this nice made plugin for WP! Well done.

    Personly, i dont use the default theme on my blog and everything is working fine, but the badest problem is that my post-image is showing very incorrectly place. When i post a newspost it will be add to the leftside above the sidebar, very weird. Anyone know how to fix this, or how to change this?

    Thanks alot
    AVD

    Blog: http://www.dreun.net

  12. Posted October 19, 2006 at 6:12 pm | Permalink

    Luxferi left some comments on how to style the template tag.

    Read it here

  13. Posted November 5, 2006 at 2:21 pm | Permalink

    I seriously truly officially LOVE YOU to F-ing DEATH!!!!! *dies* I can finally truly ditch LJ. You are my hero. lol :)
    *dork*

  14. Mike
    Posted November 11, 2006 at 2:30 am | Permalink

    Hi, first many thanx to your nice plugin. It works almost fine with one exeption i don’t understand.

    if i write one post i am able to choose an avaar and save the post. if i write a second post after the first and i choose the same avatar again (which i think was intented to do so) then the new post shows up two times the same avatar and the avatar of the post before is gone. do you have a solution for that?
    best regards from vienna, Austria
    mike

  15. Posted November 12, 2006 at 1:07 am | Permalink

    Hey Vix, You posted on my blog about my mysterious Post Avatar problem. Yes, I am using that template tag but nothing is showing up! Everything else is fine, I get the admin screen, I get the avatar options on my post screen. The only thing wrong is the tag. If you look at the source of my blog you’ll see that I commented where the tag should be but it just isn’t showing up. Any ideas? Thanks!

  16. Vix
    Posted November 13, 2006 at 8:57 am | Permalink

    Hey Mike, Can you send me the url to your site? I’m not certain yet what is the problem.

  17. Posted November 15, 2006 at 12:36 pm | Permalink

    I got the plugin installed also.. but i have no clue what u mean by loop… what loop?..

    How do i put the tags on my theme to show on my main page?

  18. Posted November 23, 2006 at 9:52 am | Permalink

    I installed the updated version on my site and followed the instructions. However, there is a broken image under the ‘image preview’, and after selecting an image and saving the post, it comes back to the page saying “No Avatar Selected” still. On the updated post I saw a commenter had the same problem as me and someone suggested puting the php code in the Loop.php … however, my Loop is spread throughout my pages, and currently the php tag is within the if (have_posts) section of the loop in my index.php and I’m still getting nothing.

    Help?

  19. Vix
    Posted November 23, 2006 at 11:05 am | Permalink

    Amanda, can you check the page source and see what is the url of the image that is trying to load?

  20. Posted November 23, 2006 at 3:37 pm | Permalink

    I just checked the source and there isn’t anything there about the icon, or anything relating to the plugin. I have the php included into the index.php, and the drop down menu shows up on my write page, but there’s no sign of it in the post or in the actual site’s source.

    O_o lol

  21. Yinz
    Posted November 25, 2006 at 7:20 pm | Permalink

    Can this plugin be used for multiple user interface? Eg. display specific avatar for each user’s post just like livejournal entries?

    Is uploading of avatar possible by means of ftp only ?

  22. Yinz
    Posted November 26, 2006 at 10:18 pm | Permalink

    I can’t find loop.php either >..

  23. Yinz
    Posted November 26, 2006 at 10:27 pm | Permalink

    I also face the same problem as Amanda, the avatar droplist shows up in the write menu but when published, the avatar is not shown on the post. I tried adding

    to single.php for single post, the avatar nv came out either.. Pls help >.

  24. Posted November 27, 2006 at 8:39 am | Permalink

    Yinz said:

    All users share the same set of avatars. I’ll add this to the development wishlist.

    Is uploading of avatar possible by means of ftp only ?
    At the moment yes.

  25. Posted November 27, 2006 at 8:42 am | Permalink

    Yinz, The Loop is the code where your entry template tags are found. You have to put the post avatar code inside there.

  26. Posted November 29, 2006 at 11:13 am | Permalink

    I second Yenz’ requests. User specific images and an admin panel upload option would be da-bomb.

  27. silverelf
    Posted December 2, 2006 at 9:46 pm | Permalink

    I think it would be better for the avatar to be in the profile menu rather than the write menu together with the upload menu, such that the avatar chosen will always be displayed each entry. It reduces the loading time for the write page too. =)

    Thanks Vix for your help, appreciated it very much~! =)

    silverelf

  28. Thea
    Posted January 2, 2007 at 5:54 am | Permalink

    Great idea for a WordPress plugin!

    One problem I’m having though: when I have multiple posts on my homepage, the avatar for the most recent post works fine – but the avatars for the posts below disappear.

    Does the PHP have to be at a certain place in the loop? Or more than once in the loop? I’m using the latest release of the K2 theme.

    Any help would be great! Thanks!

  29. Thea
    Posted January 2, 2007 at 6:13 am | Permalink

    Ok….well, nevermind. I guess it just took a little while to update, and now it’s working just fine.

    Sorry for the alarm!

    The only other problem I’m having is that on the single post pages (the permalink entries), the avatars aren’t using the CSS I’ve used for the main page. They’re in a different spot.

    If anyone has any idea how I can correct this easily, let me know! Thanks!

  30. Posted January 13, 2007 at 1:33 am | Permalink

    I recieve these errors. Someone, please help me…Thanks. THese errors are recieved when Creating New Post.

    Warning: opendir(E:\Inetpub\thehotfix.net\Wordpress\\images\news\logos\) [function.opendir]: failed to open dir: Invalid argument in E:\Inetpub\thehotfix.net\Wordpress\wp-content\plugins\post-avatar\gkl-postavatar.php on line 49

    Warning: readdir(): supplied argument is not a valid Directory resource in E:\Inetpub\thehotfix.net\Wordpress\wp-content\plugins\post-avatar\gkl-postavatar.php on line 51

    Warning: closedir(): supplied argument is not a valid Directory resource in E:\Inetpub\thehotfix.net\Wordpress\wp-content\plugins\post-avatar\gkl-postavatar.php on line 71

  31. Posted February 7, 2007 at 10:51 pm | Permalink

    Hi, I’ve got this working perfectly for me, using the code within my files.
    However I also have the same issue as the person above. It doesn’t appear to affect functionality though!
    Thanks!
    Kelly

  32. Posted April 11, 2007 at 7:02 pm | Permalink

    You are a truly Class Act, Vix! Thanks for the great plugin and thanks for your help fixing someone else’s!

  33. Posted April 12, 2007 at 11:44 pm | Permalink

    This is a MUCH needed Plug-in for WordPress.

    Are there compatibility issues with any of the browsers (IE, Safari)? It is working for me in FireFox, but not the others. Also, (this may be a sytle tweak) the post image thumbnail is not a thumbnail. I’m getting the full pic (in FireFox, nothing in the other browsers).

  34. Vix
    Posted April 13, 2007 at 12:07 pm | Permalink

    @Alan: The avatar preview in the Write Post screen only works in Firefox. I’ve added this to the known issues list.

  35. Lisa J
    Posted May 9, 2007 at 11:36 pm | Permalink

    I tried to download the latest version and it tells me the download does not exist! Please help!

  36. Posted May 30, 2007 at 7:08 pm | Permalink

    it would be a must if this plugin can be used for the comments :O)

  37. Posted July 1, 2007 at 8:40 pm | Permalink

    I have an odd problem, the post avatar works fine on the main page but when you scroll back to previous pages it loads the avatar in the upper right hand corner of the page as well as next to the post… Any ideas on how to fix this?

    Thanks!

  38. Elena
    Posted July 4, 2007 at 8:15 pm | Permalink

    This is amazing and I love you. Thank you so much!!

  39. Posted October 4, 2007 at 12:46 am | Permalink

    I have this plug-in and the lj-crossposting plug-in and was wondering if there was a way to make sure the avatar was crossposted too. The avatar shows up on the rss feeds, but not when using the crossposter.

  40. Vix
    Posted October 4, 2007 at 9:24 am | Permalink

    @Magicpointshoe: I’m not sure how the lj-crossposting plugin works. But off the top of my head, I can’t see how the post avatar would be cross-posted. Even if the images are the same, the urls are two different beasts.

    I’ll poke around the lj-crossposting plugin and see what (if anything) can be done.

  41. Posted October 6, 2007 at 4:28 pm | Permalink

    Hi,

    Is there a way for this to be admin only. My thought was to have sponsor posts and I would put the avatar on myself. My site is a job site.

    Thanks

  42. Vix
    Posted October 6, 2007 at 5:13 pm | Permalink

    James: You have to use the latest Post Avatar release (1.2.3) together with the Role Manager plugin in order to customize which user groups can post avatars.

  43. gforce
    Posted October 11, 2007 at 10:35 pm | Permalink

    there are some bug with Gengo + Post avatar both last version. Can you help me ?

  44. Elle
    Posted April 8, 2008 at 8:13 pm | Permalink

    this plugin is interesting, have to check it

  45. Posted June 22, 2008 at 5:17 pm | Permalink

    i want it to appear beofre title and post both but only 1 pic

  46. Allefant
    Posted June 28, 2008 at 2:20 am | Permalink

    This one is nice, and also works with pages, thanks a lot! I managed to modify my theme so a small version of the post avatar is displayed in the list of pages next to each link.. so lots of little icons all over the place now, really love it :)

  47. Posted September 3, 2008 at 12:59 am | Permalink

    Sorry – posted my comment in the wrong spot. I’ll move it!

  48. Posted September 28, 2008 at 12:36 am | Permalink

    It works, but only in select browers. The image are not appearing in the posts as they should in both IE and Firefox. It works fine with Safari.

  49. Guybrush
    Posted October 29, 2008 at 4:38 am | Permalink

    Great PlugIn!

    I am trying to get this Post-Avatar-selectionbox in the comments form…
    so that random guests can choose a quick
    buddyicon for the comment.

    Anyone done this before?

    Any help would be nice.)

  50. Posted November 3, 2008 at 8:43 am | Permalink

    Sadly the plugin is for displaying avatars with a post.

    You can try the Gravatars plugin (http://en.gravatar.com/site/implement/wordpress) which displays a commenters avatar if they have an account with Gravatar.com

5 Trackbacks

  1. [...] Garinungkadol [...]

  2. By Wordpress-Plugins » Blog Archiv » Post Avatar 1.0 on September 5, 2006 at 8:30 pm

    [...] Das neue Plugin, das ich euch vorstellen möchte, nennt sich “Post Avatar 1.0” und tut genau das, wonach es sich anhört: Es stellt einem Beitrag ein Avatar (also ein kleines Bildchen) zur Seite, ähnlich den Beiträgen in einem Forum. [...]

  3. By Garinungkadol » Blog Archive » Post Avatar 1.1 on October 17, 2006 at 9:55 am

    [...] For support please comment here Tags:No Tags [...]

  4. [...] The Post Avatar plug-in. Adding an image is a simple as choosing one from a list directly below the Save button, then saving the post. [...]

  5. [...] I downloaded what sounded like an awesome Wordpress plugin called Post Avatar so I could livejournal-ify my Wordpress with user icons. ‘Cept it ain’t working. I mean, the plugin is installed, I get the extra stuff in my admin screen and I’ve added the php to my template. But when I post an icon nothin’ happens. This makes me sad because I have no idea how to fix it. [...]