* Function used to check embed video * if video is embeded , it will check its code * if everthing goes ok , it will change its status to successfull * @param VID */ function remote_video_check($vid) { global $myquery, $db; if (is_array($vid)) { $vdetails = $vid; } else { $vdetails = $myquery->get_video_details($vid); } if (!empty($vdetails['remote_play_url']) && $vdetails['remote_play_url'] != ' ' && $vdetails['remote_play_url'] != 'none') { $db->update(tbl("video"), array("status"), array('Successful'), " videoid='{$vid}'"); } } /** * Function used to play embed code * @param Video details */ function play_remote_video($vdetails) { if (!empty($vdetails['remote_play_url']) && $vdetails['remote_play_url'] != 'none') { return $vdetails['remote_play_url']; } } $Cbucket->custom_video_file_funcs[] = 'play_remote_video'; register_after_video_upload_action('remote_video_check'); register_custom_upload_field($link_vid_field_array); $Cbucket->add_header(PLUG_DIR . '/cb_link_video/header.html');
preg_match("/youtube-nocookie\\.com/", $src, $ytnccom); if (!empty($ytcom[0]) || !empty($ytnccom[0])) { preg_match("/\\/v\\/([a-zA-Z0-9_-]+)/", $src, $srcs); $srcs = explode("&", $srcs[1]); $ytcode = $srcs[0]; if (!$ytcode) { preg_match("/\\/embed\\/(.*)/", $src, $srcs); $srcs = explode("&", $srcs[1]); $ytcode = $srcs[0]; } //Creating Youtube VIdeo URL $yturl = "http://www.youtube.com/watch?v=" . $ytcode; $results['url'] = $yturl; $results['ytcode'] = $ytcode; $results['website'] = 'youtube'; return $results; } else { return false; } } //If Youtube function is_ref_youtube($url) { preg_match("/youtube\\.com/", $url, $ytcom); return $ytcom; } register_after_video_upload_action('embed_video_check'); register_custom_upload_field($embed_field_array); $Cbucket->add_header(PLUG_DIR . '/embed_video_mod/header.html'); register_actions_play_video('play_embed_video'); }