1 && strpos($path, '[xu]') === false){ $name = end(explode('/', $path)); $path = str_replace($name, $xu.'_'.$name, $path); }else{ $path = str_replace('[xu]', $xu, $path); } if($ac == 'gif') $path = str_replace('.jpg', '.gif', $path); }else{ if(Mu_Type == 1 && $xu != '1'){ $ext = end(explode('/', $path)); $path = str_replace($ext, $xu.'/'.$ext, $path); } } if(Web_Play == ''){ if(Web_M3u8On == 1){ if($ac == 'm3u8'){ $link = 'http://'.Web_Url.$webpath.'m3u8/'.sys_auth($path).'.'.$ac; }else{ $link = 'http://'.Web_Url.$webpath.'m3u8/pic/'.sys_auth($path).'.'.$ac; } }else{ $link = 'http://'.Web_Url.Web_Path.$Mu_Path.$path; } }else{ if(Web_M3u8On == 1){ if($ac == 'm3u8'){ $link = 'http://'.Web_Play.$webpath.'m3u8/'.sys_auth($path).'.'.$ac; }else{ $link = 'http://'.Web_Play.$webpath.'m3u8/pic/'.sys_auth($path).'.'.$ac; } }else{ $link = 'http://'.Web_Play.'/'.$path; } } return $link; } function m3u8_dir($id,$time,$ac='m3u8',$old=0){ if($old == 0){ $Mu_Pic_Name = defined('Mu_Pic_Name') ? Mu_Pic_Name : '[年]/[月]/[日]/[md5]/vod.jpg'; $Mu_M3u8_Name = defined('Mu_M3u8_Name') ? Mu_M3u8_Name : '[年]/[月]/[日]/[md5]/m3u8.m3u8'; }else{ $Mu_Pic_Name = '[年]/[月]/[日]/[md5]/vod.jpg'; $Mu_M3u8_Name = '[年]/[月]/[日]/[md5]/m3u8.m3u8'; } $md5 = substr(md5(Mu_Key.$id.'ctcms'),0,8); $yarr = array('[年]','[月]','[日]','[id]','[md5]'); $xarr = array(date('Y',$time),date('m',$time),date('d',$time),$id,$md5); if($ac == 'gif'){ $dir_file = str_replace(array('.jpg','.png','jpeg'),'.gif',str_replace($yarr, $xarr, $Mu_Pic_Name)); }elseif ($ac == 'jpg') { $dir_file = str_replace($yarr, $xarr, $Mu_Pic_Name); }else{ $dir_file = str_replace($yarr, $xarr, $Mu_M3u8_Name); } return $dir_file; } //写文件 function write_file($path, $data, $mode = FOPEN_WRITE_CREATE_DESTRUCTIVE){ $dir = dirname($path); if(!is_dir($dir)){ mkdirss($dir); } if ( ! $fp = @fopen($path, $mode)){ return FALSE; } flock($fp, LOCK_EX); fwrite($fp, $data); flock($fp, LOCK_UN); fclose($fp); return TRUE; } //递归创建文件夹 function mkdirss($dir) { if (!$dir) { return FALSE; } if (!is_dir($dir)) { mkdirss(dirname($dir)); if (!file_exists($dir)) { mkdir($dir, 0777); } } return true; } //JSON输出 function getjson($info,$error=1,$sign=0,$callback=''){ $msg = $info; $data['error'] = $error; $data['info'] = $info; //兼容前台 $data['msg'] = $msg; if($sign==1 && is_array($msg)){ $data = array_merge($msg); } $json = json_encode($data); if(!empty($callback)){ echo $callback."(".$json.")"; }else{ echo $json; } exit; } //视频分页 function admin_page($url,$page,$pages){ $phtml = '