<?php

global $restorator_options;

$restorator_single_post_sharebox_facebook 	= isset( $restorator_options['single_post_sharebox_facebook'] ) ? $restorator_options['single_post_sharebox_facebook'] : '1';
$restorator_single_post_sharebox_twitter 	= isset( $restorator_options['single_post_sharebox_twitter'] ) ? $restorator_options['single_post_sharebox_twitter'] : '1';
$restorator_single_post_sharebox_linkedin 	= isset( $restorator_options['single_post_sharebox_linkedin'] ) ? $restorator_options['single_post_sharebox_linkedin'] : '0';
$restorator_single_post_sharebox_reddit 	= isset( $restorator_options['single_post_sharebox_reddit'] ) ? $restorator_options['single_post_sharebox_reddit'] : '0';
$restorator_single_post_sharebox_digg 		= isset( $restorator_options['single_post_sharebox_digg'] ) ? $restorator_options['single_post_sharebox_digg'] : '0';
$restorator_single_post_sharebox_delicious 	= isset( $restorator_options['single_post_sharebox_delicious'] ) ? $restorator_options['single_post_sharebox_delicious'] : '0';
$restorator_single_post_sharebox_google 	= isset( $restorator_options['single_post_sharebox_google'] ) ? $restorator_options['single_post_sharebox_google'] : '1';
$restorator_single_post_sharebox_pinterest 	= isset( $restorator_options['single_post_sharebox_pinterest'] ) ? $restorator_options['single_post_sharebox_pinterest'] : '1';
?>

<div class="sharebox">
	<span><?php echo esc_html__( 'Share this :', 'restorator' ); ?></span>
	
	<div class="sharebox_links">
		<?php if($restorator_single_post_sharebox_facebook != '0') { ?>
			<a class="social_link facebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" title="<?php esc_html_e( 'Facebook', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-facebook"></i><i class="fa fa-facebook"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_twitter != '0') { ?>
			<a class="social_link twitter" href="http://twitter.com/home?status=<?php the_title(); ?> <?php the_permalink(); ?>" title="<?php esc_html_e( 'Twitter', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-twitter"></i><i class="fa fa-twitter"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_linkedin != '0') { ?>
			<?php $restorator_featured_image_url = wp_get_attachment_url(get_post_thumbnail_id()); ?>
			<a class="social_link linkedin" href="https://www.linkedin.com/cws/share?url=<?php echo get_permalink(); ?>&title=<?php echo get_the_title(); ?>&summary=<?php echo get_the_excerpt(); ?>" title="Linkedin Share" data-image="<?php echo esc_url( $restorator_featured_image_url ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-linkedin"></i><i class="fa fa-linkedin"></i></a><script type="in/share" data-url="<?php echo get_permalink() ?>" data-counter="right"></script>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_reddit != '0') { ?>
			<a class="social_link reddit" href="http://www.reddit.com/submit?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('', '', false)) ?>" title="<?php esc_html_e( 'Reddit', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-reddit"></i><i class="fa fa-reddit"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_digg != '0') { ?>
			<a class="social_link digg" href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink() ?>&amp;bodytext=&amp;tags=&amp;title=<?php echo urlencode(the_title('', '', false)) ?>" title="<?php esc_html_e( 'Digg', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-digg"></i><i class="fa fa-digg"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_delicious != '0') { ?>
			<a class="social_link delicious" href="http://www.delicious.com/post?v=2&amp;url=<?php the_permalink() ?>&amp;notes=&amp;tags=&amp;title=<?php echo urlencode(the_title('', '', false)) ?>" title="<?php esc_html_e( 'Delicious', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-delicious"></i><i class="fa fa-delicious"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_google != '0') { ?>
			<a class="social_link google-plus" href="http://plus.google.com/share?url=<?php the_permalink() ?>&amp;title=<?php echo str_replace(' ', '+', the_title('', '', false)); ?>" title="<?php esc_html_e( 'Google+', 'restorator') ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-google-plus"></i><i class="fa fa-google-plus"></i></a>
		<?php } ?>
		
		<?php if($restorator_single_post_sharebox_pinterest != '0') { ?>
			<?php $restorator_featured_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID())); ?>
			<a class="social_link pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo get_permalink(); ?>&media=<?php echo (strlen($restorator_featured_image_url[0]) > 0) ? $restorator_featured_image_url[0] : get_option( 'restorator_logo' ); ?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><i class="fa fa-pinterest-p"></i><i class="fa fa-pinterest-p"></i></a>
		<?php } ?>
	</div>
</div>