DedeCMS织梦常见参数修改(二)
11.把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCms官方(解决方法):
登陆系统后台–系统–SQL命令行工具,运行下面代码
Alter TABLE `dede_archives` ADD COLUMN `voteid` int(10) NOT NULL DEFAULT 0 AFTER `mtype`;
运行后更新下缓冲,重新发布文章,成功解决了。
12.关于js文件由于编码的不同(gb2312或者utf-8)导致特效不出来的解决方案:
把JS文件重新粘贴到新建好的JS文档里就OK啦
13.一键更新四国语言版本的织梦问题:
中文(不用)
英文En(列表下选择En-index.htm模板)
韩文Korean(列表下选择H-index.htm模板)
一键更新就自动生成 index.html了。
14.dedecms5.7 版后台编辑器无法显示问题:
在系统设置里.Html编辑器选项(目前仅支持fck): fck
Html编辑器选项(目前仅支持fck): ckeditor
15.织梦DedeCms限制文章页上一篇、下一篇文章标题字数:
编辑打开include/arc.archives.class.php文件
查找:
$this->PreNext['pre'] = "上一篇:{$preRow['title']} ";
在这一行上面加上以下代码
$preRow['title']=cn_substr($preRow['title'],30);//最多显示15个汉字
查找:
$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";
在这一行上面加上以下代码
$nextRow['title']=cn_substr($nextRow['title'],30);//最多显示15个汉字
然后再重新生成所有页面即可。
参考网址:http://www.dedeadmin.com/?p=902
修改织梦文档标题长度限制
1、进入后台--系统--系统设置--系统基本参数--其他选项--文档标题最大程度改为你要的长度原默认是60(这里改为了200)
2、登陆数据库,改数据库表dede_archives表里面的title字段,原默认是60,(这里改为200).
16.织梦一个字数代表几个字节:
①GBK 一个汉字两个字节
②utf-8 [3×(汉字数-2)]+1 —— [3×(汉字数-2)]+1+2
17.修改织梦列表、文章默认的命名规则:
I。①文章命名:(修改完添加栏目就能看见。批量修改)
include/common.inc.php
//文档的默认命名规则 $art_shortname = $cfg_df_ext = '.html'; $cfg_df_namerule = '{typedir}/{Y}/{M}{D}/{aid}'.$cfg_df_ext;
修改成
$cfg_df_namerule = 'posts/{aid}'.$cfg_df_ext;
②列表命名:
dede/templets/catalog_add.htm
{typedir}/list_{tid}_{page} //修改成自己需要的即可
II。直接修改高级选项里边的文章命名规则(单独修改)
III。系统-系统基本参数-其它选项-是否允许用目录作为文档文件名(文档命名规则需
改为:{typedir}/{aid}/index.html)点是。然后把栏目文章命名规则改为{typedir}/{aid}
/index.html 生成的文章目录为:例 http://127.0.0.2/ceshi/135/
参考:http://www.chingli.net/37.html
18.底层模板的修改:
在 include/typelink.class.php
$typelink = "<a href='".$typepage."' title='查看 ".$typeinfos['typename']." 的全部文章'>".$typeinfos['typename']."</a>";
19.关于文章页点击次数的两种调用:
①.
{dede:field.click/} //静态(一般列表页用)
②.
<script src=" {dede:field name='phpurl'/}/count.php?view=yes&aid= {dede:field name='id'/}&mid={dede:field name='mid'/}" type='text /javascript' language="javascript"></script>次 // 动态(一般文章页用)
20.给近三天(或当天)发布的文章标题显示红色或加上new字或new小图片等:
<li><span>[[field:pubdate function="MyDate('Y-m-d H:i:s',@me)"/]]</span> <a href="[field:arcurl/]"> [field:pubdate runphp='yes'] $ntime = time(); $oneday = 3600 * 24; if(($ntime - @me)<$oneday) @me = "<font color='#900'>"; else @me = ""; [/field:pubdate] [field:title/] [field:pubdate runphp='yes'] $ntime = time(); $oneday = 3600 * 24; if(($ntime - @me)<$oneday) @me = "new!</font>"; else @me = ""; [/field:pubdate] </a></li>
给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片等
1、==========红色的日期========
[field:pubdate runphp='yes'] $a="<font color=red>".strftime('%m-%d',@me)."</font>"; $b=strftime('%m-%d',@me); $ntime = time(); $day3 = 3600 * 24 * 3; if(($ntime - @me) < $day3) @me = $a; else @me =$b; [/field:pubdate]
2、==========红色的(new)========
[field:pubdate runphp='yes'] $aa=strftime('%m-%d',@me); $ntime = time(); $tagtime = @me; $day3 = 3600 * 24 * 3; if($tagtime > $ntime-$day3) @me = "<font color='red'>(new)</font>"; else @me = $aa; [/field:pubdate]
3、==========加new.gif小图片========
[field:pubdate runphp='yes'] $aa=strftime('%m-%d',@me); $ntime = time(); $tagtime = @me; $day3 = 3600 * 24 * 3; if($tagtime > $ntime-$day3) @me = "<img src='new.gif' />".$aa; else @me = $aa; [/field:pubdate]
注意 ①:当天的去除*3 ②:img src='new.gif' /中不能用双引号,否则不行
===================================
[field:pubdate runphp="yes"] if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%H:%M",@me).'</FONT>';} else {@me=strftime("%m-%d",@me);} [/field:pubdate]
仅有 1 条评论