zhoji 发表于 2020-4-13 13:31:53

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

利用后台文章录入界面的那个外部链接功能,默认的是我们要手工输入地址,其实我们只要给他添加一个上传功能就行了,这个只要去修改字段管理的主表的 special.field 字段名,输入表单替换html代码 以下代码
<font size="3"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEAF5">
<tr>
    <td height="25" bgcolor="#FFFFFF">信息属性:
      <input name="checked" type="checkbox" value="1"<?=$r?' checked':''?>>
      审核    推荐
      <select name="isgood" id="isgood">
      <option value="0">不推荐</option>
      <?=$ftnr['igname']?>
      </select>
         头条
      <select name="firsttitle" id="firsttitle">
      <option value="0">非头条</option>
      <?=$ftnr['ftname']?>
      </select></td>
</tr>
<tr>
    <td height="25" bgcolor="#FFFFFF">关键字   :
      <input name="keyboard" type="text" size="52" value="<?=stripSlashes($r)?>">
      <font color="#666666">(多个请用","隔开)</font></td>
</tr>
<tr>
    <td height="25" bgcolor="#FFFFFF">上传pdf文件(外部链接):
      <input name="titleurl" type="text" value="<?=stripSlashes($r)?>" size="52"><a onclick="window.open('ecmseditor/FileMain.php?type=0&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=titleurl<?=$ecms_hashur?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的文件"><img src="../data/images/changefile.gif" border="0" align="absbottom"></a>      
      <font color="#666666">(请点击图标上传文件)</font></td>
</tr>
</table></font>就这样,你上传了pdf或者word后,文章打开就直接是你上传的pdf或者文件,原理很简单,就是相关于手工输入上传的地址


另:后台管理数据表那增加个附件字段也可以。
页: [1]
查看完整版本: 帝国cms插件 实现上传pdf或者word后点击文章直接打开pdf或者word