{"id":54,"date":"2007-01-21T13:22:23","date_gmt":"2007-01-21T17:22:23","guid":{"rendered":"http:\/\/scott.sherrillmix.com\/blog\/blogger\/wp_monsterid\/"},"modified":"2014-12-10T08:46:16","modified_gmt":"2014-12-10T12:46:16","slug":"wp_monsterid","status":"publish","type":"post","link":"http:\/\/scott.sherrillmix.com\/blog\/blogger\/wp_monsterid\/","title":{"rendered":"WP_MonsterID"},"content":{"rendered":"
I was skimming Simon Willison’s blog<\/a> (I know his uncle) when I came across this cool idea for automatic avatar generation<\/a>. Well to tell the truth, I took one look at the title “Visual Security: 9-block IP Identification”<\/a> and deleted the link from my RSS reader but the next day a link based on that idea came up for generating a unique monster avatar for each user<\/a> that did catch my interest. After all if it’s got monsters, it has got to be interesting.<\/p> \r\n\r\n Anyway it turns out that Don Park<\/a> decided to use a commenter’s IP address to generate a random (but persistent for each user) geometric image to associate with each user. This means that without needing external images or sites, each user can have a unique picture associated with them. Even better if several sites were to use the same algorithm for generating the image, the image would stay associated with the user across sites without any cross site communication. Andreas Gohr<\/a> ran with this idea and decided to generate monsters instead of geometric images and use email addresses instead of IP addresses. So that brings the story here, since these two real programmers had already done all the hard thinking and programming, I thought I would make a quick and dirty WordPress plugin to incorporate MonsterIDs easily into other blogs. So here is WP_MonsterID. It’s my first real WordPress plugin so it may not be pretty but it seems to be working OK here (see monsters in the comments below). Edit: If monsters aren’t your thing, I have another plugin using just Don Park’s geometric shapes<\/a>.<\/em><\/ins><\/p>\r\n\r\n WP_MonsterID v3.0<\/a><\/p>\r\n\r\n Unzip You can add CSS for Tai<\/a> has translated the installation instructions to Japanese<\/a>, 5lineas<\/a> translated them to Spanish<\/a>, and Dennys<\/a> has installation tips in Chinese<\/a> (although these are a bit out of date as of Version 1.0<\/em><\/ins>).<\/p>\r\n\r\n If you want more control of where MonsterID’s appear, disable the Automatically Add option and find the If you would prefer to base the monsters on the commentor’s IP address instead of the commentor’s email just replace If you want to customize the monster parts used in your version of WP_MonsterID just go to the Features<\/h3>\r\n
\r\n
Current Version:<\/h3>
Installation instructions:<\/h3>
monsterid.zip<\/code>. Upload wp_monsterid.php and<\/em> the
monsterid<\/code> folder. Make sure the
monsterid<\/code> folder is writable<\/a>. That should be it. Monsters should now appear beside your commenters’ names.<\/p> \r\n
img.monsterid<\/code> in your theme’s
style.css<\/code> to adjust the appearance of the images or adjust the size in the MonsterID control panel (your old monsters won’t be deleted until you clear the cache). You can also turn on Gravatar support and clear the MonsterID image cache in the Control Panel.<\/p>\r\n
Change Log:<\/h3>\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
monster_mt_array_rand<\/code><\/li>\r\n
back.png<\/code> to parts<\/li>\r\n<\/ul>\r\n<\/li>\r\n
\r\n
rand<\/code> to
mt_rand<\/code>)<\/li>\r\n
\r\n
get_bloginfo('url')<\/code> to
get_settings('siteurl')<\/code> to avoid problems when Options > General > Blog address (URI) is not default<\/li>\r\n
\r\n
build_monster<\/code> to
monsterid_build_monster<\/code><\/em> for WordPress function standards (I don’t suppose there’s any other plugins building monsters out there but better safe).<\/li> \r\n
monsterid_build_monster($comment->comment_author_email,$comment->comment_author,false)<\/code><\/li>\r\n<\/ul><\/li>\r\n
For Advanced Users<\/h3>\r\n
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("monsterid_build_monster")) {echo monsterid_build_monster($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\r\n\r\n
Customization:<\/h3>\r\n
wp-contents\/monsterid\/parts\/<\/code> folder and delete any parts you don’t like. If you’d like to add your own parts, there is a Gimp file included in that folder containing a layer for each current part which should make constructing new parts easy. Save the new parts following the same conventions bodypartname_initial(s)#.png (e.g. arms_S1.png). If you come up with any good ones, feel free to send them to me and I’ll include them in the package.<\/p>","protected":false},"excerpt":{"rendered":"I was skimming Simon Willison’s blog (I know his uncle) when I came across this cool idea for automatic avatar generation. Well to tell the truth, I took one look at the title “Visual Security: 9-block IP Identification” and deleted the link from my RSS reader but the next day a link based on that […]","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,17],"tags":[136,137,138,276,543,139,140,141,502,280,142,64],"_links":{"self":[{"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/posts\/54"}],"collection":[{"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":5,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":613,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/posts\/54\/revisions\/613"}],"wp:attachment":[{"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/scott.sherrillmix.com\/blog\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}