admin 发表于 2013-5-26 17:20:58

dedecms让arclist标签也支持currentstyle属性

arclist默认不支持currentstyle属性。参照channel标签的currentstyle属性的实现方法,修改了下arclist标签的系统文件。
修改include/taglib/arclist.lib.php
1、查找到:$channelid = $ctag->GetAtt('channelid');在下面插入:$currentstyle = $ctag->GetAtt('currentstyle');2、查找:return lib_arclistDone

          (

            $refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,

            $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,

            $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,

            $ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),

            $tagid,$pagesize,$isweight         );替换为:return lib_arclistDone

          (

            $refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,

            $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,

            $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,

            $ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),

            $tagid,$pagesize,$isweight,$currentstyle

          );3、查找function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,

      $imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',

      $innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N')替换为:function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,

      $imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',

      $innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N',$currentstyle='')4、查找$row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";在下面插入:if($currentstyle==1){

                if($row['id']==$arcid)$row['arcurl']="<li class='focus'><a href='".$row['filename']."' style='color:#FFF'> ".$row['title']." </a>";

                else $row['arcurl']="<li ><a href='".$row['filename']."' > ".$row['title']." </a>";}保存,即可。
调用方法是
{dede:arclist   currentstyle='1'}

{/dede:arclist}
根据自己的选择修改第四步中的<liclass='focus'>样式名称即可。
页: [1]
查看完整版本: dedecms让arclist标签也支持currentstyle属性