'Invalid request.'))); $url = stripslashes( $_POST['url'] ); require_once( MLVL_DIR ."lib/Embed.class.php"); $AE = new Embed(); if( !$AE->parseUrl( $url )) die( json_encode( array( 'error'=>'Invalid video url provided.'))); $AE->setParam( 'wmode','transparent'); die( json_encode( array( 'attrb'=>$AE->getObjectAttribs(),'embed'=>$AE->getEmbedCode() ))); } add_action( 'wp_ajax_mlvl_parse_embed_url','mlvl_parse_embed_url_ajax'); add_action( 'wp_ajax_nopriv_mlvl_parse_embed_url','mlvl_parse_embed_url_ajax'); function mlvl_head(){ if( !mlvl_get_options( 'fbapp_id')) return; ;echo '
'; } add_action( 'wp_head','mlvl_head'); function mlvl_shortcode( $atts,$content ){ extract( shortcode_atts( array( 'video_url'=>'', 'width'=>'', 'height'=>'', 'overlay'=>MLVL_URL.'images/patterns/default_.png', 'overlay_radius'=>'0px', 'overlay_opacity'=>'0.5', 'overlay_padding'=>'0px', 'action_text'=>'', 'action_text_color'=>'white', 'action_text_size'=>'12', 'action_text_pleft'=>'100px', 'action_text_ptop'=>'20px', 'action_text_weight'=>'400', 'action_text_align'=>'center', 'action_text_width'=>'200px', 'share_button'=>MLVL_URL.'images/buttons/unlock1.png', 'share_button_pleft'=>'100px', 'share_button_ptop'=>'180px', 'countdown_time'=>'0', 'countdown_pleft'=>'100px', 'countdown_ptop'=>'130px', 'share_title'=>( is_singular()) ?the_title('','',false) : get_bloginfo( 'name'), 'share_link'=>( is_singular()) ?get_permalink() : home_url( '/'), 'invites'=>'1', 'multiunlock'=>'0', 'social_buttons'=>'0', 'subscription_method'=>'', 'subscription_form_data'=>'' ),$atts )); $multiunlock = (bool) $multiunlock; $social_buttons = (bool) $social_buttons; require_once( MLVL_DIR ."lib/Embed.class.php"); $AE = new Embed(); if( !$AE->parseUrl( $video_url )) return ''; $AE->setWidth( $width ); $AE->setHeight( $height ); $AE->setParam( 'wmode','transparent'); $locked = true; if( isset( $_COOKIE['mlvlmu'] )) $locked = false; $unlocked_videos = isset( $_COOKIE['mlvluv'] ) ?explode( ";",$_COOKIE['mlvluv'] ) : array(); if( $locked &&!empty( $unlocked_videos ) &&in_array( md5( $video_url ),$unlocked_videos )) $locked = false; $UID = get_the_ID() .rand( 0,1000000000 ); if( $multiunlock ){ $unlocked_js = ' mlvl_setCookie("mlvlmu", "1", 100); jQuery(".mlvl_overlay, .mlvl_action_text, .mlvl_countdown_wrap, .mlvl_share_button_wrap").remove(); jQuery(".mlvl_socialbar_wrap, .mlvl_content_reveal_wrap").show(); '; } else{ if( isset( $_COOKIE['mlvluv'] )) $new_cookie = md5( $video_url ) .";".$_COOKIE['mlvluv']; else $new_cookie = md5( $video_url ); $unlocked_js=' mlvl_setCookie("mlvluv", "'.$new_cookie .'", 100); jQuery("#mlvideo-'.$UID .' .mlvl_overlay, #mlvideo-'.$UID .' .mlvl_action_text, #mlvideo-'.$UID .' .mlvl_countdown_wrap, #mlvideo-'.$UID .' .mlvl_share_button_wrap").remove(); jQuery("#mlvideo-'.$UID .' .mlvl_socialbar_wrap, #mlvideo-'.$UID .' .mlvl_content_reveal_wrap").show(); '; } $subscription_js = ""; if( isset( $subscription_method ) &&in_array( $subscription_method,array( 'getresponse','mailchimp','icontact','aweber')) &&!empty( $subscription_form_data )){ $subscription_form_data = maybe_unserialize( base64_decode( $subscription_form_data )); $subscription_js .= "// Do Subscribe Call\n"; $subscription_js .= "\t\t\t\t\t\t\tFB.api('/me?fields=name,username,email', function(response){\n"; $subscription_js .= "\t\t\t\t\t\t\tvar args = ".json_encode( $subscription_form_data ).";\n"; $subscription_js .= "\t\t\t\t\t\t\targs.name = response.name;\n"; $subscription_js .= "\t\t\t\t\t\t\targs.email = response.email;\n"; $subscription_js .= "\t\t\t\t\t\t\tjQuery.post( '".admin_url( "admin-ajax.php") ."', {\"action\":\"mlvl_subscribe\", \"service\":\"$subscription_method\", \"args\":args});\n"; $subscription_js .= "});\n\n"; } $invites = (int) $invites; $width = (int) $width; $height = (int) $height; $countdown_time = intval( $countdown_time ); if( !isset( $action_text_color ) ||!preg_match( '/^#[a-f0-9]{6}$/i',$action_text_color )) $action_text_color = "#FFF"; $result = "';print_r($a);echo ''."\n\n\n"; } ?>