Adding Sites to Sociable
While Sociable comes with a pretty large set of sites, there are always people that want to add their own. While this is pretty easy to do, you'd have to update the plugin every time it's updated, which is quite often, so that's not really a workable solution.
Today, I've fixed that. I've just submitted version 3.4 to wordpress.org, this version makes it possible to add sites to Sociable from either a plugin or from your theme.
You'd simply have to do the following:
function sociable_add_sites( $known_sites ) {
$known_sites['Joost'] = array(
'favicon' => 'http://cdn.yoast.com/images/joost.jpg',
'url' => 'http://yoast.com/submit-to-yoast',
'description' => 'What else would you do?'
);
return $known_sites;
}
add_filter('sociable_known_sites','sociable_add_sites',10,1);As you can see you can easily add your own sites now. The favicon URL can be both an absolute URL to the file, or just a filename. If it's just a filename Sociable will look for it in the image directory you've defined in the backend.
You could also use this functionality to change the icon for a certain site, just add the following to the code above (before the return statement):
$known_sites['del.icio.us']['favicon'] = 'http://cdn.yoast.com/images/joost.jpg';
As said, you can either add this code into a plugin, or put it into your themes functions.php file. After doing that, the site will become available for you to pick in the Sociable admin panel.
Update: version 3.4.1 also fixes the Sphinn submit button, to work with the new version of Sphinn.





by Simon on 16 July, 2009 at 14:14
Great update Yoast! Makes it easy to add lokal services now.
by Jermaine Young on 16 July, 2009 at 16:29
I may just use this one day. Thank you.
Pingback: Fresh From Twitter: update from @yoast …
by Blogs d'école on 16 July, 2009 at 19:34
Hello,
Would be great to have the same for the customs images. I've changed the images to bigger ones, and I have to update that every time the plugin is updated ... :(
by Joost de Valk on 16 July, 2009 at 19:46
What would you need to change then? You can simply specify an image dir right? I use bigger images myself and never have to change a thing...
by Karl Foxley on 16 July, 2009 at 19:42
This is a very welcome addition... thanks for this!
Karl
by brita on 16 July, 2009 at 20:00
Hi Joost,
I just upgraded to 3.4.1, and when I tried to update my settings, got this message: Fatal error: Call to undefined function: screen_icon() in /home/jmainehu/public_html/podcast/wp-content/plugins/sociable/sociable.php on line 982
Sorry not to post this on WordPress user forums...
by Joost de Valk on 16 July, 2009 at 21:58
Update your WordPress. Screen_icon was introduced in 2.7, 2.6 is insecure, so: update.
by Evan Mullins on 16 July, 2009 at 21:20
Awesome idea! I was just thinking about digging into the source to add sites to my list! You've made it too easy not to customize it now! I'd request a special settings section in the sociable settings page with a space where I could type php to add sites and they would be saved even when updating the plugin! But I'm stoked, I've already added a site to my sociable list!
by teknoloji on 16 July, 2009 at 22:44
thanks for this abdurrahman
by Jordan on 16 July, 2009 at 22:55
Thanks for the great site, Yoast. While we're on the subject of Sociable, what kind of response have you had with it? Does it really seem to encourage people to share your links on social networks and ultimately drive traffic? I've been considering using it for some time on my own site, but I don't think I've ever actually used the links anywhere else around the web. Maybe that's just me, though.
by Joost de Valk on 17 July, 2009 at 07:10
it works well, but don't take my word for it, test it!
by Roy on 16 July, 2009 at 23:59
Good idea, i'm off to try and figure out how to use custom images...
by reesan on 17 July, 2009 at 01:46
Hi Yoast, love your plugin and was excited to read this article as I was forever re-adding JapanSoc.com.
However, this is probably my complete ignorance so I apologise in advance, I added the code above to my functions.php as per below:
function sociable_add_sites( $known_sites ) {
$known_sites['JapanSoc'] = array(
'favicon' => 'japansoc.ico',
'url' => 'http://www.japansoc.com/submit.php?url=PERMALINK&title=TITLE',
'description' => 'JapanSoc'
);
return $known_sites;
}
add_filter('sociable_known_sites','sociable_add_sites',10,1);
But this gives me the following fatal error:
Fatal error: Call to undefined function add_filter() in /******/wp-includes/functions.php on line 3357
When I strip out the add_filter I have no fatal error but no 'known sites' functionality either.
Like I said, this is all probably my foolishness... does the add_filter command have to go in a different location than functions.php?
by reesan on 17 July, 2009 at 04:02
sorry to disturb. i knew that it would my my own stupidity. i placed the code in the wrong functions.php! d'oh!
all resolved now. thanks for listening. :-)
by Joost de Valk on 17 July, 2009 at 07:10
Glad you've got it working!
by otoharley on 17 July, 2009 at 07:01
i love sociable plugin. This plugin is very great. Many thanks
by det on 17 July, 2009 at 07:12
it worked as a charm!!!
thanks for your GREAT job!!
by Blogging Contest on 18 July, 2009 at 07:16
Great update Yoast! Thanks for sharing it...
Best,
Indo Contest
by Ghufron on 19 July, 2009 at 19:12
Nice info! I will try the code above on my theme. I using Arthemia theme. Thanks!
by boomint on 20 July, 2009 at 04:10
Great plugin Yoast! Thanks for sharing to us..
by Navjot Singh on 20 July, 2009 at 08:01
I am trying to add multiple sites by using this function in the form:
function insociable_sites( $known_sites ) {
$known_sites = array(
'Social1' => Array(
'favicon' => 'image1.png',
'url' => 'http://www.social1.com/submit',
),
'Social2' => Array(
'favicon' => 'image2.png',
'url' => 'http://www.social2.com/submit',
),
);
It does adds these sites but removes all others provided by default. It just shows these two and the remaining default selected sites. All other inactive sites are disabled. Infact the images shown by the default selected are also not shown.
How to fix this?
by Navjot Singh on 20 July, 2009 at 10:53
OK fixed it. Got the basics of PHP wrong. :lol:
by Navjot Singh on 20 July, 2009 at 12:21
I have just released a Indian Version of Sociable at http://nspeaks.com/671/indian-sociable-wordpress-plugin-released/ - It uses the above function. Thanks Joost for this.
by micro komputer on 22 July, 2009 at 02:38
This is a very welcome addition... thanks for this!
best regard
by Joelle on 22 July, 2009 at 17:37
I love the Sociable plugin as well and thanks for the tips on how to add more sites to the list. However, I was curious if this issue had been addressed? http://wordpress.org/support/topic/288487?replies=13
I'm using WP 2.8.2 and Sociable 3.4.1 - but it was having this challenge with 2.7.1 and 2.8.1 as well.
Thank you!
by Zim on 24 July, 2009 at 02:18
Great! I was just going to suggest you the site "Chuenga". Good information :)
Pingback: České a slovenské linkovací služby jako samostatný plugin ve WordPressu | Separatista
by alfon on 27 July, 2009 at 03:30
wow a good idea & thanks for sharing :)
by juust on 27 July, 2009 at 11:40
Joost, are you planning on adding a store for accountnames and passwords to Sociable ? It would give the plugin a lot more potential uses.
by WildcatDigital on 27 July, 2009 at 22:23
I was JUST wondering if adding custom sites would be possible. Thank you!!
by Happy Hotelier on 29 July, 2009 at 10:06
Hi Yoast
After having tried the tweetmeme plugin and finding out it gave too many errors, I now see your sociable plugin gives too many errors when validating my sites and deactivated it.
by musab on 29 July, 2009 at 10:25
thanks for a great job
by Adi Sabarwal on 30 July, 2009 at 06:18
Thanks for the plugins. I've been reading on your site for the last 5 hours and implementing all the advice/plugins onto my new blog before I 'officially' open it.
by Kaitlin on 31 July, 2009 at 23:39
I assume this means that it will now be possible, for example, to add functionality that is in other plugins (for example, WP-Email). My PHP is a bit soft, though, so I'll have to play around to figure out how to make the URL pull the WP-Email URL.
Pingback: Indian Sociable Wordpress Plugin released
by Paul Lear on 3 August, 2009 at 21:07
I've not installed sociable on my blog yet, I guess I better get a move on & do it. :D
Great post, great info.
Thanks,
Paul.
by N3RI on 7 August, 2009 at 05:08
WOW! Thats my idea, cool! Thanks!
http://wordpress.org/support/topic/288985#post-1134697
But, I have a question. If I put this php code on funtions.php what happens when they update wordpress and they have a new funtions.php file?
Isn't it the same problem than before? I asked this feature because every time you upgrade the sociable plugin, it overwrite the edited sociable.php file and my site disappears. Now, every time wordpress upgrade the functions.php file it will overwrite the edited file?
I think the ideal solution is one that you have not to edit a wordpress file, like a second sociable.php file, something like "sociable_extra_sites.php"
Sorry if I'm wrong. Your plugin is so cool and useful.
by Kaitlin on 7 August, 2009 at 11:51
functions.,php doesn't get replaced when WordPress is upgraded/updated. Functions.php is a part of your theme, and not part of the WordPress core that is being upgraded. Even if your theme is updated, *most* theme authors aren't updating the functions.php file because the whole idea is to have things that the user defines that don't get messed up when updating WordPress or the theme.
by Louise on 9 August, 2009 at 01:16
I am a newbie. When you talk about adding codes and things - does that also apply if you use the wordpress.org uploads. I just upgraded and am wondering if that takes care of it or if I need to do something else.
Louise
by Veronica on 14 August, 2009 at 05:21
Hi there,
Just did an upgrade of sociable, but nothing seems to work right now...
Checked settings & found a whole list of notes such as this:-
"Warning: Missing argument 2 for checked(), called in /home/patron/public_html/blog/wp-content/plugins/sociable/sociable.php on line 1065 and defined in /home/patron/public_html/blog/wp-admin/includes/template.php on line 363
checked="checked" /> Front page of the blog"
Any advice you can give?
by Julie on 16 August, 2009 at 19:04
Hi
I am experiencing the same issue as Veronica - same error message. The wordpress version i am using is 2.7 - is this the problem? Is the new version of sociable unstable when used with wordpreass 2.7.
If this is not the case could you please advise what is the problem and how to rectify
Thanks
by Martijn on 17 August, 2009 at 09:56
Just had this problem last night as I was trying to add some Taiwanese sites to Sociable.
I had found some sites and Icons in this post:
http://wordpress.org/support/topic/228080
Now I will just rework my theme instead.
by Bayrak on 18 August, 2009 at 10:27
Thank you plugin
by rawloader on 20 August, 2009 at 08:03
Thanks a lot, it very helpful.
by Gerard on 20 August, 2009 at 20:08
Hi Joost, I modified Sociable 3.4.4 to add ShareThis as an option. This is for a site that wants the most popular social bookmarking options clearly displayed in an uncluttered way, with ShareThis taking care of most others. If you're interested in including this in a future version I can send you the code. It does complicate things a bit: a ShareThis publisher ID is needed (with a field in the admin area to enter it) and JavaScript is required. A moderate amount of special case code to make it work.
by Teknoloji haberleri on 20 August, 2009 at 20:56
thank you plugin admin
by Venusya on 27 August, 2009 at 12:00
Thanks, very helpful
by Vasilinka on 28 August, 2009 at 09:25
Thanks a lot, its very helpful.
by Hesham on 29 August, 2009 at 17:32
This is great news, I was contacting you before for this reason, but I thought it will be hard work for you with all these social websites coming all the time to life!
Thanks for the good idea, and your support!
by Katyusya on 2 September, 2009 at 08:26
Thanks you for your support.
by discount web design on 3 September, 2009 at 08:43
Thanks for such excellent post. Really informative blog. Keep the good work here and i wish you all the best and success.
by Gilgamesh13 on 8 September, 2009 at 12:45
Hi !
I just noted that when I activate your Sociable plugin Version 3.4.4, it runs well, but the dashboard disappeared (WordPress 2.8.4 - Arthemia Premium Theme).
Thanks !
by Ima on 15 September, 2009 at 07:06
Thanks for share such great thing!!!