


音乐模型添加了一个试听音乐服务器字段,做外链音乐。
添加音乐哪里如果直接输入后面地址,数据多的话人家改了试听路径我要一个个的改。
问题:添加音乐地址哪里如果没http开头的播放都是{$info.st_server}www_xxx_com/public/xxx.mp3的目录. 请问红色部分怎么解决?
{volist name="$info['voice_url']" id="rs"}
{php}$rs['title']||$rs['title']=$info['title'].'(第'.$i.'段)';$rs['url']=str_replace(request()->domain(),$info['st_server'],$rs['url']);{/php}
{
mp3:decodeURIComponent('{:str_replace('.','x0o1x0o1',urlencode($rs['url']))}'.replace(/x0o1x0o1/g,".")).replace(/\+/g," "),
duration:'2:21',
cover:'{$info.picurl|default="/public/static/libs/jplayer/css/images/bg.jpg"}',
title:'{$rs.title}',
artist:'{$info.uid|get_user_name}',
background:'',
},
{/volist}
{volist name=":fun('content@next_more',$info,3)" id="rs"}
{php}$array=json_decode($rs['voice_url'],true);$voice_url=tempdir($array[0]['url']);$voice_url=str_replace(request()->domain(),$info['st_server'],$voice_url);{/php}
{
mp3:decodeURIComponent('{:str_replace('.','x0o1x0o1',urlencode($voice_url))}'.replace(/x0o1x0o1/g,".")).replace(/\+/g," "),
duration:'3:55',
cover:"{:tempdir($rs.picurl?:'/public/static/libs/jplayer/css/images/bg.jpg')}",
title:'{$rs.title}',
artist:'{$rs.uid|get_user_name}',
background:'',
next_topic:true,
},
{/volist}https://b.qibo168.com/cms/show-72.html 我音乐在另一个域名
原理就是利用前台的字符串替换 把本地的网址 改为远程的地址