帝国cms模板如何自动生成文章缩略图?
发布时间:2021-03-17作者:帝国建站网
先到 系统>管理数据表 > 后,在你需要进行设定的类型里更改,比如我要 新闻 这项的实现自动生成标题缩略图和自动分页(当然,你也可以单独实现分页和生成缩略图)
找到 新闻系统数据表 ( phome_ ecms_ news ) >[管理字段]>新闻正文 后面点击 修改
直接将修改完以后的代码复制进去更新一下就可以用了。
系统原来的代码:
<?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":stripSlashes($r[newstext]),"Default","","300","100%")?> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5"> <tr> <td bgcolor="#FFFFFF"> <input name="dokey" type="checkbox" value="1"<?=$r[dokey]==1?' checked':''?>> 关键字替换 <input name="copyimg" type="checkbox" id="copyimg" value="1"> 远程保存图片( <input name="mark" type="checkbox" id="mark" value="1"> <a href="SetEnews.php" target="_blank">加水印</a>) <input name="copyflash" type="checkbox" id="copyflash" value="1"> 远程保存FLASH(地址前缀: <input name="qz_url" type="text" id="qz_url" size=""> )</td> </tr> <tr> <td bgcolor="#FFFFFF"><input name="repimgnexturl" type="checkbox" id="repimgnexturl" value="1"> 图片链接转为下一页 <input name="autopage" type="checkbox" id="autopage" value="1">自动分页 ,每 <input name="autosize" type="text" id="autosize" value="5000" size="5"> 个字节为一页 取第 <input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="" size="1"> 张上传图为标题图片( <input name="getfirsttitlespic" type="checkbox" id="getfirsttitlespic" value="1"> 缩略图: 宽 <input name="getfirsttitlespicw" type="text" id="getfirsttitlespicw" size="3" value="<?=$public_r[spicwidth]?>"> *高 <input name="getfirsttitlespich" type="text" id="getfirsttitlespich" size="3" value="<?=$public_r[spicheight]?>"> )</td> </tr> </table>
修改完以后的代码:
<?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":stripSlashes($r[newstext]),"Default","","300","100%")?> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5"> <tr> <td bgcolor="#FFFFFF"> <input name="dokey" type="checkbox" value="1"<?=$r[dokey]==1?' checked':''?>> 关键字替换 <input name="copyimg" type="checkbox" id="copyimg" value="1" checked="checked"> 远程保存图片( <input name="mark" type="checkbox" id="mark" value="1" checked="checked"> <a href="SetEnews.php" target="_blank">加水印</a>) <input name="copyflash" type="checkbox" id="copyflash" value="1"> 远程保存FLASH(地址前缀: <input name="qz_url" type="text" id="qz_url" size=""> )</td> </tr> <tr> <td bgcolor="#FFFFFF"><input name="repimgnexturl" type="checkbox" id="repimgnexturl" value="1"> 图片链接转为下一页 <input name="autopage" type="checkbox" id="autopage" value="1">自动分页 ,每 <input name="autosize" type="text" id="autosize" value="5000" size="5"> 个字节为一页 取第 <input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="1" size="1"> 张上传图为标题图片( <input name="getfirsttitlespic" type="checkbox" id="getfirsttitlespic" value="1" checked="checked"> 缩略图: 宽 <input name="getfirsttitlespicw" type="text" id="getfirsttitlespicw" size="3" value="<?=$public_r[spicwidth]?>"> *高 <input name="getfirsttitlespich" type="text" id="getfirsttitlespich" size="3" value="<?=$public_r[spicheight]?>"> )</td> </tr> </table> 后续说明:自动生成缩略图的大小,是在系统参数设置里进行设定的,自己可以根据需要,到参数设置里进行更改,从而实现默认的大小。
相关帝国教程
- 03-04帝国CMS忘记后台管理员帐号解决办法
- 08-16帝国cms内容页,列表页,封面页如何调用栏目别名
- 07-18帝国CMS验证码显示重复的解决办法
- 11-05帝国CMS用PHP代码实现灵动标签的技巧和代码
- 01-01帝国cms目录结构讲解
- 10-18帝国CMS自定义页面用PHP获取页面ID、页面名称、标题、关键词、描述、内容等变量
- 11-22帝国CMS程序在IIS环境下设置伪静态的教程!(Windows系统)
- 06-23帝国CMS高级应用—SQL调用会员空间反馈信息
- 09-28帝国CMS会员中心模板中判断收藏夹是否有内容
- 08-28帝国cms怎么自动刷新网站首页?(帝国CMS自动刷新首页的方法)
- 06-20帝国CMS下载地址字段/播放地址字段自动转义的修改方法!
- 08-27帝国CMS让信息内容ID从1开始的方法!
- 09-28帝国cms采集规则加上采集来源地址的方法
- 07-01帝国cms后台发布信息时的多图上传去掉a标签
- 07-29帝国CMS7.5版支持自定义后台登录文件
- 12-28帝国CMS支持显示标题颜色的标题灵动标签
- 07-17帝国CMS自定义页面调用分类
- 10-26帝国cms内容页图片自适应大小方法,图片过大如何解决?
- 07-13css的文字过长裁剪后面跟着省略号
- 06-01帝国CMS内容页模板文章阅读数用中文千万为单位