Пример #1
0
function premise_the_after_social_share_tease()
{
    $enhanced_share = premise_social_share_get_social_share_type() == 1;
    $facebook_url = $enhanced_share ? premise_get_social_share_enhanced_facebook_share_url() : premise_get_social_share_facebook_share_url();
    $twitter_url = $enhanced_share ? premise_get_social_share_enhanced_twitter_share_url() : premise_get_social_share_twitter_share_url();
    $target = $enhanced_share ? '' : 'target="_blank"';
    ?>
		<div class="teaser-share-box">
			<div class="teaser-share-box-inside">
				<div class="teaser-share-message"><?php 
    premise_the_social_share_share_message();
    ?>
</div>
				<div class="teaser-share-icons">
					<a <?php 
    echo $target;
    ?>
 id="twitter-share-icon" href="<?php 
    echo esc_url($twitter_url);
    ?>
">
						<img src="<?php 
    premise_the_social_share_twitter_icon();
    ?>
" alt="Twitter Share Icon" />
						<span><?php 
    _e('Tweet This', 'premise');
    ?>
</span>
					</a>
					<a <?php 
    echo $target;
    ?>
 id="facebook-share-icon" href="<?php 
    echo esc_url($facebook_url);
    ?>
">
						<img src="<?php 
    premise_the_social_share_facebook_icon();
    ?>
" alt="Facebook Share Icon" />
						<span><?php 
    _e('Share This', 'premise');
    ?>
</span>
					</a>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>

				<?php 
    if (!$enhanced_share) {
        ?>
				<p class="teaser-share-clickthrough"><a href="<?php 
        premise_social_share_the_shared_page_url();
        ?>
"><?php 
        _e('Click here when you have shared this page.', 'premise');
        ?>
</a></p>
				<?php 
    }
    ?>
			</div>
		</div>

		<?php 
    if (!$enhanced_share) {
        ?>
		<script type="text/javascript">
			jQuery(document).ready(function($) {
				$('.teaser-share-icons a').click(function(event) {
					event.preventDefault();
					var $this = $(this);
					var href = $this.attr('href');

					var height = 580;
					var width = 980;
					var left = (screen.width / 2) - (width / 2);
					var top = (screen.height / 2) - (height / 2);

					window.open(href, "premise_social_share", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+width+', height='+height+', top='+top+', left='+left);

					setTimeout('jQuery(".teaser-share-clickthrough").show(); jQuery(".teaser-share-message,.teaser-share-icons").hide();', 5000);
				});
			});
		</script>
		<?php 
    }
}
Пример #2
0
if (premise_has_social_share_shared_page()) {
    ?>
					<?php 
    premise_the_social_share_after_share_page();
    ?>
				<?php 
} else {
    ?>
					<div class="teaser-content"><?php 
    premise_the_social_share_teaser_page();
    ?>
</div>
					<div class="teaser-share-box">
						<div class="teaser-share-box-inside">
							<div class="teaser-share-message"><?php 
    premise_the_social_share_share_message();
    ?>
</div>
							<div class="teaser-share-icons">
								<a target="<?php 
    echo esc_attr($blank);
    ?>
" id="twitter-share-icon" href="<?php 
    $twitterUrlFunc();
    ?>
">
									<img src="<?php 
    premise_the_social_share_twitter_icon();
    ?>
" alt="Twitter Share Icon" />
									<span><?php