<?php
/**
 * @version    $Id$
 * @package    IT_Theme_Framework
 * @author     InnoThemes Team <support@innothemes.com>
 * @copyright  Copyright (C) 2012 InnoThemes.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.innothemes.com
 */

// Get theme options
global $it_options;

$post_id = get_the_ID();
$url     = rawurlencode( get_permalink() );
$title   = rawurlencode( get_the_title() );
?>
<div class="social-share clearafter" data-nonce="<?php esc_attr_e( wp_create_nonce( '_itthmfw_sharing_count_nonce' ) ); ?>">
	<h4><?php _e( 'Network Sharing', IT_THEME_TEXTDOMAIN ) ?></h4>
	<ul>
		<?php if ( $it_options['single_post_social_sharing']['facebook'] ) : ?>
		<li class="facebook">
			<div class="fb-share-button" data-href="<?php esc_attr_e( $title ); ?>" data-type="button_count"></div>
			<div id="fb-root"></div>
			<script type="text/javascript">
			(function(d, s, id) {
				var js, fjs = d.getElementsByTagName(s)[0];
				if (d.getElementById(id)) return;
				js = d.createElement(s); js.id = id;
				js.src = "//connect.facebook.net/en_EN/all.js#xfbml=1&appId=254206627957104";
				fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));
			</script>
		</li>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['twitter'] ) : ?>
		<li class="twitter">
			<a href="https://twitter.com/share" class="twitter-share-button"><?php _e( 'Tweet', IT_THEME_TEXTDOMAIN ); ?></a>
			<script type="text/javascript">
			!function(d,s,id){
				var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
				if(!d.getElementById(id)){js=d.createElement(s);
					js.id=id;js.src=p+'://platform.twitter.com/widgets.js';
					fjs.parentNode.insertBefore(js,fjs);
				}
			}(document, 'script', 'twitter-wjs');
			</script>
		</li>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['googleplus'] ) : ?>
		<li class="gplus">
			<div class="g-plus" data-action="share" data-annotation="bubble"></div>
			<script type="text/javascript">
			(function() {
				var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
				po.src = 'https://apis.google.com/js/plusone.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
			})();
			</script>
		</li>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['pinterest'] ) : ?>
		<li class="pinterest"><a data-pin-do="buttonFollow" href="http://www.pinterest.com/pinterest/"><?php _e( 'Pinterest', IT_THEME_TEXTDOMAIN ); ?></a></li>
		<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['yahoo'] ) : ?>
		<li class="yahoo"><a href="mailto:?Subject=<?php esc_attr_e( $title ); ?>"><?php _e( 'Email this article', IT_THEME_TEXTDOMAIN ); ?></a></li>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['myspace'] ) : ?>
		<li class="myspace"><a href="http://myspace.com/" target="_blank"><img src="http://x.myspace.com/images/myspace_logo_16.gif" alt="MySpace"><?php _e( 'Share on myspace', IT_THEME_TEXTDOMAIN ); ?></a></li>
		<?php endif; ?>

		<?php if ( $it_options['single_post_social_sharing']['stumbleupon'] ) : ?>
		<li class="stumbleupon">
		<su:badge layout="1"></su:badge>
		<script type="text/javascript">
		(function() {
			var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
			li.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//platform.stumbleupon.com/1/widgets.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
		})();
		</script>
		</li>
		<?php endif; ?>

		<?php if ($it_options['single_post_social_sharing']['skype']) : ?>
		<li class="rss">
			<a href="skype:?call" rel="nofollow">
				<img src="http://cdn.dev.skype.com/uri/callbutton_16px.png" alt="" style="vertical-align:middle;border:0" />
			</a>
		</li>
		<?php endif; ?>

		<?php if ($it_options['single_post_social_sharing']['stumbleupon']) : ?>
		<li class="rss">
			<a href="http://feeds.feedburner.com" rel="alternate" type="application/rss+xml" target="_blank">
				<img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" />
			</a>
		</li>
		<?php endif; ?>
	</ul>
</div><!--End div.social-share-->
