首页,在我们进行对文章的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属性的方法,希望对大家有所帮助。