/*  
Theme Name: Resurrection
Theme URI: http://vikiworks.com
Version: 1.1
Author: yichi
Author URI: http://vikiworks.com
*/


/*/////////////////////////////////////////
///////////////// OVERRAL ////////////////
/////////////////////////////////////////*/	
html { margin:0; padding:0; font: 76%/130% "Lucida Grande", Arial, Verdana, sans-serif; 	color:#a6a6a6; background:#15191c url(images/bg.jpg) no-repeat left top; }
a	{ outline:none;  text-decoration:none; }
a:link, a:visited { color:#ccc; }
a:hover { color:#fff; }
.clear { clear:both; }
.center { text-align:center; }
.pagetitle { margin:0; padding:5px 5px 20px 20px; font:16px arial,verdana;color:#679ef1; background:url(images/exclamation.gif) no-repeat 0 22%; }
p { line-height:20px; }
ul { list-style:none; margin:0; padding:0; }	
	
code { font:.9em Arial, "Courier New"; color:#fff; padding:8px; background:#b28327; display:block; border:1px solid #daac52; }
blockquote { color: #679ef1; padding-top: 5px; padding-bottom: 5px; background: url(images/close-quote.gif) no-repeat right bottom; }
blockquote p { padding-left: 10px; text-indent: -18px; }
blockquote p:first-letter { background: url(images/open-quote.gif) no-repeat left top; padding-left: 18px; padding-top: 8px; }
blockquote p ~ p:first-letter { font-size:12px; background: none; }
.pullquote { padding: 6px; float: right; width: 180px; margin:10px 0 10px 10px; border-top:1px solid #005b8e; border-bottom:1px solid #005b8e; text-align: center; line-height: 22px; font-family: georgia, verdana, Arial, Helvetica, sans-serif; text-transform:none; color:#ccc; }

/*/////////////////////////////////////////
//////////// MAIN STRUCTURE /////////////
/////////////////////////////////////////*/	
div#container { text-align:left;	width:1000px;	padding:0; margin:0 auto; margin-top:130px; 	margin-left:110px; }	
div#wrapper { width:100%; overflow:auto; }
div#content { width:575px; float:left; padding:10px 8px 20px 12px; background:#121314 url(images/wrapper-corner.gif) no-repeat left top; }


/*/////////////////////////////////////////
///////////////// HEADER ////////////////
/////////////////////////////////////////*/
div#header { margin:0; padding:0; }
div#header h1 { font:26px times; margin:0; }
div#header h1 a:link, div#header h1 a:visited { color:#eee; display:block; width:200px; height:100px; }
div#header h1 a:hover { color:#f36; }	
div#header h1 small { display:block; color:#666; font-size:10px; text-transform:uppercase; letter-spacing:-1px; margin:10px 0 0 0; }	


/*/////////////////////////////////////////
////////////////		MENU     ////////////////
/////////////////////////////////////////*/
ul#menu { float:right; }
ul#menu li#rss { text-indent:-9000em; width:51px; height:54px; display:block; padding:0 10px 0 30px; margin:0; }
ul#menu li#rss a { background:url(images/feed.gif) no-repeat; display:block; width:51px; height:54px; position:relative; padding:0; margin:40px 0 0; }
ul#menu li#rss a:hover { background:url(images/feedover.gif) no-repeat; }	

	
/*/////////////////////////////////////////
///////////////   POST  ////////////////
/////////////////////////////////////////*/
div.post { margin-bottom:  10px; padding-bottom:20px; background:url(images/separator.gif) no-repeat bottom left; }
div.post h2  { font:1.5em Arial, verdana; letter-spacing:-1px; margin:0px; text-transform: capitalize; }
div.post h2 a:link, a:visited { color:#679ef1; text-decoration:none; }
div.post h2 a:hover { color:#62c0fb; border-bottom:1px dotted #444; }
div.post small { font-size:85%; font-family:arial; letter-spacing:normal; display:block; }			
div.post small a { color:#eee; }
div.post small a:hover { color:#ccc; }
	
div.post div.entry ul{ margin:10px; padding:5px; }
div.post div.entry ul li { background:url(images/icon_miniarrow.gif) no-repeat 0 50%; padding:2px 0px 2px 10px; }		
div.post div.entry ol { list-style:decimal-leading-zero; }

div.post div.entry a { text-decoration:none; font-weight:bold; }
div.post div.entry a:link, div.post div.entry a:visited { color:#fff; }
div.post div.entry a:hover { color:#679ef1; }

div.post img { border:0px none; }
div.post img:hover { border:0px none; }
div.post img.wp-smiley  { border:0px none; margin:0; }
.post-comments { background: url(images/icon-comment.gif) no-repeat 0 50%; padding-left: 13px; margin:0; }


/*/////////////////////////////////////////
///////////////// COMMENTS ////////////////
/////////////////////////////////////////*/
h3#comments, h3#respond { font-weight:normal; font:bold 12px arial, verdana; text-transform:uppercase; letter-spacing:-1px; color:#bdbd9f;padding:0 0 0 25px;
	background-position:left; background-repeat:no-repeat; }
h3#comments { background-image:url(images/icon_comments.gif); }
h3#respond  {background-image:url(images/icon_addcomment.gif); }	

ol.commentlist { list-style:none; margin:0; padding:0; }
ol.commentlist cite { text-transform:none; font-style:normal; }

ol.commentlist li { border-bottom:1px solid #666; padding:10px; }
ol.commentlist h5 { font-size:11px; margin:0; padding:0; }	
ol.commentlist h5 a:link, a:visited { color:#679ef1; }
ol.commentlist h5 a:hover { color:#eee; }
ol.commentlist h5 small { display:block; }	
ol.commentlist li { background-color:#1e2224; }
ol.commentlist li.alt { background-color:#292d30; }
ol.commentlist li span.moderate { background:url(images/icon_cursor.gif) no-repeat; padding:2px 0px 2px 20px; color:#f30; }
	
#commentform input#author,
#commentform input#email,
#commentform input#url { background:#fff url(images/icon_form.gif) no-repeat; border:1px solid #fff; padding:4px 4px 4px 30px; width:210px; }

#commentform input#author	{ background-position:3px -3px; }
#commentform input#email	{ background-position:3px -33px; }
#commentform input#url { background-position:3px -63px; }
	
#commentform #comment { width:99%; font: 16px/18px Arial, Verdana, sans-serif; background-color:#eee; border:1px solid #CCC; color:#333; }		

/*/////////////////////////////////////////
///////////////// SIDEBARS ////////////////
/////////////////////////////////////////*/
div#sidebar { width:400px; float:left;  }
div#sidebar a:link,div#sidebar a:visited { color:#eee; }
div#sidebar a:hover { color:#679ef1; }	
div#sidebar a img { border:none; }	
div#sidebar h2 { font-size:12px; color:#333; text-align:center;	text-transform: uppercase; }


#sidebar .cat { font-size:11px; width:200px; float:right; background:#0b3262 url(images/category-bg.gif) no-repeat bottom right; }
#sidebar .cat h2 {margin: 5px; font:bold 12px Arial, Helvetica, sans-serif; text-transform:uppercase; 
color:#679ef1; height:30px; }
#sidebar .cat ul { margin: 0px; padding: 0 0 10px 0; }
#sidebar .cat li { margin: 0px; padding: 5px 5px 5px 18px; list-style-type: none; }
#sidebar .cat li a { text-decoration:none; border-bottom:1px dotted #225999; }
#sidebar .cat li a:hover { text-decoration:none; border-bottom:1px solid #ccc; }


#sidebar .recent-posts { font:11px arial; width: 200px; float: left; background:#005b8e; }
#sidebar .recent-posts h2 { margin: 5px; font:bold 12px Arial, Helvetica, sans-serif; text-transform:uppercase; 
color:#fff; }
#sidebar .recent-posts ul { margin: 0px; padding: 0 0 10px 0; }
#sidebar .recent-posts li { margin: 0px; padding: 5px 5px 5px 18px; list-style-type: none; background:url(images/left-folder.gif) no-repeat 5px 50%; }
#sidebar .recent-posts li a { text-decoration:none; border-bottom:1px dotted #0a72ac; }
#sidebar .recent-posts li a:hover { text-decoration:none; border-bottom:1px solid #eee; }


#sidebar .monthly { font-size:11px; width:200px; float:right; background:#0b3262 url(images/archive-bg.gif) no-repeat bottom right; }
#sidebar .monthly h2 { margin: 5px; font:bold 12px Arial, Helvetica, sans-serif; text-transform:uppercase; 
color:#679ef1;}
#sidebar .monthly ul { margin: 0px; padding: 0 0 10px 0; }
#sidebar .monthly li { margin: 0px; padding: 5px 5px 5px 18px; list-style-type: none; }
#sidebar .monthly li a { text-decoration:none; border-bottom:1px dotted #225999; }
#sidebar .monthly li a:hover { text-decoration:none; border-bottom:1px solid #ccc; }


#sidebar .delicious  { font:11px arial; width: 200px; float: left; background:#005b8e url(images/bottoml.gif) no-repeat bottom left; padding-bottom:45px; }
#sidebar .delicious h2 { margin: 5px; font:bold 12px Arial, Helvetica, sans-serif; text-transform:uppercase; 
color:#eee; }
#sidebar .delicious h2.delicious-banner  { display:none; }
#sidebar .delicious ul {	list-style-type:none; margin:1em 0 1em 0; }
#sidebar .delicious li { list-style-type:none; margin:0; padding:5px 5px 5px 18px; background:url(images/left-dot.gif) no-repeat 5px 50%; }
#sidebar .delicious a { text-decoration:none; border-bottom:1px dotted #0a72ac; }
#sidebar .delicious a:hover { text-decoration:none; border-bottom:1px solid #ccc; }


#sidebar .sponsor { font-size:11px; width:200px; float:right; background:#0b3262 url(images/bottomr.gif) no-repeat bottom right; padding-bottom:65px; }
#sidebar .sponsor h2 { margin: 5px; font:bold 12px Arial, Helvetica, sans-serif; text-transform:uppercase; 
color:#679ef1; }
#sidebar .sponsor ul { margin: 0px; padding: 0 0 10px 0; }
#sidebar .sponsor li { margin: 0px; padding: 5px 5px 5px 18px; list-style-type: none; }
#sidebar .sponsor li a { text-decoration:none; border-bottom:1px dotted #225999; }
#sidebar .sponsor li a:hover { text-decoration:none; border-bottom:1px solid #ccc; }	


/*/////////////////////////////////////////
///////////////// TOPNAV ////////////////
/////////////////////////////////////////*/
div#sidebar div#about { background:#111e2d url(images/wrapper-corner2.gif) no-repeat right top; padding:5px; }		
div#about ul { margin:4px 0; }	
div#about ul li { padding:4px 0px; display:inline; font:10px  arial; }
div#about ul li a { text-transform:uppercase; padding:4px 5px;font:10px  arial; margin:0px 3px; }	
div#about ul li a:link,div#about ul li a:visited { color:#ccc; }
div#about ul li a:hover { color:#eee; background:#597692; }	
	
/*/////////////////////////////////////////
///////////////// UTW TAGS ////////////////
/////////////////////////////////////////*/
div#utwtag  { font-family:arial; padding:10px 10px 30px 10px; background:#111e2d url(images/icon-tags.gif) no-repeat right bottom; }
div#utwtag a { text-decoration:none; border-bottom:1px dotted #333; }
div#utwtag a:hover { color:#fff; border-bottom:1px dotted #333; }
	
/*/////////////////////////////////////////
///////////////// TWITTER ////////////////
/////////////////////////////////////////*/
div#twitter  { background:#193349 url(images/twitter.png) no-repeat left top; min-height:75px !important; height:75px; }
div#twitter li { font-family:georgia, times; padding: 10px 8px 5px 5px; margin:0; width:300px; color:#ebbb86; float:right; }
div#twitter a { color:#eee; text-decoration:none; }
div#twitter a:hover { color:#ebbb86; }
div#twitter a.mini_rss { float:right; margin-right:35px; margin-top:120px; text-indent:-9000em; width:20px; height:20px; display:block; background-image:url(images/icon_rss.gif);	 border:0; }
div#sidebar div#twitter a.mini_rss:link, div#sidebar div#twitter a.mini_rss:visited { background-position:0 0; }
div#sidebar div#twitter a.mini_rss:hover { background-position:0 -20px; }

/*/////////////////////////////////////////
///////////////// FLICKR ////////////////
/////////////////////////////////////////*/
div#flickr  { background:#0f1721; min-height:120px !important; height:120px; }
div#flickr a.mini_rss { float:right; margin-right:10px; margin-top:5px; text-indent:-9000em; width:20px; height:20px; display:block; background-image:url(images/icon_rss.gif);	 border:0; }
div#sidebar div#flickr a.mini_rss:link, div#sidebar div#twitter a.mini_rss:visited { background-position:0 0; }
div#sidebar div#flickr a.mini_rss:hover { background-position:0 -20px; }	
	
	
/*/////////////////////////////////////////
///////////////// SEARCH FORM (disabled) ////////////////
/////////////////////////////////////////*/
	
.searchform { margin:10px auto; background-color:#333; width:400px; margin:0; padding:0; }	
.searchform div { padding:5px 0; text-align:center; }		
			
.searchform label { background-image:url(images/icon_search.gif); background-position:0 0; background-repeat:no-repeat; text-indent:-9000em;
	padding:2px 0 10px 25px; height:14px; }		

.searchform #s { font:bold 10px verdana, arial; padding:2px; width:72%; background:#999; }		
.searchform img { border:none; padding:0; margin:0; }
.searchform .searchsubmit { margin:0 5px 0 0; padding:0; width:50px; height:21px; position:relative; float:right; }	

/*/////////////////////////////////////////
///////////////// FOOTER ////////////////
/////////////////////////////////////////*/
#sbm { clear:both; padding:10px 5px 0px 15px; font-size:10px; }
#sbm a { color: #ccc; text-decoration:none; border-bottom:1px dotted #333; }
#sbm a:hover { color: #5b9ef1; border-bottom:1px solid #ccc; }


/*/////////////////////////////////////////
///////////////// FEED COUNTS ////////////////
/////////////////////////////////////////*/
.feedcountdiv { float:left; font-family: arial; padding:0; margin-left:15px; background:url(images/rss1616.gif) no-repeat 0 50%; }
.feedcountdiv a { text-decoration:none; color:#f89838; border-bottom:1px dotted #ccc; }
.feedcountdiv a:hover { text-decoration:none; color:#fff; border-bottom:2px solid #f89838; }
.subscribers { float:left; margin-right:4px; color:#f99a39; margin-top:-3px; margin-left:20px; font:bold 20px Arial, Helvetica, sans-serif; }

/*/////////////////////////////////////////
///////////////// BLORGOLL  PAGE ////////////////
/////////////////////////////////////////*/
#linkpage { margin:0; padding:0; clear:both;}
#linkpage h2 { font:16px arial,verdana; color:#679ef1; }
#linkpage ul li { list-style-type:none; margin:10px 4px 10px 4px; padding:0; width:100%; float:left; }
#linkpage ul li ul li { margin:3px 0 0 3px; width:32%; float:left; list-style:none; line-height:25px; }
#linkpage ul li ul li:hover { background-color:#27466a; color:#fff; }
#linkpage ul li ul li a { padding-left:5px; color:#666; text-decoration:none; font-size:11px; display:block; }
#linkpage ul li ul li a:hover { color:#fff; }


/*/////////////////////////////////////////
///////////////// SLIDING DOOR BUTTON ////////////////
/////////////////////////////////////////*/	
button { border:0; cursor:pointer; font-weight:bold; padding:0 20px 0 0; text-align:center; width:auto; overflow:visible; }
button span { position:relative; display:block; white-space:nowrap; padding:0 0 0 20px; }
button.submitBtn { background:url(images/btn_blue_right.gif) right no-repeat; font-size:1.2em; }
button.submitBtn span { height:30px; line-height:30px; background:url(images/btn_blue_left.gif) left no-repeat; color:#fff; }
button.submitBtn:hover { background:url(images/btn_blue_right_hover.gif) right no-repeat; }
button.submitBtn:hover span { background:url(images/btn_blue_left_hover.gif) left no-repeat; }

<?php
/*
Plugin Name: Sociable
Plugin URI: http://yoast.com/wordpress/sociable/
Description: Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites. 
Version: 3.3.7
Author: Joost de Valk
Author URI: http://yoast.com/

Copyright 2006 Peter Harkins (ph@malaprop.org)
Copyright 2008-2009 Joost de Valk (joost@yoast.com)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/**
 * Determine the location
 */
$sociablepluginpath = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)).'/';

/**
 * This function makes sure Sociable is able to load the different language files from
 * the i18n subfolder of the Sociable directory
 **/
function sociable_init_locale(){
	global $sociablepluginpath;
	load_plugin_textdomain('sociable', false, 'i18n');
}
add_filter('init', 'sociable_init_locale');


/**
 * @global array Contains all sites that Sociable supports, array items have 4 keys:
 * required favicon - the favicon for the site, a 16x16px PNG, to be found in the images subdirectory
 * required url - submit URL of the site, containing at least PERMALINK
 * description - description, used in several spots, but most notably as alt and title text for the link
 * awesm_channel - the channel awe.sm files the traffic under
 */
$sociable_known_sites = Array(

	'BarraPunto' => Array(
		'favicon' => 'barrapunto.png',
		'url' => 'http://barrapunto.com/submit.pl?subj=TITLE&amp;story=PERMALINK',
	),
	
	'Bitacoras.com' => Array(
		'favicon' => 'bitacoras.png',
		'url' => 'http://bitacoras.com/anotaciones/PERMALINK',
	),
	
	'BlinkList' => Array(
		'favicon' => 'blinklist.png',
		'url' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=PERMALINK&amp;Title=TITLE',
	),

	'BlogMemes Fr' => Array(
		'favicon' => 'blogmemes.png',
		'url' => 'http://www.blogmemes.fr/post.php?url=PERMALINK&amp;title=TITLE',
	),

	'BlogMemes Sp' => Array(
		'favicon' => 'blogmemes.png',
		'url' => 'http://www.blogmemes.com/post.php?url=PERMALINK&amp;title=TITLE',
	),

	'blogmarks' => Array(
		'favicon' => 'blogmarks.png',
		'url' => 'http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=PERMALINK&amp;title=TITLE',
	),

	'Blogosphere News' => Array(
		'favicon' => 'blogospherenews.png',
		'url' => 'http://www.blogospherenews.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'blogtercimlap' => Array(
		'favicon' => 'blogter.png',
		'url' => 'http://cimlap.blogter.hu/index.php?action=suggest_link&amp;title=TITLE&amp;url=PERMALINK',
	),

	'Faves' => Array(
		'favicon' => 'bluedot.png',
		'url' => 'http://faves.com/Authoring.aspx?u=PERMALINK&amp;title=TITLE',
	),

	'co.mments' => Array(
		'favicon' => 'co.mments.png',
		'url' => 'http://co.mments.com/track?url=PERMALINK&amp;title=TITLE',
	),

	'connotea' => Array(
		'favicon' => 'connotea.png',
		'url' => 'http://www.connotea.org/addpopup?continue=confirm&amp;uri=PERMALINK&amp;title=TITLE&amp;description=EXCERPT',
	),

	'Current' => Array(
		'favicon' => 'current.png',
		'url' => 'http://current.com/clipper.htm?url=PERMALINK&amp;title=TITLE'
	),
	
	'del.icio.us' => Array(
		'favicon' => 'delicious.png',
		'url' => 'http://delicious.com/post?url=PERMALINK&amp;title=TITLE&amp;notes=EXCERPT',
	),

	'Design Float' => Array(
		'favicon' => 'designfloat.png',
		'url' => 'http://www.designfloat.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'Digg' => Array(
		'favicon' => 'digg.png',
		'url' => 'http://digg.com/submit?phase=2&amp;url=PERMALINK&amp;title=TITLE&amp;bodytext=EXCERPT',
		'description' => 'Digg',
	),

	'Diigo' => Array(
		'favicon' => 'diigo.png',
		'url' => 'http://www.diigo.com/post?url=PERMALINK&amp;title=TITLE',
	),

	'DotNetKicks' => Array(
		'favicon' => 'dotnetkicks.png',
		'url' => 'http://www.dotnetkicks.com/kick/?url=PERMALINK&amp;title=TITLE',
	),

	'DZone' => Array(
		'favicon' => 'dzone.png',
		'url' => 'http://www.dzone.com/links/add.html?url=PERMALINK&amp;title=TITLE',
	),

	'eKudos' => Array(
		'favicon' => 'ekudos.png',
		'url' => 'http://www.ekudos.nl/artikel/nieuw?url=PERMALINK&amp;title=TITLE&amp;desc=EXCERPT',
	),

	'email' => Array(
		'favicon' => 'email_link.png',
		'url' => 'mailto:?subject=TITLE&amp;body=PERMALINK',
		'awesm_channel' => 'mailto',
		'description' => __('E-mail this story to a friend!','sociable'),
	),

	'Facebook' => Array(
		'favicon' => 'facebook.png',
		'awesm_channel' => 'facebook-post',
		'url' => 'http://www.facebook.com/share.php?u=PERMALINK&amp;t=TITLE',
	),

	'Fark' => Array(
		'favicon' => 'fark.png',
		'url' => 'http://cgi.fark.com/cgi/fark/farkit.pl?h=TITLE&amp;u=PERMALINK',
	),

	'Fleck' => Array(
		'favicon' => 'fleck.png',
		'url' => 'http://beta3.fleck.com/bookmarklet.php?url=PERMALINK&amp;title=TITLE',
	),

	'FriendFeed' => Array(
		'favicon' => 'friendfeed.png',
		'url' => 'http://www.friendfeed.com/share?title=TITLE&amp;link=PERMALINK',
	),

	'FSDaily' => Array(
		'favicon' => 'fsdaily.png',
		'url' => 'http://www.fsdaily.com/submit?url=PERMALINK&amp;title=TITLE',
	),

	'Global Grind' => Array (
		'favicon' => 'globalgrind.png',
		'url' => 'http://globalgrind.com/submission/submit.aspx?url=PERMALINK&amp;type=Article&amp;title=TITLE'
	),
	
	'Google' => Array (
		'favicon' => 'googlebookmark.png',
		'url' => 'http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=PERMALINK&amp;title=TITLE&amp;annotation=EXCERPT',
		'description' => 'Google Bookmarks'
	),
	
	'Gwar' => Array(
		'favicon' => 'gwar.png',
		'url' => 'http://www.gwar.pl/DodajGwar.html?u=PERMALINK',
	),

	'HackerNews' => Array(
		'favicon' => 'hackernews.png',
		'url' => 'http://news.ycombinator.com/submitlink?u=PERMALINK&amp;t=TITLE',
	),

	'Haohao' => Array(
		'favicon' => 'haohao.png',
		'url' => 'http://www.haohaoreport.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'HealthRanker' => Array(
		'favicon' => 'healthranker.png',
		'url' => 'http://healthranker.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'HelloTxt' => Array(
        'favicon' => 'hellotxt.png',
        'url' => 'http://hellotxt.com/?status=TITLE+PERMALINK',
    ),

	'Hemidemi' => Array(
		'favicon' => 'hemidemi.png',
		'url' => 'http://www.hemidemi.com/user_bookmark/new?title=TITLE&amp;url=PERMALINK',
	),

	'Hyves' => Array(
		'favicon' => 'hyves.png',
		'url' => 'http://www.hyves.nl/profilemanage/add/tips/?name=TITLE&amp;text=EXCERPT+PERMALINK&amp;rating=5',
	),

	'Identi.ca' => Array(
		'favicon' => 'identica.png',
		'url' => 'http://identi.ca/notice/new?status_textarea=PERMALINK',
	),

	'IndianPad' => Array(
		'favicon' => 'indianpad.png',
		'url' => 'http://www.indianpad.com/submit.php?url=PERMALINK',
	),

	'Internetmedia' => Array(
		'favicon' => 'im.png',
		'url' => 'http://internetmedia.hu/submit.php?url=PERMALINK'
	),

	'Kirtsy' => Array(
		'favicon' => 'kirtsy.png',
		'url' => 'http://www.kirtsy.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'laaik.it' => Array(
		'favicon' => 'laaikit.png',
		'url' => 'http://laaik.it/NewStoryCompact.aspx?uri=PERMALINK&amp;headline=TITLE&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12',
	),

	'LinkArena' => Array(
		'favicon' => 'linkarena.png',
		'url' => 'http://linkarena.com/bookmarks/addlink/?url=PERMALINK&amp;title=TITLE',
	),
	
	'LinkaGoGo' => Array(
		'favicon' => 'linkagogo.png',
		'url' => 'http://www.linkagogo.com/go/AddNoPopup?url=PERMALINK&amp;title=TITLE',
	),

	'LinkedIn' => Array(
		'favicon' => 'linkedin.png',
		'url' => 'http://www.linkedin.com/shareArticle?mini=true&amp;url=PERMALINK&amp;title=TITLE&amp;source=BLOGNAME&amp;summary=EXCERPT',
	),

	'Linkter' => Array(
		'favicon' => 'linkter.png',
		'url' => 'http://www.linkter.hu/index.php?action=suggest_link&amp;url=PERMALINK&amp;title=TITLE',
	),
	
	'Live' => Array(
		'favicon' => 'live.png',
		'url' => 'https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=PERMALINK&amp;title=TITLE',
	),

	'Meneame' => Array(
		'favicon' => 'meneame.png',
		'url' => 'http://meneame.net/submit.php?url=PERMALINK',
	),
	
	'MisterWong' => Array(
		'favicon' => 'misterwong.png',
		'url' => 'http://www.mister-wong.com/addurl/?bm_url=PERMALINK&amp;bm_description=TITLE&amp;plugin=soc',
	),

	'MisterWong.DE' => Array(
		'favicon' => 'misterwong.png',
		'url' => 'http://www.mister-wong.de/addurl/?bm_url=PERMALINK&amp;bm_description=TITLE&amp;plugin=soc',
	),
	
	'Mixx' => Array(
		'favicon' => 'mixx.png',
		'url' => 'http://www.mixx.com/submit?page_url=PERMALINK&amp;title=TITLE',
	),
	
	'muti' => Array(
		'favicon' => 'muti.png',
		'url' => 'http://www.muti.co.za/submit?url=PERMALINK&amp;title=TITLE',
	),
	
	'MyShare' => Array(
		'favicon' => 'myshare.png',
		'url' => 'http://myshare.url.com.tw/index.php?func=newurl&amp;url=PERMALINK&amp;desc=TITLE',
	),

	'MySpace' => Array(
		'favicon' => 'myspace.png',
		'awesm_channel' => 'myspace',
		'url' => 'http://www.myspace.com/Modules/PostTo/Pages/?u=PERMALINK&amp;t=TITLE',
	),

	'MSNReporter' => Array(
		'favicon' => 'msnreporter.png',
		'url' => 'http://reporter.nl.msn.com/?fn=contribute&amp;Title=TITLE&amp;URL=PERMALINK&amp;cat_id=6&amp;tag_id=31&amp;Remark=EXCERPT',
		'description' => 'MSN Reporter'
	),
	
	'N4G' => Array(
		'favicon' => 'n4g.png',
		'url' => 'http://www.n4g.com/tips.aspx?url=PERMALINK&amp;title=TITLE',
	),
	
	'Netvibes' => Array(
		'favicon' => 'netvibes.png',
		'url' =>	'http://www.netvibes.com/share?title=TITLE&amp;url=PERMALINK',
	),
		
	'NewsVine' => Array(
		'favicon' => 'newsvine.png',
		'url' => 'http://www.newsvine.com/_tools/seed&amp;save?u=PERMALINK&amp;h=TITLE',
	),

	'Netvouz' => Array(
		'favicon' => 'netvouz.png',
		'url' => 'http://www.netvouz.com/action/submitBookmark?url=PERMALINK&amp;title=TITLE&amp;popup=no',
	),

	'NuJIJ' => Array(
		'favicon' => 'nujij.png',
		'url' => 'http://nujij.nl/jij.lynkx?t=TITLE&amp;u=PERMALINK&amp;b=EXCERPT',
	),
	
	'Ping.fm' => Array(
		'favicon' => 'ping.png',
		'awesm_channel' => 'pingfm',
		'url' => 'http://ping.fm/ref/?link=PERMALINK&amp;title=TITLE&amp;body=EXCERPT',
	),

	'Posterous' => Array(
		'favicon' => 'posterous.png',
		'url' => 'http://posterous.com/share?linkto=PERMALINK&amp;title=TITLE&amp;selection=EXCERPT',
	),
	
	'ppnow' => Array(
		'favicon' => 'ppnow.png',
		'url' => 'http://www.ppnow.net/submit.php?url=PERMALINK',
	),
	
	'PDF' => Array(
		'favicon' => 'pdf.png',
		'url' => 'http://www.printfriendly.com/print?url=PERMALINK&amp;partner=sociable',
		'description' => __('Turn this article into a PDF!', 'sociable'),
	),
	
	'Print' => Array(
		'favicon' => 'printfriendly.png',
		'url' => 'http://www.printfriendly.com/print?url=PERMALINK&amp;partner=sociable',
		'description' => __('Print this article!', 'sociable'),
	),
	
	'Propeller' => Array(
		'favicon' => 'propeller.png',
		'url' => 'http://www.propeller.com/submit/?url=PERMALINK',
	),

	'Ratimarks' => Array(
		'favicon' => 'ratimarks.png',
		'url' => 'http://ratimarks.org/bookmarks.php/?action=add&address=PERMALINK&amp;title=TITLE',
	),

	'Rec6' => Array(
		'favicon' => 'rec6.png',
		'url' => 'http://rec6.via6.com/link.php?url=PERMALINK&amp;=TITLE',
	),

	'Reddit' => Array(
		'favicon' => 'reddit.png',
		'url' => 'http://reddit.com/submit?url=PERMALINK&amp;title=TITLE',
	),

	'RSS' => Array(
		'favicon' => 'rss.png',
		'url' => 'FEEDLINK',
	),
	
	'Scoopeo' => Array(
		'favicon' => 'scoopeo.png',
		'url' => 'http://www.scoopeo.com/scoop/new?newurl=PERMALINK&amp;title=TITLE',
	),	

	'Segnalo' => Array(
		'favicon' => 'segnalo.png',
		'url' => 'http://segnalo.alice.it/post.html.php?url=PERMALINK&amp;title=TITLE',
	),

	'Simpy' => Array(
		'favicon' => 'simpy.png',
		'url' => 'http://www.simpy.com/simpy/LinkAdd.do?href=PERMALINK&amp;title=TITLE',
	),

	'Slashdot' => Array(
		'favicon' => 'slashdot.png',
		'url' => 'http://slashdot.org/bookmark.pl?title=TITLE&amp;url=PERMALINK',
	),

	'Socialogs' => Array(
		'favicon' => 'socialogs.png',
		'url' => 'http://socialogs.com/add_story.php?story_url=PERMALINK&amp;story_title=TITLE',
	),
	
	'SphereIt' => Array(
		'favicon' => 'sphere.png',
		'url' => 'http://www.sphere.com/search?q=sphereit:PERMALINK&amp;title=TITLE',
	),

	'Sphinn' => Array(
		'favicon' => 'sphinn.png',
		'url' => 'http://sphinn.com/submit.php?url=PERMALINK&amp;title=TITLE',
	),

	'StumbleUpon' => Array(
		'favicon' => 'stumbleupon.png',
		'url' => 'http://www.stumbleupon.com/submit?url=PERMALINK&amp;title=TITLE',
	),

	'Symbaloo' => Array(
		'favicon' => 'symbaloo.png',
		'url' => 'http://www.symbaloo.com/nl/add/url=PERMALINK&amp;title=TITLE&amp;icon=http%3A//static01.symbaloo.com/_img/favicon.png',
	),
	
	'Techmeme' => Array( 
		'favicon' => 'techmeme.png',
		'awesm_channel' => 'twitter-techmeme', 
		'url' => 'http://twitter.com/home/?status=tip%20@Techmeme%20PERMALINK%20TITLE', 
		'description' => 'Suggest to Techmeme via Twitter'
	), 

	'Technorati' => Array(
		'favicon' => 'technorati.png',
		'url' => 'http://technorati.com/faves?add=PERMALINK',
	),

	'ThisNext' => Array(
		'favicon' => 'thisnext.png',
		'url' => 'http://www.thisnext.com/pick/new/submit/sociable/?url=PERMALINK&amp;name=TITLE',
	),

	'Tipd' => Array(
		'favicon' => 'tipd.png',
		'url' => 'http://tipd.com/submit.php?url=PERMALINK',
	),
	
	'Tumblr' => Array(
		'favicon' => 'tumblr.png',
		'url' => 'http://www.tumblr.com/share?v=3&amp;u=PERMALINK&amp;t=TITLE&amp;s=EXCERPT',
	),
	
	'Twitter' => Array(
		'favicon' => 'twitter.png',
		'awesm_channel' => 'twitter',
		'url' => 'http://twitter.com/home?status=TITLE%20-%20PERMALINK',
	),

	'Upnews' => Array(
			'favicon' => 'upnews.png',
			'url' => 'http://www.upnews.it/submit?url=PERMALINK&amp;title=TITLE',
	),
	
	'Webnews.de' => Array(
        'favicon' => 'webnews.png',
        'url' => 'http://www.webnews.de/einstellen?url=PERMALINK&amp;title=TITLE',
    ),

	'Webride' => Array(
		'favicon' => 'webride.png',
		'url' => 'http://webride.org/discuss/split.php?uri=PERMALINK&amp;title=TITLE',
	),

	'Wikio' => Array(
		'favicon' => 'wikio.png',
		'url' => 'http://www.wikio.com/vote?url=PERMALINK',
	),

	'Wikio FR' => Array(
		'favicon' => 'wikio.png',
		'url' => 'http://www.wikio.fr/vote?url=PERMALINK',
	),

	'Wikio IT' => Array(
		'favicon' => 'wikio.png',
		'url' => 'http://www.wikio.it/vote?url=PERMALINK',
	),
	
	'Wists' => Array(
		'favicon' => 'wists.png',
		'url' => 'http://wists.com/s.php?c=&amp;r=PERMALINK&amp;title=TITLE',
		'class' => 'wists',
	),

	'Wykop' => Array(
		'favicon' => 'wykop.png',
		'url' => 'http://www.wykop.pl/dodaj?url=PERMALINK',
	),

	'Xerpi' => Array(
		'favicon' => 'xerpi.png',
		'url' => 'http://www.xerpi.com/block/add_link_from_extension?url=PERMALINK&amp;title=TITLE',
	),

	'YahooBuzz' => Array(
		'favicon' => 'yahoobuzz.png',
		'url' => 'http://buzz.yahoo.com/submit/?submitUrl=PERMALINK&amp;submitHeadline=TITLE&amp;submitSummary=EXCERPT&amp;submitCategory=science&amp;submitAssetType=text',
		'description' => 'Yahoo! Buzz',
	),
	
	'Yahoo! Bookmarks' => Array(
		'favicon' => 'yahoomyweb.png',
		'url' => 'http://bookmarks.yahoo.com/toolbar/savebm?u=PERMALINK&amp;t=TITLE&opener=bm&amp;ei=UTF-8&amp;d=EXCERPT',
	),

	'Yigg' => Array(
		'favicon' => 'yiggit.png',
		'url' => 'http://yigg.de/neu?exturl=PERMALINK&amp;exttitle=TITLE',
	 ),
);

/**
 * Returns the Sociable links list.
 *
 * @param array $display optional list of links to return in HTML
 * @global $sociable_known_sites array the list of sites that Sociable uses
 * @global $sociablepluginpath string the path to the plugin
 * @global $wp_query object the WordPress query object
 * @return string $html HTML for links list.
 */
function sociable_html($display=array()) {
	global $sociable_known_sites, $sociablepluginpath, $wp_query; 

	$sociableooffmeta = get_post_meta($post->ID,'sociableoff',true);
	if ($sociableooffmeta == "true") {
		return "";
	}

	$active_sites = get_option('sociable_active_sites');

	// If a path is specified where Sociable should find its images, use that, otherwise, 
	// set the image path to the images subdirectory of the Sociable plugin.
	// Image files need to be png's.
	$imagepath = get_option('sociable_imagedir');
	if ($imagepath == "")
		$imagepath = $sociablepluginpath.'images/';		

	// if no sites are specified, display all active
	// have to check $active_sites has content because WP
	// won't save an empty array as an option
	if (empty($display) and $active_sites)
		$display = $active_sites;
	// if no sites are active, display nothing
	if (empty($display))
		return "";

	// Load the post's and blog's data
	$blogname 	= urlencode(get_bloginfo('name')." ".get_bloginfo('description'));
	$blogrss	= get_bloginfo('rss2_url'); 
	$post 		= $wp_query->post;
	
	// Grab the excerpt, if there is no excerpt, create one
	$excerpt	= urlencode(strip_tags(strip_shortcodes($post->post_excerpt)));
	if ($excerpt == "") {
		$excerpt = urlencode(substr(strip_tags(strip_shortcodes($post->post_content)),0,250));
	}
	// Clean the excerpt for use with links
	$excerpt	= str_replace('+','%20',$excerpt);
	$permalink 	= urlencode(get_permalink($post->ID));
	$title 		= str_replace('+','%20',urlencode($post->post_title));
	
	$rss 		= urlencode(get_bloginfo('ref_url'));

	// Start preparing the output
	$html = "\n<div class=\"sociable\">\n";
	
	// If a tagline is set, display it above the links list
	$tagline = get_option("sociable_tagline");
	if ($tagline != "") {
		$html .= "<div class=\"sociable_tagline\">\n";
		$html .= stripslashes($tagline);
		$html .= "\n</div>";
	}
	
	/**
	 * Start the list of links
	 */
	$html .= "\n<ul>\n";

	$i = 0;
	$totalsites = count($display);
	foreach($display as $sitename) {
		/**
		 * If they specify an unknown or inactive site, ignore it.
		 */
		if (!in_array($sitename, $active_sites))
			continue;

		$site = $sociable_known_sites[$sitename];

		$url = $site['url'];
		$url = str_replace('TITLE', $title, $url);
		$url = str_replace('RSS', $rss, $url);
		$url = str_replace('BLOGNAME', $blogname, $url);
		$url = str_replace('EXCERPT', $excerpt, $url);
		$url = str_replace('FEEDLINK', $blogrss, $url);
		
		if (isset($site['description']) && $site['description'] != "") {
			$description = $site['description'];
		} else {
			$description = $sitename;
		}

		if (get_option('sociable_awesmenable') == true &! empty($site['awesm_channel']) ) {
			/**
			 * if awe.sm is enabled and it is an awe.sm supported site, use awe.sm
			 */
			$permalink = str_replace('&', '%26', $permalink); 
			$destination = str_replace('PERMALINK', 'TARGET', $url);
			$destination = str_replace('&amp;', '%26', $destination);
			$channel = urlencode($site['awesm_channel']);

			$parentargument = '';
			if ($_GET['awesm']) {
				/**
				 * if the page was arrived at through an awe.sm URL, make that the parent
				 */ 
				$parent = $_GET['awesm'];
				$parentargument = '&p=' . $parent;
			} 

			if (strpos($channel, 'direct') != false) {
				$url = $sociablepluginpath.'awesmate.php?c='.$channel.'&t='.$permalink.'&d='.$destination.'&dir=true'.$parentargument;
			} else {
				$url = $sociablepluginpath.'awesmate.php?c='.$channel.'&t='.$permalink.'&d='.$destination.$parentargument;	
			}
		} else {
			/**
			 * if awe.sm is not used, simply replace PERMALINK with $permalink
			 */ 
			$url = str_replace('PERMALINK', $permalink, $url);		
		}

		/**
		 * Start building each list item. They're build up separately to allow filtering by other
		 * plugins.
		 * Give the first and last list item in the list an extra class to allow for cool CSS tricks
		 */
		if ($i == 0) {
			$link = '<class="sociablefirst">';
		} else if ($totalsites == ($i+1)) {
			$link = '<class="sociablelast">';
		} else {
			$link = '';
		}
		
		/**
		 * Start building the link, nofollow it to make sure Search engines don't follow it, 
		 * and optionally add target=_blank to open in a new window if that option is set in the 
		 * backend.
		 */
		$link .= "<a rel=\"nofollow\"";
		if (get_option('sociable_usetargetblank')) {
			$link .= "target=\"_blank\"";
		}
		$link .= " href=\"$url\" title=\"$description\">";
		
		/**
		 * If the option to use text links is enabled in the backend, display a text link, otherwise, 
		 * display an image.
		 */
		if (get_option('sociable_usetextlinks')) {
			$link .= $description;
		} else {
			$link .= "<img src=\"".$imagepath.$site['favicon']."\" title=\"$description\" alt=\"$description\" class=\"sociable-hovers";
			if (isset($site['class']) && $site['class'])
				$link .= " sociable_{$site['class']}";
			$link .= "\" />";
		}
		$link .= "</a></li>";
		
		/**
		 * Add the list item to the output HTML, but allow other plugins to filter the content first.
		 * This is used for instance in the Google Analytics for WordPress plugin to track clicks
		 * on Sociable links.
		 */
		$html .= "\t".apply_filters('sociable_link',$link)."\n";
		$i++;
	}

	$html .= "</ul>\n</div>\n";

	return $html;
}

/**
 * Hook the_content to output html if we should display on any page
 */
$sociable_contitionals = get_option('sociable_conditionals');
if (is_array($sociable_contitionals) and in_array(true, $sociable_contitionals)) {
	add_filter('the_content', 'sociable_display_hook');
	add_filter('the_excerpt', 'sociable_display_hook');
	
	/**
	 * Loop through the settings and check whether Sociable should be outputted.
	 */
	function sociable_display_hook($content='') {
		$conditionals = get_option('sociable_conditionals');
		if ((is_home()     and $conditionals['is_home']) or
		    (is_single()   and $conditionals['is_single']) or
		    (is_page()     and $conditionals['is_page']) or
		    (is_category() and $conditionals['is_category']) or
			(is_tag() 	   and $conditionals['is_tag']) or
		    (is_date()     and $conditionals['is_date']) or
			(is_author()   and $conditionals['is_author']) or
		    (is_search()   and $conditionals['is_search'])) {
			$content .= sociable_html();
		} elseif ((is_feed() and $conditionals['is_feed'])) {
			$sociable_html = sociable_html();
			$sociable_html = strip_tags($sociable_html,"<a><img>");
			$content .= $sociable_html . "<br/><br/>";
		}
		return $content;
	}
}

/**
 * Set the default settings on activation on the plugin.
 */
function sociable_activation_hook() {
	return sociable_restore_config(false);
}
register_activation_hook(__FILE__, 'sociable_activation_hook');

/**
 * Add the Sociable menu to the Settings menu
 * @param boolean $force if set to true, force updates the settings.
 */
function sociable_restore_config($force=false) {
	global $sociable_known_sites;

	if ($force or !is_array(get_option('sociable_active_sites')))
		update_option('sociable_active_sites', array(
			'Print',
			'Digg',
			'Sphinn',
			'del.icio.us',
			'Facebook',
			'Mixx',
			'Google',
		));

	if ($force or !is_string(get_option('sociable_tagline')))
		update_option('sociable_tagline', "<strong>" . __("Share and Enjoy:", 'sociable') . "</strong>");

	if ($force or !is_array(get_option('sociable_conditionals')))
		update_option('sociable_conditionals', array(
			'is_home' => False,
			'is_single' => True,
			'is_page' => True,
			'is_category' => False,
			'is_tag' => False,
			'is_date' => False,
			'is_search' => False,
			'is_author' => False,
			'is_feed' => False,
		));

	if ($force or !is_bool(get_option('sociable_usecss')))
		update_option('sociable_usecss', true);
}

/**
 * Add the Sociable menu to the Settings menu
 */
function sociable_admin_menu() {
	add_options_page('Sociable', 'Sociable', 8, 'Sociable', 'sociable_submenu');
}
add_action('admin_menu', 'sociable_admin_menu');

/**
 * Make sure the required javascript files are loaded in the Sociable backend, and that they are only
 * loaded in the Sociable settings page, and nowhere else.
 */
function sociable_admin_js() {
	if (isset($_GET['page']) && $_GET['page'] == 'Sociable') {
		global $sociablepluginpath;
		
		wp_enqueue_script('jquery'); 
		wp_enqueue_script('jquery-ui-core',false,array('jquery')); 
		wp_enqueue_script('jquery-ui-sortable',false,array('jquery','jquery-ui-core')); 
		wp_enqueue_script('sociable-js',$sociablepluginpath.'sociable-admin.js', array('jquery','jquery-ui-core','jquery-ui-sortable')); 
	}
}
add_action('admin_print_scripts', 'sociable_admin_js');

/**
 * Make sure the required stylesheet is loaded in the Sociable backend, and that it is only
 * loaded in the Sociable settings page, and nowhere else.
 */
function sociable_admin_css() {
	global $sociablepluginpath;
	if (isset($_GET['page']) && $_GET['page'] == 'Sociable')
		wp_enqueue_style('sociable-css',$sociablepluginpath.'sociable-admin.css'); 
}
add_action('admin_print_styles', 'sociable_admin_css');

/**
 * If Wists is active, load it's js file. This is the only site that historically has had a JS file
 * in Sociable. For all other sites this has so far been refused.
 */
function sociable_js() {
	if (in_array('Wists', get_option('sociable_active_sites'))) {
		global $sociablepluginpath;
		wp_enqueue_script('sociable-wists',$sociablepluginpath.'wists.js'); 
	}	
}
add_action('wp_print_scripts', 'sociable_js');

/**
 * If the user has the (default) setting of using the Sociable CSS, load it.
 */
function sociable_css() {
	if (get_option('sociable_usecss') == true) {
		global $sociablepluginpath;
		wp_enqueue_style('sociable-front-css',$sociablepluginpath.'sociable.css'); 
	}
}
add_action('wp_print_styles', 'sociable_css');

/**
 * Update message, used in the admin panel to show messages to users.
 */
function sociable_message($message) {
	echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>\n";
}

/**
 * Displays a checkbox that allows users to disable Sociable on a
 * per post or page basis.
 */
function sociable_meta() {
	global $post;
	$sociableoff = false;
	$sociableoffmeta = get_post_meta($post->ID,'sociableoff',true);
	if ($sociableoffmeta == "true") {
		$sociableoff = true;
	}
	?>
	<input type="checkbox" name="sociableoff" <?php if ($sociableoff) { echo 'checked="checked"'; } ?>/> <?php _e('Sociable disabled?','sociable') ?>
	<?php
}

/**
 * Add the checkbox defined above to post and page edit screens.
 */
function sociable_meta_box() {
	add_meta_box('sociable','Sociable','sociable_meta','post');
	add_meta_box('sociable','Sociable','sociable_meta','page');
}
add_action('admin_menu', 'sociable_meta_box');

/**
 * If the post is inserted, delete the sociableoff value and reenable it when its been set.
 */
function sociable_insert_post($pID) {
	delete_post_meta($pID, 'sociableoff');
	update_post_meta($pID, 'sociableoff', ($_POST['sociableoff'] ? 'true' : 'false'));
}
add_action('wp_insert_post', 'sociable_insert_post');

/**
 * Displays the Sociable admin menu, first section (re)stores the settings.
 */
function sociable_submenu() {
	global $sociable_known_sites, $sociable_date, $sociablepluginpath;

	if (isset($_REQUEST['restore']) && $_REQUEST['restore']) {
		check_admin_referer('sociable-config');
		sociable_restore_config(true);
		sociable_message(__("Restored all settings to defaults.", 'sociable'));
	} else if (isset($_REQUEST['save']) && $_REQUEST['save']) {
		check_admin_referer('sociable-config');
		$active_sites = Array();
		if (!$_REQUEST['active_sites'])
			$_REQUEST['active_sites'] = Array();
		foreach($_REQUEST['active_sites'] as $sitename=>$dummy)
			$active_sites[] = $sitename;
		update_option('sociable_active_sites', $active_sites);
		/**
		 * Have to delete and re-add because update doesn't hit the db for identical arrays
		 * (sorting does not influence associated array equality in PHP)
		 */
		delete_option('sociable_active_sites', $active_sites);
		add_option('sociable_active_sites', $active_sites);

		foreach ( array('usetargetblank', 'awesmenable', 'usecss', 'usetextlinks') as $val ) {
			if ( isset($_POST[$val]) && $_POST[$val] )
				update_option('sociable_'.$val,true);
			else
				update_option('sociable_'.$val,false);
		}
		
		foreach ( array('awesmapikey', 'tagline', 'imagedir') as $val ) {
			if ( !$_POST[$val] )
				update_option( 'sociable_'.$val, '');
			else
				update_option( 'sociable_'.$val, $_POST[$val] );
		}
		
		/**
		 * Update conditional displays
		 */
		$conditionals = Array();
		if (!$_POST['conditionals'])
			$_POST['conditionals'] = Array();
		
		$curconditionals = get_option('sociable_conditionals');
		if (!array_key_exists('is_feed',$curconditionals)) {
			$curconditionals['is_feed'] = false;
		}
		foreach($curconditionals as $condition=>$toggled)
			$conditionals[$condition] = array_key_exists($condition, $_POST['conditionals']);
			
		update_option('sociable_conditionals', $conditionals);

		sociable_message(__("Saved changes.", 'sociable'));
	}
	
	/**
	 * Show active sites first and in the right order.
	 */
	$active_sites = get_option('sociable_active_sites');
	$active = Array(); 
	$disabled = $sociable_known_sites;
	foreach( $active_sites as $sitename ) {
		$active[$sitename] = $disabled[$sitename];
		unset($disabled[$sitename]);
	}
	uksort($disabled, "strnatcasecmp");
	
	/**
	 * Display options.
	 */
?>
<form action="<?php echo attribute_escape( $_SERVER['REQUEST_URI'] ); ?>" method="post">
<?php
	if ( function_exists('wp_nonce_field') )
		wp_nonce_field('sociable-config');
?>

<div class="wrap">
	<?php screen_icon(); ?>
	<h2><?php _e("Sociable Options", 'sociable'); ?></h2>
	<table class="form-table">
	<tr>
		<th>
			<?php _e("Sites", "sociable"); ?>:<br/>
			<small><?php _e("Check the sites you want to appear on your site. Drag and drop sites to reorder them.", 'sociable'); ?></small>
		</th>
		<td>
			<div style="width: 100%; height: 100%">
			<ul id="sociable_site_list">
				<?php foreach (array_merge($active, $disabled) as $sitename=>$site) { ?>
					<li id="<?php echo $sitename; ?>"
						class="sociable_site <?php echo (in_array($sitename, $active_sites)) ? "active" : "inactive"; ?>">
						<input
							type="checkbox"
							id="cb_<?php echo $sitename; ?>"
							name="active_sites[<?php echo $sitename; ?>]"
							<?php echo (in_array($sitename, $active_sites)) ? ' checked="checked"' : ''; ?>
						/>
						<img src="<?php echo $sociablepluginpath.'images/'.$site['favicon']; ?>" width="16" height="16" alt="" />
						<?php echo $sitename; ?>
					</li>
				<?php } ?>
			</ul>
			</div>
			<input type="hidden" id="site_order" name="site_order" value="<?php echo join('|', array_keys($sociable_known_sites)) ?>" />
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Tagline", "sociable"); ?>
		</th>
		<td>
			<?php _e("Change the text displayed in front of the icons below. For complete customization, copy the contents of <em>sociable.css</em> in the Sociable plugin directory to your theme's <em>style.css</em> and disable the use of the sociable stylesheet below.", 'sociable'); ?><br/>
			<input size="80" type="text" name="tagline" value="<?php echo attribute_escape(stripslashes(get_option('sociable_tagline'))); ?>" />
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Position:", "sociable"); ?>
		</th>
		<td>
			<?php _e("The icons appear at the end of each blog post, and posts may show on many different types of pages. Depending on your theme and audience, it may be tacky to display icons on all types of pages.", 'sociable'); ?><br/>
			<br/>
			<?php
			/**
			 * Load conditions under which Sociable displays
			 */
			$conditionals 	= get_option('sociable_conditionals');
			?>
			<input type="checkbox" name="conditionals[is_home]"<?php echo ($conditionals['is_home']) ? ' checked="checked"' : ''; ?> /> <?php _e("Front page of the blog", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_single]"<?php echo ($conditionals['is_single']) ? ' checked="checked"' : ''; ?> /> <?php _e("Individual blog posts", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_page]"<?php echo ($conditionals['is_page']) ? ' checked="checked"' : ''; ?> /> <?php _e('Individual WordPress "Pages"', 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_category]"<?php echo ($conditionals['is_category']) ? ' checked="checked"' : ''; ?> /> <?php _e("Category archives", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_tag]"<?php echo ($conditionals['is_tag']) ? ' checked="checked"' : ''; ?> /> <?php _e("Tag listings", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_date]"<?php echo ($conditionals['is_date']) ? ' checked="checked"' : ''; ?> /> <?php _e("Date-based archives", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_author]"<?php echo ($conditionals['is_author']) ? ' checked="checked"' : ''; ?> /> <?php _e("Author archives", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_search]"<?php echo ($conditionals['is_search']) ? ' checked="checked"' : ''; ?> /> <?php _e("Search results", 'sociable'); ?><br/>
			<input type="checkbox" name="conditionals[is_feed]"<?php echo ($conditionals['is_feed']) ? ' checked="checked"' : ''; ?> /> <?php _e("RSS feed items", 'sociable'); ?><br/>
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Use CSS:", "sociable"); ?>
		</th>
		<td>
			<input type="checkbox" name="usecss" <?php checked( get_option('sociable_usecss'), true ); ?> /> <?php _e("Use the sociable stylesheet?", "sociable"); ?>
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Use Text Links:", "sociable"); ?>
		</th>
		<td>
			<input type="checkbox" name="usetextlinks" <?php checked( get_option('sociable_usetextlinks'), true ); ?> /> <?php _e("Use text links without images?", "sociable"); ?>
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Image directory", "sociable"); ?>
		</th>
		<td>
			<?php _e("Sociable comes with a nice set of images, if you want to replace those with your own, enter the URL where you've put them in here, and make sure they have the same name as the ones that come with Sociable.", 'sociable'); ?><br/>
			<input size="80" type="text" name="imagedir" value="<?php echo attribute_escape(stripslashes(get_option('sociable_imagedir'))); ?>" />
		</td>
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("Open in new window:", "sociable"); ?>
		</th>
		<td>
			<input type="checkbox" name="usetargetblank" <?php checked( get_option('sociable_usetargetblank'), true ); ?> /> <?php _e("Use <code>target=_blank</code> on links? (Forces links to open a new window)", "sociable"); ?>
		</td>		
	</tr>
	<tr>
		<th scope="row" valign="top">
			<?php _e("awe.sm:", "sociable"); ?>
		</th>
		<td>
			<?php _e("You can choose to automatically have the links posted to certain sites shortened via awe.sm and encoded with the channel info and your API Key.", 'sociable'); ?><br/>
			<input type="checkbox" name="awesmenable" <?php checked( get_option('sociable_awesmenable'), true ); ?> /> <?php _e("Enable awe.sm URLs?", "sociable"); ?><br/>
			<?php _e("awe.sm API Key:", 'sociable'); ?> <input size="65" type="text" name="awesmapikey" value="<?php echo get_option('sociable_awesmapikey'); ?>" />
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>
			<span class="submit"><input name="save" value="<?php _e("Save Changes", 'sociable'); ?>" type="submit" /></span>
			<span class="submit"><input name="restore" value="<?php _e("Restore Built-in Defaults", 'sociable'); ?>" type="submit"/></span>
		</td>
	</tr>
</table>

<h2><?php _e('Like this plugin?','sociable'); ?></h2>
<p><?php _e('Why not do any of the following:','sociable'); ?></p>
<ul class="sociablemenu">
	<li><?php _e('Link to it so other folks can find out about it.','sociable'); ?></li>
	<li><?php _e('<a href="http://wordpress.org/extend/plugins/sociable/">Give it a good rating</a> on WordPress.org.','sociable'); ?></li>
	<li><?php _e('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2017947">Donate a token of your appreciation</a>.','sociable'); ?></li>
</ul>
<h2><?php _e('Need support?','sociable'); ?></h2>
<p><?php _e('If you have any problems or good ideas, please talk about them in the <a href="http://wordpress.org/tags/sociable">Support forums</a>.', 'sociable'); ?></p>

<h2><?php _e('Credits','sociable'); ?></h2>
<p><?php _e('<a href="http://yoast.com/wordpress/sociable/">Sociable</a> was originally developed by <a href="http://push.cx/">Peter Harkins</a> and has been maintained by <a href="http://yoast.com/">Joost de Valk</a> since the beginning of 2008. It\'s released under the GNU GPL version 2.','Sociable'); ?></p>


</div>
</form>
<?php
}

/**
 * Add an icon for the Sociable plugin's settings page to the dropdown for Ozh's admin dropdown menu
 */
function sociable_add_ozh_adminmenu_icon( $hook ) {
	static $sociableicon;
	if (!$sociableicon) {
		$sociableicon = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)). '/book_add.png';
	}
	if ($hook == 'Sociable') return $sociableicon;
	return $hook;
}
add_filter( 'ozh_adminmenu_icon', 'sociable_add_ozh_adminmenu_icon' );				

/**
 * Add a settings link to the Plugins page, so people can go straight from the plugin page to the
 * settings page.
 */
function sociable_filter_plugin_actions( $links, $file ){
	// Static so we don't call plugin_basename on every plugin row.
	static $this_plugin;
	if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
	
	if ( $file == $this_plugin ){
		$settings_link = '<a href="options-general.php?page=Sociable">' . __('Settings') . '</a>';
		array_unshift( $links, $settings_link ); // before other links
	}
	return $links;
}
add_filter( 'plugin_action_links', 'sociable_filter_plugin_actions', 10, 2 );

/**
 * Add the Yoast.com RSS feed to the WordPress dashboard
 */
if (!function_exists('yst_db_widget')) {
	function yst_text_limit( $text, $limit, $finish = '[&hellip;]) { if( strlen( $text ) > $limit ) { $text = substr( $text, 0, $limit )';
			$text = substr( $text, 0, - ( strlen( strrchr( $text,' ') ) ) );
			$text .= $finish
		}
		return $text;
	}
	
	function yst_db_widget($image = 'normal', $num = 3, $excerptsize = 250, $showdate = true) {
		require_once(ABSPATH.WPINC.'/rss.php');  
		if ( $rss = fetch_rss( 'http://feeds2.feedburner.com/joostdevalk' ) ) {
			echo '<div class="rss-widget">';
			if ($image == 'normal') {
				echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';			
			} else {
				echo '<a href="http://yoast.com/" title="Go to Yoast.com"><img width="80" src="http://cdn.yoast.com/yoast-logo-rss.png" class="alignright" alt="Yoast"/></a>';			
			}
			echo '<ul>';
			$rss->items = array_slice( $rss->items, 0, $num );
			foreach ( (array) $rss->items as $item ) {
				echo '<li>';
				echo '<a class="rsswidget" href="'.clean_url( $item['link'], $protocolls=null, display ).>. htmlentities($item[title]) .</a> ;
				if ($showdate)
					echo <span class=rss-date>. date(F j, Y, strtotime($item[pubdate])) .</span> 
               
				
			}
			echo '</ul>';
			echo '<div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
			echo '<a href="http://feeds2.feedburner.com/joostdevalk"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
			if ($image == 'normal') {
				echo ' &nbsp; &nbsp; &nbsp; ';
			} else {
				echo '<br/>';
			}
			echo '<a href="http://yoast.com/email-blog-updates/"><img src="http://cdn.yoast.com/email_sub.png" alt=""/> Subscribe by email</a>';
			echo '</div>';
			echo '</div>';
		}
	}
 
	function yst_widget_setup() {
	    wp_add_dashboard_widget( 'yst_db_widget' , 'The Latest news from Yoast' , 'yst_db_widget');
	}
 
	add_action('wp_dashboard_setup', 'yst_widget_setup');
}
?>