« Customize MT4 Notification Emails | Main | Template Inheritance Pro 2.0 - Inherit All Templates for a Blog »

Add User Photos (Avatars) using User Profiles

User Profiles is a plugin for Movable Type 4 that extends the user profiles in MT4. Version 1.0 adds the ability to user profile images (sometimes called avatars) from within the MT4 interface:

Profile images are just the first step for the User Profiles plugin. Look forward to more profile features in the near future.

How it Works

From admin MT4 interface, users can add a profile image by editing their profile. (System admins can perform this task for any user on the system):

Users will the be prompted to upload a profile image:

Square images are recommended, but if the uploaded photo is not a square, the plugin will automatically crop the image to make it a square.

After saving the profile image, the image will appear in the user profile:

Finally, the <MTAuthorImageURL> and <MTCommenterImageURL> tags can be used to display the user's profile image on your published blog pages.

Note: In version 1.0, authenticated commenters cannot upload their own profile images -- only users will access to the MT4 admin area can upload photos. In the next version, commenters will be able to upload profile images as well.

Profile images are stored as Assets within Movable Type. This means that these images can also be used in other ways, such as inserting them into entries. Movable Type will keep the full size image (cropped to square, if necessary) and create thumbnails when using the tags described below. Each profile image is tagged with 'profileimage'.

Template Tags

Version 1.0 of User Profiles includes 4 new template tags:

  • <MTAuthorImageURL> - This displays the url to a thumbnail of the author's profile image. There is one optional argument:
    • size - the size in pixels of square thumbnail, default is 50 pixels (each side)
  • <IfMTAuthorImage> - This conditional tag displays its contents if the author has uploaded a profile image.
  • <MTAuthorImageURL> - This displays the url to a thumbnail of the commenter's profile image. There is one optional argument:
    • size - the size in pixels of square thumbnail, default is 50 pixels (each side)
  • <IfMTCommenterImage> - This conditional tag displays its contents if the commenter has a profile image. Note: if you posted a comment on your own blog (while signed in), your profile image will be displayed using this tag.

Example: In your "Entry Metadata" template module, your could add the following:

<MTIfAuthorImage><img src="<MTAuthorImageURL size="50">" align="left" /> </MTIfAuthorImage>

This would display the author's profile image, if they have one in their profile.

Similarly, in your "Comment Detail" module, you could add:

<MTIfCommenterImage><img src="<MTCommenterImageURL size="50">" align="left" /> </MTIfCommenterImage>

Both example above can be seen in action on the MT4 Test Blog.

Installation

  1. Download the zip file and upload the contents of the 'plugins' folder to the 'plugins' directory of your MT installation.
  2. Go to the blog you want, then to Preferences > Plugins. Then choose User Profiles, then Settings. Entry the path for uploading profile images, then save.
  3. Upload a profile image from your profile. (Tip: the quickest way to get to your profile is to click the "Hi Username!" link in the very top right of the page.) Click the link to add a profile image and follow the steps as shown above.
  4. Edit your templates to display profile images, as described in the Template Tags section above.

Get User Profiles

User Profiles v1.0 is free for both commercial and non-commercial use. (Note that future versions will have additional features and may not free for commercial use.)

Download Now

Download Now
Downloads: 522

Upcoming Features

This is just the beginning for the User Profiles plugin. Potential future features include:

  • Enabling commenters to upload photos
  • Public user profile pages listing profile information, plus recent entries and comments.
  • Extended profiles (fields for birth date, hometown, etc.)
  • Importing photos from other services, if possible.
  • And more - please make feature suggestions in the comments of this entry

Rate this entry:

  • Currently 3.8/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 3.8/5 (12 votes cast). Powered by the Ajax Rating plugin.

Comments (38)

This is GREAT! Will you send out an email when the next version is available? I'd love to implement this for the commenters' profile.

CraigV Author Profile Page:

I'm sorry. I meant to post this under VisitorStats... Craig

CraigV, I have moved your comment here and replied to it.

Brian Moy:

I really like the idea for this.

I installed it two days after release, however, I can't seem to get it to work 100%. The profile image shows up fine on the main home page. But I get errors on archive and entry pages. Also, I get the similar error message in the comment section. I think that I followed the directions exactly.

Basically, where the tag is (entry area or comment area), I get this error message (instead of the template section that is supposed to be there):

Page Not Found

Smarty error: [in evaluated template line 4]: syntax error: unrecognized tag 'mtifauthorimage' (Smarty_Compiler.class.php, line 580)

The error for MTIfCommenterImage obviously says 'myifcommenterimage' instead of where it says 'mtifauthorimage'. Once I delete the line w/ the new tag, everything looks just fine how it used to, so I've done that for now. Excuse me if this is an easy fix that I'm just missing.

Hi Brian, the template tags for this plugin are not currently supported under MT's dynamic publishing system. The error you quoted suggests that you are using dynamic publishing. A future version of this plugin may include PHP versions of the template tags.

Brian Moy:

Ah, then that makes perfect sense.

Thanks.

I'll go to .html for the archives to play around with it a little bit.

Maybe include a template for use in making a foaf.rdf that can be used with the template installer. Only missing a few things from being able to make a full profile already. Excellent plugin as always.

Mark, I'm very interested in purchasing a dynamic version of this with the upcoming features you suggested. :-)

Cheers. You have the best MT plugins by the way.

Kyle:

I installed the user profile plugin and the upgrade said it was successful, but it's not working correctly. I click on add image under a user and I'm able to upload the image (i see the image upload to the file system), but the preview during the upload doesn't work and the image doesn't show up in the profile. It also continues to ask if I want to upload an image to the profile.

Even though the upgrade said it was successful, I'm not sure that any fields were added to the database. Can you tell me what fields get added and to which table?

I installed a fresh copy of MT version 4.01 and the issue is still happening.

Thanks!

tomwademurphy Author Profile Page:

I'm having a problem with the User Profile edit page and PHP. Plugin works great, but the PHP in my footer stops working. (Only on pages generated via mt-userprofiles.cgi). Any advice?

Many thanks!

nevado Author Profile Page:

Hello im problem in the installation, when upgrade my MT see me this:

Error durante la actualización: failed loading package UserProfiles::Pro::Util for routine UserProfiles::Pro::Util::import_images: Can't locate XML/Parser.pm in @INC (@INC contains: /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/UserProfiles/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/CommentRegistration/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/AjaxRating/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/CustomFields/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/WidgetManager/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/WXRImporter/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/Textile/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/StyleCatcher/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/spamlookup/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/MultiBlog/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/feeds-app-lite/lib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib lib /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib/XML/XPath/XMLParser.pm line 7. BEGIN failed--compilation aborted at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib/XML/XPath/XMLParser.pm line 7. Compilation failed in require at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib/XML/XPath.pm line 13. BEGIN failed--compilation aborted at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/extlib/XML/XPath.pm line 13. Compilation failed in require at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/UserProfiles/lib/UserProfiles/Pro/Util.pm line 103. BEGIN failed--compilation aborted at /var/www/vhosts/tuneaelmovil.com/cgi-bin/blog/plugins/UserProfiles/lib/UserProfiles/Pro/Util.pm line 103. Compilation failed in require at (eval 47) line 1. MT::handler_to_coderef('MT','$UserProfile::UserProfiles::Pro::Util::import_images') called at lib/MT/Upgrade.pm line 2212 MT::Upgrade::core_update_records('MT::Upgrade','from',-1,'type','author','label','CODE(0x9af82ac)','condition','CODE(0x9518818)',...) called at lib/MT/Upgrade.pm line 1025 MT::Upgrade::run_step('MT::Upgrade','ARRAY(0x9af93e0)') called at lib/MT/App/Upgrader.pm line 440 eval {...} called at lib/MT/App/Upgrader.pm line 430 MT::App::Upgrader::run_actions('MT::App::Upgrader=HASH(0x89d813c)') called at lib/MT/App.pm line 1753 eval {...} called at lib/MT/App.pm line 1645 MT::App::run('MT::App::Upgrader=HASH(0x89d813c)') called at lib/MT/Bootstrap.pm line 75 eval {...} called at lib/MT/Bootstrap.pm line 59 MT::Bootstrap::import('MT::Bootstrap','App','MT::App::Upgrader') called at mt-upgrade.cgi line 11 main::BEGIN() called at lib/MT/Upgrade.pm line 11 eval {...} called at lib/MT/Upgrade.pm line
11


What i can do?thanx

nevado Author Profile Page:

Now im test with the User profile and work, but with the User profile Pro not working, see the error up

Kyle, it sounds like you don't have Image::Magick on your system. Run mt-check.cgi and it will tell you.

tomwademurphy, since the "edit profile" page is displayed by the mt-userprofiles.cgi Perl script, you can't use PHP code on that page.

nevado, that error suggests that you are missing the XML::Parser perl module. This required for importing photos from other services. That said, I can try to update the plugin so that you can still use it without XML::Parser, but it won't be able to import photos from all of the services. If possible, you should ask your web host to install XML::Parser.

shuttersbuddy:

How can I find out what my Blog ID is?

amy Author Profile Page:

Ditto: I don't know what a Blog ID is. I never had to use this before.

simon:

Hello,

I have just installed the User Profiles Pro plugin and now when I log in the Movable Type administration board, I get the following error message : "Can't call method "file_extension" on an undefined value at /var/www/html/contrefeux/cgi/plugins/UserProfiles/lib/UserProfiles/Pro/Publisher.pm line 103."

... anyone had the same problem ?! please help me stay away from Perl code!

Thanks in advance

Bowch Author Profile Page:

Hi

Can't seem to get this working right.

It's installed okay and everything and I've got an image uploaded and attached to my Author Profile.

But, I can't seem to find any way of attaching an image to a Commentator's profile.

Any help appreciated.

Bowch Author Profile Page:

Solved; just needed to change permissions on the cgi script...

Bowch Author Profile Page:

I spoke too soon.

Clicking on Edit Profile works but it won't let anybody upload a photo.

Neop:

I'm getting the following error, when I try to "Install Templates":

Can't locate object method "install_blog_templates" via package "MT::Plugin::TemplateInstaller" at /home/sdeals/public_html/cms/plugins/UserProfiles/lib/UserProfiles/App/CMS.pm line 12.

Template Installer works fine on it's own. Using 1.1.

Chris O'Donnell:

I'm getting the exact same error as Neop. I'm using version 1.11 of Template Installer and UserProfiles 1.5. Any suggestions?

I have purchased the Pro version and may have made the error of dropping the Pro folders on top of the non-pro version. I don't believe the installer ran which set up the additional DB entries. How do I back out and uninstall the files/folders? Simply remove the folders?

Thanks

einjen Author Profile Page:

I have installe duserprofiles from mthacks.com, but i cannot get it to work.
My site is published statically.

in the "edit user profile" template I get:

Unrecognized Tags

*
*

When trying to show the template, it just shows up as an empty page

einjen Author Profile Page:

Seems the two tags doesn't get displayed:


* mtapp:setting
* mtapp:statusmsg

Is this a problem related to the plugin or to the installation itselfe?

Now im test with the User دردشة صوتية

الولة

شات صوتي
profile and work, but with the User profile Pro not working, see the error up

Seems the two tags doesn't get displayed:I have just installed the User Profiles Pro plugin and now when I log in the Movable Type administration board, I get the following error message : "Can't call method "file_extension" on an undefined value at /var/www/html/contrefeux/cgi/plugins/UserProfiles/lib/UserProfiles/Pro/Publisher.pm line 103."


شات صوتي


دردشة صوتيه


دردشة زين


profile and work, but with the User profile Pro not working, see the error up


http://www.t7b.com/dlil

When trying to show the template, it just shows up as an empty page

http://www.t7b.com/dlil/show80156.html

When trying to show the template, it just shows up as an empty page

http://www.ksavip.com

I had a FF comment imported successfully but when I tried to add in the code snippet above to place the FF icon before the author's name, I ended up getting

E eu tenho certeza que tem tofu aqui :(

E eu tenho certeza que tem tofu aqui :(

E eu tenho certeza que tem tofu aqui :(

E eu tenho certeza que tem tofu aqui :(

E eu tenho certeza que tem tofu aqui :(

from G Wave, but it´s interesting and i think too, that bloggers will get

Post a comment