=1000000){ $count=$count/1000000; $count=$count."M"; } else if($count>=1000) { $ncount=$count/1000; $count=$ncount."K"; } return $count; } //shortcode for horizontal sharing function mo_openid_share_shortcode( $atts = '', $title = '', $excerpt = '' ) { $html = ''; $selected_theme = isset( $atts['shape'] )? esc_attr($atts['shape']) : esc_attr(get_option('mo_openid_share_theme')); $selected_direction = esc_attr(get_option('mo_openid_share_widget_customize_direction')); $sharingSize = isset( $atts['size'] )? esc_attr($atts['size']) : esc_attr(get_option('mo_sharing_icon_custom_size')); $custom_color = isset( $atts['backgroundcolor'] )? esc_attr($atts['backgroundcolor']) : esc_attr(get_option('mo_sharing_icon_custom_color')); $custom_theme = isset( $atts['theme'] )? esc_attr($atts['theme']) : esc_attr(get_option('mo_openid_share_custom_theme')); $fontColor = isset( $atts['fontcolor'] )? esc_attr($atts['fontcolor']) : esc_attr(get_option('mo_sharing_icon_custom_font')); $spaceBetweenIcons = isset( $atts['space'] )? esc_attr($atts['space']) : esc_attr(get_option('mo_sharing_icon_space')); $textColor = isset( $atts['color'] ) ? esc_attr($atts['color']) : '#'.esc_attr(get_option('mo_openid_share_widget_customize_text_color')); $text = isset( $atts['heading'] ) ? esc_attr($atts ['heading']) : esc_attr(get_option('mo_openid_share_widget_customize_text')); $twitter_username = get_option('mo_openid_share_twitter_username'); $url = isset( $atts['url'])? esc_url($atts['url']) : esc_url(get_permalink()); $sharing_counts = isset( $atts['sharecnt'] )? esc_attr($atts['sharecnt']) : esc_attr(get_option('mo_openid_share_count')); if(!$url) { $url = esc_attr(get_site_url()); } if($fontColor) { if(ctype_xdigit($fontColor) && strlen($fontColor)==6 && strpos($fontColor,'#')==false){ $fontColor= "#".$fontColor; }else $fontColor; } if($sharing_counts=="yes" || $sharing_counts=="1") $sharing_counts=1; else $sharing_counts=0; $email_subject = esc_html(get_option('mo_openid_share_email_subject')); $email_body = get_option('mo_openid_share_email_body'); $email_body = str_replace('##url##', $url, $email_body); if($custom_theme == 'custombackground'){ $custom_theme = 'custom'; } if($custom_theme == 'nobackground'){ $custom_theme = 'customFont'; } $orientation = 'hor'; $html .= '
'; $html .= '

'; if( $orientation == 'hor' ) { $html .= $text . '

'; $html .= "
"; if($custom_theme == 'custom'){ if($sharing_counts) { $html.="
"; } } else if($custom_theme == 'customFont') { if ($sharing_counts) { $html .= "
"; } } else { if ($sharing_counts) { $html .= "
"; } } $html .= "
"; } $html .= "


"; $html .= ''; return $html; } function mo_openid_vertical_share_shortcode( $atts = '', $title = '', $excerpt = '' ) { $html = ''; $selected_theme = isset( $atts['shape'] )? esc_attr($atts['shape']) : esc_attr(get_option('mo_openid_share_theme')); $selected_direction = esc_attr(get_option('mo_openid_share_widget_customize_direction')); $sharingSize = isset( $atts['size'] )? esc_attr($atts['size']) : esc_attr(get_option('mo_sharing_icon_custom_size')); $custom_color = isset( $atts['backgroundcolor'] )? esc_attr($atts['backgroundcolor']) : esc_attr(get_option('mo_sharing_icon_custom_color')); $custom_theme = isset( $atts['theme'] )? esc_attr($atts['theme']) : esc_attr(get_option('mo_openid_share_custom_theme')); $fontColor = isset( $atts['fontcolor'] )? esc_attr($atts['fontcolor']) : esc_attr(get_option('mo_sharing_icon_custom_font')); $spaceBetweenIcons = isset( $atts['space'] )? esc_attr($atts['space']) : '10'; $alignment = isset( $atts['alignment'] )? esc_attr($atts['alignment']) : 'left'; $left_offset = isset( $atts['leftoffset'] )? esc_attr($atts['leftoffset']) : '20'; $right_offset = isset( $atts['rightoffset'] )? esc_attr($atts['rightoffset']) : '10'; $top_offset = isset( $atts['topoffset'] )? esc_attr($atts['topoffset']) : '100'; $twitter_username = get_option('mo_openid_share_twitter_username'); $url = isset( $atts['url'])? esc_url($atts['url']) : esc_url("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); $email_subject = esc_attr(get_option('mo_openid_share_email_subject')); $email_body = get_option('mo_openid_share_email_body'); $email_body = str_replace('##url##', $url, $email_body); if($custom_theme == 'custombackground'){ $custom_theme = 'custom'; } if($custom_theme == 'nobackground'){ $custom_theme = 'customFont'; } $html .= "
"; $html .= '
'; $html .= '

'; $html .= "

"; if($custom_theme == 'custom'){ if( get_option('mo_openid_facebook_share_enable') ) { $link = 'https://www.facebook.com/dialog/share?app_id=766555246789034&display=popup&href='.$url; $html .= ""; } if( get_option('mo_openid_twitter_share_enable') ) { $link = empty($twitter_username) ? 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url : 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url. '&via='.$twitter_username; $html .= ""; } if( get_option('mo_openid_google_share_enable') ) { $link = "https://plus.google.com/share?url=".$url; $html .= ""; } if( get_option('mo_openid_vkontakte_share_enable') ) { $link = 'http://vk.com/share.php?url='.$url.'&title='.$title.'&description='.$excerpt; $html .= ""; } if( get_option('mo_openid_tumblr_share_enable') ) { $link = 'http://www.tumblr.com/share/link?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_stumble_share_enable') ) { $link = 'http://www.stumbleupon.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_linkedin_share_enable') ) { $link = 'https://www.linkedin.com/shareArticle?mini=true&title='.$title.'&url='.$url.'&summary='.$excerpt; $html .= ""; } if( get_option('mo_openid_reddit_share_enable') ) { $link = 'http://www.reddit.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_pinterest_share_enable') ) { $html .= ""; } if( get_option('mo_openid_pocket_share_enable') ) { $link = 'https://getpocket.com/save?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_digg_share_enable') ) { $link = 'http://digg.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_delicious_share_enable') ) { $link = 'http://www.delicious.com/save?v=5&noui&jump=close&url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_odnoklassniki_share_enable') ) { $link = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st.comments='.$excerpt.'&st._surl='.$url; $html .= ""; } if( get_option('mo_openid_mail_share_enable') ) { $html .= ""; } if( get_option('mo_openid_print_share_enable') ) { $html .= ""; } if( get_option('mo_openid_whatsapp_share_enable') ) { if(wp_is_mobile()){ $html .= '"; } else{ $html .= '"; } } } else if($custom_theme == 'customFont') { if( get_option('mo_openid_facebook_share_enable') ) { $link = 'https://www.facebook.com/dialog/share?app_id=766555246789034&display=popup&href='.$url; $html .= ""; } if( get_option('mo_openid_twitter_share_enable') ) { $link = empty($twitter_username) ? 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url : 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url. '&via='.$twitter_username; $html .= ""; } if( get_option('mo_openid_google_share_enable') ) { $link = 'https://plus.google.com/share?url='.$url; $html .= ""; } if( get_option('mo_openid_vkontakte_share_enable') ) { $link = 'http://vk.com/share.php?url='.$url.'&title='.$title.'&description='.$excerpt; $html .= ""; } if( get_option('mo_openid_tumblr_share_enable') ) { $link = 'http://www.tumblr.com/share/link?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_stumble_share_enable') ) { $link = 'http://www.stumbleupon.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_linkedin_share_enable') ) { $link = 'https://www.linkedin.com/shareArticle?mini=true&title='.$title.'&url='.$url.'&summary='.$excerpt; $html .= ""; } if( get_option('mo_openid_reddit_share_enable') ) { $link = 'http://www.reddit.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_pinterest_share_enable') ) { $html .= ""; } if( get_option('mo_openid_pocket_share_enable') ) { $link = 'https://getpocket.com/save?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_digg_share_enable') ) { $link = 'http://digg.com/submit?url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_delicious_share_enable') ) { $link = 'http://www.delicious.com/save?v=5&noui&jump=close&url='.$url.'&title='.$title; $html .= ""; } if( get_option('mo_openid_odnoklassniki_share_enable') ) { $link = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st.comments='.$excerpt.'&st._surl='.$url; $html .= ""; } if( get_option('mo_openid_mail_share_enable') ) { $html .= ""; } if( get_option('mo_openid_print_share_enable') ) { $html .= ""; } if( get_option('mo_openid_whatsapp_share_enable') ) { if(wp_is_mobile()){ $html .= '"; } else{ $html .= '"; } } } else { if( get_option('mo_openid_facebook_share_enable') ) { $link = 'https://www.facebook.com/dialog/share?app_id=766555246789034&display=popup&href='.$url; $html .= "Facebook"; } if( get_option('mo_openid_twitter_share_enable') ) { $link = empty($twitter_username) ? 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url : 'https://twitter.com/intent/tweet?text='.$title.'&url='.$url. '&via='.$twitter_username; $html .= "Twitter"; } if( get_option('mo_openid_google_share_enable') ) { $link = 'https://plus.google.com/share?url='.$url; $html .= "Google"; } if( get_option('mo_openid_vkontakte_share_enable') ) { $link = 'http://vk.com/share.php?url='.$url.'&title='.$title.'&description='.$excerpt; $html .= "Vkontakte"; } if( get_option('mo_openid_tumblr_share_enable') ) { $link = 'http://www.tumblr.com/share/link?url='.$url.'&title='.$title; $html .= "Tumblr"; } if( get_option('mo_openid_stumble_share_enable') ) { $link = 'http://www.stumbleupon.com/submit?url='.$url.'&title='.$title; $html .= "StumbleUpon"; } if( get_option('mo_openid_linkedin_share_enable') ) { $link = 'https://www.linkedin.com/shareArticle?mini=true&title='.$title.'&url='.$url.'&summary='.$excerpt; $html .= "LinkedIn"; } if( get_option('mo_openid_reddit_share_enable') ) { $link = 'http://www.reddit.com/submit?url='.$url.'&title='.$title; $html .= "Reddit"; } if( get_option('mo_openid_pinterest_share_enable') ) { $html .= "Pinterest"; } if( get_option('mo_openid_pocket_share_enable') ) { $link = 'https://getpocket.com/save?url='.$url.'&title='.$title; $html .= "Pocket"; } if( get_option('mo_openid_digg_share_enable') ) { $link = 'http://digg.com/submit?url='.$url.'&title='.$title; $html .= "Digg"; } if( get_option('mo_openid_delicious_share_enable') ) { $link = 'http://www.delicious.com/save?v=5&noui&jump=close&url='.$url.'&title='.$title; $html .= "Delicious"; } if( get_option('mo_openid_odnoklassniki_share_enable') ) { $link = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st.comments='.$excerpt.'&st._surl='.$url; $html .= "Odnoklassniki"; } if( get_option('mo_openid_mail_share_enable') ) { $html .= "Email this page"; } if( get_option('mo_openid_print_share_enable') ) { $html .= "Print this page"; } if( get_option('mo_openid_whatsapp_share_enable') ) { if(wp_is_mobile()){ $html .= 'Whatsapp"; } else{ $html .= 'Whatsapp"; } } } $html .= "
"; $html .= "

"; if(get_option('mo_share_vertical_hide_mobile')) { $html .= ""; } $html .= ''; return $html; } ?>