- http://player.youku.com/player.php/sid/XMTYzNjQzNjE2MA==/v.swf
复制代码,
- if(strpos($msglower, ‘[/flash]’) !== FALSE) {
复制代码,
- if(strpos($msglower, ‘[/flash]’) !== FALSE) {
- $message = preg_replace(“/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is”, “[media]\\4[/media]”, $message);
- }
复制代码,
- $message = preg_replace(“/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is”, “[media]\\4[/media]”, $message);
复制代码,
- $message = preg_replace(“/\[flash=([1-9]\d*),([1-9]\d*)\]http:\/\/player\.youku\.com\/player\.php\/sid\/([\w=]+)\/v\.swf\[\/flash\]/”, youku_palyer(‘\\3’) , $message);
复制代码,
- function parseurl($url, $text, $scheme) {
复制代码,
- function youku_palyer($id){
- $html =”<div id=\”youkuplayer\” style=\”width:480px;height:400px\”></div><script type=\”text/javascript\” src=\”http://player.youku.com/jsapi\”></script><script type=\”text/javascript\”>function playVideo(){player.playVideo()}function pauseVideo(){player.pauseVideo()}function seekTo(e){player.seekTo(e)}function currentTime(){return player.currentTime()}player=new YKU.Player(\”youkuplayer\”,{styleid:\”0\”,client_id:\”6b017a5ff31195d4\”,vid:\”$id\”,newPlayer:!0,autoplay:!0,show_related:!1});</script>”;
- return $html;
- }
复制代码,此教程仅适合视频链接为:一下格式的视频引用
- http://player.youku.com/player.php/sid/XMTYzNjQzNjE2MA==/v.swf
复制代码
修改:source/function/function_discuzcode.php 文件
DZ起点网提示您:(
修改文件前切记备份)
1.
搜索:
- if(strpos($msglower, ‘[/flash]’) !== FALSE) {
复制代码
找到
第二个搜索结果
!
注意一定要是第二个搜索结果,搜索一共会出来两个结果!
第一个是电脑端的!~
第二个是才是手机端的
!
完整代码为:
- if(strpos($msglower, ‘[/flash]’) !== FALSE) {
- $message = preg_replace(“/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is”, “[media]\\4[/media]”, $message);
- }
复制代码
只需要将其中的代码:
- $message = preg_replace(“/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is”, “[media]\\4[/media]”, $message);
复制代码
修改为以下代码即可!
- $message = preg_replace(“/\[flash=([1-9]\d*),([1-9]\d*)\]http:\/\/player\.youku\.com\/player\.php\/sid\/([\w=]+)\/v\.swf\[\/flash\]/”, youku_palyer(‘\\3’) , $message);
复制代码
2.
然后搜索
- function parseurl($url, $text, $scheme) {
复制代码
在这段代码前面加入以下代码!
- function youku_palyer($id){
- $html =”<div id=\”youkuplayer\” style=\”width:480px;height:400px\”></div><script type=\”text/javascript\” src=\”http://player.youku.com/jsapi\”></script><script type=\”text/javascript\”>function playVideo(){player.playVideo()}function pauseVideo(){player.pauseVideo()}function seekTo(e){player.seekTo(e)}function currentTime(){return player.currentTime()}player=new YKU.Player(\”youkuplayer\”,{styleid:\”0\”,client_id:\”6b017a5ff31195d4\”,vid:\”$id\”,newPlayer:!0,autoplay:!0,show_related:!1});</script>”;
- return $html;
- }
复制代码