搜索
SR網頁設計工作室 - 購物網站/企業官網專業開發 Discuz 使用教程 讓 Discuz 討論區/個人日誌可以支援解析 YOUTUBE 影片 ...
byadmin 發表於 2014-9-4 18:46:48 , 6131人已閱讀 , 1人回應
討論區
修改後可使DISCUZ 討論區多媒體支援 http://youtu.be/_XV77W2OAJs 格式影片嵌入

個人空間 / 日誌
修改後可使DISCUZ 個人日誌可支援 http://youtu.be/_XV77W2OAJs 格式影片嵌入

2014-09-04_184618.jpg


論壇
function_discuzcode
→ function parseflv 函數

  1. } elseif(strpos($lowerurl, 'youtu.be/') !== FALSE) {
  2. if(preg_match("/http:\/\/youtu.be\/([^\/]+)/i", $url, $matches)) {
  3. $flv = 'http://www.youtube.com/v/'.$matches[1].'?version=3&hl=zh_TW&rel=0';
  4. if(!$width && !$height) {
  5. $str = file_get_contents("http://www.youtube.com/embed/".$matches[1]);
  6. if(!empty($str) && preg_match("/\"iurl\": \"(.+?)\",/i", $str, $image)) {
  7. $imgurl = trim(str_replace('\\', '', $image[1]));
  8. }
  9. }
  10. }
  11. } elseif(strpos($lowerurl, 'vlog.xuite.net/play') !== FALSE) {
  12. if(preg_match("/http:\/\/vlog.xuite.net\/play\/(.*?)/i", $url, $matches)) {
  13. $str = file_get_contents($url);
  14. preg_match("/\"og:video\" content=\"(.+?)\"/i", $str, $video);
  15. $flv = trim($video[1]);
  16. if(!$width && !$height) {
  17. if(!empty($str) && preg_match("/\"og:image\" content=\"(.+?)\"/i", $str, $image)) {
  18. $imgurl = trim($image[1]);
  19. }
  20. }
  21. }
複製代碼
個人空間
function_blog
→ function blog_flash

  1. elseif((strpos($swf_url, 'www.youtube.com/') !== FALSE) or(strpos($swf_url, 'youtu.be/') !== FALSE) ) {                $flv=$swf_url;                if(preg_match("/http:\/\/www.youtube.com\/watch\?v=([^\/&]+)&?/i", $swf_url, $matches)) {                        $flv = 'http://www.youtube.com/v/'.$matches[1].'&hl=zh_CN&fs=1';                }                if(preg_match("/http:\/\/youtu.be\/([^\/&]+)&?/i", $swf_url, $matches)) {                        $flv = 'http://www.youtube.com/v/'.$matches[1].'&hl=zh_CN&fs=1';                }$html='<object width="560" height="349"><param name="movie" value="http://www.youtube.com/v/2Fz3zFqLc3E?version=3&amp;hl=zh_CN"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src='.$flv.' type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
複製代碼
by林幽靈@FB 發表於 2015-1-5 21:43:20
看不到,需求太高了

回覆 顯示全部樓層 道具 舉報

Traffic Exchange Site
您需要登錄後才可以回帖 登錄 | 立即註冊

作者資訊

文章分類

SR數位設計工作室

  • 服務專線:03-3555-069


ECSHOP購物網站開發|接案說明|線上洽詢|隱私權政策|SR數位設計(CMS)

信箱:sr.design2011@gmail.com

, Processed in 0.193463 second(s), 52 queries , Gzip On.

Copyright © 2011-2014 Template By SR網頁設計清新部落風格

Core - DZ2.5 GMT+8, 2024-4-18 21:58

回頂部