Exemplo n.º 1
0
        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');
}
Exemplo n.º 2
0
 * 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');
Exemplo n.º 3
0
        $title = $result['field_title'];
        $value = $result['default_value'];
        $db_field = $result['db_field'];
        if ($type == 'dropdown') {
            $defaultselectvalue = explode(",", $value);
            $selectbuttonvalues = array();
            foreach ($defaultselectvalue as $key => $value) {
                $selectbuttonvalues[$value] = $value;
            }
            $array = array($name => array('title' => $title, 'type' => $type, 'value' => $selectbuttonvalues, 'name' => $name, 'id' => $name, 'db_field' => $db_field));
        } else {
            if ($type == 'radiobutton' || $type == 'checkbox') {
                $defaultradio = explode(",", $value);
                $radiobuttonvalues = array();
                foreach ($defaultradio as $key => $value) {
                    $radiobuttonvalues[$value] = $value;
                }
                $array = array($name => array('title' => $title, 'type' => $type, 'name' => $name, 'id' => $name, 'value' => $radiobuttonvalues, 'checked' => $defaultradio[0], 'db_field' => $db_field, 'auto_view' => 'no', 'sep' => ' '));
            } else {
                $array = array($name => array('title' => $title, 'type' => $type, 'name' => $name, 'id' => $name, 'db_field' => $db_field));
            }
        }
        foreach ($array as $key => $fields) {
            $new_array[$key] = $fields;
        }
    }
    return $new_array;
}
register_signup_field(load_custom_fields_signup($data, true));
register_custom_upload_field(load_custom_fields($data, true));
add_admin_menu('Custom Field', 'Custom Field', 'add_custom_field.php', CB_CUSTOM_FIELDS_DIR_NAME . '/admin');