'.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; } // 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'); // 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( "/\", $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 (ak_can_update_options()) { if (!empty($_POST['st_widget'])) { // have widget $widget = stripslashes($_POST['st_widget']); $widget = preg_replace("/\&/", "&", $widget); if(!preg_match('/buttons.js/',$widget)){ $pattern = "/publisher\=([^\&\"]*)/"; preg_match($pattern, $widget, $matches); if ($matches[0] == "") { // widget does not have publisher parameter at all $publisher_id = get_option('st_pubid'); if ($publisher_id != "") { $widget = preg_replace("/\"\>\s*\<\/\s*script\s*\>/", "&publisher=".$publisher_id."\">", $widget); $widget = preg_replace("/widget\/\&publisher\=/", "widget/?publisher=", $widget); } } elseif ($matches[1] == "") { // widget does not have pubid in publisher parameter $publisher_id = get_option('st_pubid'); if ($publisher_id != "") { $widget = preg_replace("/([\&\?])publisher\=/", "$1publisher=".$publisher_id, $widget); } else { $widget = preg_replace("/([\&\?])publisher\=/", "$1publisher=".$publisher_id, $widget); } } else { // widget has pubid in publisher parameter $publisher_id = get_option('st_pubid'); if ($publisher_id != "") { if ($publisher_id != $matches[1]) { $publisher_id = $matches[1]; } } else { $publisher_id = $matches[1]; } } }else{ $publisher_id = get_option('st_pubid'); $pkeyUpdated=false; if(!empty($_POST['st_pkey']) && $publisher_id!==$_POST['st_pkey'] && preg_match('/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/',$_POST['st_pkey'])){ update_option('st_pubid', $_POST['st_pkey']); $publisher_id=$_POST['st_pkey']; $pkeyUpdated=true; } else{ if(substr($_POST['st_pkey_hidden'], 0, 3) == "wp." && $publisher_id!==$_POST['st_pkey_hidden'] && preg_match('/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/',$_POST['st_pkey_hidden'])) { update_option('st_pubid', $_POST['st_pkey_hidden']); $publisher_id=$_POST['st_pkey_hidden']; $pkeyUpdated=true; } else{ // Re-generate new random publisher key $publisher_id=trim(makePkey()); update_option('st_pubid',$publisher_id); $pkeyUpdated=true; } } if (preg_match("/publisher:['\"]\w{8}-\w{4}-\w{4}-\w{4}-\w{12}['\"]/",$widget) || preg_match("/publisher:['\"]wp\.\w{8}-\w{4}-\w{4}-\w{4}-\w{12}['\"]/",$widget)) { $pkeyUpdated=false; } if(!preg_match('/stLight.options/',$widget) || $pkeyUpdated==true){ $widgetTemp=""; //if(preg_match('/doNotCopy/',$widget)){ // $widgetTemp.=""; //}else{ // $widgetTemp.=""; //} $widgetTemp.=""; // In case of button style = sharethis (4/7) default. // Remove FBLike, Google+,Pinterest from hoverbar services $defaultServices = '"facebook","twitter","linkedin","email","sharethis"'; $st_services_values = ''; if($_POST["st_current_type"] == 'classic') { $st_services_values = $defaultServices; } else{ // Adding double quotes for each service separated by comma $chickletServicesArray = explode(',', trim($_POST['st_services'])); $newchickletServicesArray = array(); for($i=0; $i