dede織夢 arclist標簽完美支持currentstyle屬性


由於客戶需求,所以進行對文章的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}

有問題可以給我留言。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM