Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 2.4   Updated Friday, September 29th, 2006 at 5:17pm

User Bio Popup plugin for WordPress

This WordPress plugin searches posts and pages for the nicknames of authors. When it finds one, it turns it into a link which brings up a popup window with the author’s bio and image. It uses the contents of the ‘About Yourself’ field in the user’s profile for the actual bio, and the image used depends on which of the two methods you select. The options page for this plugin allows you to configure the popup’s heading, width, height, and more. It also is fully customizable with the built-in CSS in the popup template file.

Download

Instructions

  • Download dd-user-bio-popup.zip and uncompress
  • Upload dd-user-bio-popup.php to your plugin directory
  • Upload ddub-template.php to your theme directory
  • Enable the plugin
  • Configure the plugin options (under DDUserBioPopup). More information on that is below

Upgrading

Be sure to download both files when you upgrade, and check the options and the information on this page to make sure something has not been changed.

Change Log

  • 09-29-07 Version 2.4 - ‘Load Default Options’ button added. Tested with WP 2.3
  • 05-16-07 Version 2.3 - Updated for WordPress 2.2.
  • 04-06-06 Version 2.2 - Now in the options, you enter the FULL URL to the images directory. It should help make things a bit more standard. Everything validates now as well.
  • 04-05-06 Version 2.1 - Image detection code improved, gravatar code improved, and a few other little things.
  • 04-04-06 Version 2.0 - Popup code completely redone. Now popup window has it’s own template file. Images are now supported (Uploaded and Gravatars), as well as many other fixes and updates.
  • 04-02-06 Version 1.0 - First release.

Using images

The image used depends on your settings. This plugin allows you to create a directory, and upload images to it. You must simply specify the full URL to this directory in the options.

If you like, you could use a directory that your other author’s have access to, so they can upload their images themselves.

For image file names, simply use the author’s nickname - lower case, with spaces removed. The plugin will search for matching files that are either jpg, gif, or png.

Example

Let’s say your wordpress installation is at http://www.somesite.com/wp/ and you create a subdirectory called authors for the images. In your options page you would enter http://www.somesite.com/wp/authors/ for the directory.

Let’s also say that you have a user called Some User. You would want to call the image someuser.jpg (or gif or png). That’s it!

Now if the plugin cannot find a matching image, and Gravatars are enabled, it will try to find one by using the author’s email address (in their profile).

This plugin uses its own code for Gravatars, so you do not have to install anything else. If you are already using a Gravatar plugin, that is fine. They will not conflict.

Configuring

The CSS code for the popup window is contained in the template file (ddub-template.php). Feel free to change this to fit your site.

Options

Here are the settings available in this plugin’s options page in the WordPress admin panel.

Author images directory

This is the full url to your author image directory. This is where you can choose to store images for each author.

Use Gravatars?

If enabled, and an author image cannot be found in the specified directory, the author’s gravatar will be used. If you want to always use gravatars, just leave the ‘author images directory’ option blank.

Heading for the popup

This will be shown at the top of the popup window. If you want to include the user’s name, use %U.

Hover text for link

This will be shown when the visitor’s mouse is hovered over the link. If you want to include the user’s name, use %U.

Popup window width

Self-explanatory.

Popup window height

Self-explanatory.

CSS for popup window

This allows you to completely customize the popup window. The #wrapper div is around the content.

  1. I’d love to see an option to show a users page and not a pop-up window. :)

  2. Can the plugin pickup author bio content from an URL instead of “About yourself”? In other words, can it just simply display the content of an URL instead?

    Thanks

    PN

  3. The User Bio Popup plugin make me this error into the popup window:

    Fatal error: Call to a member function on a non-object in /home/wp-includes/query.php on line 10

    Why?

    I use Wordpress 2.3.3

  4. Dear admin,

    If you could spend a couple minutes to help me with this please… in this page of mine with your plugin in effect, http://veggyplease.com/?page_id=45, the nickname Mr White… opens the correct pop-up bio but the hover text gives the title for Mr Green (another user) instead of Mr White. It shouldn’t work like that should it?

    Thanx so much in advance,
    Mr Green

  5. HolisticGal: First you need to tell us what the problem is?

  6. I can’t get this to work. We’ve got multiple authors and I’ve tried everything I know. Anyone have any ideas? thanks

  7. Abhishek: This plugin will only turn author nicknames into links if they are in a post or page - not in the template files directly.

  8. I’ve installed your plugin and the code I use to get the author’s nickname on Wordpress 2.2 is <?php the_author(); ?> on revieware.net.

    It’s a multi-user blog and I just cant seem to find out why the popup link is not being generated. Would really appreciate some help here.
    Thanks,
    Abhishek

  9. 77
    Darren

    Would it be simple enougth to have the bio show as a page in the site rather than a pop-up?

  10. Foggy: The width and height of the popup can be adjusted in the options page for this plugin, under the WordPress admin panel.

  11. After reading the installation instructions one more time, I got the thing to work ;) Bad me. However, I can’t get the popup to size up the height so it includes the picture.

    Check the first post at http://blog.stockholmsyndromes.se/ and click my nick “Foggy” in the bottom and you’ll see what I’ve mean. I’ve tried altering the height to 100% in the template file, but when I upload it, it doesn’t show when I view the source code.

    What silly thing am I overlooking?

  12. While this plugin does not use any code that should have been affected by the changes in WordPress 2.1, I just tested it out on my test site, which runs WordPress 2.1.3.

    It worked fine for me at least.

    For those of you having problems with it, be sure you are using the nickname (not display name) of the author in your post or page - that is what the plugin looks for. Also try disabling your other plugins to make sure there is not a conflict.

  13. I agree with Austin’s comment #72 - I have installed the two files in their respective directories with no result. I am running WP 2.1.2.

    Also, you talk about ddub-template.php being installed in our themes directory. Is this in the general themes directory (wp-content/themes) or in the specific theme we have applied to our site (wp-content/themes/connections). As an aside, I have tried ddub-template.php in both locations and the plugin doesn’t work in either.

  14. Hey this plugin sounds really cool but i have installed and activated it and it doesnt work. It wont create the links or anything. I am running the newest WP i know that. Any ideas?

  15. Annelies: It sounds like you are somehow getting extra whitespace at the top of the files. The very first thing in the files needs to be the starting PHP declaration. If anything is sent to the browser first, it will generate that error. Or perhaps you have a plugin displaying output before it should. You can test by disabling your other plugins.

  16. Hi, I’m trying to activate this plugin, but when I do, I get a blank screen with this warning:
    Warning: Cannot modify header information - headers already sent by (output started at /storage/mijndomein/users/041361/public/sites/leden.helikonsymfonieorkest.nl/wordpress/wp-content/plugins/dd-user-bio-popup.php:258) in /storage/mijndomein/users/041361/public/sites/leden.helikonsymfonieorkest.nl/wordpress/wp-includes/pluggable.php on line 275

    I also have this problem when I try to activate your sitemap plugin. I’m using WP 2.1.2.

  17. if there is a name in the alt tag or link i convert the name to unicode with this converter: http://www.mikezilla.com/exp0012.html

    Put the name in the ASCII field

  18. Great. Thank you. I absolutely love your plugins. I have several in use on my new multi-author blog, and nothing out there does what yours do. They’re excellent! (The link to that blog is in my comment link.)

  19. Michel: Ah, I see what you mean now - this is actually a known issue. Last time I updated this script I was trying to think of the best way to handle it actually. :) I may see about having it not replace instances of the name if it is inside a link or image.

  20. No, it’s not in their profile. It’s in the post. If there’s a link like a href=blah title=author’s name, or an image with the alt tag with the author’s name, it screws up the post as your plugin tries to linkify the author’s name in the post’s HTML coding.

  21. Michel: I will check that out, but I do not believe WordPress officially supports adding html to user profile fields anyway.

  22. Seems there’s a bug. If an author has a picture with the alt tag with their name, the plugin thinks it’s linkable and shows the code rather than the link, in the post. For example:

  23. it’s working fine. I just combined your script with an ubb-parser. I was suprised it worked because i never have programmed in php before. I think it could use some optimizing but i don’t have the knowledge for that stuff ;)
    Offcourse you may edit it were you like and add it to future versions of your script.
    I think there is one little bug, after you used a ubb tag, the text goes to the next line (like a ).
    You can see the script in action here: http://sk8indtc.trimsalonpluto.nl/?page_id=37
    Just click my name.

  24. Jurriaan: Nice work :) After you have been testing it out for a bit, if you want to write up some info on it, I will add it to the article :) Email me if so.

  25. hmm i can’t post the full code here.
    wel here’s a link. Just copy the code and save as ddub-template.php and replace for the original.

    http://sk8indtc.trimsalonpluto.nl/wp-content/ddub-template.txt

  26. i’ve got it working now. I used some guy’s ubb-parser and intergrated it into the template. Matbe it’s not very neat but it works. You can use ubb tags like [b] [i] [u] [s]

  27. Hi there,
    I’m not an coding expert but i really need an option to us bold text within the pop-up, is there a way to make this?

    Thanks in advance,

    Jurriaan

  28. Marc: img_found is set to false originally.. then it sets it to true once it actually finds the image - strange that it is working for you like that :)

    I am not sure if you will be able to get this plugin to work in the sidebar though, as there is not a standard plugin filter to handle that. Currently it only works for the actual content of the post/page. It might be easier to just setup manual links to author pages for the sidebar. You could try this:

    (somewhere in the sidebar)
    <ul>
    <li><?php echo ddub_generate("User1"); ?></li>
    <li><?php echo ddub_generate("User2"); ?></li>
    <li><?php echo ddub_generate("User3"); ?></li>
    </ul>

    That should generate the proper links :)

  29. Is there a way to use that plugin for a list of authors in the sidebar? I get the list with . Is i t possible to link these names to the bio with User Bio popup?

  30. 56
    Marc

    got it. changed $img_found = FALSE; to $img_found = TRUE; in the template. works.

  31. Marc: Link?

    IBloon: Try wrapping the code tags around code (see below the message box)

  32. 54
    Marc

    Okay guys, i tried it for 2h now. The Bio shows up, but the image is missing. The subdirectory is accessable with firefox, the pics show up an are named like the nicknames. No spaces or capital letters. Any Ideas?

  33. Umm… Sorry for double commenting but for some reason my previous comment’s code didn’t go through….. I used comment tags… Let me try it again.

    Replace

    with

    
    <a href="void(0)" title="View Bio" rel="nofollow">/ddub-template.php?ddub=', '350', '600')"&gt;</a>
    

    Read my previous comment for more information…. I hope this works.

  34. I found a simple hack allowing you to link where your post authors are to the bio popup. Ok that was alittle confusing, basically if you have a blog with more than one user, replace

    
    
    

    With

    
    <a href="void(0)" title="View Bio" rel="nofollow">/ddub-template.php?ddub=', '350', '600')"&gt;</a>
    

    On your index page and your single.php page. (if your using k2, you can find on the ‘theloop.php’ page)

    This will make the YOURNAME in “this post was posted by YOURNAME” (or something similar) link to your bio popup. :)

    I am sure that alittle more editing could make this useful on comments as well.

    Thanks for this plugin, great job!!

  35. Todd: Sure, you could change this line:

    $content = str_replace($u_nick, $link_data, $content);

    And replace $u_nick with $u_first. Of course you will then have to declare $u_first above in the code, where $u_nick is declared. Try this:

    $u_first = get_usermeta($u->ID, 'first_name');

    I will leave the rest as an excersize to the reader, although that is pretty much all there is to it :)

  36. 50
    Todd

    Is there any way to get the plugin to work by searching for the authors first name?

  37. Todd: This plugin searches for the author’s nickname - not their regular name. Check to see what the nickname is set to in the user settings.

  38. Take a look at my site (www.iscramla.com) The author only shows up on the post page, not the front page. But, after installing your plugin, the authors name does not become a link. Why is this?

  39. Some of you might find this new plugin useful :)

    http://www.dagondesign.com/articles/add-signature-plugin-for-wordpress/

  40. Ambrosia: Yes, this is a known issue. The plugin does not work out very well in some cases such as this :) I am open to ideas for it though :) It is just a matter of choosing a nice method to get it to only apply it to the text you want it to change.

    Nathan: That is an interesting idea. I have not ever created any plugins which actually change the output of the feeds, but I imagine it would be possible. When I am able to, I will look into it :)

  41. Awesome stuff!

    Any chance of a little tweak for the next version so that if I’m reading the blog post in my RSS aggregator, and I click the author’s name, the popup still pops up? … so basically having the bio popup work off-site.

  42. Hello! I love the plugin, thanks! But I noticed one small thing, it also attempts to convert the username if it’s within a link. I was working on an “About Us!” page for a group blog, and I was linking each person to their profile on the forum we’re all from. Some of us had the same WordPress username as we did at the forum, so when I added title=WP-Name/Forum-Name, the link was broken. For example, my WP username is “Ambrosia”, and my name at the forum is also “Ambrosia”. So in my link to my profile on the forum, I inserted title="Ambrosia". The link was broken because your plugin tried to make my name a popup to the profile. This happened to everyone who used the same name. :D It was no big deal, I just went and did title="[Ambrosia]" and so on in my links. :P

  43. Jose: That looks good to me :)

  44. 42
    Jose

    Can I do:

    
    $u_fname = get_usermeta($u_id, 'first_name');
    $u_lname = get_usermeta($u_id, 'last_name');
    

    near the top (after I get the nickname) and then stick this:

    $content .= '<a href="http://whatever.com/contact-' . $u_fname . $u_lname'/" rel="nofollow">Contact ' . $u_nick . '</a>';

    at the end? I don’t know if that code is formatted right, but I think it is. That would get around my problem since the nickname for my authors is just their first name and then their last name.

    Thanks for the quick response.

  45. Jose: Try sticking this at the top of the ddub_generate function:

    global $wp_query;
    $page_id = $wp_query->post->ID;
    if ($page_id == 123) { // page number to exclude
    	return $content;
    }

    As far as integrating it, what you could do is something like this.

    create a contact page for each author. Example: whatever.com/contact-user1/

    Then at the very bottom of the ddub_generate function, right before the return line, add this:

    $content .= '<a href="http://whatever.com/contact-' . $u_nick .'/" rel="nofollow">Contact ' . $u_nick . '</a>';

    That way it will automatically stick a link at the bottom. I did not test that code, but you get the idea. That particular example requires that the author’s nick names do not have spaces, etc..

  46. 40
    Jose

    Oh, and before I forget, is there any way to integrate this plugin with your Secure Form Mailer Plugin? As in I have the email setup in the bio, and that email points the browser to a post which contains the Secure Form Mailer for that email?

    Or is there a way to have html with this plugin? I have tried, but the best I can do is to manually edit the template to have html code form, and I don’t know if I could do that myself for various authors.

    Thanks in adcance.

  47. 39
    Jose

    Is there any way to disable this plugin for one post? I have a post that contains my author’s names as links to categories, and this thing turns them into bio links. The only thing I can think of is making those links pictures, but that is just dumb :P . Any advice? Or hack?

  48. Alright, thanks. 8]

  49. Li: This plugin only processes the actual contents of the post. It does this by using this plugin hook:

    add_filter('the_content', 'ddub_generate');

    Now there is a filter which can be used on comment text, but it is only the comment text itself I believe - not the author, time, etc.. so I doubt it will work. If you want to try though, add this where the other add_filter lines are:

    add_filter('comment_text', 'ddub_generate');

  50. Any chance someone can click on the name of the commenter in the comment section of the post to see the bio? So if you go here: http://www.nexuscolony.com/leemancheng/blog/?p=487 - scroll down to where the comments are, and by clicking on say “Spongey” or “Li”, the pop-up appears.

  51. [...] Dagon Design » Articles » User Bio Popup plugin for WordPress Ook deze plugin is een mooie aanvulling op multuple authors blogs. (tags: wordpress plugin) [...]

  52. joh: That is just the way the plugin works. If I set it to make sure there was a space on both sides of the username, it would not always work, since sometimes there would be a paragraph tag in front of it, etc..

    Perhaps a future version would allow you to insert a tag to create the link, but that would defeat some of the purpose.

    It is a pretty specific working plugin that will not work for everyone :)

  53. this is doing some weird stuff on my site - i’d be grateful for any help
    in the word “australian” it turns the last three letters into a link (one of my users is “ian”)
    but points at another user altogether - then when you clcik i get a pop up window with “no input file specified”
    gulp
    i have turned the plug in off so you can’t see it malfunctioning
    :|

  54. [...] Dagon Design » Articles » User Bio Popup plugin for WordPress (tags: wordpress-plugin) [...]

  55. 31
    Selena

    Okay, I got it now.Thank you :)

  56. Selena: To use it, you just need to have an authors nickname somewhere on the post/page. It will automatically be turned into a link (for the popup) by the plugin :)

  57. 29
    Selena

    I am confused.I have the plugin installed and activated and all set up.However, where do I go or what do I do to actually see it in action?

  58. Ram: After looking into it some more, it will certainly not work with WordPress 1.5 because it does not include any usermeta functionality. There is a usermeta plugin for WordPress 1.5 but it does not work the same way the function included in WordPress 2.0 works. Unfortunately, your only option for getting this to work seems to be an upgrade to WordPress (which is not a bad idea anyway - lots of nice stuff added).

  59. Hi,

    Thanks , I hope you will get it resolve to work with v1.5.

    Ram Prasad

  60. Ram: This plugin requires WordPress 2.0. I may see if it is possible to get it working with 1.5 sometime though.

  61. Hi,

    Yes, I am using version 1.5, please suggest me to resolve the problem.

    Thanks in advance,

    Ram Prasad.

  62. Ram: What version of WordPress are you using? It sounds like you might be using a version prior to 2.0.

  63. Hi,

    When I have using the plugin I am getting the following error.

    Fatal error: Call to undefined function: get_usermeta() in C:\Program Files\Apache Group\Apache2\htdocs\wp\wp-content\plugins\dd-user-bio-popup.php on line 209.

    Please do the needful help.

    Thanks in advance.

    Ram Prasad.

  64. It pulls up fine for me (And I am at another computer right now).

  65. The link to ddub-template.txt does not appear to be available:

    http://www.dagondesign.com/files/ddub-template.txt

  66. [...] User Bio Popup plugin for WordPress (tags: wordpress plugin) Posted by nonimage Filed in [...]

  67. 19
    Bricolou

    Great stuff, Admin, thanks again !

  68. Version 2.2 has been released.

    Now in the options page, you enter the FULL URL to the images directory. It should help make things a bit more standard across different servers. Everything validates now as well, and a few other little fixes have been made.

  69. I started getting T_String parse error
    It has to do with the script language = line around 232.

    There are a few capital letters that makes it not validate and those I could fix, I just can not fix the parse error.

    BD

  70. [...] Dagon Design Got a blog with a lot of users/authors? This plugin will give a pop-up image and bio for the author when you hover over their name. Nice addition to multi-author sites. [...]

  71. It appears that this now works and is compatible with Brian Groce’s email notification plug in.

    Thanks

  72. [...] Curioso plugin, que realmente no se que hace, pero parece que te muestra un pequeño pop-up con info del autor. [...]

  73. Version 2.1 has been released. :) There are several code improvements, including better image detection, Gravatar code, and a few other things.

    I tried to sign up for a Gravatar myself, but it looks like their site might be having problems.

  74. 12
    Bricolou

    You are “THE MAN”…

  75. [...] Check it out at Dragon Design. [...]

  76. Bricolou: Can you email me a link where you have this in use? So I can see the source of the popup and tell perhaps why it is not generating the image link properly?

  77. 9
    Bricolou

    Hi again Admin,
    I’ve tried the new version in both a localhost install with Wordpress in the root directory and a live site with Worpress in http://www.mysite.com/WP. I’ve followed your instructions to the letter. In both cases, it’s working fine with gravatars but it won’t pick up locally hosted images, just the text description shows up. Any idea what can be wrong?

  78. Version 2.0 has been released. I rewrote almost all of the code and put the popup stuff in it’s own template file (easier to make modifications and adjust the CSS). It also now supports images (two methods you can use), as well as several other fixes and things :)

  79. 7
    Bricolou

    Be sure your adkillers and popup blockers are disactivated. I forgot about that at first. Now working fine even in a tabbed browser.

  80. Big Dog: Can you show me an example page on your site where it generates a link, so I can check it out?

  81. Everything seems to have worked until I clicked on the link. No pop-up window appeared so I am not sure what I need to do.

    Has anyone else run into this?

  82. I will see what I can do :)

  83. 3
    Bricolou

    I’d go for the easiest solution which from my point of view, is the second. A simple link typed in to the profile information would allow users with upload rights to use images in the upload directory and users with no rights to use a gravatar url or an image from their own site.
    It would be really good if you could do this. TIA.

  84. There is a paypal link at the top of the page now. :)

    When I get home today, I figure out a way to include an image.

    One option is to use one of those usermeta plugins such as the ones mentioned in the WP forum. Would you prefer something like this? Or would you be happy using the current method, if images were able to be used?

  85. 1
    Bricolou

    Hi, great plugin. Many thanks. I said I’d make a donation but can’t find a way to do so from your site. Can you indicate a paypal address?
    Just one question: with the old B2 hack, it was possible to include a photo in the bio using HTML. HTML in the user profile doesn’t seem to work. Even slashing out the “, I just get the img src address. Is there some way to include a photo?

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.