您的位置:宽带测速网 > 帝国cms > 帝国cms实现上传pdf或者word后点击文章直接打开pdf或者word

帝国cms实现上传pdf或者word后点击文章直接打开pdf或者word

2025-08-20 10:28来源:互联网 [ ]

利用后台文章录入界面的那个外部链接功能,默认的是我们要手工输入地址,其实我们只要给他添加一个上传功能就行了,这个只要去修改字段管理的主表的 special.field 字段名,输入表单替换html代码 以下代码


<tablewidth="100%"border="0"cellpadding="0"cellspacing="0"bgcolor="#DBEAF5"><tr><tdheight="25"bgcolor="#FFFFFF">信息属性:<inputname="checked"type="checkbox"value="1"<?=$r[checked]?'checked':''?>>审核&nbsp;&nbsp;推荐<selectname="isgood"id="isgood"><optionvalue="0">不推荐</option><?=$ftnr['igname']?></select>&nbsp;&nbsp;头条<selectname="firsttitle"id="firsttitle"><optionvalue="0">非头条</option><?=$ftnr['ftname']?></select></td></tr><tr><tdheight="25"bgcolor="#FFFFFF">关键字&nbsp;&nbsp;&nbsp;:<inputname="keyboard"type="text"size="52"value="<?=stripSlashes($r[keyboard])?>"><fontcolor="#666666">(多个请用&quot;,&quot;隔开)</font></td></tr><tr><tdheight="25"bgcolor="#FFFFFF">上传pdf文件 外部链接:<inputname="titleurl"type="text"value="<?=stripSlashes($r[titleurl])?>"size="52"><aonclick="window.open('ecmseditor/FileMain.php?type=0&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=titleurl<?=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');"title="选择已上传的文件"><imgsrc="../data/images/changefile.gif"border="0"align="absbottom"></a><fontcolor="#666666">(请点击图标上传文件)</font></td></tr></table>就这样,你上传了pdf或者word后,文章打开就直接是你上传的pdf或者文件,原理很简单,就是相关于手工输入上传的地址