Text social bookmarks

I started with the plugin ob-textonly-social-bookmarker by Rajender Singh then went ultra minimalist using coloured letters instead of words to indicate the particular social bookmark. I think most people will get it. I like the idea of a text only site that still looks cool.

This code results in something like this

Bookmark or share this page
t | f | G | su | D | Y!

I think it looks better than “Twitter | facebook | google bookmarks | stumbleupon | Digg | Yahoo bookmarks” and I like the idea that it is text so the browser can deal with the specifics :)

 

<?php

/*
Plugin Name: ob-textonly-social-bookmarker
Plugin URI: http://www.oraclebrains.com/wordpress/plugin/ob_social_button
Description: Add social book mark text links at the bottom of each post: bookmarks options includes del.icio.us, reddit, slashdot it, digg, facebook, technorati, google, stumble, windows live, tailrank, bloglines, furl, netscape, yahoo, blinklist
Version: 2.0
Author: Rajender Singh
Author URI: http://www.oraclebrains.com/

Copyright 2007  Rajender Singh  (email : rajs@oraclebrains.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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

function obtextonlysocialbookmarkerLinks()
{

$link = urlencode(get_permalink());
$title = urlencode(the_title(”, ”, false));

$social_sites = array(
‘twitter’ => array(
‘title’ => ‘Share on twitter!’
, ‘link’ => ‘http://twitter.com/home/?status=’.$title.’ : ‘.$link.'”‘
, ‘img’ => ‘”http://www.twitter.com/favicon.ico” width=”16″ height=”16″ alt=”Twitter”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#6cd2fc” FACE=”Courier 10 Pitch”><b>t</b></font>’
)
,’facebook’ => array(
‘title’ => ‘Share on Facebook!’
, ‘link’ => ‘http://www.facebook.com/share.php?u=’.$link.'”‘
, ‘img’ => ‘”http://www.facebook.com/favicon.ico” width=”16″ height=”16″ alt=”Facebook”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#415cad” FACE=”Arial, sans-serif”><b>f</b></font>’
)
,’google’ => array(
‘title’ => ‘Add to my Google Bookmarks!’
, ‘link’ => ‘http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=’.$link.’&amp;title=’.$title.”
, ‘img’ => ‘”http://www.google.com/favicon.ico” width=”16″ height=”16″ alt=”Google”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#2300dc” FACE=”DejaVu Sans, sans-serif”>G</FONT>’
)
,’stumbleupon’ => array(
‘title’ => ‘Stumble it!’
, ‘link’ => ‘http://www.stumbleupon.com/submit?url=’.$link.’&amp;title=’.$title.”
, ‘img’ => ‘”http://www.stumbleupon.com/favicon.ico” width=”16″ height=”16″ alt=”StumbleUpon”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#33cc66″ FACE=”Comic Sans MS, cursive”><b>s</FONT><FONT COLOR=”#2300dc” FACE=”Comic Sans MS, cursive”>u</b></FONT>’
)
,’digg’ => array(
‘title’ => ‘Add to Digg!’
, ‘link’ => ‘http://digg.com/submit?phase=2&amp;url=’.$link.’&amp;title=’.$title.”
, ‘img’ => ‘”http://digg.com/favicon.ico” width=”16″ height=”16″ alt=”Digg”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#b3b3b3″><b>D</b></FONT>’
)
,’yahoo’ => array(
‘title’ => ‘Add to Yahoo!’
, ‘link’ => ‘http://myweb2.search.yahoo.com/myresults/bookmarklet?u=’.$link.’&t=’.$title
, ‘img’ => ‘”http://myweb2.search.yahoo.com/favicon.ico” width=”16″ height=”16″ alt=”Yahoo”‘
, ‘js’ =>  ”
, ‘alt’ =>  ‘<FONT COLOR=”#ff0000″><b>Y!</b></FONT>’
)
);
$bookmarker = array();
foreach ($social_sites as $key => $data) {
$bookmarker[$key] = ‘<a href=”‘.$data['link'].'” target=”_blank”‘.’ title=”‘.$data['title'].'”‘.’> ‘.$data['alt'].'</a>';
}

return ‘<b>Bookmark or share this page<br></b><span style=”font-size: 1.5em” onmouseover=”this.style.fontSize=`2em`;” onmouseout=”this.style.fontSize=`1.5em`;”> ‘
. implode(” | “, $bookmarker)
. “</span>”;
}

function obtextonlysocialbookmarker($content)
{
return “$content\n”.obtextonlysocialbookmarkerLinks();
}

if (function_exists(‘add_action’)) {
add_action(‘the_content’, ‘obtextonlysocialbookmarker’);
}

?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>