/**
     * Widget Render
     */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $title2 = $instance['title2'];
        $feedid = $instance['feedid'];
        $width = $instance['width'];
        $height = $instance['height'];
        $desc = $instance['desc'];
        $subscribe = !empty($instance['subscribe']) ? '1' : '0';
        $social_link = array('rss' => $instance['rss'], 'twitter' => $instance['twitter'], 'facebook' => $instance['facebook'], 'pinterest' => $instance['pinterest'], 'youtube' => $instance['youtube'], 'linkedin' => $instance['linkedin'], 'vimeo' => $instance['vimeo']);
        ?>

		<?php 
        echo $before_widget;
        ?>
			<?php 
        if ($title != '') {
            echo $before_title . $title . $after_title;
        }
        ?>
			<div class="social-link clearfix <?php 
        echo $class;
        ?>
">
				<?php 
        foreach ($social_link as $name => $link) {
            ?>
					<?php 
            if ($link && '' != $link) {
                ?>
						<a href="<?php 
                echo $link;
                ?>
" class="social-<?php 
                echo $name;
                ?>
"><i class="icon-<?php 
                echo $name;
                ?>
"></i></a>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
			</div><!-- .social-link -->
			<?php 
        $fblike_args = array('float' => 'left', 'url' => site_url(), 'showfaces' => 'false', 'verb' => 'like', 'colorscheme' => 'light', 'font' => 'arial');
        echo colabs_shortcode_fblike($fblike_args);
        ?>
		<?php 
        echo $after_widget;
        ?>
   
		<?php 
    }
示例#2
0
 function colabs_share()
 {
     $return = '';
     $colabs_share_twitter = get_option('colabs_share_twitter');
     $colabs_share_fblike = get_option('colabs_share_fblike');
     $colabs_share_google_plusone = get_option('colabs_share_google_plusone');
     $colabs_share_pinterest = get_option('colabs_share_pinterest');
     $colabs_share_linkedin = get_option('colabs_share_linkedin');
     //Share Button Functions
     global $colabs_options;
     $url = get_permalink();
     $share = '';
     //Twitter Share Button
     if (function_exists('colabs_shortcode_twitter') && $colabs_share_twitter == "true") {
         $tweet_args = array('url' => $url, 'style' => 'horizontal', 'source' => get_option('colabs_twitter_username') ? get_option('colabs_twitter_username') : '', 'text' => '', 'related' => '', 'lang' => '', 'float' => 'fl');
         $share .= colabs_shortcode_twitter($tweet_args);
     }
     //Google +1 Share Button
     if (function_exists('colabs_shortcode_google_plusone') && $colabs_share_google_plusone == "true") {
         $google_args = array('size' => 'medium', 'language' => '', 'count' => '', 'href' => $url, 'callback' => '', 'annotation' => 'bubble', 'float' => 'left');
         $share .= colabs_shortcode_google_plusone($google_args);
     }
     //Facebook Like Button
     if (function_exists('colabs_shortcode_fblike') && $colabs_share_fblike == "true") {
         $fblike_args = array('float' => 'left', 'url' => '', 'style' => 'button_count', 'showfaces' => 'false', 'width' => '105', 'height' => '', 'verb' => 'like', 'colorscheme' => 'light', 'font' => 'arial');
         $share .= colabs_shortcode_fblike($fblike_args);
     }
     global $post;
     if (is_attachment()) {
         $att_image = wp_get_attachment_image_src($post->id, "thumbnail");
         $image = $att_image[0];
     } else {
         $image = colabs_image('return=true&link=url&id=' . $post->ID);
     }
     //Pinterest Share Button
     if (function_exists('colabs_shortcode_pinterest') && $colabs_share_pinterest == "true") {
         $pinterest_args = array('count' => 'horizontal', 'float' => 'left', 'use_post' => 'true', 'image_url' => $image, 'url' => $url);
         $share .= colabs_shortcode_pinterest($pinterest_args);
     }
     //Linked Share Button
     if (function_exists('colabs_shortcode_linkedin_share') && $colabs_share_linkedin == "true") {
         $linkedin_args = array('style' => 'right', 'float' => 'left');
         $share .= colabs_shortcode_linkedin_share($linkedin_args);
     }
     $return .= '<div class="social_share">' . $share . '</div><div class="clear"></div>';
     return $return;
 }