Social Profiles Wordpress Plugin
The Social Profiles Wordpress Plugin was created in an effort to help get the members of your community more involved by giving them increased exposure by showcasing their profiles on selected social networks in addition to the standard website link on their comments.
This plugin was conceptualized by Sugarrae and brought to life by Joost de Valk, the Wordpress plugin master and author of THE Wordpress mailing list that all serious Wordpress users should be subscribed to.
Social Profiles allows you to add social network profile links to the comments of your registered users as specified by the user on their profile page (which you can theme to be seamless with your site with the CYC plugin). The links can appear as textual links or graphical links and you can choose to add a nofollow tag to the links if you choose. See the screenshot below for an example:
The Social Profiles plugin comes with ten mainstream networks pre-installed and with a little bit of code addition (which I’ll detail below), you can add any others that you’d like. The default social networks available are:
- Delicious
- Digg
- Flickr
- Furl
- MySpace
- Newsvine
- Stumbleupon
- Technorati
Delicious, Digg and Flickr are enabled by default. You can change these selections via the Social Profiles Panel (more information below).
Installation
- Download the plugin zip file
- Unzip the plugin file to a directory where you will be able to find it
- Upload the /social-profiles/ folder to your /wp-content/plugins/ folder
- Upload the social-profiles-include.php file to the root /wp-content/plugins/ folder (this is the file that allows you to add additional networks… it does not go inside the /social-profiles/ folder to prevent it from being overwritten when the plugin gets upgraded, so be sure to put it into the root /wp-content/plugins/ folder)
- Activate the plugin from your plugins administration screen
- Customize the settings (more on this below) under Settings > Social Profiles
- Please the following code after the comment_author_link (on my blog, it is set after the comment_time):
<?php cyc2_show_profiles($comment->user_id); ?>
- To use the Social Profiles plugin an author page, add the following in the author.php file where you want the social profiles to appear:
$a = get_userdatabylogin($wp_query->query_vars['author_name']);
cyc2_show_profiles($a->ID);
- If you’re utilizing the Guest Author Hack (number 7 in the list) previously published here (again, see number 7 in the list) that was written by Joost, you can add the Social Profiles to it by putting the following code where you want it to appear within that hack:
<?php cyc2_show_profiles(get_the_author_ID()); ?>
Using the Social Profiles Panel
You’ll find several options available in the Social Profiles panel including:
- An option to “nofollow” profile links
- An option to use images to link to the listed networks instead of text
- A listing of “active profiles” – check all the ones you want to appear
- A prefix output box (things put into this box will appear before the social network links)
- A suffix output box (things put into this box will appear after the social network links)
Change the listed options to fit your preferences and then click the “update settings” button and providing you have the code listed in the installation section above added to your template, you should be good to go.
Customization aka Adding New Social Networks
Those with technical skills probably can take a quick look at the social-profiles-include.php file and see how to quickly add new networks. For people like myself, who aren’t PHP wizards, I’ve done my best to explain adding new networks in laymans terms below.
While the plugin comes with most of the big social networks included (please note that Facebook is excluded purposely due to a URL structure that isn’t “username variable” based), we know that we may be missing niche social networks of importance to you and your community. Thus, we’ve created a way for you to add social networks/forums provided their URL structures are based on a “username variable”.
By username variable, I’m referring to the only difference between my profile link and your profile link is the username for the network/forum. For instance, my Digg profile URL is:
http://digg.com/users/sugarrae
While your Digg profile URL is:
http://digg.com/users/YOURUSERNAMEHERE
The only difference in the profile URLs for individual users is the username. That’s what I mean by URLs that use “username variables”.
To add new networks, all you need to do is edit the social-profiles-include.php file that you should have uploaded to /wp-content/plugins/ per the installation instructions. Once you open the file, you’ll see an example network addition, “commented out” that looks like this:
<?php
// $cyc2_networks['Delicious'] = Array(
// ‘heading’ => ‘Delicious’,
// ‘name’ => ‘delicious’,
// ‘pattern’ => Array(
// ‘minlength’ => 1,
// ‘maxlength’ => 63,
// ),
// ‘image’ => $cyc2_pluginpath.’delicious.png’,
// ‘url’ => ‘http://delicious.com/username’,
// );
?>
All you need to do is copy everything in between the <?php and ?> tags, remove the comment code on each line (//) and enter the information for the social network of your choosing.
For example, because I am in the webmaster industry, Sphinn is a forum that many of my community members belong to. As a result, I wanted to allow my members to show off their profiles there. So, I edited my social-profiles-include.php file to read:
<?php
// $cyc2_networks['Delicious'] = Array(
// ‘heading’ => ‘Delicious’,
// ‘name’ => ‘delicious’,
// ‘pattern’ => Array(
// ‘minlength’ => 1,
// ‘maxlength’ => 63,
// ),
// ‘image’ => $cyc2_pluginpath.’delicious.png’,
// ‘url’ => ‘http://delicious.com/username’,
// );
$cyc2_networks['Sphinn'] = Array(
‘heading’ => ‘Sphinn’,
‘name’ => ‘Sphinn’,
‘pattern’ => Array(
‘minlength’ => 1,
‘maxlength’ => 63,
),
‘image’ =>”,
‘url’ => ‘http://sphinn.com/user/view/profile/username’,
);
?>
I uploaded the file edited as above to the /wp-content/plugins/ and it made Sphinn appear in the Social Profiles admin panel so that I could check off the box to have it be shown. Once I checked the box for “Sphinn”, it added the field to the user profile pages for users to fill out. If they add a username for Sphinn, the link to their profile will appear next to their comments on my site.
Note: if you want a graphic to appear for new networks you’re adding, you’ll simply need to upload a 16×16 .png to the /wp-content/plugins/social-profiles/ folder and add the image name to the code per the “commented out” code example above:
‘image’ => $cyc2_pluginpath.’delicious.png’,
I don’t use graphics, so I didn’t bother to upload one for my “add on” network and changed that line of code to read:
‘image’ =>”,
Which basically means “no image” as you can see in the Sphinn example above.
I’d suggest leaving the commented out code in the social-profiles-include.php so you always have a “master” to refer to.
FAQ Section
Question:“Facebook is my favorite social network, but there is no “username” attached to my profile. How do I add it?”
Answer: Unfortunately, the format of Facebook profile links don’t allow for users to enter in a simple “username” to generate the link. We could have had users enter in their full Facebook url instead, but felt it would confuse an otherwise simple process of simply adding your username in the box next to any of the social networks listed that you belong to.
Versions and Changelogs
- 09.27.08 – Version 0.1 closed beta
- 10.01.08 – Version 0.2 released for public use
- 10.10.08 – Version 0.3 released for public use, settings now linked to from plugins admin panel and icon for admin drop down menu added
Show Appreciation
You can show appreciation for the time and effort to conceive, create and offer this plugin by:
- Linking to it
- Giving a donation via Paypal







