青岛做网站
        行业新闻
行业新闻
当前位置:首页> 新闻动态 > 行业新闻

如何为织梦dede:list标签增加currentstyle属性

更新时间:2018-10-27
   现在,很多站长朋友都习惯选择织梦系统作为网站后台程序,因为织梦系统对应网站后期推广优化有一定的优势。当然,我们在使用系统的时候会遇到一些特殊的要求,原系统是无法实现的,这就需要我们进行二次开发。今天笔者就跟大家分享一下如何如何为织梦dede:list标签增加currentstyle属性,实现当前信息高亮显示。

   首页,在我们进行对文章的arclist标签进行增加当前样式高亮(currentstyle)属性,修改前记得备份网站系统,以免误操作导致网站系统无法使用。

接下来,笔者就以织梦dede版本v5.7sp跟大家分享一下具体步骤:

1、找到要修改的PHP文件:

找到include/taglib/arclist.lib.php

2、搜索:

$channelid = $ctag->GetAtt(’channelid’);

在下面插入:

$currentstyle = $ctag->GetAtt(’currentstyle’);

3、搜索:

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

          );

4、搜索:

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=’’)

5、搜索:

$row[’textlink’] = "<a href=’".$row[’filename’]."’>".$row[’title’]."</a>";

在下面插入

 if($currentstyle==1){

                if($row[’id’]==$arcid)  $row[’arcurl’]="<li ><a href=’".$row[’filename’]."’  class=’activecurrentstyle’> ".$row

[’title’]." </a></li>";

                else $row[’arcurl’]="<li ><a href=’".$row[’filename’]."’ > ".$row[’title’]." </a></li>";}

最后,笔者说一下如何引用

{dede:arclist typeid=’147’   row=’10’ titlelen=’18’   orderby=’weight’  currentstyle=’1’}

[field:arcurl/] 

{/dede:arclist}

以上就是如何为织梦dede:list标签增加currentstyle属性的方法,希望对大家有所帮助。

 

 

 

免责声明:本站所有资讯内容搜集整理于互联网或者网友提供,并不代表本网赞同其观点,仅供学习与交流使用,如果不小心侵犯到你的权益,如果你对文章内容、图片和版权等问题存在异议,请及时联系我们删除该信息。