WP Plugin Enhancement – Profiler
Anybody who wants his blog to be like a CMS would wants a user directory page where all users of the blog can be seen.
I just found the plugin just for that and it is called Profiler by Eric Schulz
here are the screenshots of the profiler plugin
It is perfect for creating a user directory page where you can view other members but i wanted more… What i want is an extended user profile where aside from the email and join date a yahoo messenger address and perhaps a friendster url (entered via the Register Plus plugin) can be seen.
So i decided to edit Eric’s plugin to do what i had in mind…
After an extensive review of the codes here is the addition that i made to the source codes…
-
function pf_get_friendster($id)
-
{
-
global $wpdb;
-
$friendster = $wpdb->get_var("SELECT `meta_value`
-
FROM `wp_usermeta`
-
WHERE `meta_key` = ‘friendster’");
-
return $friendster;
-
}
-
function pf_get_yim($id)
-
{
-
global $wpdb;
-
$yim = $wpdb->get_var("SELECT `meta_value`
-
FROM `wp_usermeta`
-
WHERE `meta_key` = ‘yim’");
-
return $yim;
-
}
So that should get the extra values from our databases and what’s left is to output the it into the user profile page.. I placed my data inside a table so that the labels and the values can be styled seperately to make it look better and the code is as follows…
edit the function pf_output_single($id) and near line 470s i think just after the show photo codes here is what i did to the $output code…
-
$output .= "<table><tr>";
-
$output .= "<td><span class=\"profName\">$display_name</span></td></tr>";
-
if(get_option(‘pf_show_emails’) == ‘yes’)
-
$output .= "<tr><td><span class=\"profField\">Email:</span></td><td><span class=\"profVal\"><a href=" . "mailto:" . $user_email . ">" . antispambot($user_email) . "</a></span></td></tr>";
-
if($user_url != ” && $user_url != ‘http://’)
-
$output .= "<tr><td><span class=\"profField\">Website:</span></td><td><span class=\"profVal\"><a href=" . $user_url . " rel=\"nofollow\">$user_url</a></span></td></tr>";
-
$output .= "<tr><td><span class=\"profField\">Join date:</span></td><td><span class=\"profVal\">" . pf_format_datetime($user_registered) . "</span></td></tr>";
-
$output .= "<tr><td><span class=\"profField\">Friendster:</span></td><td><span class=\"profVal\">$friendster</span></td></tr>";
-
$output .= "<tr><td><span class=\"profField\">YM ID:</span></td><td><span class=\"profVal\"><a href=ymsgr:sendim?$yim>$yim</a></span></td></tr></table>";
after saving and firing up my user profile page here is what it looks like…
After changing themes this is what the user directory looks like then:
Download my profiler edit Profiler Plugin (29)
Credit remains with Eric Schulz for developing such a wonderful plugin
Popularity: 49% [?]










This post has 2 comments
July 24th, 2009
Can we use this plugin to show the currently logged in users in the
wordpress sidebar?
March 19th, 2009
cool editing you made… thank you for sharing that…