<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt [Danger] &#187; Share This</title>
	<atom:link href="http://mattdanger.net/tag/share-this/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattdanger.net</link>
	<description>One step closer to world domination</description>
	<lastBuildDate>Thu, 06 May 2010 21:31:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hacking &#8220;Share This&#8221; to Configure Sharing Options</title>
		<link>http://mattdanger.net/2008/11/hacking-share-this-to-configure-sharing-options/</link>
		<comments>http://mattdanger.net/2008/11/hacking-share-this-to-configure-sharing-options/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 17:54:40 +0000</pubDate>
		<dc:creator>Matt Danger</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Share This]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://mattdanger.net/?p=14</guid>
		<description><![CDATA[Thomas likes to use Alex King&#8217;s Share This plugin on his Wordpress install but wanted a little more configurability from it. I wrote a little hack to allow him to select which sharing tab appears by default. This was written for version 1.3 and I&#8217;m not sure if it could be successfully implemented into the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://woodswebdesign.com/">Thomas</a> likes to use <a href="http://alexking.org/">Alex King&#8217;s</a> <a href="http://alexking.org/blog/2006/12/12/share-this-13">Share This</a> plugin on his Wordpress install but wanted a little more configurability from it. I wrote a little hack to allow him to select which sharing tab appears by default. This was written for version 1.3 and I&#8217;m not sure if it could be successfully implemented into the 2.3 version.</p>
<p>To select the default tab set &#8220;DEFAULT_TAB&#8221; to either &#8217;social&#8217; or &#8216;email&#8217; for which tab you&#8217;d like to be displayed when Share This is activated. Set &#8220;FIRST_TAB&#8221; to either &#8217;social&#8217; or &#8216;email&#8217; for which tab you&#8217;d like to appear first in the tab order when Share This is activated.</p>
<p>To begin, add this code at line 26:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #339933;">@</span><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'DEFAULT_TAB'</span><span style="color: #339933;">,</span> <span style="">'email'</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// 'social' or 'email' </span>
<span style="color: #339933;">@</span><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'FIRST_TAB'</span><span style="color: #339933;">,</span> <span style="">'email'</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// 'social' or 'email' as the first tab.</span></pre></div></div>

<p>Then add this code at line 123:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_default_tab<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>DEFAULT_TAB<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">case</span> <span style="">'email'</span><span style="color: #339933;">:</span>
      <span style="color: #000088;">$tab_number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span>;
      <span style="color: #b1b100;">break</span>;
    <span style="color: #b1b100;">case</span> <span style="">'social'</span><span style="color: #339933;">:</span>
      <span style="color: #000088;">$tab_number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>;
      <span style="color: #b1b100;">break</span>;
    <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error with the Share This plugin: Please define DEFAULT_TAB as either 'social' or 'email'.&quot;</span><span style="color: #009900;">&#41;</span>;  
  <span style="color: #009900;">&#125;</span>
  <span style="color: #990000;">echo</span> <span style="color: #000088;">$tab_number</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then add this code at line 174:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">akst_share_tab('<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_default_tab<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>');</pre></div></div>

<p>Finally, at line 442 replace:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">&lt;li id=&quot;akst_tab1&quot; onclick=&quot;akst_share_tab('1');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'Social Web'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
&lt;li id=&quot;akst_tab2&quot; class=&quot;selected&quot; onclick=&quot;akst_share_tab('2');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'E-mail'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;</pre></div></div>

<p>with:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>FIRST_TAB<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">case</span> <span style="">'social'</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;li id=&quot;akst_tab1&quot; onclick=&quot;akst_share_tab('1');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'Social Web'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
    &lt;li id=&quot;akst_tab2&quot; class=&quot;selected&quot; onclick=&quot;akst_share_tab('2');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'E-mail'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">break</span>;
  <span style="color: #b1b100;">case</span> <span style="">'email'</span><span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;li id=&quot;akst_tab2&quot; class=&quot;selected&quot; onclick=&quot;akst_share_tab('2');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'E-mail'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
    &lt;li id=&quot;akst_tab1&quot; onclick=&quot;akst_share_tab('1');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="">'Social Web'</span><span style="color: #339933;">,</span> <span style="">'alexking.org'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">break</span>;
  <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error with the Share This plugin: Please define FIRST_TAB as either 'social' or 'email'.&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mattdanger.net/2008/11/hacking-share-this-to-configure-sharing-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
