A couple weeks ago I made a WordPress plugin to generate unique monsters for each commenter. Don Park came up with the original idea for representing users with geometric shapes. 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’t like monsters so much?) then this plugin is for you.
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 with each additional user, should be quite enough for almost any blog.
Features
- Dynamically generated avatars for each commenter
- Consistently themed geometric icons
- Consistent on any blog
- Gravatar support
- Theme edits no longer necessary
Current Version:
Installation instructions:
Unzip wp_identicon.zip. Upload wp_identicon.php and the identicon folder. Make sure the identicon folder is writable. If your unzipping program creates a wp_identicon folder please only upload the contents (wp_identicon.php and the identicon folder). That should be it. Identicons should now appear next to your commenter’s names.
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.
Configuration:
- Identicon Size in Pixels
- How many pixels high and wide you want your Identicons. 35 by 35 seems like a decent compromise between compactness and clarity but they should remain mostly clear at any reasonable size.
- Number of Squares
- Number of shape blocks to build Identicon out of. Don Parks uses 3 by 3. I kind of like 4 by 4 myself. More than 4 starts to get a bit cluttered but can be interesting.
- Background colors
- The color of the background (empty part) of the Identicon. Personally I really like when the background matches the surroundings and the identicon appears to blend into it. Setting this to 0,0,0 makes the background transparent (what I’m using here) but IE6 does not like transparency in PNG’s and just fills the background with grey. If you know the R,G,B values of your background then you could set them directly here or you can put in a range of colors (like 1-255,255,255 to get backgrounds ranging from blue to light blue to white).
- Foreground colors
- The color of the foreground (colored part) of the Identicon. If this is 1-255,1-255,1-255 you will get Identicons of all the possible R,G,B colors. If you want only a certain color you could set the R,G,B values here (like 255,0,0 for only red Identicons) or you can put in a range of colors (like 1-255,255,255 to get Identicons ranging from blue to light blue to white).
- CSS Styling
- This is not in the Options menu. You can edit the CSS styling by adjusting the
style.cssfile of your current theme. Identicons can be selected byimg.identicon. A good start might be to addimg.identicon{float:left; margin-right:3px;}to the bottom of yourstyle.css.
For Advanced Users:
You can add CSS for img.identicon in your theme’s style.css. 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);. For example, find the comments.php of your current theme (it should be in the folder wp-content/themes/[currentThemeName]/). Open it up and look for something similar to foreach ($comments as $comment). Inside this loop there should be code that displays the comment author’s name or metadata like <p class="comment-author"> or <p class="comment-metadata">. Just before all this enter:<?php if (function_exists(identicon_build)) echo identicon_build($comment->comment_author_email, $comment->comment_author); ?>
If you would prefer to base the Identicons on the commentor’s IP address instead of the commentor’s email just replace $comment->comment_author_email in the above with $comment->comment_author_IP.
icoguo has kindly translated the install instructions to Chinese and Tai has translated them to Japanese although these are a bit outdated since version 0.51.
If any of this is unclear just let me know in the comments and I’ll do my best to guide you through it.
Change Log:
- v2.0 12-10-2014:
- v1.02 5-6-2008:
- Fixed WP 2.5+ built-in avatars when
$id_or_emailnot email
- Fixed WP 2.5+ built-in avatars when
- v1.01 5-2-2008:
- Fixed WP 2.5+ built-in avatars and gravatar support
- v1.0 5-1-2008:
- Fixed automatically adding identicons to sidebar in single posts bug
- Supports WP 2.5+ built-in avatars
- v0.62 2-14-2008:
- Added Recent Comment (with Identicons) Widget
- Deals with nested directories
- v0.56 1-27-2007:
- Fixed manual identicon global problem (Thanks again to Anton)
- v0.55 1-27-2007:
- Fixed gravatar option (Thanks Anton)
- v0.51 1-9-2007:
- Added custom random number generator
- Monsters now consistent across servers
- Added greyscale option (nice for B&W themes)
- Added auto placement option
- Added gravatar support
- Obscured filenames
- Clarified options page
- Changed get_settings to get_option
- Fixed bug in random number generator seed
- Changed download link to WordPress Extends
- v0.2 2-6-2007:
- Switched to heading/distance shape representation
- Added a bunch of shapes
- Added transparency
- Added option to choose number of pieces in Identicon (I’m partial to 4×4)
- Added height and width attributes to img for accessibility
- v0.1 1-31-2007:
- Implemented 9 block identicon as per Don Park’s idea but using the srand() setting method of MonsterID
ScottS-M | 06-Feb-07 at 11:12 am | Permalink
Obligatory test post.
Scott | 06-Feb-07 at 11:29 am | Permalink
Still me, different email.
icoguo | 07-Feb-07 at 5:04 am | Permalink
want to see how it work
icoguo | 07-Feb-07 at 5:17 am | Permalink
hi,my english is not so well….so ,can you put some pic about config this. or send a mail for me .. if you can ,thanks a lot…
missi | 07-Feb-07 at 7:15 am | Permalink
just testing :)
Mark | 07-Feb-07 at 7:50 am | Permalink
Let’s see how it looks like.
ScottS-M | 07-Feb-07 at 8:34 am | Permalink
@icoguo
I added a more detailed Configuration section above. Unfortunately it’s still in English but I hope it can help clears things up. Let me know if I can help with anything.
Don Park | 07-Feb-07 at 2:09 pm | Permalink
Hey, Jim. Would you mind if I ‘steal’ extra shapes you added? :-)
Don Park | 07-Feb-07 at 2:10 pm | Permalink
Oop. I meant Scott.
ScottS-M | 07-Feb-07 at 2:51 pm | Permalink
@Don Park
Sure feel free. Thanks for the Identicon idea.
Caitlin | 07-Feb-07 at 4:27 pm | Permalink
Can this be integrated with Gravatar to assign Identicons to people without gravatars?
Awesome plugin! :)
ScottS-M | 07-Feb-07 at 4:50 pm | Permalink
@Caitlin
I’ve never used Gravatar’s so I’m not certain but if this page is up to date then I think you should be able to use both Gravatars and Identicons (or MonsterIDs) by replacing your
<?php gravatar(); ?>function with<?php gravatar("PG",40,$identicon->identicon_build($comment->comment_author_email, $comment->comment_author,false)); ?>You could replace “PG” with whatever rating you want to allow and 40 with whatever size you want. You’ll still need to include the
$identicon=new identicon;higher up in the file outside the loop.Let me know if this actually works if you get the chance.
Muffy Tyrone | 07-Feb-07 at 5:47 pm | Permalink
Very cool! I will be implementing this at work and at http://www.muffytyrone.com :)
Thanks Scott !
TikkunGer | 08-Feb-07 at 1:10 pm | Permalink
hi
great plug-in thanks for designing and sharing it with all of us.
okay so onto my problem.
I seemed to a run into a glitch where there is an orphan icon on every page at the beginning of the comments section on my blog.
can someone have a look and let me know how to fix it?
also I’ve been nailed with ugly looking Day-Glo color for my personal icon and am wondering how can I change it so that I’m not the one stuck with it?
thanks in advance for your help.
ScottS-M | 08-Feb-07 at 2:20 pm | Permalink
@TikkunGer
Well that’s an interesting glitch. I haven’t ran into that before. It looks like the $identicon->identicon_build() is getting called outside the comment loop (alt=” Identicon Icon” should be alt=”<commenter> Identicon Icon”). Pretty odd. Could you post the part of your comments.php with something like:
<?php if ( $comments ) : ?>
<?php foreach ($comments as $comment) : ?>
As for colors, I believe if you were to make a small change in your color preferences then you should get new random numbers. For example changing Red from 1-255 to 2-255. You’ll have to clear the Identicon cache to generate the new icon.
TikkunGer | 08-Feb-07 at 3:17 pm | Permalink
I thanks for the quick reply.
I’m not sure exactly what to give you so I’ve just copied and pasted the entire file I hope that that’s okay.
—————————————————
Edit: Deleted WordPress mangled code.
TikkunGer | 08-Feb-07 at 3:19 pm | Permalink
okay that really doesn’t look right so let me try this.
Edit: Deleted WordPress mangled code.
TikkunGer | 08-Feb-07 at 3:19 pm | Permalink
oh boy, I’m not sure why this keeps happening maybe I can just e-mail you the stuff?
ScottS-M | 08-Feb-07 at 3:29 pm | Permalink
I think I got it. Sorry about WordPress mangling it. I need to write a
plugin to fix that. From the remains of the wordpress scrambled code it
looks like you might have 2 $identicon->identicon_build in your file? If
so, you should only need 1.
My guess is you should have something like:
<?php if ( $comments ) : ?>
<?php if (class_exists("identicon")) $identicon=new identicon;?>
<?php foreach ($comments as $comment) : ?>
<div class="comentarios">
<?php if (isset($identicon)) echo
$identicon->identicon_build($comment->comment_author_email,
$comment->comment_author); ?>
<a href="<?php comment_author_url(); ?
rel="nofollow">">
<?php comment_author(); ?></a> wrote @ <?php comment_date(‘F jS, Y’) ?> at
<?php comment_time() ?>
TikkunGer | 08-Feb-07 at 3:43 pm | Permalink
that did thanks so much. now i will try to this colour thing.
Roman Edirisinghe | 08-Feb-07 at 5:33 pm | Permalink
This is a really cool plugin, and I installed on my site with no major problems.
I have a suggestion for a feature improvement: give the user the ability to select between PNG and GIF output formats in the plugin options panel.
ScottS-M | 08-Feb-07 at 5:41 pm | Permalink
@Roman
That’s a good idea. I had debated it but I didn’t implement it because you really need the anti-aliasing if you are going to use transparent images and gifs (as far as I know) only allow totally transparent or totally solid with no shades in between. So the Identicons look very jaggy without it. Were you thinking of gifs for their IE6 transparency compatibility or for a different reason?
awflasher | 09-Feb-07 at 1:41 am | Permalink
test from Beijing, China.
AnimalMutha | 09-Feb-07 at 6:36 am | Permalink
Just testing too.
Juan martín | 09-Feb-07 at 1:19 pm | Permalink
Testing…
skarld | 09-Feb-07 at 4:46 pm | Permalink
What a great idea!
I calculate that there would be 6,720,000 combinations.
Could it be used for for Titles or Categories, etc.?
Shahab | 09-Feb-07 at 4:59 pm | Permalink
Very interesting .. ! Let me see how I’d look .. :D
ScottS-M | 09-Feb-07 at 6:36 pm | Permalink
@skarld
You could use it for categories or titles. I’ve been debating hacking on it a little and generating a different favicon for each post based on the category. Not sure if that would be interesting or annoying. So anyway to answer your question you can feed $identicon->identicon_build whatever you want. For an example, if you wanted to feed it post titles you could do something like:
<?php if (isset($identicon)) echo $identicon->identicon_build(the_title(), the_title()); ?>
reading_is_dangerous | 10-Feb-07 at 5:07 pm | Permalink
beautiful id
ea.
eh
oh
now let me re-read the instructions again and see if I can install it
:)
Kai Carver | 10-Feb-07 at 8:38 pm | Permalink
Nice!
Joel | 15-Feb-07 at 3:54 am | Permalink
Considering using this for my website….
Joel | 15-Feb-07 at 3:54 am | Permalink
Cool! I like it!
grilix | 16-Feb-07 at 9:07 am | Permalink
test.. :D
Aine | 18-Feb-07 at 7:40 am | Permalink
Gravatar 2 just started up again, but it looks like they’re having some issues with propagating gravatars. This looks like an interesting alternative.
nate | 08-Mar-07 at 5:35 am | Permalink
groovey stuff!
Alchemist | 16-Mar-07 at 9:03 am | Permalink
I am attempting to insert the code above, but it is not working. I am going to leave the broken code in so you can see the result on http://www.gestaltknitting.com/?p=5#comments
In essense, after the echo command, anything in the single quote (the nested php call) shows as text, not a parse. I don’t see you nesting php calls in your later comment code (no echos at all). Help please – we would like to get this going.
Alchemist | 16-Mar-07 at 9:55 am | Permalink
ok, and your comments REALLY didn’t like the snip of code I put in :-(
Have a look at the comment link and you will see the problem. The code in single quotes after the echo command is not parsing out (I think that is the right term) but being read as text.
Help please. I don’t see you giving echo commands in the code in the comments above. Is that the problem?
ScottS-M | 16-Mar-07 at 11:55 am | Permalink
@alchemist
I think the code above was messed up when I turned off the exex-php plugin for upgrading. Sorry about that.
So the htmlspecialchar stuff was just me being lazy and using exec-php to write out the appropriate html character codes instead of entering them myself. It should be corrected now. Let me know if you have any trouble now that the instructions aren’t messed up.
jayne d'Arcy | 18-Mar-07 at 8:56 pm | Permalink
I really truly love this avatar plugin. It suits my love of patterns beautifully. Thank you!
Alchemist | 19-Mar-07 at 1:15 pm | Permalink
One minor suggestion for installation that caught us up. You wrote:
“Unzip wp_identicon.zip. Upload wp_identicon.php and the identicon folder. ”
It is kind of implied that the folder should be named “Identicon” but what unzipped was wp_Identicon and that is what I moved over to our server. After quite some time of “files not found” I got it worked out that I needed to change the folder name.
I would suggest either making the more obvious what the folder name needs to be or change the zipped folder name.
My $0.02 worth
ScottS-M | 19-Mar-07 at 2:17 pm | Permalink
@alchemist
That’s a good point. I’m used to unzipping a folder and getting the contents directly and forget that some programs automatically put the contents into a folder named like the zipped folder. I added a bit to the installation instructions above. Thanks for pointing that out.
ruzz | 20-Mar-07 at 7:22 pm | Permalink
I reworked your plugin a bit for the alchemist today. Not to my design tastes, but I added functionality to generate an opaque version of the thumbnail (which they are using as a background for the comment). Nothing too special but if you want a copy of the code, throw me an email.
Alchemist | 21-Mar-07 at 1:15 pm | Permalink
You can see the rework ruzz did at:
http://www.gestaltknitting.com/?p=5#comments
The opacity is nicely controllabe from the admin side.
Identiquilt?
Quilticon?
ScottS-M | 21-Mar-07 at 2:21 pm | Permalink
@ruzz and alchemist
That’s an interesting idea. It fits very well with the knitting theme. Nice to see new variants.
Stuart Robertson | 29-Mar-07 at 9:22 pm | Permalink
Excellent plugin!
fel | 16-Apr-07 at 9:22 am | Permalink
I love the identicons. To use it, I sort of gutted your plugin of the WP-interface stuff, leaving just the identicon class, and then worked that into an avatar plugin so that people get identicons when they register on my bbPress forum ( http://forums.loinhead.net/ ). I hope that’s okay with you.
I’d also like to share this plugin/identicon hack with other people (obviously crediting you); is that alright?
fel | 16-Apr-07 at 9:25 am | Permalink
That link should be http://forums.loinhead.net! In trying to edit I got the following error. When I click the edit button again, I see the edited version, otherwise I see the original. [Edit: now of course I see the edited version.]
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
SELECT comment_content, comment_author_IP, comment_date_gmt FROM wp_comments WHERE comment_ID =
You aren’t allowed to edit this comment, either because you didn’t write it or you passed the 20 minute time limit.
ScottS-M | 16-Apr-07 at 10:23 am | Permalink
@fel
Sure feel free to share it. Let me know the link and I’ll add it here.
Thanks for the heads-up on the Edit problem. I’ll take a look. Test edit.
ScottS-M | 16-Apr-07 at 11:17 am | Permalink
Looks like WP 2.1 and changes to wp-cache broke the Edit Comments plugin. I think I should have it fixed now.
sailorv | 30-Apr-07 at 6:48 pm | Permalink
this is such a simple, classy idea.
well done indeed- and thank you for sharing!
Secco | 07-May-07 at 2:58 pm | Permalink
Fantastic! I love it.
And how do I look like?
bubba | 12-May-07 at 4:33 pm | Permalink
wa§§up
bubba | 12-May-07 at 4:33 pm | Permalink
NADA
Thrawn | 12-May-07 at 4:53 pm | Permalink
Testing, 123
cheri | 19-May-07 at 11:47 am | Permalink
hmmm, interesting
Admin VBVBC.org | 03-Jun-07 at 10:20 am | Permalink
I installed this plugin on http://www.vbvbc.org
It’s a WordPress-site with 30,000 + posts…
Thanks for your great plugin!
Johann | 26-Jun-07 at 8:25 pm | Permalink
I love randomness. Thanks !
Matthew | 29-Jun-07 at 6:12 am | Permalink
Here’s an idea, Scott: assign them the identicon while they’re typing a comment. Don’s able to do it because the IP is known before the page loads. Could you do some sort of AJAX-like lookup when the ‘e-mail’ field goes from focused to blurred?
M. Robertson | 04-Jul-07 at 11:50 pm | Permalink
Scott, are the options which define which user gets which image stored in the wordpress SQL database? If so where?
ScottS-M | 05-Jul-07 at 7:58 am | Permalink
@Matthew
That does sound like a good idea but I haven’t really messed with Ajax yet. It would probably be easy to build in Don Park’s original script instead of using all PHP like I’m doing.
@Robertson
The plugin doesn’t store user data in the database (it does store png’s in the
plugins/identiconfolder). It takes the first 10 digits of a sha1 hash of the email (or IP address):substr(sha1($seed),0,10);and uses that to represent the user. For example, your hash ended up as 7ffc20c445 so the identicon that represents you is 7ffc20c445.png. If that png already exists then the plugin doesn’t do anything except spit out the filename, otherwise it makes the png then spits out the filename.
if (!file_exists(WP_IDENTICON_DIR_INTERNAL.$filename)){The identicon stays the same even if it has to remake the png because the random seed is set by the the user’s hash.
srand( hexdec($seed) );Let me know if that didn’t answer your question.
Sudrien | 06-Jul-07 at 3:52 pm | Permalink
…wow
Robertson | 07-Jul-07 at 12:20 am | Permalink
@Scott
Oh right. I’ve got it reading just names, which works just fine for a school-based comment system. There’s an identicon for all the ‘Anonymous’ comments, but that’s bright pink. I desaturated it to a dull gray so that it doesn’t stand out, but obviously whenever I empty the cache, it’ll go back to bright pink. What I wanted to do is go to this ‘database’ and change a hex colour, so that it does it by itself. But seeing as it generates the patterns dynamically from the name, that’s not possible.
Robertson | 07-Jul-07 at 12:33 am | Permalink
Wait a second. Does that mean my identicon stays the same across different blogs (assuming I provide the same e-mail)?
Cool.
ScottS-M | 07-Jul-07 at 9:00 am | Permalink
@Robertson
It’s a bit of a hack but if you really didn’t like the color of one common name, you could add a line to
function identicon_set_randomness($seed=""){somewhere around line 193 (say aboveif($seed) srand();) like:if ($seed=="12345abcde"){$this->colors[1]=imagecolorallocate($this->im,120,120,120)}with “12345abcde” being the first 10 digits of the sha1 of the ‘Anonymous’ comments (the stuff before .png in their identicon file name). Or if you didn’t want to mess with the Identicon code maybe you could add something in your own code prior to the
$identicon->identicon_buildcall? Like:$author_name=$comment->comment_author;if ($author_name=="Anonymous") {$author_name="randomxsaasxa";}
$identicon->identicon_build($author_name, $comment->comment_author)
Sorry it’s not more elegant. I’ll try to think about an easier way to do that.
I think Identicon’s should stay the same across different blogs as long as they have the same options set but I’m not absolutely sure they do. Unfortunately, I only have one server to play with but it’s possible that different versions of php or server configurations affect the ‘random’ results.
Robertson | 10-Jul-07 at 3:52 am | Permalink
Wow. Thanks Scott!
Here’s my implementation in case you’re interested. It even worked well with my AJAX comments. I had to make the background solid because of a certain browser that shall not be named.
Thanks again!
ScottS-M | 10-Jul-07 at 7:20 pm | Permalink
@Robertson
That looks pretty good. Glad it worked for you. IE sure can be a pain with transparency. It’ll be nice to be able to count on people using IE7.
Steve Adams | 17-Jul-07 at 11:28 am | Permalink
This is a yahoo address. See if it looks like other yahoos.
GunSky | 29-Jul-07 at 12:46 pm | Permalink
Test it!
levati | 01-Aug-07 at 2:27 am | Permalink
Look nice but a bit surrearistic.
BAM | 12-Aug-07 at 6:09 pm | Permalink
test
NightAngel | 23-Aug-07 at 9:39 pm | Permalink
testing ^^
NightAngel | 23-Aug-07 at 9:39 pm | Permalink
good plugin ! thx !
manele | 31-Aug-07 at 5:46 am | Permalink
thank you for this nice plugin. now my blog is more cool!
Muzica Noua | 25-Nov-07 at 4:33 am | Permalink
Very nice…. take care
Muzica | 25-Nov-07 at 4:34 am | Permalink
THANK YOU ! you are no.1
manele noi | 25-Nov-07 at 4:35 am | Permalink
man this is so cool ! thank you
Claire | 20-Dec-07 at 9:35 pm | Permalink
This reminds me of a flash demo by Jarred Tarbell
http://www.levitated.net/daily/lev9block.html
ScottS-M | 21-Dec-07 at 12:59 am | Permalink
@Claire
That’s a pretty cool flash demo. I think he is using the same set of base shapes that the original creator of Identicons used. I wonder if one is based on the other or if those 16 options form some sort of quilting base set.
Zsolt | 04-Jan-08 at 4:38 am | Permalink
Thanks for this great little plugin. It really adds a funky feeling to my website…
Manele gratis | 09-Jan-08 at 2:22 pm | Permalink
this is great.. thanks!!!
CircleReader | 25-Jan-08 at 4:47 am | Permalink
Cool – I’ll see if I can get this running on my site… (having a little trouble at this point, but I do want to see what my email gets…)
ScottS-M | 26-Jan-08 at 12:43 am | Permalink
@Circlereader
Let me know what’s giving you trouble if you get the chance. It’s always good to get tips on how to make installation easier.
Anton | 27-Jan-08 at 12:25 pm | Permalink
There is the bug probably in v0.51. Line 227 of ‘wp_identicon.php’ is:
if($monsterID_options['gravatar']) $filename = (…)
but it must be
if($identicon_options['gravatar']) $filename = (…)
Also, file ‘identicon/Thumbs.DB’ is not necessary.
Thanx for your work!
ScottS-M | 27-Jan-08 at 1:40 pm | Permalink
Thanks. I’ll fix that right now. Copying and pasting from one plugin to another has it’s problem. And stupid Windows always putting in it’s Thumbs.db. I thought I deleted that.
Anton | 27-Jan-08 at 2:08 pm | Permalink
Sorry, that line must be
if($this->identicon_options['gravatar']) $filename = (…)
And one more problem. For me, option ‘Automatically Add Identicons to Comments -> I’ll Do It Myself’ starts working only after I add ‘global $identicon;’ to comments.php. Probably this is PHP5-specific.
Anton | 27-Jan-08 at 2:22 pm | Permalink
>Copying and pasting from one plugin to another has it’s problem.
May be it would be better solution to combine this two plugins into one?
Going furter, it seems to me that it would be a good idea to construct some, say, metaplugin for WP avatars that would serve as framework for different rendering shemes (monsters, some strange geometric images, fractals, etc) and service interfaces (gravatars, favatars, myLogBlog avatars, etc).
ScottS-M | 27-Jan-08 at 2:34 pm | Permalink
Thanks again. Tried to fix it in a hurry and left out the $this.
I’m going to have to do a little experimenting to get a handle on the global $identicon problem I think. So you wanted to add the Identicons yourself and selected the option I’ll Do It Myself. But Identicons were still added automatically? I’m having some trouble duplicating the problem in PHP 5.2.5. If you go back to the Identicon options page is the I’ll Do It Myself option still selected (i.e. I messed up the option save somewhere)?
ScottS-M | 27-Jan-08 at 2:38 pm | Permalink
That’s not a bad idea about one avatar plugin to rule them all. I’ll think about how to implement it and if I get any bright ideas I might give it a shot. Probably should combine my two in any case.
Anton | 27-Jan-08 at 2:57 pm | Permalink
>I’m having some trouble duplicating the problem in PHP 5.2.5. If you go back to the Identicon options page is the I’ll Do It Myself option still selected (i.e. I messed up the option save somewhere)?
Option saving works just fine. The problem is in different ways to call $identicon->identicon_build().
If ‘autoadd’ option is set, it is called from ‘get_comment_author’ filter. If called by hand, it is called from comments.php template (that is included from wp-includes/comment-template.php).
ScottS-M | 27-Jan-08 at 3:06 pm | Permalink
OK I see now. It’s also not working on my test setup. I was thinking I was running it that way on this blog but I remembered I have some leftover code from earlier versions creating the $identicon. Going to have to think about how to get around that. Edit: I’ll just wrap it in a function and call the global from the function. Updating the instructions and such now.
Thanks for catching that Anton and let me know if the new version doesn’t work for you.
Anton | 27-Jan-08 at 3:45 pm | Permalink
v.0.56 works fine, but for using it from template, ‘global $identicon’ stil needed (in my case).
Minor corrections:
In plugin interface: ‘If there is no identicon above or there are any other problems, concerns or suggestions please let me know here. Enjoy your identicons.’
Maybe if there are some problems, it’s not very logically to say enjoy? ;-)
Also in instructions on this page: ‘If you would prefer to base the monsters on the commentor’s IP (…)’ (probably copypasted from MonsterID plugin page).
Thank you for ultra-fast responce!
Anton | 27-Jan-08 at 3:59 pm | Permalink
BTW note similar plugin http://www.shamusyoung.com/twentysidedtale/?p=1462
ScottS-M | 27-Jan-08 at 5:22 pm | Permalink
Did you try switching the function from
$identicon->build_identicon()to just plainbuild_identicon()(with the same arguments [without a leading$identicon->])? That was the last change I made in version 0.56 that fixed the missing $identicon (on my setup at least).(The function
build_identicon()just gets theglobal $identicon;and does$identicon->build_identicon()itself.)Shamus’s plugin is good too. I like his gradients.
Anton | 28-Jan-08 at 1:51 am | Permalink
Yes, plain build_identicon() works, but ‘global $identicon’ stil needed. This may be system-specifical.
ScottS-M | 29-Jan-08 at 8:12 pm | Permalink
Hmm. That’s pretty strange. I guess I’ll take the easy way out and go with system-specific for now since you did work around it. Thanks for catching those bugs.
brainsolid | 14-Feb-08 at 5:57 am | Permalink
Hello!
Great plugin, but I have only one important question.
Can i use another geometric shapes? For example, circles. How complex it to do?
ScottS-M | 14-Feb-08 at 11:10 am | Permalink
Additional shapes wouldn’t be too difficult except funnily enough for circles. Right now each shape is stored as the angles and distances of the vertices from center. For example, a half block triangle is
array(array(45,$diagonal), array(135,$diagonal), array(225,$diagonal))with$diagonalbeing the length from the central point to a corner. So additional straight line shapes would be easy to add to the shapes array (if you are mildly familiar with php). Since circles have smooth arcs in them it would take a little more work to add them. Perhaps you could add a few shapes with some other attributes, randomly pick a shape and then do something like:if (isset($shape['attribute'])){ imagefilledellipse(...);...}Let me know if I can help any more.
brainsolid | 15-Feb-08 at 3:59 am | Permalink
thanx, ScottS-M
In fact I would like to generate avatars from numbers “1″ and “0″ only (for my site binaries.ru)
As I can see, much better customise Wavatars or Monster_ID plugins for that.
Anyway, thanx for your advice.
ScottS-M | 15-Feb-08 at 10:12 am | Permalink
Hmm. If you’re going to hand draw the 1′s and 0′s then maybe Monster_ID or Wavatar. If you were going to use
imagettftextthen maybe this one would be better since it generates everything itself. You could cut out all the shape drawing stuff and instead pick random numbers, x,y positions, color, rotations, font files and 0 vs 1. Are you planning on having a scattering of 1′s and 0′s or fixed positions? If you’re just using it on your site, you could cut out the extra Mersenne Twister stuff and just usesrandandrand.Let me know if you need help. I could hack up something simple out of this plugin and then let you polish it off if you wanted?
Stamat | 15-Feb-08 at 11:56 pm | Permalink
Just testin’ :)
brainsolid | 17-Feb-08 at 1:57 pm | Permalink
One more request/advice.
It will be excellent, if you will make support of LJ userpics, like in plugin Gravatar (and userpics).
I mean this structure:
1.LJ userpic (if not)
2.Gravatar (if not)
3.WP_Identicon generated avatar
brainsolid | 17-Feb-08 at 2:14 pm | Permalink
And about “0/1″-idea.
At first I think that fixed positions of numbers will be better, but I don’t know how it will be. I mean, maybe avatars generated such way will be too similar (becouse I would like use only grey colors). So, maybe scattering numbers will be better. Anyway, I can’t realize both of these ideas and if You can suggest any help it will be very cool)
Zachary Guidry | 22-Feb-08 at 11:16 am | Permalink
If a person has a Gravatar accout, can you set it to use their custom Gravatar image in place of the geometric pattern? That way users who have taken the time to set up their Gravatar will have a unique custom image, and those who don’t have a Gravatar will get the generated image.
ScottS-M | 22-Feb-08 at 12:15 pm | Permalink
@Zachary
Gravatar support is already built in (unless something isn’t working for you?). Just go to the options page and select “Gravatar + Identicon” from the “Gravatar Support” option.
ScottS-M | 23-Feb-08 at 1:51 pm | Permalink
@brainsolid
I’ve been traveling the last while. I’ll take a look at a 0/1 making plugin in the next couple days.
brainsolid | 24-Feb-08 at 12:05 pm | Permalink
Thank you, Scott)
velqn | 27-Feb-08 at 6:40 pm | Permalink
Nice stuff!
lolly_lady | 27-Feb-08 at 8:45 pm | Permalink
pls…violet)))
lolly_lady | 28-Feb-08 at 8:15 am | Permalink
just cheking one more time;)
Tsveti | 02-Mar-08 at 10:24 am | Permalink
Hi…
Jess | 03-Mar-08 at 5:22 pm | Permalink
This is pretty cool. :)
Sue | 10-Mar-08 at 3:59 pm | Permalink
This is amazing! Thanks so much! It’s even better than the gravatars plugin because you have the option of displaying identicons if the user doesn’t have a gravatar, instead of displaying the default avatar in its place. A lot of the commenters on my site don’t have a gravatar so this is nice.
wolkanca | 10-Mar-08 at 11:58 pm | Permalink
nice plugin. olala, test comments. thanks.
Neke | 11-Mar-08 at 4:42 am | Permalink
What’s about the compatibility with the new version WordPress version?
ScottS-M | 11-Mar-08 at 8:38 am | Permalink
It should still be compatible with the new version. I haven’t added code to deal with the new standardized gravatar call in 2.5 yet. I figure I’ll wait and make sure they don’t change it on me. But from looking at the nightly builds there’s a handy filter that this plugin can hook into to work with (or replace) the gravatars.
gofree | 31-Mar-08 at 11:38 am | Permalink
Just found out this wonderful plugin of yours. I wonder how many users will it be able to handle not to overlap the avatar?
Can it handle 10,000 users?
Thx
gofree | 31-Mar-08 at 11:40 am | Permalink
Opp, one more thing – I noticed there are two images show up before the comment: “one small and one big” next to each other. How can I remove the small one or the big one?
Kind regards,
Gofre
ScottS-M | 31-Mar-08 at 4:50 pm | Permalink
@gofree
It’s kind of hard to tell exactly how many combinations actually look distinct to people but it’s a pretty high number. 10,000 should be pretty safe. If you do find a duplicate, I’d be pretty curious to see them.
Two images besides the comments definitely doesn’t sound right. I guess the first thing to try would be to disable “Automatically Add Identicons to Comments” in the Identicon Control Panel and see if one or both go away. If it’s still happening, maybe leave me a link with a page showing the bug? Hopefully we’ll get it sorted out.
Peter Griffyn | 15-Apr-08 at 7:58 am | Permalink
Just checking it out.
Steven | 22-Apr-08 at 6:33 pm | Permalink
Testing. Yay.
Zim | 23-Apr-08 at 12:30 pm | Permalink
Nice plug-in, I’ll test it :)
Josh~ | 23-Apr-08 at 1:42 pm | Permalink
It adds the Identicons in the Recent Comment Widgets even if I don’t use the Widget with Identicons :( IF I use the Identicon-Widget they are added twice.
ScottS-M | 23-Apr-08 at 1:59 pm | Permalink
@Josh
Hmm. That sounds odd. Maybe the widgetting changed in 2.5. I’ll check.
lemolee | 23-Apr-08 at 9:41 pm | Permalink
oh~~ have a Test
Dusty | 24-Apr-08 at 1:11 pm | Permalink
gotta test that! xD
ScottS-M | 28-Apr-08 at 8:59 am | Permalink
@Josh
Were the extra identicons (and double when turned on) on the main page or single page? If it was on a single page, I think the automatic placement might mess up since there’s no easy way to distinguish normal comments from sidebar comments on single pages (although I wonder if I could rig something up by checking for the information the sidebar query doesn’t load in). I’ll check on that solution.
Hannelore | 28-Apr-08 at 8:22 pm | Permalink
Scott, I have the same problem as Josh and as you mentioned, only on the single page (FF and IE7).
ScottS-M | 29-Apr-08 at 10:44 pm | Permalink
@Hannelore
Thanks for the bug report. I think I fixed it. I’m cleaning up the code (and dealing with WP 2.5′s new built-in avatar support) and should have the plugin updated tomorrow.
John | 01-May-08 at 4:43 pm | Permalink
To start, this plugin is awesome! But…
I’m getting the same issue of double images both in comments as well as in the sidebar. However, on the main page, the sidebar is just fine. It only happens on single post pages.
Is there a manual fix I can do or should I justw ait for an update to this great plugin?
ScottS-M | 01-May-08 at 4:53 pm | Permalink
@John
I think the single post sidebar issue should be fixed in the new version 1.0 (I just uploaded it a few hours ago so I’m guessing you’re still on the old version). If version 1.0 doesn’t fix it for you, let me know and I’ll get back to bug hunting.
Hannelore | 01-May-08 at 6:40 pm | Permalink
Thank you for the fix Scott, it’s working just fine now!
John | 01-May-08 at 7:32 pm | Permalink
@Scott
The new version fixed everything. Thanks!
John | 01-May-08 at 10:22 pm | Permalink
…fixed everything except that my theme’s post author comment highlighting doesn’t work. No big deal, as my gravatar should denote me just fine, but I wonder why WP_Identicon should interfere with that function?
CircleReader | 02-May-08 at 2:01 am | Permalink
Hi, Scott!
Thanks for the plugin, and the update. It fixed my issue with double images, but now, on the Gravatar+Identicon setting, I have Gravatars but no Identicons, and on the Identicons only setting, I get the same Identicon for every comment.
Any insights? I’m running WP 2.5.1 with the built-in-Gravatars Sandbox theme. Thanks!
ScottS-M | 02-May-08 at 9:58 am | Permalink
@John
That is pretty odd. I wouldn’t expect Identicons to mess up other parts of the page. Just to make sure we’re on the same page: You used to have a css highlight (like the dashed lines around this comment) for the author’s comments in the single page comments? But after adding Identicons it does not work?
I tried to take a look at the Drunkey Love theme but I didn’t see any comment highlighting for the author in the PHP/css (might have just missed it). Did you add something yourself?
@CircleReader
That’s not good. Let me check on that.
ScottS-M | 02-May-08 at 11:11 am | Permalink
Thanks for catching that bug CircleReader. I was setting d= instead of default= for the gravatar url. That’s what I get for programming offline. The new version (1.01) should fix the WP 2.5+ avatars when used with gravatar + identicon.
John | 02-May-08 at 2:24 pm | Permalink
@Scott
The problem only exists on my new theme, which is based on Mandingo. That theme has built-in css changes to author comments, but will not work with Identicons.
No worries though, as I just installed the Author Highlight plugin and it can override whatever error is happening. No need to go bug hunting for this one.
Thanks again for all the fixes!
ScottS-M | 02-May-08 at 2:57 pm | Permalink
@John
It looks like Mandingo author highlighting is based based on the css
.authorcomment. I can’t figure out how Identicons would be messing with that. Pretty strange stuff. Must be gremlins. Anyway, glad you got it working and thanks for the bug hunting.CircleReader | 03-May-08 at 11:25 am | Permalink
@Scott
Thanks for the bug-fix; Gravatars and Identicons are now both showing up on my comments, but I still have the same Identicon for every commenter. (Example here: http://readingcirclebooks.com/archives/47)
Curiouser and curiouser….
RubyShooZ | 06-May-08 at 9:21 am | Permalink
Well, being ever the investigator, I had to come and see what mine would look like so -
Lemee see and hey, thanks!
Peace, love and understanding.
ScottS-M | 07-May-08 at 8:16 am | Permalink
@CircleReader
Sorry this took so long, my host had a hard drive failure (I actually had it updated a few days ago but I lost a couple days of changes). I think v1.02 should fix the identical Identicon problem (I think the problem was me expecting wordpress to standardize the filter input to email but actually passing email or id # or the entire comment). Looks like it’s working for you now.
C.Harv | 07-May-08 at 9:29 am | Permalink
Testing.
Lex | 09-May-08 at 4:55 pm | Permalink
That’s me
Bayounette | 10-May-08 at 5:57 pm | Permalink
amazing
Predrag Stojadinovic | 16-May-08 at 1:53 pm | Permalink
Just want to see my identicon :D
BlogCini | 20-May-08 at 9:10 am | Permalink
Awesome! Realy very useful and nice…
Thak you so much…
Andreas Viklund | 29-May-08 at 10:27 am | Permalink
Gotto try this out of curiosity! :)
(seriously, I got the prettiest identicon of them all! wow!)
Juan | 31-May-08 at 1:40 am | Permalink
Ok let me test the icon! *-*
Free ebooks | 31-May-08 at 2:40 pm | Permalink
Gr8 thinking buddy I would definitely use this plugin. Will give it a try. thanks
explorish | 01-Jun-08 at 7:46 pm | Permalink
hi,
i am using it on neoclassical theme, wp2.5.1, it does show in comments but not in the sidebar recent comments widget. wd greatly appreciate help!
thanks!
(cool plugin :)
Yardsnacker | 05-Jun-08 at 2:41 am | Permalink
Will it work seamlessly with gravatars? Hmmm….
Yardsnacker | 05-Jun-08 at 5:04 am | Permalink
I have wp 2.5.1 and am using gravatars and identicons but the identicons don’t show up, just as blank spots. The gravatars work. The installation shows no errors. Any help? Thanks! :D
ScottS-M | 05-Jun-08 at 8:34 am | Permalink
@Yardsnacker
Do you have an identicon in the Identicon control panel? Is there an
error message in the testing portion of the Identicon control panel? If
not, do any identicons appear if you use the “Add Identicons For Me” option?
Yardsnacker | 05-Jun-08 at 2:01 pm | Permalink
@Scott
Yes installation went flawlessly, I do see the the identicon you mention that shows the php is working correctly in the identicon control panel. There are no error messages below that. I do have the “Add identicons for Me” enabled.
Yardsnacker | 05-Jun-08 at 2:16 pm | Permalink
Oh this might be helpful, I’m not sure if there are any issues with this plugin but I am using wp-gravatar on top of identicons if that makes sense.
http://wordpress.org/extend/plugins/wp-gravatar/
ScottS-M | 05-Jun-08 at 8:37 pm | Permalink
I think I found the problem. WP_Identicon adds identicons for you (in themes without built-in avatars) by adding the identicon to the comment_author hook. From a quick glance at the wp-gravatar plugin, it looks like that plugin takes the comment_author_link and overwrites it (and the previously added identicon) with its own output. So I would guess if you turned off wp-gravatar, WP_Identicons would work correctly.
Alternatively, you could turn off WP_Identicons and use identicons option in wp-gravatar to use gravatar’s built-in Identicons.
Yardsnacker | 05-Jun-08 at 10:56 pm | Permalink
Ok thanks Scott. What did it for me was a setting in gravatar control panel. I had two options selected marked with an X:
Choose your sites default Gravatar
Choose only one of the options – if more than one is checked will be used.
X Use your own default Gravatar for users without Gravatars. As you see above!
Use a Wavatar as default Gravatar for users without Gravatars.
X Use a Identicon as default Gravatar for users without Gravatars.
Use a MonsterID as default Gravatar for users without Gravatars.
By unchecking the first option, everything seemed to work together in harmony! Wahoo, cool plugin thanks man! :D :D :D
Hypax | 14-Jun-08 at 9:32 pm | Permalink
I’ve been using Brian’s Threaded Comments, and although the Identicons display fine using the default theme support option, it does not display Gravatars where present. I tried some of the code above to no avail, is there some code I can drop over the BTC code?
Hypax | 18-Jun-08 at 3:48 am | Permalink
Fixed… changed it over to 2.5 gravs.
ScottS-M | 18-Jun-08 at 7:18 am | Permalink
@Hypax
Glad you got it fixed. Sorry I didn’t get back to you sooner. I had a wedding this weekend and started a new job this week so I haven’t had much internet time. Let me know if it gives you any more trouble.
Anna | 20-Jun-08 at 2:55 pm | Permalink
Hello! I DO LOVE WP Identicons, so I made them i18n-able.
It’s here: http://mistress.hweia.ru/blog/2008/06/wordpress-identicons-102/
My blog is in russian, but filename is clear :)
ScottS-M | 22-Jun-08 at 9:14 am | Permalink
@Anna
Thanks for making it translatable and adding Russian translations. Pretty cool to have it internationalized. I’ll update the plugin with that in the next week or so.
Anna | 22-Jun-08 at 10:24 am | Permalink
No problem. Drop me a note then, so that I’ll be able to remove my file and link here
Anna | 23-Jun-08 at 7:07 am | Permalink
Oh, by the way – at first I put .po files into the root directory of the plugin. But for the multi-milti-language blogs it would be better to make a special subfolder like “i18n”.
This option is set in the identicon_textdomain() function – with a ‘wp-content/plugins/wp-identicon/i18n’ as a path to .po files
Allan | 25-Jun-08 at 12:16 am | Permalink
Sweet!
Obeyd | 25-Jun-08 at 9:49 pm | Permalink
Testing
Caesar | 06-Jul-08 at 7:30 am | Permalink
Great work! I love Identicons (though I must say I’m not keen on Monsters…) – I was really thrilled when this was integrated into Automattic’s Gravatar service.
Steph | 07-Jul-08 at 10:47 am | Permalink
testing. Looks interesting. :)
testman | 13-Jul-08 at 10:03 am | Permalink
curious
Marc | 13-Jul-08 at 10:13 am | Permalink
so, give it a try!
wonderer | 13-Jul-08 at 10:25 am | Permalink
test
wonderer | 13-Jul-08 at 10:26 am | Permalink
2. test
wonderer | 13-Jul-08 at 10:27 am | Permalink
funny stuff
wonderer | 13-Jul-08 at 10:29 am | Permalink
one more time!
Murk | 16-Jul-08 at 6:15 am | Permalink
I put this in a little while back, and it is working well – I’ve just upgraded to WP2.6 and thought I’d be having to convert back to the WP code…. but looking at the WP built in avatar options, there are all the identicon patterns…
I wonder, what is the future of this plugin now the functionality seems to be in the core… and is it interfering somehow with the Wp core (or is there some different issue).
ScottS-M | 16-Jul-08 at 7:42 am | Permalink
@Murk
You’re right Identicons are available directly from Gravatar (not WP but close enough I suppose) now. That’s pretty cool and should be good for most people.
I mostly just maintain the plugin for people who want more control over their Identicons (e.g. custom colors or numbers of squares) or who want only Identicons for all users (e.g. want a fixed theme for avatars).
By the way, what do you mean interfering with WP core?
In any case, the plugin is supported but not really in development, although I’ve been meaning to add multi-language support from Anna for a few weeks now (job’s been keeping me busy).
Murk | 16-Jul-08 at 8:43 am | Permalink
I’ve just come back to provide the answer to my own Q….
I wondered if it might play havoc with WP2.6. The one issue I found is that it removes all the options (monsterID etc). Disabling the plugin means that all these are back – and it appears to work perfectly without having to modify the code from plugin to wp-standard code (I guess this is because the plugin was absorbed into the main wp code).
I have my code to show the avatars in an ‘if function exists’ statement, to allow my to disable plugins at will without problem. I’ve just switched it over to MonsterID.
I note that you have some posts with one type of avatar, and some with another… that’s a neat trick (not one I would see the need to replicate, but….)
ScottS-M | 16-Jul-08 at 10:12 am | Permalink
I haven’t upgraded to 2.6 yet. I’ll have to get on it and see if I can duplicate that. Good it shook itself out though.
For different avatars on different posts, I just put a if post->slug==”wp_identicons” then identicon in the theme. I’ve debated having different categories have different avatars following the same sort of idea. Could write something like that into the plugin if it’d help you out?
Miguel | 26-Jul-08 at 1:03 pm | Permalink
Test
Barbara | 04-Aug-08 at 12:17 am | Permalink
Let’s see…
navesele | 06-Aug-08 at 11:03 pm | Permalink
This is an interesting idea.
Have you guys also heard of “gravatar” ?
Scarred Sun | 09-Aug-08 at 5:11 pm | Permalink
testing :D
hi5 | 28-Aug-08 at 7:11 pm | Permalink
this is really cool!
Stewart Dominios | 01-Sep-08 at 3:30 pm | Permalink
I Will try on my website.
hithere | 01-Sep-08 at 5:47 pm | Permalink
testing~~
Şahin ÇETİNKAYA | 02-Sep-08 at 1:54 pm | Permalink
testing :D ty
recentbookmarks | 12-Sep-08 at 3:22 pm | Permalink
lets see what i get :)
ElazigLee | 15-Sep-08 at 3:37 pm | Permalink
Cool,thanks
deizel. | 18-Sep-08 at 9:30 am | Permalink
Nice one!
suicidalsam | 22-Sep-08 at 9:15 pm | Permalink
wow, this is the best avatars I found for people without gravatar. other avatars inside the gravatar plugin was just too cheesy for me. Your is much much better.
Colin Warwick | 28-Oct-08 at 10:27 am | Permalink
Any way to disable the Settings tab for Users that don’t have Admin permissions?
Antonio | 28-Oct-08 at 4:53 pm | Permalink
testando
Jordan | 29-Oct-08 at 12:56 pm | Permalink
shapeify me!
nmjk | 11-Nov-08 at 8:35 pm | Permalink
what’s my identicon?
Editor B | 18-Nov-08 at 5:16 pm | Permalink
Cool.
Hello | 22-Nov-08 at 9:53 pm | Permalink
I’ll test it! :-)
Hello | 17-Dec-08 at 11:38 am | Permalink
Testing identicon
Anna | 19-Dec-08 at 2:39 am | Permalink
Wonder what I look like.
kursatsenturk | 27-Dec-08 at 8:50 pm | Permalink
nice plugin. thanks.
TEST | 29-Dec-08 at 1:40 pm | Permalink
Want a blue one>
Flimm | 03-Jan-09 at 5:17 pm | Permalink
So if I post two comments with the same email address, I should get the same avatar, right?
Flimm | 03-Jan-09 at 5:17 pm | Permalink
Second comment, to test theory.
Flimm | 03-Jan-09 at 5:17 pm | Permalink
Hooray! It works!
Fisheke | 04-Jan-09 at 11:48 am | Permalink
Obligatory test post.. nice idea!
Dan | 08-Jan-09 at 6:05 am | Permalink
I hope mine looks like a Gryphon!
Hayalet | 12-Jan-09 at 1:27 pm | Permalink
nice plugin. thanks.
Gabo | 17-Jan-09 at 10:53 pm | Permalink
Lets try it. =)
franz | 18-Jan-09 at 2:42 pm | Permalink
Hi! Great plugin. Thank you very much. Is it possible to combine it with the plugin “profile-pic”? IF someone has uploaded his own profil-pic instead of the identicon his picture should be displayed. Otherwise the the “old” identicon has to displayed. Here what the profile-pic-autor “needs” demands:
= Template Tag 4: =
**Get Author’s Avatar** – intended for use in the comments loop
USAGE: profilepic_internal_gravatar($authorID, $tags = ”)
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:
user_id, “class=’gravatar’”);
} else {
$author_gravatar = false;
}
if ($author_gravatar != false) {
echo $author_gravatar;
}
?>
Result (Ex.): “
Some hints would be great.
Best wishes.
ScottS-M | 19-Jan-09 at 1:09 am | Permalink
@franz
It looks like
profilepic_internal_gravatarshould return false if it can’t find a gravatar. So something along the lines of:$author_gravatar = profilepic_internal_gravatar($comment->user_id, "class='gravatar'");
if(!$author_gravatar) author_gravatar = identicon_build($comment->comment_author_email, $comment->comment_author);
echo $author_gravatar;
You might want a little error checking in there but that should be the basic idea. Let me know if you have any trouble.
franz | 19-Jan-09 at 10:15 am | Permalink
Thank’s a lot, ScottS-M! I’m really eager to test it soon. Best wishes.
franz | 19-Jan-09 at 2:22 pm | Permalink
@ #210: Sorry, but WHERE exactly one has to insert that code in wp_identicon.php (or elsewhere)? Thank you!
ScottS-M | 19-Jan-09 at 3:01 pm | Permalink
Actually now that I look closer I’m not sure I understand what you’re trying to do. You have multiple authors on your blog and you want to allow them to choose a picture or default to identicons? Or do you want commenters to be able to choose a picture but default to identicon?
If it’s author stuff, I’m not really sure what the filters and actions for that. Also after looking closer, profilepic_internal_gravatar appears to only return false if it didn’t get an author ID and probably returns ‘
/wp-content/plugins/profile-pic/default.jpg‘ in an<img />when an author hasn’t picked a picture. So I guess we could search the return ofprofilepic_internal_gravatarfor the default path and if found replace it with a path to the appropriate identicon. But in order to do that you would need to know the appropriate email address which may or may not be available depending on where you are using it.cindy m | 19-Jan-09 at 3:42 pm | Permalink
where can I donate for the use of WP_Identicon plugin. 8o)
cindy
franz | 19-Jan-09 at 5:39 pm | Permalink
Quite right – I want commenters to be able to choose a picture according to the profile-pic-plugin (http://geekgrl.net/wordpress/wordpress-profile-pic-plugin/)but default to identicon! I learned from your hints that my idea needs some more skill in php as I call my own. THANK YOU!
ScottS-M | 19-Jan-09 at 6:36 pm | Permalink
@franz
That does sound like a good idea but also a bit of work. Isn’t the profile-pic plugin set up for authors only so you’d have to do a fair bit of hacking on that end? But php is a pretty fun language so if you feel like getting a feel for it that might be a good project.
@cindy m
I don’t really have a donate thing. I should probably set one up one of these days but just saying thanks is plenty.
cindy m | 19-Jan-09 at 8:55 pm | Permalink
I really love the WP_Identicon plugin. My blog is about quilting and it looks like all the commenters have quilt blocks next to their nicks. Thank you very much! 8o)
cindy
Eleven | 20-Jan-09 at 11:14 am | Permalink
nice work,thank you.
lsw | 26-Feb-09 at 8:13 am | Permalink
Testing 1 2 3
Patrick | 02-Apr-09 at 1:21 am | Permalink
Hey, thanks for the plugin… how can I remove the link from the identicon image? By default, the if the person enters a site, the a href surrounds both the name and the indenticon, where I only want it to surround the name…
Thanks!
Patrick | 02-Apr-09 at 1:23 am | Permalink
Ah… I skipped over the advanced section! heh, gotta more confidence in myself I suppose.
Thanks!
ade | 06-Apr-09 at 4:53 pm | Permalink
test
Paulo Ribeiro | 08-Apr-09 at 1:19 pm | Permalink
Just testing. ;)
test | 21-Apr-09 at 6:31 pm | Permalink
This is not a test ;)
Verious | 01-May-09 at 4:36 pm | Permalink
WP_Identicon creates some very interesting patterns.
kaveh | 17-May-09 at 12:14 pm | Permalink
okey
anna | 06-Jun-09 at 1:38 am | Permalink
wheeee
Keiran | 22-Jun-09 at 1:56 pm | Permalink
liked to see what’s my icon looks like…
JJ | 14-Jul-09 at 5:57 am | Permalink
two words, so cool.
Vera | 14-Jul-09 at 5:07 pm | Permalink
Very very cool!
Alvaro Arce | 16-Jul-09 at 11:15 am | Permalink
just wanted to see how it would look mine
Alvaro Arce | 16-Jul-09 at 11:16 am | Permalink
cool
cool man | 16-Jul-09 at 5:35 pm | Permalink
http://loud2max.co.cc
the best place
Sherri | 24-Jul-09 at 3:08 pm | Permalink
For a non-programmer you sure create some nice plugins. Nice to have a backup career. ;)
Sherri | 24-Jul-09 at 4:17 pm | Permalink
This is really nice. I was wondering if you have a stand alone version that can be used for other things outside of word press?
takashi | 27-Jul-09 at 3:41 am | Permalink
testing
ScottS-M | 27-Jul-09 at 9:32 am | Permalink
@Sherri
I’ve been meaning to clean out the WP specific stuff for a standalone version. I’ll have to do that.
Sherri | 27-Jul-09 at 2:21 pm | Permalink
That would be fantastic. I’ll have to keep checking back here.
pedraig | 15-Aug-09 at 6:10 am | Permalink
test
edna desouza | 18-Aug-09 at 12:21 pm | Permalink
oiiiiii
Janet Evans | 27-Sep-09 at 2:13 pm | Permalink
Hi,
How do I get rid of the border around my indnticons? I assume I go into my stylesheet – but I don’t know where. Can you help Love the plugin.
ScottS-M | 28-Sep-09 at 12:29 pm | Permalink
@Janet
You’re right it’s your css. You could add
.commentlist li a img {border:none;
}
to your .css file to turn off the border of images inside links inside comment lists.
abo prämie | 29-Sep-09 at 6:17 pm | Permalink
Thank you so much! It helped me a lot.
Matador | 06-Oct-09 at 1:58 am | Permalink
Really nice job. Thanks you so much.
comptonkid | 15-Nov-09 at 2:08 am | Permalink
My goodness, It’s my first time seeing something like this, But it just feel’s and seem’s really helpful and cool.You keep it up and go-on with your Bad-Self. Will try to follow and keep up with your most inventive Idea…
Thank You.
comptonkid | 15-Nov-09 at 2:11 am | Permalink
How much does it cost ?
cp | 17-Nov-09 at 5:39 am | Permalink
great idea.test…
uyab | 24-Dec-09 at 4:54 am | Permalink
testing 1 2 3
Gabriel | 31-Dec-09 at 2:28 am | Permalink
Hi,
I use 3 col Coppyblogger (on WP 2.9, PHP 4) with Identicons activated.
It gives me a “GD Image library not found. Identicon needs this library.” error and does not show Identicons on the http://www.boxlife.co.za pages ALTHOUGH if I go to EDIT COMMENTS it shows the Identicon images as they should actually be in the main blog.
I use Gravatars on my posts but would like Identicons to show on comments where people have no Gravatars.
In the Edit Comments section my Gravatar is not showing alongside my comments, it is being replaced by an Identicon.
Any help?
God bless
Gabriël
PS
May His Peace be with you in 2010!
Rui Santos | 31-Dec-09 at 3:54 pm | Permalink
Just testing …
ScottS-M | 04-Jan-10 at 4:21 pm | Permalink
@Gabriel
Are you sure your host has the GD library for php installed?
Hooonza | 08-Jan-10 at 9:53 am | Permalink
Just testing …
Andrew | 08-Jan-10 at 7:09 pm | Permalink
WP_Identicon the best!
Thank you.
Modern equipment
Alex | 08-Jan-10 at 7:41 pm | Permalink
this is the best avatars I found for people without gravatar. other avatars inside the gravatar plugin was just too cheesy for me. Your is much much better.
pangon | 10-Jan-10 at 3:05 am | Permalink
:p
zardoz | 18-Jan-10 at 12:20 pm | Permalink
just wanna see what my identicon would look like…
kelimatör | 06-Feb-10 at 12:39 pm | Permalink
nice plugin. thanks.
thomas | 24-Feb-10 at 2:07 pm | Permalink
thanks for this great software :)
i stripped it down a bit and removed the dependency to wordpress, so its usable for any php programs: http://thomasfischer.biz/?p=330
Tester | 27-Feb-10 at 11:21 pm | Permalink
Testing…
Yvonne | 27-Feb-10 at 11:28 pm | Permalink
Let’s see.
Karen | 10-Mar-10 at 5:36 pm | Permalink
just testing
emo | 12-Mar-10 at 3:31 pm | Permalink
yeah. me testing
Obiwan | 16-Mar-10 at 4:14 pm | Permalink
Interesting how one small but nifty idea resonates far and wide over time.
Natascha | 01-Apr-10 at 4:50 pm | Permalink
looking…
Alfre | 01-Apr-10 at 4:54 pm | Permalink
Show it!
deepres | 01-May-10 at 1:59 pm | Permalink
very good, Thanks
jaewoong | 21-May-10 at 2:15 am | Permalink
how to use this?
kampanya | 24-May-10 at 2:41 pm | Permalink
hello was beautiful writing very good, Thanks
NFQ | 14-Jun-10 at 8:35 pm | Permalink
Hi — great plugin. I downloaded this so that I could use the recent comments widget, as I was getting sick of seeing the default avatar for commenters without Gravatars. They have such pretty icons in the comment threads themselves!
One question: some new comments show Identicons instead of Gravatars for people who do have Gravatars, but not all the time. (For example, I always show up with my own Gravatar, and at least one other commenter does so I know it’s not just about being the blog admin.) I do have “Gravatar + Identicon” selected in the plugin settings, and I’ve tried clearing the Identicon image cache but that does nothing. Is there something else I need to refresh?
Thanks in advance for any advice you can offer!
ScottS-M | 16-Jun-10 at 8:44 am | Permalink
@NFQ
That sounds odd. Do you have a page with an example? Also Gravatar added built-in Identicons a while back. That might do it for you without having to bother with a plugin.
NFQ | 22-Jun-10 at 8:27 pm | Permalink
My home page is presently an example — http://www.noforbiddenquestions.com. The most recent commenter seems to have a Gravatar if you follow his comment link to the actual post, but he shows an Identicon in the sidebar widget. Meanwhile, two other people plus myself in the sidebar have Gravatars that show up.
Previously, I had built-in Identicons enabled (and still use that for the comments on threads) but I downloaded your plugin for the sidebar widget, because in that case with the previous Recent Comments widgets I tried, I was always just getting the default icon for anyone that didn’t have a Gravatar.
NFQ | 22-Jun-10 at 8:30 pm | Permalink
Sorry, it occurs to me that by whenever you read this there’s some chance (if I’m lucky…) that this guy will not still be my most recent comment. The commenter’s name is Sabio Lantz.
NFQ | 25-Jun-10 at 2:46 pm | Permalink
Sabio’s been pushed off the list, but there is a new example now — “vjack” has a Gravatar on the post where he commented, but an Identicon in the widget.
Stuart | 30-Jun-10 at 1:51 pm | Permalink
check out this curious identicon
http://www.gravatar.com/avatar.php?gravatar_id=01cff471bceeeb8660680642bdd2fa63&d=identicon&size=45
lol =D
haberolog | 18-Jul-10 at 12:38 pm | Permalink
nice plugin. thanks good
kampanyalar | 01-Aug-10 at 2:19 pm | Permalink
nice plugin. thanks good
marabo | 05-Sep-10 at 12:37 pm | Permalink
nice! funny stuff
Wonder | 05-Sep-10 at 12:40 pm | Permalink
Really good job. Thanks you very much.
AboVergleich.org | 17-Sep-10 at 11:11 am | Permalink
Yea nice work.
andrea | 18-Sep-10 at 11:41 am | Permalink
just curious
Abo-Vergleich-Frosch | 28-Sep-10 at 1:21 am | Permalink
well done. thanks
Sportartikel | 28-Sep-10 at 3:46 am | Permalink
thanks for this helpful page
snackers | 30-Sep-10 at 4:52 am | Permalink
Previously, I had built-in Identicons enabled (and still use that for the comments on threads) but I downloaded your plugin for the sidebar widget, because in that case with the previous Recent Comments widgets I tried, I was always just getting the default icon for anyone that didn’t have a Gravatar.
Foto Kunst | 20-Oct-10 at 5:44 am | Permalink
Thx, nice site
the shadowy night | 05-Nov-10 at 5:38 am | Permalink
Good work. I like this site. Thank you.
finite answers | 19-Nov-10 at 2:27 am | Permalink
this identicon is very nice and i will use for my web services.compared with frames it is quite easy to use
Cryssie | 27-Nov-10 at 2:29 pm | Permalink
Test…this is pretty cool though ^^
Very nice =D
Icy-chan | 27-Nov-10 at 2:30 pm | Permalink
This is so good! XD
vetole | 28-Nov-10 at 1:11 am | Permalink
That’s a really great thing. =D
Abo Sven | 12-Dec-10 at 7:39 am | Permalink
Great plug-in! Thanks for designing and sharing it.
raj | 17-Dec-10 at 1:01 am | Permalink
It is very interactive and useful for my web services.It is very good when compare to other.
Jack Jack | 05-Jan-11 at 1:15 pm | Permalink
cool.
jlkaus | 28-Jan-11 at 3:57 pm | Permalink
Testing this out
Gong Zeitschrift | 15-Feb-11 at 10:10 am | Permalink
pretty cool plugin, thanks!
Trading Guy | 16-Feb-11 at 2:47 pm | Permalink
Great plugin, works good, thanks man. Just trying it now!
Better Maria | 20-Feb-11 at 11:12 am | Permalink
perfect plugin thank you
iren | 13-Mar-11 at 4:41 am | Permalink
,?,
padliyanto | 23-Mar-11 at 4:05 am | Permalink
tes
guggl | 25-Mar-11 at 5:24 am | Permalink
test
guggl | 25-Mar-11 at 5:30 am | Permalink
test2
wazzup | 25-Mar-11 at 5:33 am | Permalink
testing
Abo Michael | 08-Apr-11 at 5:15 am | Permalink
perfect plugin that works, thank you!
Neilandio | 18-May-11 at 2:36 pm | Permalink
hi
f72 | 17-Jun-11 at 12:45 am | Permalink
test
still curious | 17-Jun-11 at 2:49 am | Permalink
gee is this true
Tom | 20-Jun-11 at 5:35 pm | Permalink
Hi,
I’m having trouble with my comment icons showing up on my site. I chose identicon and the comments show identicon pictures in the dashboard, but strangely on my front page the comments still show up as mystery man and some on a seperate widget showing my users comments show up with the gravatar logo. I want them all to be identicon.
Can you help?
cd65 | 29-Jun-11 at 7:41 am | Permalink
I like it
testtest | 22-Jul-11 at 6:53 pm | Permalink
test
testtest | 22-Jul-11 at 6:56 pm | Permalink
testhdhd
test | 22-Aug-11 at 1:17 am | Permalink
test
msmith92336 | 23-Aug-11 at 12:24 am | Permalink
test
campsmithnewport | 23-Aug-11 at 12:25 am | Permalink
test
blarg | 23-Sep-11 at 10:15 pm | Permalink
Testing
ADC | 02-Oct-11 at 3:34 pm | Permalink
very cool
Praemienabo | 05-Nov-11 at 5:20 am | Permalink
Just awesome!
JustInquisitive | 20-Nov-11 at 7:16 am | Permalink
avatar
Defacto | 09-Dec-11 at 10:25 pm | Permalink
Does this plugin make identical identicons to gravatar?
harliger | 11-Jan-12 at 1:04 am | Permalink
this is a test
harliger | 11-Jan-12 at 1:05 am | Permalink
very good,useful
PAuly | 30-Mar-12 at 7:36 pm | Permalink
i want one too
PAuly | 30-Mar-12 at 7:36 pm | Permalink
and again
checkit | 04-Apr-12 at 11:15 am | Permalink
yeah
uli | 04-Apr-12 at 11:24 am | Permalink
guggug
Compu Gator | 15-Apr-12 at 6:06 pm | Permalink
I’d seen these designs on various blogs, but I had never tried to research them. What kind of search terms could one expect to use, anyhow? Generated by assembling shapes into a block based on a hash of de facto user-id. Fascinating. I wonder how one might allow users to select their own color schemes.
Drew | 18-Apr-12 at 8:13 pm | Permalink
Just want to see the generated identicon.
Len | 15-May-12 at 11:17 am | Permalink
A wonderful solution, adding simple uniqueness.
Gonzalo | 24-May-12 at 1:10 pm | Permalink
HELLO !!
adtiya | 26-Aug-12 at 11:20 am | Permalink
hello
testguy | 01-Nov-12 at 5:37 am | Permalink
I of course, am just testing.
Martha | 17-Jan-13 at 6:47 pm | Permalink
I’ve gotten two comments from people on gmail, and the identicon is the same–very different emails BEFORE the @–5 letters vs. 7 letters, only one letter in common. I conclude that the identicon is generated from the part of the email address after the @??
I’d like different identicons for different commenters. But I don’t want to go to IP address because then it will change for commenters with dynamically assigned IPs (= most likely commenters).
Does it really only use the email url (I.e, after the @)? If so, can that be modified? If not, what’s up with my identical results for the gmail commenters?
ScottS-M | 18-Jan-13 at 10:22 am | Permalink
@Martha
That’s strange. Identicons should use the whole email address. If you look at the filename of the identicon (for example with “Copy Image Location” in Firefox), are the two .png image files named the same? If so then you caught a lucky hash collision (or something is going wrong with WordPress passing the full email address). If they’re not the same filename, then there may be some very subtle difference between the two images or you may have gotten lucky in the identicon generation stage (which should also be very very rare).
Martha | 22-Jan-13 at 8:11 pm | Permalink
Well, I do have a single background color and a single foreground color set. But that shouldn’t be so limiting? And I have it set to do 6 squares, not 4.
I have gotten 4 comments from gmail users, (including a test comment from a gmail account of mine and a comment I haven’t approved). They all look identical to me. It is a very simple identicon–stripes around a central square–not much detail to squint at and wonder. The file names do have different strings of numbers.
I have posted test comments from two pairs of email addresses, each pair using the same url (x@z.com, y@z.com, a@c.com, b@c.com). As expected, the pairs sharing the same url are different from each other.
Weirdly, ONE of these seems identical to the gmail identicon–just one. So that makes 5 addresses that have generated what looks like the same image! And at least 3 that generate totally different images.
I’ve scrolled up through your comments here and I don’t see anything similar–or similar in simplicity. See the comments at http://www.halfoftheholylife.org/meditating-at-the-edge/ to view two examples of this image.
Martha | 22-Jan-13 at 10:21 pm | Permalink
Well, now every comment, even pending, that has had a comment approved from that url (after the @) has what appears to be the same identicon–though they have different numbers. Clearly, something is wrong.
ScottS-M | 23-Jan-13 at 11:45 am | Permalink
@Martha
Well those do indeed look pretty identical although they have different file names. That’s very strange. This doesn’t answer the question but if you pull out the colors from those two on your meditating-at-the-edge page, they’re actually subtly different (#f05531 and #ef5a30) which is weird if you’re set to only use a single color.
Just to make sure things are narrowed down:
You didn’t do any editing to the plugin php right?
It looks like your identicons are going through some sort of wordpress.com caching? Did you set something up to do that?
Could you click the “Clear cache” button and see if those particular identicons stay the same?
I’ll email you in case you want me to look at a few of the strange email addresses.
иван | 20-Feb-13 at 6:01 pm | Permalink
Let me see mine.
sharay | 30-Apr-13 at 2:25 am | Permalink
testing…
sharay | 30-Apr-13 at 2:26 am | Permalink
testing . . .
Chiefer | 14-May-13 at 3:51 pm | Permalink
testing.
M | 01-Oct-13 at 3:07 am | Permalink
Hello! LOVE this wonderful plugin! It has been working perfect but I just switched servers and my recent comments are coming in red and white identical identicons that are different than the usual ones. I had tried clearing cache and even tweaking colors but they are not changing. Any ideas what could be the problem? You can see them in this recent post here: http://www.mysticmamma.com/awaiting-the-new-moon-astral-insights-from-sarah-varcas/
Gratitude for your help!
culi | 26-Nov-13 at 7:30 pm | Permalink
Amazing!
dan | 26-Nov-13 at 7:42 pm | Permalink
Any way to generate them through an App?
sefa Güler | 02-Feb-14 at 12:34 pm | Permalink
Any way to generate them through an App?
gummifisch | 10-May-14 at 7:25 am | Permalink
hi there!
we’re using wp_identicon v1.02 since 5 years and got over 1.4k pretty and different identicons. thank you for this nice plugin. but since 2 weeks despite the png-files have different names there will be always the same pattern. this happens to every address even for the old ones where we had temporarily renamed the png files. so we’re a little bit afraid to clear the image cache.
there had been no change neither in the plugin nor the wordpress installation but our hoster switched recently off the php v4. any suggestions?
ps. as i see, it’s exact the same pattern as it is displayed for this post. huh?
gummifisch | 10-May-14 at 7:28 am | Permalink
ps. as i see, it’s exact the same pattern which is displayed for my posts here. huh?
spyrius | 23-Nov-14 at 4:54 pm | Permalink
hmm..my avatar is the same as previous author’s
spyrius | 23-Nov-14 at 4:59 pm | Permalink
ScottS-M | 10-Dec-14 at 9:05 am | Permalink
@spyrius @gummifisch
Thanks for catching that. MySQL made integer overflow an error in their newer versions but I was using that in the randomization code so things stopped getting randomized with new MySQL versions. Should be fixed now.
Rafael Vega | 02-Aug-15 at 12:01 pm | Permalink
Hi, I’ve made a fork of your identicon generator for a personal project and i’d like to release it on github. I don’t see any license or copyright notice on your code so I don’t know if that will be ok or not.
The modifications consist simply in removing all the wordpress stuff and providing a simple command line interface for the identicon generator.
Is it ok to use your code in such a way? is it ok to publish my modifications under an open source license? Which license do you prefer, if any?
Thanks :)
ScottS-M | 03-Aug-15 at 5:51 am | Permalink
@Rafael Vega
Sure that’s fine to split out the identicon stuff. I’ve been meaning to do that myself and haven’t gotten around to it. I guess GPL sounds good unless you had some other preference. Thanks for doing that.
A person | 18-Aug-15 at 10:13 pm | Permalink
Presumably it is possible to calculate the e-mail address which the image was generated for by simply reversing the generation process…
Another person | 18-Aug-15 at 10:14 pm | Permalink
Yes, I thought the same as the above…
Yet another person | 18-Aug-15 at 10:23 pm | Permalink
Me too! This is amazing!
marshall | 05-Oct-17 at 8:55 pm | Permalink
funtastic
Sakbanul | 11-Sep-18 at 4:10 pm | Permalink
Pingin ikut lomba 10 lobang di joker merah