'25%','50'=>'50%','75'=>'75%');
//public $prepare_switch = true;
// Construct
public function __construct()
{
$plugin_b = plugin_basename(__FILE__);
$plugin_b = "playpops.php";
// exit();
add_filter('plugin_action_links_' . $plugin_b, 'mmPlayPopsFb_ActionLinks');
add_action('add_meta_boxes', array( $this, 'mmPlayPopsFb_AddMetaBox'));
add_action('save_post', array( $this, 'mmPlayPopsFb_Save'));
add_filter('the_content', array($this, 'mmPlayPopsFb_ConvertPlayer'), 20);
}
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
// Functions
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
public function mmGetShareButtons($urlshare, $playpops_skip_message)
{
/*
-->
*/
// ** This function is not available in Lite
return $sharebuttons;
}
public function mmGetVideoLength($video_id, $playpops_key)
{
// If playpops key is not defined then exit
if (empty($playpops_key))
return;
// Define url for google api calls
$url = 'https://www.googleapis.com/youtube/v3/videos?id=' . $video_id . '&part=contentDetails&key=' . $playpops_key;
// AIzaSyDUUjO-exXUFhEIlDXfbm4N6ocMGA-ZFnk
//Using cURL php extension to make the request to youtube API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//$feed holds a rss feed xml returned by youtube API
$json_response = curl_exec($ch);
curl_close($ch);
//$entry = $xml->entry[0];
$responseObj = json_decode($json_response, true);
//print_r($responseObj);
// duration
$duration = $responseObj['items'][0]['contentDetails']['duration'];
// Convert to seconds
preg_match_all('/(\d+)/', $duration, $parts);
$hours = floor($parts[0][0] / 60);
$minutes = $parts[0][0] % 60;
$seconds = $parts[0][1];
$totalseconds = ($hours * 3600) + ($minutes * 60) + $seconds;
return $totalseconds;
}
// Get current url
public function mmCurPageURL()
{
$pageURL = 'http';
if (isset($_SERVER["HTTPS"]))
if ($_SERVER["HTTPS"] == "on")
{
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
$pageURL .= $_SERVER["SERVER_NAME"].":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
else
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
return $pageURL;
}
// -------------------------------------------
// functions : Social Functions
// -------------------------------------------
public function mmFacebookLike($fb_pageurl, $playpops_skip_message)
{
// Define the popup skip message
$popskipmsg = '