{"id":57,"date":"2007-02-06T11:11:53","date_gmt":"2007-02-06T15:11:53","guid":{"rendered":"http:\/\/scott.sherrillmix.com\/blog\/blogger\/wp_identicon\/"},"modified":"2014-12-10T08:01:25","modified_gmt":"2014-12-10T12:01:25","slug":"wp_identicon","status":"publish","type":"post","link":"http:\/\/scott.sherrillmix.com\/blog\/blogger\/wp_identicon\/","title":{"rendered":"WP_Identicon"},"content":{"rendered":"
A couple weeks ago I made a WordPress plugin to generate unique monsters<\/a> for each commenter. Don Park<\/a> came up with the original idea for representing users with geometric shapes<\/a>. Since I already had the framework in place I thought I’d make a WordPress plugin for the original geometric Identicons. If you want to visually represent users (but maybe you don\u00e2\u20ac\u2122t like monsters so much?) then this plugin is for you.<\/p>\r\n\r\n So what is an Identicon? It’s a randomly generated assortment of shapes that is specific to a commenter’s email (or if you prefer IP address). Identicons allow visual representations of commenters without requiring any external sites or user interactions. With 40 possible shapes (about 70 with inversions) in 3 possible positions, around 8000 distinguishable colors and four different rotations for each part, there should be several billion possible shape combinations which, even with the increasing chance of overlap<\/a> with each additional user, should be quite enough for almost any blog.<\/p>\r\n\r\n\r\n WP_Identicon v2.0<\/a><\/p>\r\n\r\n Unzip You can adjust the background and foreground colors, the number of squares in and the size of the identicons in the Identicon Control Panel. You can also clear the Identicon image cache in the control panel.<\/p>\r\n\r\n You can add CSS for If you would prefer to base the Identicons on the commentor’s IP address instead of the commentor’s email just replace icoguo<\/a> has kindly translated the install instructions to Chinese<\/a> and Tai<\/a> has translated them to Japanese<\/a> although these are a bit outdated since version 0.51.<\/em><\/ins><\/p>\r\n If any of this is unclear just let me know in the comments and I’ll do my best to guide you through it.<\/em><\/span><\/p>\r\n\r\n\r\nFeatures<\/h3>\r\n
\r\n
Current Version:<\/h3>
Installation instructions:<\/h3>
wp_identicon.zip<\/code>. Upload wp_identicon.php and<\/em> the
identicon<\/code> folder. Make sure the
identicon<\/code> folder is writable<\/a>. If your unzipping program creates a wp_identicon folder please only upload the contents (
wp_identicon.php<\/code> and the
identicon<\/code> folder). That should be it. Identicons should now appear next to your commenter’s names.<\/p> \r\n
Configuration:<\/h3>\r\n
\r\n
style.css<\/code> file of your current theme. Identicons can be selected by
img.identicon<\/code>. A good start might be to add
img.identicon{float:left; margin-right:3px;}<\/code> to the bottom of your
style.css<\/code>.<\/dd>\r\n<\/dl>\r\n\r\n
For Advanced Users:<\/h3>\r\n
img.identicon<\/code> in your theme’s
style.css<\/code>. For even more control, you can disable the automatic placement in the Identicon Control Panel and add an identicon to any comment with
identicon_build($comment->comment_author_email, $comment->comment_author);<\/code>. For example, find the
comments.php<\/code> of your current theme (it should be in the folder
wp-content\/themes\/[currentThemeName]\/<\/code>). Open it up and look for something similar to
foreach ($comments as $comment)<\/code>. Inside this loop there should be code that displays the comment author’s name or metadata like
<p class="comment-author"><\/code> or
<p class="comment-metadata"><\/code>. Just before all this enter:
<?php if (function_exists(identicon_build)) echo identicon_build($comment->comment_author_email, $comment->comment_author); ?><\/code><\/p>\r\n
$comment->comment_author_email<\/code> in the above with
$comment->comment_author_IP<\/code>.<\/p>\r\n
Change Log:<\/h3>\r\n
\r\n
\r\n
\r\n
$id_or_email<\/code> not email<\/li>\r\n<\/ul>\r\n<\/li>\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n