The Blog of Brad
Code: Add sites to Social Links [UPDATE]
[UPDATE] Changed base URLs for yFrog and TwitPic in the code. And edited the name of the yFrog image.
Since I’ve launched the redesigned BradArsenault dot com, I’ve been using a WordPress plugin called Social Links to show my social links (such as to Last.fm, Digg, Flickr, etc.) and this is how to add services that aren’t included by default.
First off, I’ll walk you through adding yFrog, however this will work with any site (that is publicly accessible with a user-specific URL)
First you have to get an image for the site you want to add. This could be from the favicon.ico file from the site (look for a link to that in the site’s source code) or from an image search. You then have to dress the icon up by cropping it, giving it a transparent background (if it has empty space in the icon), and resizing it to 16×16 pixels.
This was my design process in Pixelmator

Pixelmator designing yFrog favicon
You now have to upload this to the /images of this plugin’s folder with an easy name, like yfrog.php. The next step is to add the right code to the php file.
I use Espresso by MacRabbit for my code, however any raw text editor will work (Smultron, SubEthaEdit, Coda, the Transmit built-in editor, and many others will work for this). Open the sociallinks.php in the main plugin folder.
Look down the code for the
$definitions array
and add another definition at the end (so that you would be at
array(22
if you are starting from the stock code). Add this code.
/sociallinks/sociallinks.php
array(22,'yfrog.jpg','http://yfrog.com/%userid%','Enter your Twitter handle','yFrog'),
If you’re not familiar with PHP then you may need this help: The first quoted block (that’s an apostrophe there, it’s the non-shifted quotation mark) is the location of the image relating to that service, in this case yFrog.png. This is what we just edited and put in the /images folder of the plugin. The next portion is the link that this will go to when clicked to bring you to your user page, excluding the feature that uniquely identifies your account. Where you see %userid% is where your user name will be inserted by this script in the management page.
The next block gives you instruction as to what to enter, in this case yFrog uses your Twitter handle for your page. Finally, you have to state what this service is called.
Save. Now rename the old version of the script (sociallinks-1.php?) and upload the new script with the name sociallinks.php. Now you can go to the administrative page and select your new service. If there are errors, it’s most likely because you forgot a comma after each entry except for the last, forgot to close a quote, used the mismatched quotes, or didn’t use quotes at all.
fwiw here is what I have: (starting at line 67 of the PHP file)
/sociallinks/sociallinks.php
array(20,'technorati.jpg','http://technorati.com/people/technorati/%userid%/','Enter your Technorati username.','Technorati'),
array(21,'friendfeed.png','http://friendfeed.com/%userid%','Enter your FriendFeed username.','FriendFeed'),
/*I added the rest of theses --BradArsenault (Nov 28/09)*/
/*Note the changes I made to TwitPic and yFrog -- these are the correct base URLs*/
array(20,'technorati.jpg','http://technorati.com/people/technorati/%userid%/','Enter your Technorati username.','Technorati'),
array(21,'friendfeed.png','http://friendfeed.com/%userid%','Enter your FriendFeed username.','FriendFeed'),
array(22,'yfrog.png','http://www.yfrog.com/froggy.php?username=','Enter your Twitter handle','yFrog'),
array(23,'twitpic.png','http://twitpic.com/photos/%userid%','Enter your Twitter handle','TwitPic'),
array(24,'qik.jpg','http://qik.com/%userid%','Enter your Qik user account','Qik'),
array(25,'wakoopa.png','http://wakoopa.com/%userid%','Enter your Wakoopa user account','Wakoopa')
);
If you want to use the icons that I used you can download them here (icons.zip)
| Print article | This entry was posted by BradArsenault on November 28, 2009 at 8:52 pm, and is filed under Blog. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

















No comments yet.
Days of Code: Perl URL Shortener
about 7 months ago - View Comments
Today I got some work done; I didn’t get anything on my list that I made yesterday done, however I did experiment with jQuery (the Javascript library)… and now have an easy-to-use listing mechanism (to see the sum of all URLs in the database and the viewers logs). Take a look . With that you
Quick Self-Exam of Writing Syntax
about 7 months ago - View Comments
I was writing my update to my Perl uploader project for today when it dawned on me that my writing syntax has evolved. I saw that in place of the usual — I began to use almost a year ago has been replaced by // which isn’t just present in my Tweets and blog posts,
Greasemonkey Scripts
about 8 months ago - View Comments
Greasemonkey is a useful extension for Firefox, however this week, I saw that Mitchell McKenna (@MitchellMckenna) mentioned that Chrome now installs Greasemonkey scripts. If you aren’t fully aware of the power of Greasemonkey take a look here (link here). First off, the best place I’ve found to get GM scripts is userscripts.org, a (mostly) free
Twitter Tools problem –No links!
about 9 months ago - View Comments
As you’ve seen on my Twitter feed, there are some posts from my blog which are prefixed with “New Blog Post: “. These are tweeted with the Twitter Tools WordPress Extension. This extension interfaces your WordPress powered blog to Twitter by creating digests (daily or weekly) or individual posts for each of your tweets, and
Track My Snow Leopard Shipment!
about 1 year ago - View Comments
If you remember back earlier thi year I had a post about tracking a classic Mac keyboard and mouse from eBay… well I’ve since shipped a few items on Canada Post, Fedex, and Purolator and have come up with a few PHP pages to make these pages viewable on non-secure connections and to eliminate almost
Firefox Extension: Tree Style Tabs
about 1 year ago - View Comments
I heard this recommendation on Leo Laporte and Steve Gibson’s Security Now podcast (episode ##) for a Firefox addon called Tree Style Tabs which is just about the most UI concept I’ve ever seen. (Given that it does almost have a terminal-esque geeky feel to it, so this is not universally grandma-friendly). Basically, this just
Firefox Extension: Googlepedia
about 1 year ago - Comments Off
I have to draw notice to this AMAZING Firefox addon, Googlepedia, this gives the user ~80% more Wikipedia-age per search (as we know, the top results to Googles searches are frequently Wikipedia links) by transforming the normally useless right half of the Google search result page into a Wikipedia viewer. This is part of my
New Theme: Atahualpa
about 1 year ago - Comments Off
This is a new theme I’m trying as of April 1 (this is not a joke)…. it’s called Atahualpa. It looks like a neat theme, however I will have to perform some CSS tweaks (I don’t like the fluid width)… guess I have another excuse to use MacRabbit’s CSSEdit. I’m interested to hear what you
I’m now at DreamHost!
about 1 year ago - Comments Off
I’ve been moved over to DreamHost for a total of… three minutes. If you’re interested, here’s what I did: 1. First I logged into my domain via GoDaddy’s SSH, I zip’d all of my files as allfiles.zip via the command zip -r allfiles.zip * This command says to zip (* means wildcard, so everything), the
CODE: Message Shown from List
about 1 year ago - View Comments
This AppleScript provides a simple function, if you need to show pre-determined text on your screen in a noticeable way, Quicksilver’s ‘Large Type’ function is great. This script allows you to enter the sets of text you need to show in the code then run the script to select the bit to show. To close
Comments are closed.