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.

Pages: « 6 5 4 [3] 2 1 » Show All

  1. 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.

  2. 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

  3. Jose: That looks good to me :)

  4. 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.

  5. 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..

  6. 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.

  7. 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?

  8. Alright, thanks. 8]

  9. 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');

  10. 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.

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

  12. 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 :)

  13. 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
    :|

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

  15. 31
    Selena

    Okay, I got it now.Thank you :)

Pages: « 6 5 4 [3] 2 1 » Show All

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.