Hi guys i am after a script/tool/code to put at the end of my posts so people can stumble,digg e.t.c my posts. Just like what you see on wordpress themes? Will.
<?php class Bookmarks { // Properties private $_url; private $_title; private $_site_name; private $_templates = array ( 'blinkbits' => array( 'icon' => 'blinkbits.png', 'url' => 'http://www.blinkbits.com/bookmarklets/save.php?v=1&source_url={LINK}&title={TITLE}&body={TITLE}' ), 'BlinkList' => array( 'icon' => 'blinklist.png', 'url' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url={LINK}&Title={TITLE}' ), 'blogmarks' => array( 'icon' => 'blogmarks.png', 'url' => 'http://blogmarks.net/my/new.php?mini=1&simple=1&url={LINK}&title={TITLE}' ), 'co.mments' => array( 'icon' => 'co.mments.gif', 'url' => 'http://co.mments.com/track?url={LINK}&title={TITLE}' ), 'connotea' => array( 'icon' => 'connotea.png', 'url' => 'http://www.connotea.org/addpopup?continue=confirm&uri={LINK}&title={TITLE}' ), 'del.icio.us' => array( 'icon' => 'delicious.png', 'url' => 'http://del.icio.us/post?url={LINK}&title={TITLE}' ), 'De.lirio.us' => array( 'icon' => 'delirious.png', 'url' => 'http://de.lirio.us/rubric/post?uri={LINK}&title={TITLE};when_done=go_back' ), 'Digg' => array( 'icon' => 'digg.png', 'url' => 'http://digg.com/submit?phase=2&url={LINK}&title={TITLE}' ), 'Fark' => array( 'icon' => 'fark.png', 'url' => 'http://cgi.fark.com/cgi/fark/edit.pl?new_url={LINK}&new_comment={TITLE}&new_comment={SITENAME}&linktype=Misc' ), 'feedmelinks' => array( 'icon' => 'feedmelinks.png', 'url' => 'http://feedmelinks.com/categorize?from=toolbar&op=submit&url={LINK}&name={TITLE}' ), 'Facebook' => array( 'icon' => 'facebook.gif', 'url' => 'http://facebook.com/sharer.php?u={LINK}' ), 'Furl' => array( 'icon' => 'furl.png', 'url' => 'http://www.furl.net/storeIt.jsp?u={LINK}&t={TITLE}' ), 'LinkaGoGo' => array( 'icon' => 'linkagogo.png', 'url' => 'http://www.linkagogo.com/go/AddNoPopup?url={LINK}&title={TITLE}' ), 'Ma.gnolia' => array( 'icon' => 'magnolia.png', 'url' => 'http://ma.gnolia.com/beta/bookmarklet/add?url={LINK}&title={TITLE}&description={TITLE}' ), 'NewsVine' => array( 'icon' => 'newsvine.png', 'url' => 'http://www.newsvine.com/_tools/seed&save?u={LINK}&h={TITLE}' ), 'Netvouz' => array( 'icon' => 'netvouz.png', 'url' => 'http://www.netvouz.com/action/submitBookmark?url={LINK}&title={TITLE}&description={TITLE}' ), 'Reddit' => array( 'icon' => 'reddit.png', 'url' => 'http://reddit.com/submit?url={LINK}&title={TITLE}' ), 'scuttle' => array( 'icon' => 'scuttle.png', 'url' => 'http://www.scuttle.org/bookmarks.php/maxpower?action=add&address={LINK}&title={TITLE}&description={TITLE}' ), 'Shadows' => array( 'icon' => 'shadows.png', 'url' => 'http://www.shadows.com/features/tcr.htm?url={LINK}&title={TITLE}' ), 'Simpy' => array( 'icon' => 'simpy.png', 'url' => 'http://www.simpy.com/simpy/LinkAdd.do?href={LINK}&title={TITLE}' ), 'Slashdot' => array( 'icon' => 'slashdot.png', 'url' => 'http://slashdot.org/bookmark.pl?title={TITLE}&url={LINK}' ), 'Smarking' => array( 'icon' => 'smarking.png', 'url' => 'http://smarking.com/editbookmark/?url={LINK}&description={TITLE}' ), 'Spurl' => array( 'icon' => 'spurl.png', 'url' => 'http://www.spurl.net/spurl.php?url={LINK}&title={TITLE}' ), 'StumbleUpon' => array( 'icon' => 'stumbleupon.png', 'url' => 'http://www.stumbleupon.com/submit?url={LINK}&title={TITLE}' ), 'TailRank' => array( 'icon' => 'tailrank.png', 'url' => 'http://tailrank.com/share/?text=&link_href={LINK}&title={TITLE}' ), 'Technorati' => array( 'icon' => 'technorati.png', 'url' => 'http://technorati.com/faves?add={LINK}' ), 'Wists' => array( 'icon' => 'wists.png', 'url' => 'http://wists.com/r.php?c=&r={LINK}&title={TITLE}' ), 'YahooMyWeb' => array( 'icon' => 'yahoomyweb.png', 'url' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u={LINK}&={TITLE}' ) ); // $_templates array // Constructor public function Bookmarks( $url, $title, $site_name ) { $this->_url = $url; $this->_title = $title; $this->_site_name = $site_name; } public function getHTML( $sites = array( 'StumbleUpon', 'Facebook', 'Digg', 'Reddit', 'Technorati', 'YahooMyWeb', 'Slashdot', 'Furl', 'Wists' ) ) { $search = array( '{LINK}', '{TITLE}', '{SITENAME}' ); $replace = array( urlencode( $this->_url ), urlencode( $this->_title ), urlencode( $this->_site_name ) ); $html = "<ul>\r\n"; foreach ( $sites as $site ) { if ( $site_info = $this->_templates[$site] ) { $url = str_replace( $search, $replace, $site_info['url'] ); $html .= ' <li><a href="' . $url . '" title="Submit to ' . $site . '" rel="nofollow">'; $html .= '<img src="/images/' . $site_info['icon'] . '" alt="Submit to ' . $site . '" />'; $html .= "</a></li>\r\n"; } } $html .= "</ul>\r\n"; return $html; } public function getFeedHTML( $sites = array( 'Reddit', 'Facebook', 'StumbleUpon', 'Digg', 'Technorati' ) ) { $search = array( '{LINK}', '{TITLE}', '{SITENAME}' ); $replace = array( urlencode( $this->_url ), urlencode( $this->_title ), urlencode( $this->_site_name ) ); $html = '<p>'; foreach ( $sites as $site ) { if ( $site_info = $this->_templates[$site] ) { $url = str_replace( $search, $replace, $site_info['url'] ); $html .= '<a href="' . $url . '" title="' . $site . '" rel="nofollow">'; $html .= '<img src="/images/' . $site_info['icon'] . '" alt="Submit to ' . $site . '" />'; $html .= "</a>\r\n"; } } $html .= '</p>'; return $html; } // End class } ?> Code (php): To use: <?php require_once( 'inc/class.Bookmarks.php' ); $oBookmarks = new Bookmarks( $url, $title, $site_name ); echo $oBookmarks->getHTML(); ?> Code (php): Make sure you have appropriate image files for each bookmark in your /images/ directory, otherwise edit the path in the code. If you like/use, please link back to http://www.coffeesh0p.com