由於客戶需求,所以進行對文章的arclist標簽進行設置當前樣式(currentstyle),修改前記得備份。
dede版本v5.7sp
找到PHP修改:
include/taglib/arclist.lib.php
1、搜索:
$channelid = $ctag->GetAtt(‘channelid’);
在下面插入:
$currentstyle = $ctag->GetAtt(‘currentstyle’);
2、搜索:
$tagid,$pagesize,$isweight
修改成:
$tagid,$pagesize,$isweight,$currentstyle
3、搜索:
$innertext=”, $arcid=0, $idlist=”, $channelid=0, $limit=”, $att=”, $order=’desc’, $subday=0, $noflag=”,$tagid=”, $pagesize=0, $isweight=’N’)
修改成:
$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 && $row[‘id’]==$arcid){
$currentstyle = str_replace(‘~typelink~’, $row[‘filename’], $currentstyle);
$row[‘currentstyle’] = str_replace(‘~typename~’, $row[‘title’], $currentstyle); //by adooo.org
}
保存文檔上傳,然后再模板添加以下代碼進行調用。
調用方法:
{dede:arclist titlelen=’26’ row=’10’ currentstyle=’1′}
[field:array runphp=’yes’]
if(@me[‘currentstyle’]){
@me = “<a href='{@me[“arcurl”]}’ title='{@me[“title”]}’ class=’current’>{@me[“title”]}</a>”;
}else{
@me = “<a href='{@me[“arcurl”]}’ title='{@me[“title”]}’ class=''>{@me[“title”]}</a>”;
}
[/field:array]
{/dede:arclist}
有問題可以給我留言。