- เครดิต
- 1
- เพื่อน
- ทักทาย
- บล็อก
- อัลบั้ม
- โพสต์
- กระทู้
- แชร์
- สำคัญ
- สิทธิ์อ่าน
- 10
- จำนวนผู้ติดตาม
- จำนวนผู้กำลังติดตาม
- เพศ
- ไม่บอก
|
3bbit
โพสต์ 2011-9-21 13:15:27
function parseflv($url, $width = 0, $height = 0) {
$lowerurl = strtolower($url);
$flv = '';
$imgurl = '';
if(strpos($lowerurl, 'www.youtube.com/watch') !== FALSE) {
if(preg_match("/http:\/\/www.youtube.com\/watch\?v=([\-_a-zA-Z0-9]+)(.*)?/i", $url, $matches)) {
if(!$width) {
$width = 640;
}
if(!$height){
$height = 385;
}
return '<iframe class="youtube-player" type="text/html" width="'.$width.'" height="'.$height.'" src="http://www.youtube.com/embed/'.$matches[1].'" frameborder="0"></iframe>';
}
}elseif(strpos($lowerurl, 'video.mthai.com/player.php') !== FALSE){
if(preg_match("/http:\/\/video\.mthai\.com\/player\.php.id=([0-9]+)M([0-9]+)M([0-9]+)(.*)?/i", $url, $matches)) {
if(!$width) {
$width = 480;
}
if(!$height){
$height = 372;
}
return '<object id="mthai_player" width="'.$width.'" height="'.$height.'" data="http://video.mthai.com/Flash_player/flowplayer/flowplayer-3.1.5.swf" type="application/x-shockwave-flash" ><param name="allowFullScreen" value="true" ></param><param name="movie" value="http://video.mthai.com/Flash_player/flowplayer/flowplayer-3.1.5.swf"></param><param name="flashvars" value="config=http://video.mthai.com/get_config_event.php?id='.$matches[2].'"></param><param name="allowscriptaccess" value="always"></param><embed src="http://video.mthai.com/Flash_player/flowplayer/flowplayer-3.1.5.swf" type="application/x-shockwave-flash" allowscriptaccess="always" flashvars="config=http://video.mthai.com/get_config_event.php?id='.$matches[2].'" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></object>';
}
}elseif(strpos($lowerurl, 'www.clipmass.com/movie') !== FALSE){
if(preg_match("/http:\/\/www\.clipmass\.com\/movie\/((.+)\-\-\-)?([0-9]+)/i", $url, $matches)) {
if(!$width) {
$width = 425;
}
if(!$height){
$height = 355;
}
$code2 = substr($matches[3],-6);
return '<embed width="'.$width.'" height="'.$height.'" src="http://www.clipmass.com/player2010/cm/cmp.swf?config=http://www.clipmass.com/player2010/cm/econfig.php?video='.$matches[3].','.$code2.'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" />';
}
}elseif(strpos($lowerurl, 'video.sanook.com') !== FALSE){
if(preg_match("/http:\/\/video\.sanook\.com\/(.+)\-([0-9]+)\-player\.html/i", $url, $matches)) {
if(!$width) {
$width = 425;
}
if(!$height){
$height = 355;
}
return '<embed width="'.$width.'" height="'.$height.'" src="http://video.sanook.com/player/playerver1.swf" allowfullscreen="true" allowscriptaccess="always" flashvars="contentId='.$matches[2].'&embed=true&autoplay=false&repeats=false"></embed>';
}
}
return FALSE;
}
function parseimg($width, $height, $src, $lazyload) {
global $_G;
$extra = '';
if($width > $_G['setting']['imagemaxwidth']) {
$height = intval($_G['setting']['imagemaxwidth'] * $height / $width);
$width = $_G['setting']['imagemaxwidth'];
if(defined('IN_MOBILE') && !defined('TPL_DEFAULT')) {
$extra = '';
} else {
$extra = ' onclick="zoom(this)" style="cursor:pointer"';
}
}
$attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src';
return bbcodeurl($src, '<img'.($width > 0 ? ' width="'.$width.'"' : '').($height > 0 ? ' height="'.$height.'"' : '').' '.$attrsrc.'="'.$src.'"'.$extra.' border="0" alt="" />');
}
---------------------
ของผมแบบนี้ผิดตรงไหนครับ
------------
แบบนี้ครับผิดตรงไหนแน่นำด้วย |
|