djntt 现在是可以识别了 但是真的好奇怪发帖一直都是这样提示。但是帖子是发出去了 但是就现在这样的错误提示
那是你自己的问题。
djntt 无法自动识别。同时增加上去可以打开帖子网页没出现500,但是发帖出现 系统发生异常,非法输入!
咦,
我测试没问题呢。。
1,我测试 单独和同时 都没有问题。
2,发布了有自动识别的帖子,再发布自动识别的贴,或者附件贴,普通文本帖子,都没有问题。
是否可以开启debug =2 看看 错误提示。
我干脆把我的代码贴给你:
<?php $message= $first['message_fmt']; //腾讯视频 $message = preg_replace('/https:\/\/v.qq.com\/(.+)\/([a-zA-Z0-9]{8,}).(html?)/', '<iframe src="//v.qq.com/txp/iframe/player.html?origin=http%3A%2F%2Fmp.weixin.qq.com&vid=\2&autoplay=false&full=true&show1080p=false" allowfullscreen="true" height="376" width="95%" frameborder="0"></iframe>', $message); $message = preg_replace('/http:\/\/v.qq.com\/(.+)\/(.+)\/([a-zA-Z0-9]{8,}).(html?)/', '<iframe src="//v.qq.com/txp/iframe/player.html?origin=http%3A%2F%2Fmp.weixin.qq.com&vid=\3&autoplay=false&full=true&show1080p=false" allowfullscreen="true" height="376" width="95%" frameborder="0"></iframe>', $message); $message = preg_replace('/https:\/\/v.qq.com\/iframe\/player.html\?vid=([a-zA-Z0-9\=]+)/', '<iframe src="//v.qq.com/txp/iframe/player.html?origin=http%3A%2F%2Fmp.weixin.qq.com&vid=\3&autoplay=false&full=true&show1080p=false" allowfullscreen="true" height="376" width="95%" frameborder="0"></iframe>', $message); //网易云 if(strpos($message, 'music.163.com')){ $message = preg_replace('/https:\/\/music.163.com\/#\/song\?id=([0-9\=]+)/', '<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=\1&auto=0&height=66"></iframe>', $message); } if(strpos($message, 'music.163.com')){ $message = preg_replace('/https:\/\/music.163.com\/#\/m\/song\?id=([0-9\=]+)/', '<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=\1&auto=0&height=66"></iframe>', $message); } //优酷1 if(strpos($message, 'player.youku.com')){ $message = preg_replace('/https:\/\/player.youku.com\/player.php\/sid\/([a-zA-Z0-9\=]+)\/v.swf/', '<iframe src="https://player.youku.com/embed/\1" frameborder=0 "allowfullscreen"></iframe>', $message); } //优酷2 if(strpos($message, 'v.youku.com')){ $message = preg_replace('/https:\/\/v.youku.com\/v_show\/id_([a-zA-Z0-9\=]+)(\/|.html?)?.*/', '<iframe src="https://player.youku.com/embed/\1" frameborder=0 "allowfullscreen"></iframe>', $message); } // 完整的正则表达式 bilibili $pattern = '/https:\/\/www\.bilibili\.com\/video\/([a-zA-Z0-9]+)\/?.*/'; $replacement = '<iframe src="//player.bilibili.com/player.html?bvid=$1&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>'; $message = preg_replace($pattern, $replacement, $message); // $message = preg_replace('/https:\/\/www.bilibili.com\/video\/([a-zA-Z0-9\=]+)/', '<iframe src="//player.bilibili.com/player.html?aid=662897050&bvid=\1&cid=1318363561&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>', $message); // 图片 $img_re = '/(http[s]?:\/\/?([\w\d\-_]+[\.\w\d\-_]+).+\.(jpg|jpeg|gif|png|webp))\w*/'; if(preg_match($img_re, $message)){ $message = preg_replace($img_re, '<img class="lazy" src="\1" />', $message); } $music_re = '/(http[s]?:\/\/[\w.\/-]+\/)([^\/]+\.(mp3|mp4))\b/'; $message = preg_replace($music_re, '<audio src="$1$2"></audio>', $message); $first['message_fmt'] = $message; ?>
$music_re = '/(http[s]?:\/\/[\w.\/-]+\.)(mp3|mp4)\b/'; $message = preg_replace($music_re, '<audio src="$1$2"></audio>', $message);
试试。
更新一下:
'/(http[s]?:\/\/[\w.\/-]+\/)([^\/]+\.(mp3|mp4))\b/'; 支持网易云url: 类似:http://music.163.com/song/media/outer/url?id=354750.mp3
CF 目前只做了ftp
还会更新吗
哇,这个可以上传到云存储吗!!!
CF 暂时不接
好的吧~
搜:
<!--{hook post_message_after.htm}-->
下面加:
<a class="ttreadbutton" href="javascript:;" onclick="try{ UM.getEditor('message').setContent('[ttlogin]请在此输入登录可见内容[/ttlogin]',true) } catch(err) {document.getElementById('message').innerHTML+='[ttlogin]请在此输入登录可见内容[/ttlogin]';}">[登录可见]</a>
太贵了吧
版块
人生倒计时
~扫~码~领~红~包~