1.修改列表页码序列HTML组合串: /include/arc.listview.class.php 动态分页方法:function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno") 静态分页方法:function GetPageListST($list_len,$listitem="index,end,pre,next,pageno") 2.一、二级导航嵌套输出:在 {dede:channelartlist type='top' row='8'} <UL> <LI class="bh1 b"><A href="http://blog.163.com/wumingli456@126/blog/{dede:field name='typeurl'/}">{dede:field name='typename'/}</A> </LI> <LI><P class="index_mulu_p1 b">分类:</P><P class=index_mulu_p2> {dede:channel type='son' } <a href='http://blog.163.com/wumingli456@126/blog/[field:typeurl/]'>[field:typename/]</a>| {/dede:channel} </P> </LI> </UL> {/dede:channelartlist} 3.如上在list_article模板哪怕指定是type='top' ,仍然会以传为参数为基准 4.{dede:arclist}{/dede:arclist} 此标签有一个不太爽的地方就是输出行之间会自动的加入一个硬回车\r\n 由其是我们在进行js变量组合的时候会比较的不爽,或者会出错,解决方法如下: 修改include/taglib/arclist.lib.php 找到return $artlist 改为return str_replace("\r\n","",$artlist); 5. table :dede_arcatt 文档属性 添加相关的属性之后需要在table:dede_archives.flag 枚举属性中相应的加入 6.DEDECMS根据副栏目进行文章调用 DEDECMS中一个文章可以同时属于两个栏目,即一个主栏目一个副栏目,{dede:arclist} 属性中可以通过typeid进行主栏目有效性筛选,但是有时我们却想根据副栏目进行筛选,查了dedecms的在线用户手册发现没有此功能,airzen 就动手改了标签对应的源文件 dedecmsROOT/include/taglib/arclist.lib.php,其中我们更改方法 function lib_arclist(&$ctag,&$refObj){ ... return lib_arclistDone(...,$ctag->GetAtt('noflag') , $ctag->GetAtt('typeid2') ); } 然后更改方法: function lib_arclistDone(..., $noflag='',$typeid2=0){ ..... $typeid2= AttDef($typeid2,0); .... if($typeid2 !=0) { $orwheres[] = " arc.typeid2 = $typeid2 "; } if(!empty($typeid)) { ..... } } 其中上面加粗下划线的部分为airzen修改的地方可以完美的与{dede:arclist typeid2='n'}{/dede:arclist}进行数据调用了。 7.DEDECMS列表页调用主副栏目有一个位栏目ID的文章列表 {dede:list} 对应的是/include/arc.listview.class.php 要同时获得副栏目的文章修改此文件 查找$cfg_need_typeid2 会找到 function CountRecord() { global $cfg_list_son,$cfg_need_typeid2; if(empty($cfg_need_typeid2)) $cfg_need_typeid2 = 'N';//增加下面一行 $cfg_need_typeid2 = 'Y'; .... } 好了,在副栏目列表中就会出现主栏目和副栏目ID都为栏目ID的文章,崩溃吧。 8.伪静态分页BUG解决 打开文件:/include/arc.listview.class.php 找到下面这个方法 //获取动态的分页列表 function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno"){ .... if($cfg_rewrite == 'Y') { $plist = str_replace('.php?tid=', '-', $plist); $plist = str_replace('&TotalResult=', '-', $plist); $plist = preg_replace("/&PageNo=(\d+)/i",'-\\1.html',$plist); return str_replace("/plus/","/",$plist); //加上这句 } return $plist; } 9.在添加文档的时候同时添加至文档关键字 一般我们希望为某个文章定为某个关键词,在其它文章中出现该关键词的时候,就显示内链至该文档,我们需要两步,一。添加文档,二。在文档关键字维护中添加关键字和链接。 下面我们通过修改文档模型,只需要直接添加关键字,就一步完成关键字和本文链接的添加,下面介绍一下操作步骤: step1,修改文档模型,添加一个text的字段叫做guanjianzi,此值会自动修改表dede_addonarticle step2.在后台目录/article_add.php 的else if($dopost=='save') 处理完成,提示信息之前加入以下代码 //by airzen 20090729 关键字自动添加至关键字表.start $guanjianzi = trim($guanjianzi); $rank = 30; if($guanjianzi!='') { $rpurl ="http://域名/view-{$arcID}-1.html";//链接这里需要手动修改,这里是伪静态链接 $row = $dsql->GetOne("Select * From `#@__keywords` where keyword like '$guanjianzi'"); if(!is_array($row)) { $inquery = "Insert INTO `#@__keywords`(keyword,rank,sta,rpurl) VALUES ('$guanjianzi','$rank','1','$rpurl');"; $dsql->ExecuteNoneQuery($inquery); }
}
|