国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 建站經(jīng)驗 > 正文

phpwind教程:為列表頁標題后面添加新的附件圖標

2024-04-25 20:33:54
字體:
供稿:網(wǎng)友

pw論壇只有三種格式圖標,在后面找了很久沒找到,今天自已修改部分代碼,修改方法如下:

為下文方便說明,現(xiàn)在規(guī)定下面2個單詞定義

type指:附件類別名稱,比如大家可以將后綴為bmp、png、jpg等的一類附件定義為img這樣一個類別

ifupload指:一個type對應的一個唯一編號,比如下面例子中的img--->1,txt--->2

下面以添加music,pdf,torrent這三個類別文件圖標為例

1、 修改根目錄thread.php

找 到:

$attachtype = array('1'=>'img','2'=>'txt','3'=>'zip');

添 加相應格式圖標進去:

添加格式:,'ifupload'=>'type'

如:

$attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','5'=>'music','6'=>'pdf','4'=>'torrent');

2、 修改lib文件夾下的getinfo.class.php

找 到:

$attachtype = array('img','txt','zip');

添 加相應格式圖標進去:

添 加格式:,'type'

如:

$attachtype = array('img','txt','zip','pdf','music','torrent');

3、 修改lib文件夾下的upload.class.php

找 到:

elseif ($upload['ext'] == 'txt') {

if (preg_match('/(onload|submit|post|form)/i', readover($source))) {

P_unlink($source);

uploadmsg('upload_content_error');

}

$upload['type'] = 'txt';

}

添 加相應的圖標進去:

添 加格式:elseif ($upload['ext'] == '附件后綴')(多個后綴有的不同,詳細看下面例子) {

$upload['type'] = 'type';

}

如:

elseif ($upload['ext'] == 'txt') {

if (preg_match('/(onload|submit|post|form)/i', readover($source))) {

P_unlink($source);

uploadmsg('upload_content_error');

}

$upload['type'] = 'txt';

}elseif ($upload['ext'] == 'pdf') {

$upload['type'] = 'pdf';

}elseif (in_array($upload['ext'], array('mp3','mp4','avi','rmvb'))) {

$upload['type'] = 'music';

}elseif (in_array($upload['ext'], array('torrent','bittorrent'))) {

$upload['type'] = 'torrent';

}

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 庆安县| 叙永县| 百色市| 开平市| 咸丰县| 宜州市| 松江区| 安康市| 林州市| 怀仁县| 清水县| 莲花县| 浠水县| 兴仁县| 瑞丽市| 班戈县| 阳信县| 阿克| 鸡泽县| 资中县| 海盐县| 运城市| 清水县| 平山县| 临朐县| 凤山市| 新乡市| 乾安县| 高青县| 连州市| 齐河县| 东源县| 循化| 平顺县| 会东县| 蒙阴县| 镇原县| 洞头县| 德格县| 祁东县| 张家口市|