Mentions légales du service

Skip to content
Snippets Groups Projects
Commit de041885 authored by VIEVILLE Thierry's avatar VIEVILLE Thierry
Browse files

Merge branch 'master' of gitlab.inria.fr:ClassCode/class_code_v2

OK
parents ae55bf0a 45d29da0
No related branches found
No related tags found
No related merge requests found
......@@ -134,12 +134,16 @@ function get_query_by_category( $category, $nb_posts = -1, $offset = 0 ) {
return new WP_Query( $args );
}
function UR_exists($url){
$headers=get_headers($url);
return stripos($headers[0],"200 OK")?true:false;
}
// 'thumbnail_large', 'thumbnail_medium', 'thumbnail_small'
function get_vimeo_image( $vimeoId, $size = 'thumbnail_large' ) {
if(is_file("http://vimeo.com/api/v2/video/" . $vimeoId . ".json")){
$data = file_get_contents("http://vimeo.com/api/v2/video/" . $vimeoId . ".json");
$json_url = "http://vimeo.com/api/v2/video/" . $vimeoId . ".json";
if(UR_exists($json_url)){
$data = file_get_contents($json_url);
$data = json_decode($data);
return $data[0]->{$size};
}else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment