Franyer Rivas
1
Pi
Verificado
Verificación en dos pasos activada
Verificado por Whatsapp
¡Ha verificado su Paypal!
Verificado por Binance
¡Usuario popular!
Suscripción a IA
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/7xPgaeR1zf4?fs=1&hl=es_ES"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7xPgaeR1zf4?fs=1&hl=es_ES" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
function videoak($post,&$thumb_url) {
$content = $post->post_content;
preg_match('www.youtube.com/v/(.*?)/i',$content,$video_id);
$thumb_url = 'http://img.youtube.com/vi/' . $video_id . '/2.jpg';
}
<?php videoak($thumb_url) ?>
Warning: Missing argument 2 for videoak(), called in "RUTA DEL TEMA"
'www.youtube.com/v/(.*)'
Array
(
[0] => www.youtube.com/v/7xPgaeR1zf4
[1] => 7xPgaeR1zf4
)
http://img.youtube.com/vi/7xPgaeR1zf4/2.jpg
function videoak($post,&$thumb_url)
Warning: Missing argument 2 for videoak(), called in "RUTA DEL TEMA"
<?php videoak($post,$thumb_url) ?>
function print_video_thumb_supported_site($post,&$thumb_url) {
$content = $post->post_content;
if (preg_match(video_pattern(),$content, $match)) {
// video found
$content = $match[0];
preg_match('/^\[(\w+)/',$content,$video_type);
switch ($video_type[1]) {
case 'youtube':
preg_match('/v=(.*?)[\s&\[]/',$content,$video_id);
$thumb_url = 'http://img.youtube.com/vi/' . $video_id[1] . '/2.jpg';
return 1;
case 'googlevideo':
preg_match('/docid=(.*?)[\s&\[]/',$content,$docid);
$url = 'http://video.google.com/videofeed?docid=' . $docid[1];
$data = get_url($url);
preg_match("/media:thumbnail url=\"([^\"]\S*)\"/siU",$data,$t_url);
$thumb_url = $t_url[1];
return 1;
case 'vimeo':
preg_match('/\/(\d+)\[/',$content,$docid);
$url = 'http://vimeo.com/api/clip/' . $docid[1] . '.php';
$data = get_url($url);
/* Bypass Vimeo Api problem: http://www.vimeo.com/forums/topic:11826 */
preg_match('/thumbnail_large"\;s:\d+:"(.*?)"/',$data,$t_url);
// $thumb_url = $t_url[0]['thumbnail_large'];
$thumb_url = $t_url[1];
return 1;
case 'flv':
preg_match('/\](.*?)\[/',$content,$url);
$thumb_url = preg_replace('/\.((flv)|(swf)|(f4v))$/','.jpg',$url[1],1);
return 1;
case 'quicktime':
preg_match('/\](.*?)\[/',$content,$url);
$thumb_url = preg_replace('/\.mov$/','.jpg',$url[1],1);
return 1;
case 'dailymotion':
preg_match('/\](.*?)\[/',$content,$url);
$data = get_url($url[1]);
preg_match('/\.addVariable\("preview",\s*"(.*?)"\)/',$data,$t_url);
$thumb_url = urldecode($t_url[1]);
return 1;
case 'veoh':
preg_match('/\/watch\/([[:alnum:]]+)[\s&\[]/',$content,$docid);
$url = 'http://www.veoh.com/rest/video/' . $docid[1] . '/details';
$data = get_url($url);
preg_match('/fullHighResImagePath="(.*?)"/', $data, $t_url);
$thumb_url = $t_url[1];
return 1;
case 'viddler':
preg_match('/id=([[:alnum:]]+)/',$content,$docid);
$thumb_url = 'http://cdn-thumbs.viddler.com/thumbnail_2_' . $docid[1] . '.jpg';
return 1;
case 'metacafe':
preg_match('/\/watch\/([0-9]+)\//',$content,$docid);
$thumb_url = 'http://s4.mcstatic.com/thumb/' . $docid[1] . '.jpg';
return 1;
case 'blip':
preg_match('/posts_id=([[:alnum:]]+)/',$content,$docid);
$url = 'http://blip.tv/rss/flash/' . $docid[1];
$data = get_url($url);
preg_match('/<blip:smallThumbnail>(.*?)<\/blip:smallThumbnail>/', $data, $t_url);
$thumb_url = $t_url[1];
return 1;
case 'flickrvideo':
preg_match('/\](.*?)\[/',$content,$url);
preg_match('/\/([0-9]+)\/?\[/',$content,$docid);
$data = get_url($url[1]);
preg_match('/\.video_thumb_src\s*=\s*\'(\S+)\';/',$data,$t_url);
$thumb_url = $t_url[1];
return 1;
case 'spike':
preg_match('/\/([0-9]+)\/?\[/',$content,$docid);
$thumb_url = 'http://dyn.ifilm.com/resize/image/stills/films/resize/istd/' . $docid[1] . '.jpg?width=160';
return 1;
}
}
}
loop()://No se como era exactamente en WP esto, entiendo que algo como foreach($posts as $post):
//aquí lo importante
$img_url = 'http://www.sitio.com/default.jpg'; //Default por si no tienes resultados
videoak($post,&$img_url);
echo '<img src="'.$img_url.'" alt="mi imagen">';
//...
;
function videoak() {
global $post;
$content = $post->post_content;
preg_match('www.youtube.com/v/(.*?)/i', $content, $video_id[1]);
$thumb_url = 'http://img.youtube.com/vi/' . $video_id . '/2.jpg';
}
<?php videoak(); ?>
preg_match('www.youtube.com/v/(.*?)\?/i', $content, $video_id[1]);
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?