茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    帝國cms實(shí)現(xiàn)即彈出下載txt等格式
    來源:易賢網(wǎng) 閱讀:2095 次 日期:2016-06-14 14:50:20
    溫馨提示:易賢網(wǎng)小編為您整理了“帝國cms實(shí)現(xiàn)即彈出下載txt等格式”,方便廣大網(wǎng)友查閱!

    測試版本:帝國cms6.5

    功能位置:后臺(tái)->其他管理->下載模型管理->管理地址前綴

    相關(guān)函數(shù):e/class/downsysfun.php dotypefordownurl() , qdownloadfile() , downsoft()

    功能解釋:

    header:使用header轉(zhuǎn)向,通常設(shè)為這個(gè)。

    meta:直接轉(zhuǎn)自,如果是ftp地址推薦選擇這個(gè)。

    read:使用php程序讀取,防盜鏈較強(qiáng),但較占資源,服務(wù)器本地小文件可選擇。

    帝國cms彈出下載txt,xls等說明

    1.看下面粘貼的帝國原函數(shù)dotypefordownurl() header 與 meta 兩種方式都使用的真實(shí)地址,在這兩種方式下瀏覽器不能讀取的文件格式,例如rar,zip等將直接直接彈出一個(gè)真實(shí)地址下載,txt等瀏覽器可讀的文件格式則直接在線瀏覽;

    2.默認(rèn)不選擇前綴的情況下,使用是header

    3.read 這種方式下是利用php讀取文件,并傳遞給瀏覽器,無論 rar 還是txt都會(huì)彈出下載,而不是瀏覽器直接讀取,彈出的地址也是加密的地址類似:xxx.com/enews=downsoft& classid=39&id=11&pathid=0&pass=7b9516932a88d44b4e4610e209f6288d&p=22:::j2qcrbgqmrxk

    4.read的加密地址判斷是否有下載權(quán)限,也就是地址是否正確是由e/class/downsysfun.php中downsoft()函數(shù)來判 斷的,經(jīng)測試如果不更改后臺(tái)->系統(tǒng)設(shè)置->模型設(shè)置->下載驗(yàn)證碼 的情況下流傳出去是可以持續(xù)被下載的(沒有用戶組,積分等判斷限制 如果要避免那么e/class/downsysfun.php 第一行 $downsys_checkip=0; 中的0改為1),帝國cms也是通過這個(gè)方式來防盜鏈;

    5.如果我不想使用下載地址前綴,而讓txt等格式可以彈出下載,那么你可以在e/class/downsysfun.php中搜索dotypefordownurl($downurl,$downurlr['downtype']);上一行加入如下代碼:

    view plaincopy to clipboardprint?

    //trylife add check type 20101231 

    //不使用下載地址前綴 讓txt等瀏覽器可讀類型文件彈出下載 

    //a.f4 

    $type2r=array(.xls,.txt,); 

    if(in_array(getfiletype($downurl),$type2r)) 

    $downurlr['downtype']=2; 

    相關(guān)函數(shù)參閱

    view plaincopy to clipboardprint?

    //ecms e/class/downsysfun.php 

    function downsoft($classid,$id,$pathid,$p,$pass){ 

    global $empire,$public_r,$level_r,$class_r,$emod_r,$user_tablename,$user_userid,$user_rnd,$user_group,$user_userfen,$user_userdate,$user_username,$dbtbpre; 

    $id=(int)$id; 

    $classid=(int)$classid; 

    $pathid=(int)$pathid; 

    if(emptyempty($id)||emptyempty($p)||emptyempty($classid)) 

    printerror(errorurl,history.go(-1),1); 

    $p=reppostvar($p); 

    $p_r=explode(:::,$p); 

    $userid=$p_r[0]; 

    $rnd=$p_r[1]; 

    //驗(yàn)證碼 

    $cpass=md5(returndownsyscheckip().wm_chief.$public_r[downpass].$userid); 

    if($cpass<>$pass) 

    printerror(faildownpass,history.go(-1),1); 

    //表不存在 

    if(emptyempty($class_r[$classid][tbname])) 

    printerror(exiestsoftid,history.go(-1),1); 

    $mid=$class_r[$classid][modid]; 

    $tbname=$class_r[$classid][tbname]; 

    $ok=1; 

    $r=$empire->fetch1(select * from {$dbtbpre}ecms_.$tbname. where id='$id' and classid='$classid'); 

    if(emptyempty($r[id])) 

    printerror(exiestsoftid,history.go(-1),1); 

    //副表 

    if($emod_r[$mid]['tbdataf']&&$emod_r[$mid]['tbdataf']<>',') 

    $selectdataf=substr($emod_r[$mid]['tbdataf'],1,-1); 

    $finfor=$empire->fetch1(select .$selectdataf. from {$dbtbpre}ecms_.$tbname._data_.$r[stb]. where id='$r[id]'); 

    $r=array_merge($r,$finfor); 

    //區(qū)分下載地址 

    $path_r=explode(rn,$r[downpath]); 

    if(!$path_r[$pathid]) 

    printerror(exiestsoftid,history.go(-1),1); 

    $showdown_r=explode(::::::,$path_r[$pathid]); 

    $downgroup=$showdown_r[2]; 

    //下載權(quán)限 

    if($downgroup) 

    $userid=(int)$userid; 

    //取得會(huì)員資料 

    $u=$empire->fetch1(select * from .$user_tablename. where .$user_userid.='$userid' and .$user_rnd.='$rnd'); 

    if(emptyempty($u[$user_userid])) 

    {printerror(mustsingleuser,history.go(-1),1);} 

    //下載次數(shù)限制 

    $setuserday=; 

    if($level_r[$u[$user_group]][daydown]) 

    $setuserday=docheckmdownnum($userid,$u[$user_group]); 

    if($level_r[$downgroup][level]>$level_r[$u[$user_group]][level]) 

    printerror(notdownlevel,history.go(-1),1); 

    //點(diǎn)數(shù)是否足夠 

    $showdown_r[3]=intval($showdown_r[3]); 

    if($showdown_r[3]) 

    //---------是否有歷史記錄 

    $bakr=$empire->fetch1(select id,truetime from {$dbtbpre}enewsdownrecord where id='$id' and classid='$classid' and userid='$userid' and pathid='$pathid' and online=0 order by truetime desc limit 1); 

    if($bakr[id]&&(time()-$bakr[truetime]<=$public_r[redodown]*3600)) 

    {} 

    else 

    //包月卡 

    if($u[$user_userdate]-time()>0) 

    {} 

    //點(diǎn)數(shù) 

    else 

    if($showdown_r[3]>$u[$user_userfen]) 

    printerror(notenoughfen,history.go(-1),1); 

    //去除點(diǎn)數(shù) 

    $usql=$empire->query(update .$user_tablename. set .$user_userfen.=.$user_userfen.-.$showdown_r[3]. where .$user_userid.='$userid'); 

    //備份下載記錄 

    $utfusername=doutfandgbk($u[$user_username],1); 

    bakdown($classid,$id,$pathid,$userid,$utfusername,$r[title],$showdown_r[3],0); 

    //更新用戶下載次數(shù) 

    if($setuserday) 

    $usql=$empire->query($setuserday); 

    //總下載數(shù)據(jù)增一 

    $usql=$empire->query(update {$dbtbpre}ecms_.$class_r[$classid][tbname]. set totaldown=totaldown+1 where id='$id'); 

    $downurl=stripslashes($showdown_r[1]); 

    $downurlr=returndownqzpath($downurl,$showdown_r[4]); 

    $downurl=$downurlr['repath']; 

    //防盜鏈 

    @include(ecms_path.e/class/enpath.php); 

    $downurl=doendownpath($downurl); 

    db_close(); 

    $empire=null; 

    //trylife add check type 20101231 

    //不使用下載地址前綴 讓txt等瀏覽器可讀類型文件彈出下載 

    //a.f4 

    $type2r=array(.doc,.xls,.docx,.ppt,.pptx,.txt,pdf,); 

    if(in_array(getfiletype($downurl),$type2r)) 

    $downurlr['downtype']=2; 

    //trylife add check type 20101231 [e] 

    dotypefordownurl($downurl,$downurlr['downtype']); 

    //下載操作 

    function dotypefordownurl($downurl,$type=0){ 

    global $public_r; 

    if($type==1)//meta 

    echo<meta content='0;url=$downurl' http-equiv='refresh'>; 

    elseif($type==2)//read 

    qdownloadfile($downurl); 

    else//header 

    header(location:$downurl); 

    exit(); 

    //下載 

    function qdownloadfile($file){ 

    global $public_r; 

    if(strstr($file,)) 

    $exp=; 

    elseif(strstr($file,/)) 

    $exp=/; 

    else 

    header(location:$file); 

    exit(); 

    if(strstr($file,$exp.e.$exp)||strstr($file,..)||strstr($file,?)||strstr($file,#)) 

    header(location:$file); 

    exit(); 

    if(strstr($file,$public_r[fileurl])) 

    $file=str_replace($public_r[fileurl],'/d/file/',$file); 

    if(!strstr($file,://)) 

    if(!file_exists($file)) 

    $file=../...$file; 

    $filename=getdownurlfilename($file,$exp); 

    if(empty($filename)) 

    header(location:$file); 

    exit(); 

    //下載 

    header(content-type: application/octet-stream); 

    //header(accept-ranges: bytes); 

    //header(accept-length: .$filesize); 

    header(content-disposition: attachment; filename=.$filename); 

    echo readfiletext($file); 

    更多信息請查看CMS教程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:帝國cms實(shí)現(xiàn)即彈出下載txt等格式
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
    相關(guān)閱讀CMS教程

    2026國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)