<?php
/**
 * Social share
 *
 * This template can be overridden by copying it to yourtheme/smart-post-show-pro/templates/item/social-share.php
 *
 * @package    Smart_Post_Show_Pro
 * @subpackage Smart_Post_Show_Pro/public
 */

?>
<div class="sp-pcp-social-share">
<?php
do_action( 'pcp_add_first_socials' );
foreach ( $social_share_media as $style_key => $style_value ) {
	switch ( $style_value ) {
		case 'facebook':
			?>
			<a title="Facebook"  href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink( $pcp_post ); ?>" class="pcp-social-icon pcp-facebook <?php echo esc_attr( $social_icon_shape ); ?>" onClick="window.open('https://www.facebook.com/sharer.php?u=<?php the_permalink( $pcp_post ); ?>','Facebook','width=450,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;" ><i class="fa fa-facebook"></i></a>
			<?php
			break;
		case 'twitter':
			?>
			<a title="Twitter" onClick="window.open('https://twitter.com/share?url=<?php the_permalink( $pcp_post ); ?>&amp;text=<?php echo esc_attr( wp_strip_all_tags( get_the_title( $pcp_post ) ) ); ?>','Twitter share','width=450,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;" href="https://twitter.com/share?url=<?php the_permalink( $pcp_post ); ?>&amp;text=<?php echo esc_attr( wp_strip_all_tags( get_the_title( $pcp_post ) ) ); ?>" class="pcp-social-icon pcp-twitter <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="sp-icon-x"></i></a>
			<?php
			break;
		case 'linkedIn':
			?>
			<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink( $pcp_post ); ?>" title="linkedIn" class="pcp-social-icon pcp-linkedin <?php echo esc_attr( $social_icon_shape ); ?>" onClick="window.open('https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink( $pcp_post ); ?>','Linkedin','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink( $pcp_post ); ?>"> <i class="fa fa-linkedin"></i></a>
			<?php
			break;
		case 'pinterest':
			?>
			<a href='javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;https://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());' class="pcp-social-icon pcp-pinterest <?php echo esc_attr( $social_icon_shape ); ?>" title="Pinterest"> <i class="fa fa-pinterest"></i></a>
			<?php
			break;
		case 'email':
			?>
			<a href="mailto:?Subject=<?php echo get_the_title( $pcp_post ); ?>&amp;Body=<?php the_permalink( $pcp_post ); ?>" title="Email" class="pcp-social-icon pcp-envelope <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-envelope"></i></a>
			<?php
			break;
		case 'instagram':
			?>
				<a title="Instagram" onClick="window.open('https://instagram.com/?url=<?php the_permalink( $pcp_post ); ?>&amp;text=<?php echo get_the_title( $pcp_post ); ?>','Twitter share','width=450,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;" href="https://instagram.com/?url=<?php the_permalink( $pcp_post ); ?>&amp;text=<?php echo get_the_title( $pcp_post ); ?>" class="pcp-social-icon pcp-instagram <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-instagram" aria-hidden="true"></i></a>
				<?php
			break;
		case 'whatsapp':
			?>
			<a href="https://api.whatsapp.com/send?text=<?php echo get_the_title( $pcp_post ); ?>%20<?php the_permalink( $pcp_post ); ?>" onClick="window.open('https://api.whatsapp.com/send?text=<?php echo get_the_title( $pcp_post ); ?>%20<?php the_permalink( $pcp_post ); ?>','whatsapp','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" title="WhatsApp" class="pcp-social-icon pcp-whatsapp <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-whatsapp"></i></a>
			<?php
			break;
		case 'reddit':
			?>
			<a href="https://reddit.com/submit?url=<?php the_permalink( $pcp_post ); ?>&amp;title=<?php echo get_the_title( $pcp_post ); ?>" onClick="window.open('https://reddit.com/submit?url=<?php the_permalink( $pcp_post ); ?>&amp;title=<?php echo get_the_title( $pcp_post ); ?>','reddit','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" title="Reddit"  class="pcp-social-icon pcp-reddit <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-reddit"></i></a>
			<?php
			break;
		case 'tumblr':
			?>
			<a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=<?php the_permalink( $pcp_post ); ?>&amp;title=<?php echo get_the_title( $pcp_post ); ?>" title="tumblr" onClick="window.open('https://www.tumblr.com/widgets/share/tool?canonicalUrl=<?php the_permalink( $pcp_post ); ?>&amp;title=<?php echo get_the_title( $pcp_post ); ?>','tumblr','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" class="pcp-social-icon pcp-tumblr <?php echo esc_attr( $social_icon_shape ); ?>"><i class="fa fa-tumblr"></i></a>
			<?php
			break;
		case 'digg':
			?>
			<a href="https://digg.com/submit?url=<?php the_permalink( $pcp_post ); ?>%&amp;title=<?php echo get_the_title( $pcp_post ); ?>" onClick="window.open('https://digg.com/submit?url=<?php the_permalink( $pcp_post ); ?>%&amp;title=<?php echo get_the_title( $pcp_post ); ?>','Digg','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" title="digg" class="pcp-social-icon pcp-digg <?php echo esc_attr( $social_icon_shape ); ?>"><i class="fa fa-digg"></i></a>
			<?php
			break;
		case 'vk':
			?>
			<a href="https://vk.com/share.php?url=<?php the_permalink( $pcp_post ); ?>&amp;title=<?php echo get_the_title( $pcp_post ); ?>&amp;comment="  title="VK" onClick="window.open('https://vk.com/share.php','VK','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;" class="pcp-social-icon pcp-vk <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-vk"></i></a>
			<?php
			break;
		case 'xing':
			?>
			<a href="https://www.xing.com/spi/shares/new?url=<?php the_permalink( $pcp_post ); ?>" onClick="window.open('https://www.xing.com/spi/shares/new?url=<?php the_permalink( $pcp_post ); ?>','xing','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;"  title="Xing" class="pcp-social-icon pcp-xing <?php echo esc_attr( $social_icon_shape ); ?>"><i class="fa fa-xing"></i></a>
			<?php
			break;
		case 'pocket':
			?>
			<a href="https://getpocket.com/edit?url=<?php the_permalink( $pcp_post ); ?>" onClick="window.open('https://getpocket.com/edit?url=<?php the_permalink( $pcp_post ); ?>','ocket','width=450,height=300,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;"  title="Pocket" class="pcp-social-icon pcp-pocket <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-get-pocket"></i></a>
			<?php
			break;
		case 'copy':
			?>
			<span class=pcp-copy-url><a href="#" data_url="<?php the_permalink( $pcp_post ); ?>" title="Pocket" class="pcp-social-icon pcp-copy <?php echo esc_attr( $social_icon_shape ); ?>"> <i class="fa fa-clone"></i>
				<div class="post-url-copy-popup"><?php esc_html_e( 'Copied!', 'smart-post-show-pro' ); ?></div></span>
			</a>
			<?php
			break;
	}
}
do_action( 'pcp_add_last_socials' );
?>
</div>
<?php
