帝国cms数据系统有一个 外部链接 ,她是很强大的。这个外部,可以是外站的任意网址,当然也可以是本站的网址。
利用这一点,我们就可以实现:实现上传pdf,word,jpg等文件后点击文章直接打开
方法如下:
很简单的,利用后台文章录入界面的那个外部链接功能,默认的是我们要手工输入地址,其实我们只要给他添加一个上传功能就行了,这个只要去修改字段管理的主表的 special.field 字段名,输入表单替换html代码 以下代码
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEAF5">
<tr>
<td bgcolor="#FFFFFF">信息属性:
<input name="checked" type="checkbox" value="1"<?=$r[checked]?' 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 bgcolor="#FFFFFF">关键字 :
<input name="keyboard" type="text" size="52" value="<?=stripSlashes($r[keyboard])?>">
<font color="#666666">(多个请用","隔开)</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">上传pdf文件(外部链接):
<input name="titleurl" type="text" value="<?=stripSlashes($r[titleurl])?>" 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[ehref]?>','','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>
就这样,你上传了pdf或者word后,文章打开就直接是你上传的pdf或者文件,原理很简单,就是相关于手工输入上传的地址。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。