AL8 Forum
   登錄註冊幫助


標題: [插件] 附件類型識别BT
 marcus02
 0033358
Rank: 1

頭銜: Newbie

帖子: 18

精華: 0

積分: 290 點

現金: 92 元

存款: 0 元

閱讀權限: 10

註冊: 2005-10-23

狀態: 離線
 
發表於 2005-10-30 21:02  資料  個人空間  短消息  加為好友 
看看吧。。。。




 AL8 Forum © All rights reserved.
頂部
 人間蒸發
 0033726
Rank: 1

頭銜: Newbie

帖子: 4

精華: 0

積分: 40 點

現金: 4 元

存款: 0 元

閱讀權限: 10

註冊: 2005-10-29

狀態: 離線
 
發表於 2005-10-31 13:08  資料  個人空間  短消息  加為好友 
thank you




 AL8 Forum © All rights reserved.
頂部
 mgchat
 0033788
Rank: 1

頭銜: Newbie

帖子: 29

精華: 0

積分: 450 點

現金: 20 元

存款: 0 元

閱讀權限: 10

註冊: 2005-10-29

狀態: 離線
 
發表於 2005-10-31 23:28  資料  個人空間  短消息  加為好友 
我要睇
see~~~




 AL8 Forum © All rights reserved.
頂部
 殺人狂
 0018486
Rank: 3Rank: 3Rank: 3
點擊查看 殺人狂 的詳細資料

頭銜: Conqueror

帖子: 215

精華: 0

積分: 3167 點

現金: 0 元

存款: 881 元

閱讀權限: 20

註冊: 2005-3-30

來自: Cyber

狀態: 離線
 
發表於 2005-11-3 21:45  資料  個人空間  主頁 短消息  加為好友 
SEE  SEE




 AL8 Forum © All rights reserved.
頂部
 newspace
 0030544
Rank: 3Rank: 3Rank: 3
點擊查看 newspace 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 0

積分: 3940 點

現金: 194 元

存款: 11987 元

閱讀權限: 20

註冊: 2005-9-11

狀態: 離線
 
發表於 2005-11-6 17:40  資料  個人空間  短消息  加為好友 
有咩睇=.=




 AL8 Forum © All rights reserved.
頂部
 fiyo
 0017876
Rank: 1

頭銜: Newbie

帖子: 1

精華: 0

積分: 10 點

現金: 24 元

存款: 0 元

閱讀權限: 10

註冊: 2005-3-18

狀態: 離線
 
發表於 2005-11-8 22:46  資料  個人空間  短消息  加為好友 
不错,找了也很半天了




 AL8 Forum © All rights reserved.
頂部
 johnng
 0026476
Rank: 4Rank: 4Rank: 4Rank: 4
點擊查看 johnng 的詳細資料

頭銜: Lord

帖子: 424

精華: 0

積分: 3288 點

現金: 227 元

存款: 787 元

閱讀權限: 25

註冊: 2005-7-17

來自: http:// ...

狀態: 離線
 
發表於 2005-11-12 08:18  資料  個人空間  主頁 短消息  加為好友 
function attachtype($type, $returnval = 'html') {
        if(!isset($GLOBALS['_DCACHE']['attachicon'])) {
                $GLOBALS['_DCACHE']['attachicon'] = array
                        (        1 => 'common.gif',
                                2 => 'binary.gif',
                                3 => 'zip.gif',
                                4 => 'rar.gif',
                                5 => 'msoffice.gif',
                                6 => 'text.gif',
                                7 => 'html.gif',
                                8 => 'real.gif',
                                9 => 'av.gif',
                                10 => 'flash.gif',
                                11 => 'image.gif',
                                12 => 'bt.gif'
                        );
        }

        if(is_numeric($type)) {
                $typeid = $type;
        } else {
       
        if(preg_match("/BitTorrent|^(torrent)\t/", $type)) {
                        $typeid = 12;

                } elseif(preg_match("/image|^(jpg|gif|png|bmp)\t/", $type)) {
                        $typeid = 11;
                } elseif(preg_match("/flash|^(swf|fla|swi)\t/", $type)) {
                        $typeid = 10;
                } elseif(preg_match("/audio|video|^(wav|mid|mp3|m3u|wma|asf|asx|vqf|mpg|mpeg|avi|wmv)\t/", $type)) {
                        $typeid = 9;
                } elseif(preg_match("/real|^(ra|rm|rv)\t/", $type)) {
                        $typeid = 8;
                } elseif(preg_match("/htm|^(php|js|pl|cgi|asp)\t/", $type)) {
                        $typeid = 7;
                } elseif(preg_match("/text|^(txt|rtf|wri|chm)\t/", $type)) {
                        $typeid = 6;
                } elseif(preg_match("/word|powerpoint|^(doc|ppt)\t/", $type)) {
                        $typeid = 5;
                } elseif(preg_match("/^rar\t/", $type)) {
                        $typeid = 4;
                } elseif(preg_match("/compressed|^(zip|arj|arc|cab|lzh|lha|tar|gz)\t/", $type)) {
                        $typeid = 3;
                } elseif(preg_match("/octet-stream|^(exe|com|bat|dll)\t/", $type)) {
                        $typeid = 2;
                } elseif($type) {
                        $typeid = 1;
                       
                } else {
                        $typeid = 0;
                }
        }

        if($returnval == 'html') {
                return '<img src="images/attachicons/'.$GLOBALS['_DCACHE']['attachicon'][$typeid].'" align="absmiddle" border="0">';
        } elseif($returnval == 'id') {
                return $typeid;
        }
}


有些不同code,用別的方式修改,以上的code以供參考
我測試過,可用的!

[此帖最後由 johnng 在 2005-11-12 於 08:21 修改]




 AL8 Forum © All rights reserved.
頂部
 少爺Jin
 0036952
Rank: 1

頭銜: Newbie

帖子: 1

精華: 0

積分: 10 點

現金: 85 元

存款: 0 元

閱讀權限: 10

註冊: 2005-12-14

狀態: 離線
 
發表於 2005-12-14 11:17  資料  個人空間  短消息  加為好友 
我論壇可以有用ga




 AL8 Forum © All rights reserved.
頂部
聯繫我們 - AL8 Forum - 網頁空間由 I-SERVICES 提供 - Archiver - WAP
清除 Cookies, 當前時區 GMT+8, 現在時間是 2008-11-22 22:21
Processed in 0.066764 second(s), 7 queries , Gzip enabled
Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.