function widget($args, $instance) { $facebook_page = $instance['facebook']; $rss_id = $instance['rss']; $twitter_id = $instance['twitter']; $youtube_url = $instance['youtube']; $vimeo_url = $instance['vimeo']; $dribbble_url = $instance['dribbble']; $new_window = $instance['new_window']; if ($new_window) { $new_window = ' target="_blank" '; } else { $new_window = ''; } $counter = 0; if ($rss_id) { $counter++; } if ($twitter_id) { $counter++; } if ($facebook_page) { $counter++; } if ($youtube_url) { $counter++; } if ($vimeo_url) { $counter++; } if ($dribbble_url) { $counter++; } ?> <div class="widget widget-counter col<?php echo $counter; ?> "> <ul> <?php if ($rss_id) { ?> <li class="rss-subscribers"> <a href="<?php echo $rss_id; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php _e('Subscribe', 'tie'); __('Subscribers', 'tie'); ?> </span> <small><?php _e('To RSS Feed', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($twitter_id) { $twitter = tie_followers_count(); ?> <li class="twitter-followers"> <a href="<?php echo $twitter['page_url']; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php echo @number_format($twitter['followers_count']); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($facebook_page) { $facebook = tie_facebook_fans($facebook_page); ?> <li class="facebook-fans"> <a href="<?php echo $facebook_page; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php echo @number_format($facebook); ?> </span> <small><?php _e('Fans', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($youtube_url) { $youtube = tie_youtube_subs($youtube_url); ?> <li class="youtube-subs"> <a href="<?php echo $youtube_url; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php echo @number_format($youtube); ?> </span> <small><?php _e('Subscribers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($vimeo_url) { $vimeo = tie_vimeo_count($vimeo_url); ?> <li class="vimeo-subs"> <a href="<?php echo $vimeo_url; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php echo @number_format($vimeo); ?> </span> <small><?php _e('Subscribers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($dribbble_url) { $dribbble = tie_dribbble_count($dribbble_url); ?> <li class="dribbble-followers"> <a href="<?php echo $dribbble_url; ?> "<?php echo $new_window; ?> > <strong></strong> <span><?php echo @number_format($dribbble); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> </ul> </div> <?php }
function widget($args, $instance) { $facebook_page = @$instance['facebook']; $rss_id = @$instance['rss']; $twitter_id = @$instance['twitter']; $youtube_url = @$instance['youtube']; $vimeo_url = @$instance['vimeo']; $dribbble_url = @$instance['dribbble']; $soundcloud_url = @$instance['soundcloud']; $soundcloud_api = @$instance['soundcloud_api']; $behance_url = @$instance['behance']; $behance_api = @$instance['behance_api']; $instagram_url = @$instance['instagram']; $instagram_api = @$instance['instagram_api']; $new_window = @$instance['new_window']; if ($new_window) { $new_window = ' target="_blank" '; } else { $new_window = ''; } $counter = 0; if ($rss_id) { $counter++; } if ($twitter_id) { $counter++; } if ($facebook_page) { $counter++; } if ($youtube_url) { $counter++; } if ($vimeo_url) { $counter++; } if ($dribbble_url) { $counter++; } if ($soundcloud_url) { $counter++; } if ($behance_url) { $counter++; } if ($instagram_url) { $counter++; } ?> <div class="widget widget-counter col<?php echo $counter; ?> "> <ul> <?php if ($rss_id) { ?> <li class="rss-subscribers"> <a href="<?php echo $rss_id; ?> "<?php echo $new_window; ?> > <strong class="tieicon-rss"></strong> <span><?php _e('Subscribe', 'tie'); __('Subscribers', 'tie'); ?> </span> <small><?php _e('To RSS Feed', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($twitter_id) { $twitter = tie_followers_count(); ?> <li class="twitter-followers"> <a href="<?php echo $twitter['page_url']; ?> "<?php echo $new_window; ?> > <strong class="tieicon-twitter"></strong> <span><?php echo @number_format($twitter['followers_count']); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($facebook_page) { $facebook = tie_facebook_fans($facebook_page); ?> <li class="facebook-fans"> <a href="<?php echo $facebook_page; ?> "<?php echo $new_window; ?> > <strong class="tieicon-facebook"></strong> <span><?php echo @number_format($facebook); ?> </span> <small><?php _e('Fans', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($youtube_url) { $youtube = tie_youtube_subs($youtube_url); ?> <li class="youtube-subs"> <a href="<?php echo $youtube_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-youtube"></strong> <span><?php echo @number_format($youtube); ?> </span> <small><?php _e('Subscribers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($vimeo_url) { $vimeo = tie_vimeo_count($vimeo_url); ?> <li class="vimeo-subs"> <a href="<?php echo $vimeo_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-vimeo"></strong> <span><?php echo @number_format($vimeo); ?> </span> <small><?php _e('Subscribers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($dribbble_url) { $dribbble = tie_dribbble_count($dribbble_url); ?> <li class="dribbble-followers"> <a href="<?php echo $dribbble_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-dribbble"></strong> <span><?php echo @number_format($dribbble); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($soundcloud_url && $soundcloud_api) { $soundcloud = tie_soundcloud_count($soundcloud_url, $soundcloud_api); ?> <li class="soundcloud-followers"> <a href="<?php echo $soundcloud_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-soundcloud"></strong> <span><?php echo @number_format($soundcloud); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($behance_url && $behance_api) { $behance = tie_behance_count($behance_url, $behance_api); ?> <li class="behance-followers"> <a href="<?php echo $behance_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-behance"></strong> <span><?php echo @number_format($behance); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> <?php if ($instagram_url && $instagram_api) { $instagram = tie_instagram_count($instagram_url, $instagram_api); ?> <li class="instagram-followers"> <a href="<?php echo $instagram_url; ?> "<?php echo $new_window; ?> > <strong class="tieicon-instagram"></strong> <span><?php echo @number_format($instagram); ?> </span> <small><?php _e('Followers', 'tie'); ?> </small> </a> </li> <?php } ?> </ul> </div> <?php }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $subscribe_title = $instance['subscribe_title']; $subscribe_description = $instance['subscribe_description']; $view = isset($instance['view']) ? $instance['view'] : false; $feedburner = isset($instance['feedburner']) ? $instance['feedburner'] : false; $label = isset($instance['label']) ? $instance['label'] : false; $facebook_page = isset($instance['facebook']) ? $instance['facebook'] : false; $twitter_id = isset($instance['twitter']) ? $instance['twitter'] : false; $youtube_url = isset($instance['youtube']) ? $instance['youtube'] : false; $new_window = isset($instance['new_window']) ? $instance['new_window'] : false; if ($new_window) { $new_window = ' target="_blank" '; } else { $new_window = ''; } echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } ?> <div class="follow-widget <?php echo $view == 'simple' ? 'simple' : 'extended'; ?> "> <?php if ($twitter_id) { $twitter = tie_followers_count(); ?> <a href="<?php echo $twitter['page_url']; ?> "<?php echo $new_window; ?> class="tw"> <span class="follow-widget-valign"> <i class="soc_icon-twitter-3"></i> <span class="number"><?php echo @number_format($twitter['followers_count']); ?> </span> <br /> <span class="text"><?php _e('followers', 'dfd'); ?> </span> </span> </a> <?php } ?> <?php if ($facebook_page) { $facebook = tie_facebook_fans($facebook_page); ?> <a href="<?php echo $facebook_page; ?> "<?php echo $new_window; ?> class="fb"> <span class="follow-widget-valign"> <i class="soc_icon-facebook"></i> <span class="number"><?php echo @number_format($facebook); ?> </span> <br /> <span class="text"><?php _e('fans', 'dfd'); ?> </span> </span> </a> <?php } ?> <?php if ($youtube_url) { $youtube = tie_youtube_subs($youtube_url); ?> <a href="<?php echo $youtube_url; ?> "<?php echo $new_window; ?> class="yt"> <span class="follow-widget-valign"> <i class="soc_icon-youtube"></i> <span class="number"><?php echo @number_format($youtube); ?> </span> <br /> <span class="text"><?php _e('subscr.', 'dfd'); ?> </span> </span> </a> <?php } ?> </div> <div class="subscribe-widget <?php if ($view == 'simple') { echo 'simple'; } ?> "> <?php if ($subscribe_title != '') { ?> <h3 class="widget-title"><?php echo $subscribe_title; ?> </h3> <?php } ?> <?php if ($subscribe_description != '') { ?> <p><?php echo $subscribe_description; ?> </p> <?php } ?> <form id="<?php echo uniqid('feedburner_subscribe_'); ?> " action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo $feedburner; ?> ', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"> <input class="text" type="text" name="email" id="<?php echo uniqid('subsmail_'); ?> " placeholder="<?php echo $label; ?> " /> <div class="text-center"> <button type="submit" class="button submit"><i class="icon-mail-2"></i><?php _e('Add me to rss', 'dfd'); ?> </button> </div> <input type="hidden" value="<?php echo $feedburner; ?> " name="uri"/> <input type="hidden" name="loc" value="en_US"/> </form> </div> <?php echo $after_widget; }