1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is there any tool/code for adding social media buttons?

Discussion in 'Social Networks' started by willyboy104, Aug 17, 2008.

  1. #1
    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.
     
    willyboy104, Aug 17, 2008 IP
  2. shabbirbhimani

    shabbirbhimani Well-Known Member

    Messages:
    1,063
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    140
    #2
    addthis.com
     
    shabbirbhimani, Aug 17, 2008 IP
  3. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #3
    
    <?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&amp;source_url={LINK}&amp;title={TITLE}&amp;body={TITLE}'
    		),
    		'BlinkList' => array(
    			'icon' => 'blinklist.png', 
    			'url'  => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=&amp;Url={LINK}&amp;Title={TITLE}'
    		),
    		'blogmarks' => array(
    			'icon' => 'blogmarks.png', 
    			'url'  => 'http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url={LINK}&amp;title={TITLE}'
    		),
    		'co.mments' => array(
    			'icon' => 'co.mments.gif', 
    			'url'  => 'http://co.mments.com/track?url={LINK}&amp;title={TITLE}'
    		),
    		'connotea' => array(
    			'icon' => 'connotea.png', 
    			'url'  => 'http://www.connotea.org/addpopup?continue=confirm&amp;uri={LINK}&amp;title={TITLE}'
    		),
    		'del.icio.us' => array(
    			'icon' => 'delicious.png', 
    			'url'  => 'http://del.icio.us/post?url={LINK}&amp;title={TITLE}'
    		),
    		'De.lirio.us' => array(
    			'icon' => 'delirious.png', 
    			'url'  => 'http://de.lirio.us/rubric/post?uri={LINK}&amp;title={TITLE};when_done=go_back'
    		),
    		'Digg' => array(
    			'icon' => 'digg.png', 
    			'url'  => 'http://digg.com/submit?phase=2&amp;url={LINK}&amp;title={TITLE}'
    		),
    		'Fark' => array(
    			'icon' => 'fark.png', 
    			'url'  => 'http://cgi.fark.com/cgi/fark/edit.pl?new_url={LINK}&amp;new_comment={TITLE}&amp;new_comment={SITENAME}&amp;linktype=Misc'
    		),
    		'feedmelinks' => array(
    			'icon' => 'feedmelinks.png', 
    			'url'  => 'http://feedmelinks.com/categorize?from=toolbar&amp;op=submit&amp;url={LINK}&amp;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}&amp;t={TITLE}'
    		),
    		'LinkaGoGo' => array(
    			'icon' => 'linkagogo.png', 
    			'url'  => 'http://www.linkagogo.com/go/AddNoPopup?url={LINK}&amp;title={TITLE}'
    		),
    		'Ma.gnolia' => array(
    			'icon' => 'magnolia.png', 
    			'url'  => 'http://ma.gnolia.com/beta/bookmarklet/add?url={LINK}&amp;title={TITLE}&amp;description={TITLE}'
    		),
    		'NewsVine' => array(
    			'icon' => 'newsvine.png', 
    			'url'  => 'http://www.newsvine.com/_tools/seed&amp;save?u={LINK}&amp;h={TITLE}'
    		),
    		'Netvouz' => array(
    			'icon' => 'netvouz.png', 
    			'url'  => 'http://www.netvouz.com/action/submitBookmark?url={LINK}&amp;title={TITLE}&amp;description={TITLE}'
    		),
    		'Reddit' => array(
    			'icon' => 'reddit.png', 
    			'url'  => 'http://reddit.com/submit?url={LINK}&amp;title={TITLE}'
    		),
    		'scuttle' => array(
    			'icon' => 'scuttle.png', 
    			'url'  => 'http://www.scuttle.org/bookmarks.php/maxpower?action=add&amp;address={LINK}&amp;title={TITLE}&amp;description={TITLE}'
    		),
    		'Shadows' => array(
    			'icon' => 'shadows.png', 
    			'url'  => 'http://www.shadows.com/features/tcr.htm?url={LINK}&amp;title={TITLE}'
    		),
    		'Simpy' => array(
    			'icon' => 'simpy.png', 
    			'url'  => 'http://www.simpy.com/simpy/LinkAdd.do?href={LINK}&amp;title={TITLE}'
    		),
    		'Slashdot' => array(
    			'icon' => 'slashdot.png', 
    			'url'  => 'http://slashdot.org/bookmark.pl?title={TITLE}&amp;url={LINK}'
    		),
    		'Smarking' => array(
    			'icon' => 'smarking.png', 
    			'url'  => 'http://smarking.com/editbookmark/?url={LINK}&amp;description={TITLE}'
    		),
    		'Spurl' => array(
    			'icon' => 'spurl.png', 
    			'url'  => 'http://www.spurl.net/spurl.php?url={LINK}&amp;title={TITLE}'
    		),
    		'StumbleUpon' => array(
    			'icon' => 'stumbleupon.png', 
    			'url'  => 'http://www.stumbleupon.com/submit?url={LINK}&amp;title={TITLE}'
    		),
    		'TailRank' => array(
    			'icon' => 'tailrank.png', 
    			'url'  => 'http://tailrank.com/share/?text=&amp;link_href={LINK}&amp;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=&amp;r={LINK}&amp;title={TITLE}'
    
    		),
    		'YahooMyWeb' => array(
    			'icon' => 'yahoomyweb.png', 
    			'url'  => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u={LINK}&amp;={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

    :)
     
    Synchronium, Aug 17, 2008 IP
  4. 10000listings

    10000listings Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes... addthis.com works great.
     
    10000listings, Aug 17, 2008 IP
  5. newpbc

    newpbc Active Member

    Messages:
    307
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #5
    newpbc, Aug 17, 2008 IP