This plugin has IE 7 issues - I’m insanely busy right now but I’ll fix and update the plugin ASAP. Until then, consider yourself warned
What It Does:
Profile Pics is a WordPress plugin which adds a photo upload utility to the user profile editing pane, and 4 template tags to place the picture in an author page or elsewhere — even as a comment avatar. Settings are highly configurable via GUI config page within WordPress. I designed this plugin for WordPress 2.x - it has not been tested on previous versions.
Example:
http://geekgrl.net/author/admin/
Download Link:

Dowload Count: 5804
Last Updated: 01/14/2007
Even a dollar goes a long way in allowing me to keep releasing plugins and updates for free. I really appreciate your support!
Screen Shots:

Picture on Profile Page
Directions: (mirrored in readme)
Install Instructions:
- Upload profile-picture.php to wp-content/plugins/
- Upload folder “authors” to wp-content/uploads/
- Set folder wp-content/uploads/authors to chmod 777
- Activate Profile Pictures plugin from the plugins page in the WP admin area
- Change settings if desired, from within the OPTIONS: page in the WP admin area
- Add the following code to your theme’s author.php file, or use the included themes/my-theme/author.php as a template for creating your own author page template (more details below)
Author Template Code Example
<?php
if (isset($_GET['author_name'])){
$curauth = get_userdatabylogin($author_name);
$authid = $author_name;
} else {
$curauth = get_userdata(intval($author));
$authid = intval($author);
}
?>
<div id=”profilebox” style=”min-height: <?php author_image_dimensions(author_image_path($authid, false, ‘absolute’), ‘height’, true); ?>px;”>
<?php author_image_tag($authid, ‘align=right’); ?>
<h2><?php _e($curauth->first_name); ?> <?php _e($curauth->last_name); ?></h2>
<p><b>E-Mail: </b> <?php _e($curauth->user_email); ?>
<p><b>Yahoo IM: </b><?php _e($curauth->yim); ?>
<p><b>AIM: </b><?php _e($curauth->aim); ?>
<p><b>Jabber: </b><?php _e($curauth->jabber); ?>
<p><b>Web Page: </b><a href=”<?php _e($curauth->user_url); ?>”><?php _e($curauth->user_url); ?></a>
<p><b>Registered Since: </b><?php _e($curauth->user_registered); ?>
<p><b>Profile: </b><?php _e($curauth->description); ?>
</div>
Comments Avatar Code Example (add the following lines to wp-content/themes/my-themes/comments.php where you want the avatar to appear. set width in plugin options.)
if (function_exists(’author_gravatar_tag’)) {
$author_gravatar = author_gravatar_tag($comment->user_id,”class=’gravatar’”);
} else {
$author_gravatar = false;
}
if ($author_gravatar != false) {
echo ‘<a href=”‘.get_bloginfo(’url’).’/?author=’.$comment->user_id.’”>’.$author_gravatar.’</a>’;
}
?>
Implementation:
This plugin adds three template functions to display the author’s profile picture. These functions are designed to be used from within the Author Template. Theoretically, they can easily work from anywhere inside The Loop as well, although when used in the author template they can be placed outside The Loop. A sample author template is included with this plugin (see sample_template/author.php) — this needs to be placed in wp-content/themes/your-theme/ . To learn more about the author template, see: http://codex.wordpress.org/Author_Templates
Template Tag 1: Get Author Image Tag - makes a pretty <img> tag for author’s picture.
USAGE: author_image_tag(’authorID’, ‘tags’, ‘display’)
OPTIONS:
authorID: id number of author
tags: attributes to include in img tag (optional, defaults to no tags)
display: display results in html (ie. echo) or reuse in php? true or false (optional, defaults to true)
EXAMPLE:
Code: <?php author_image_tag($authid, ‘align=left’); ?>
Result (ex.): <img src=”http://blog.com/wp-content/uploads/authors/default.jpg” width=200 height=199 align=left id=”authorpic” />
Template Tag 2: Get Author Image Path - useful if you need to do something else with the path or url (link to it, stuff it into another function, make your own image tag, etc)
FUNCTION: returns url or absolute path to author’s picture
OPTIONS:
authorID: id number of author
display: display results in html (ie. echo) or reuse in php? (optional, defaults to false)
type: specify what kind of path requested: ‘url’ or ‘absolute’ (optional, defaults to url)
EXAMPLE:
code: <?php author_image_path($authid, true, ‘absolute’); ?>
result: /home/jdoe/public_html/blog/wp-content/uploads/authors/1.jpg
Template Tag 3: Get Author’s Image’s Dimension - useful if you are making your own <img> tag, or a div container for the img
FUNCTION: returns requested dimension of author’s picture
OPTIONS:
path: absolute path to author’s picture from server root’,
dimension: the dimension you want, can be either ‘height’ or width’
display: display results in html (ie. echo) or reuse in php? true or false
EXAMPLES: to get picture width… (using author_image_path to get path to picture)
Code: <?php author_image_dimensions(author_image_path($authid, false, ‘absolute’), ‘width’, true); ?>
Result (Ex.): 200
to get picture height… (using author_image_path to get path to picture)
Code: <?php author_image_dimensions(author_image_path($authid, false, ‘absolute’), ‘height’, true); ?>
Result (Ex.): 199
Template Tag 4: Get Author’s Avatar - intended for use in the comments loop
FUNCTION: returns image tag if authorID is a registered user of your blog, false if author is not
OPTIONS:
authorID: id number of author
tags: attributes to include in img tag (optional, defaults to no tags)
EXAMPLES:
Code: <?php
if (function_exists(’author_gravatar_tag’)) {
$author_gravatar = author_gravatar_tag($comment->user_id,”class=’gravatar’”);
} else {
$author_gravatar = false;
}
if ($author_gravatar != false) {
echo $author_gravatar;
}
?>
Result (Ex.): <img src=”http://blog.com/wp-content/uploads/authors/default.jpg” width=80 height=80 class=’gravatar’ />
44 Comments so far
Suleiman: I made a small adjustment and reuploaded the plugin - try downloading/installing it now. I’ve got the older version running on two sites now, so this must be a pretty minor error. I’m hoping I squashed it. Let me know!
Hannah, thank you for giving the details about your plugin. I haven’t done php for years so the details help orient me.
Marjorie: I’m glad the instructions were helpful.
I tried to provide as much detail as possible… its not a one click install plugin, easy to get a bit lost. Let me know if you run into any problems.
Hei! This is a perfekt plugin! Thank you! But i have one question: Can i use the Profil-pic like a gravater i comments? If yes, what is the code.
Thank you a lot!
Markus
that’s a good idea. I’ll work on it today. ![]()
okay, avatar option has been added. go ahead and redownload the plugin, replace the old profile-picture.php with the new, and then edit your theme’s comments.php useing the example code above to add avatars to comments (code already is use on these comments, in conjunction with the standard gravitars plugin)
Hei Hannah,
that´s so nice! Thank you very very much. After a wordpress-day have jeg with your help en sucess. Thank you! It works and i´m happy. Now can i sleep
Tusen takk (that´s norwegian) and Tausend Dank (that´s german)
Markus
I am trying to get this working with an older (1.5.x) version of wordpress and so far everything is showing up in the backend except for the upload picture part. Do you know what i would have to change in order to hack it in?
Thanks in advance.
Shane: my plugin uses the profile_update hook to add the upload form to the user profile editing page. to my knowlege, there is no 1.5 equiv. hook. You could hack the form code into the profile editing core page without too much pain, but that kinda goes against WP principles.
Its true it would be ugly, but could you maybe email me what section of code I would have to paste and maybe what file to paste it into? I would be very grateful ![]()
[...] Hannah over at geekgrl has helped me integrate a wonderful author picture plugin for wordpress author profiles check it out. As some of you might have noticed, you can on access author profiles by clicking on there names under the permalink to each post. [...]
I also would like to know where exactly i need merge that code.
Genau: I’m talking with Shane to publish a 1.5 package. We’ll keep you posted…
Hannah -
FYI we had to add a section of file-permission code (snipped from from wp-includes/post.php) to work around an issue on our server and ensure that the upload isn’t executable. We placed this right after your move_uploaded_file call and worked like a charm:
// Set correct file permissions
$stat = @ stat(dirname($file_path));
$perms = $stat['mode'] & 0007777;
$perms = $perms & 0000666;
@ chmod($file_path, $perms);
Cheers –
– Stan
Hi Hannah,
I’m unclear if I’m able to set the dimensions of the profile photos. It looks like it in your template tag 1, but I just can’t seem to work it out.
Beautiful plugin in any case.
-former banana slug (’03)
Stan: Thanks for the code. this issue came up with another user and we resolved it with a similar bit of modification. I’ll go ahead and include it with the next release.
Sean: Template tag 1 is fingering width and height based on the size of the uploaded image. The script does not resize the pic (this functionality may be added later). (go slugs!)
Hi,
I’m trying to use your plugin.
In fact I’m not a PHP master ^^
I past the code in comment.php (from default theme) but I get an error at this step :
$author_gravatar = author_gravatar_tag($comment->user_id,”class=’gravatar’”);
wherever I put it.
I guess I don’t choose the best place to put your code in comment.php.
Could you give me a clue ??
Regards.
Hei hannah,
i have en new question: I use the Plugin Get Recent Comments and i will use “your” Profil pics (like in the comments). How can i do this? Have you any idea?
Thank´s for your work!
Markus
[...] Supports Hannah Gray’s Profile Pics Plugin [...]
Hello Markus and Hannah, the get_recent_comments plugin now has a %profile_picture macro to support Profile Pics. ![]()
Hi Hannah,
bit of a noob question here for you.
Where exactly would I place the tag:
to get an avatar next to a post or comment ?
thank you !
Paul - dazed and confused.
Hei Hannah, now support the plugin recent comments (http://blog.jodies.de/archiv/2004/11/13/recent-comments/) your plugin. Now can vi use the autor pic i author profile, comments and sidebar wiht recent comments. i´m happy!
Markus
Hi Hannah,
I have the plugin working now with the default image,
but when I try to upload a new image from:
Your Profile page
Profile Picture
I can Browse and locate the file, then click Update Profile button, but the file is not uploaded, the default picture remains as Current:
I have the permissions of Authors folder set to 777.
Can you suggest anything please ?
Thank you.
P.
Hannah,
I’m trying to use your plugin in an installation of WPMU, the same software that powers Wordpress.com.
I thought the plugin would hiccup at uploading files to the directory /uploads/authors/ but it does not in fact have any diffculty doing so–which is great news!
The problem comes when trying to display the images associated with an author.
For example, on the blog farah.hadithuna.com, I was able to upload a profile picture for farah, who has a WPMU blog_id of “9.”
Your plugin saved her picture as “9.jpg” in the wp-content/uploads/authors/ directory, however if you go to her author page, the default image is displayed: http://farah.hadithuna.com/authors/
Do you have any idea what might be causing this kind of hiccup?
What about including an imageResize function in the plug-in?
So when you make a call for the picture you can also specify a max-width or height, or both.
Like integrating this script:
$maxheight){
$div = $maxheight/$newheight;
$newwidth = $newwidth * $div;
$newheight = $newheight * $div;
}
}else if (isset($maxwidth)){
// Get new sizes
if ($width
I’m using the author_image_tag to display the image on the front page next to the user’s posts but I cannot seem to get those pictures to update when the user chooses a new avatar. It updates fine when I use the author_gravatar_tag in the comments, just not when I put it for the posts. I am using Wordpress 2.1 and any help would be really appreciated!
I can’t see the picture I keep trying to upload in my profile. I even tried using ftp to move my picture in the suggested “authors” folder and it doesn’t show
Help appreciated
Hi Hannah
Looks like a great plugin and a wonderful idea.
I cant for the life of my figure out on the other hand why it is not working for me. I have 777 the author directory, and when I look at my postst with comments it displays only the default picture. I have looked at the folder through FTP and it does have two other pictures, 1.jpg and 4.jpg.
When I use the Get Recent Comments plugin then the pictures are displayd without any problems so I assume that author.php was correctly uploaded.
img src=?php author_image_path($authid,true,url);? width=”80″ align=”left”
That is the code that I use to display the pictures but I always get the same picture in the posts.
Any ideas?
The upload function does not work in Internet Explorer.
Very Cool! I’m going to try it! ![]()
yeah, I second Paul… there doesn’t appear to be a way to actually upload pictures.
Parse error: parse error, unexpected ‘=’ in /var/www/vhosts/hosternaut.com/httpdocs/wp-content/themes/My_tabs/comments.php on line 107
why does it do this?
Hi Hannah,
thanx for the great plugin… It’s just what i needed…
But, i found some flaws, at least i think so…
You did the extension check in java script, but you didn’t do it in php, so the file gets uploaded anyway… It’s just not shown as image in the blog…
Image on author profile page wasn’t resized, so i added defualt image width. Also I added file size check.
Both of them you can set in the admin area…
If you want I can send altered plugin, so you can look at it, maybe change it, and then release ver0.2… ![]()
suleiman, Author Template Code should add after , this should be work. ![]()
suleiman, Author Template Code should add after the_post() in author template, this should be work. ![]()
I don’t know if it’s exclusive to IE7, but the upload does not work with IE7 due to the fact that the form on the profile page does not have the parameter “enctype=multipart-form/data”. Obviously, this can be fixed by editing the profile.php file but that involes a WP core edit. Anyone know of another workaround?
Hi Hannah.
I am having the same issue as the previous user. I am inserting the picture within the loop on single.php (WP v2.0.4). I tried uploading the author’s pic through wp-admin but it does not place the image in the authors directory (permissions are set 777), but the page returns with “profile updated” message. So then I put the picture there manually…in this case I called it 7.jpg since the author_id=7.
No matter whether the author of the post is 7 or not, it is showing default.jpg. I set it up as follows:
AUTHOR.PHP CONTAINS:
px;”>
SINGLE.PHP CONTAINS:
NOTE: The call to this template is placed within the loop right before
It’s a very cool plug-in…hope to get it working. Thanks for any assistance.
Sorry to add a second comment…code I pasted in got removed…hope this works.
AUTHOR.PHP CONTAINS:
px;”>
Read the rest of this entry »’); ?>
I’m excited about this plugin but am unfortunately having the same problem as Paul, i.e. I can browse to a pic but it doesn’t appear to upload. I’ll look into the code and see if there is an obvious problem I’m missing…but I just thought I would let you know that someone else is having the same problem!
Thank you so much,
Chris
Yeah I fixed the problem I wasn’t able to show pics in the comments loop but i installed a gravatar plugin and it just decided to work all of a sudden. Im guessing it was a missing database table of some sort.
Hello Hannah,
I have tried and tried to make this work but I can not get anything but the default pic on the the single page. I know your wonderful plugin works because I see the photos on the supplied author page. I have tried turning off all the plugin and using the default them but I still get the default pic for every author on the single page. What could I be missing? I have upgraded to WordPress 2.1.2.
Thank you for any suggestions.
It seems really really cool! ![]()
Leave a reply




would love to test out this plugin but I get the following error on my blog:
Parse error: syntax error, unexpected T_VARIABLE in /home/…../public_html/wp-content/plugins/profile-picture.php on line 14