全国400电话网上服务平台
强大号码库资源任选,方便,快捷,快速开通。
咨询热线:400-1100-266
强大号码库资源任选,方便,快捷,快速开通。
咨询热线:400-1100-266
dede织梦让channelartlist标签支持currentstyle属性
POST TIME:2020-04-10 18:43
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
);
其实就是在调用函数的最后加了一个$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='')
其实就是在函数后面加了一个$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);
}
保存,即可。
调用方法:
{dede:arclist titlelen='42' row='10' currentstyle="<li class='current' ><a href='~typelink~'>~typename~</a></li>"}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<li class='current' ><a href='{@me['arcurl']}'>{@me['title']}</a></li>";
}
[/field:array]
{/dede:arclist}
也可以与channelartlist标签相结合使用,
这样调用:
{dede:channelartlist typeid='2' currentstyle='current'}
<dt ><a class='{dede:field.currentstyle/}' href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></dt>
{dede:arclist titlelen='42' row='10' currentstyle="<dd><a class='current' href='~typelink~'>~typename~</a></dd>"}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<dd ><a href='{@me['arcurl']}'>{@me['title']}</a></dd>";
}
[/field:array]
{/dede:arclist}
{/dede:channelartlist}
$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
);
其实就是在调用函数的最后加了一个$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='')
其实就是在函数后面加了一个$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);
}
保存,即可。
调用方法:
{dede:arclist titlelen='42' row='10' currentstyle="<li class='current' ><a href='~typelink~'>~typename~</a></li>"}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<li class='current' ><a href='{@me['arcurl']}'>{@me['title']}</a></li>";
}
[/field:array]
{/dede:arclist}
也可以与channelartlist标签相结合使用,
这样调用:
{dede:channelartlist typeid='2' currentstyle='current'}
<dt ><a class='{dede:field.currentstyle/}' href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></dt>
{dede:arclist titlelen='42' row='10' currentstyle="<dd><a class='current' href='~typelink~'>~typename~</a></dd>"}
[field:array runphp='yes']
if(@me['currentstyle']){
@me = @me['currentstyle'];
}else{
@me = "<dd ><a href='{@me['arcurl']}'>{@me['title']}</a></dd>";
}
[/field:array]
{/dede:arclist}
{/dede:channelartlist}
Copyright © 2003-2016
时间:9:00-21:00 (节假日不休)
版权所有:巨人网络(扬州)科技有限公司
总部地址:江苏省信息产业基地11号楼四层
《增值电信业务经营许可证》 苏B2-20120278
时间:9:00-21:00 (节假日不休)
版权所有:巨人网络(扬州)科技有限公司
总部地址:江苏省信息产业基地11号楼四层
《增值电信业务经营许可证》 苏B2-20120278