回复 1# 竹片子
这个需要修改discuzcode.func.php中的rayfilecode函数,请做如下的替换,我觉得似乎会增加解析负担,当然写的有些急,这部分脑子动得少了,如有修改意见请尽管提出。- //additional plugin code
- function rayfilecode($code)
- {
- global $discuzcodes;
- $discuzcodes['pcodecount']++;
- $codecount=$discuzcodes['pcodecount'];
- $searcharray = explode("|", $code);//Split [rayfile] tag's content
- $rayfile_url = str_replace("[url]", "", str_replace("[/url]", "", $searcharray[2]));//Get the Rayfile File page url
- $rayfile_code = str_replace("/", "", str_replace("http://www.rayfile.com/files/", "", $rayfile_url));//Get the Rayfile code
- $searcharray_filetype = strtolower(substr(strrchr($searcharray[0], '.'), 1, 5));//Get the extension name of the upload file
- $searcharray_description = $searcharray_wmpnote = $searcharray_wmp = "";//Description of the upload file
- if($searcharray_filetype == "mp3" || $searcharray_filetype == "wma" || $searcharray_filetype == "mid" || $searcharray_filetype == "wav"){
- $view = "<br /><img src="images/attachicons/rayfile.gif" border="0" class="absmiddle" alt="" /> <span style="white-space: nowrap" id="attach_".$rayfile_code."" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})"><a target="_blank" href="".$rayfile_url.""><strong>".$searcharray[0]."</strong></a></strong></a></span>";
- if ($searcharray[1] != $searcharray[0]) $searcharray_description = "(".$searcharray[1].")";
- $searcharray_wmpnote = ",下为本曲试听";
- $searcharray_wmp = "<p>".parseaudio("getrayfileurl.php?rayfilecode=".$rayfile_code."&type=.mp3", 400, 0)."</p>";
- $view.= $searcharray_description."<div class="t_attach" id="attach_".$rayfile_code."_menu" style="position: absolute; display: none">点击进入Rayfile下载页".$searcharray_wmpnote."</div>".$searcharray_wmp;
- }else{
- $view = "<br /><table cellspacing="0" class="t_table" style="width:550px"><tr><td><font style="font-size: 9pt"><strong>文件名:</strong> ".$searcharray[0]."<br /><strong>描述:</strong> ".$searcharray[1]."<br /><strong>下载地址:</strong> <a href="".$rayfile_url."" target="_blank">".$rayfile_url."</a></font></td></tr></table>";
- }
- $discuzcodes['codehtml'][$discuzcodes['pcodecount']] = "$view";
- $discuzcodes['codecount']++;
- return "[\tDISCUZ_CODE_$discuzcodes[pcodecount]\t]";
- }
- }
复制代码 这段代码我换上去 帖子就打不开了 我喜欢你能把除音乐文件以那样的形式展出
其他文件的形式都想像这样 好些 |