• 让arclist标签也支持currentstyle属性 完美解决


    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标签(详见:http://bbs.dedecms.com/read.php?tid-559891-ds-1.html )相结合使用,
    这样调用:

    {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><a href='{@me['arcurl']}'>{@me['title']}</a></li>";
             }
         [/field:array]
    {/dede:arclist}
    @me = "<li><a href='{@me['arcurl']}'>{@me['title']}</a></li>";这一行不加任何样式标签

  • 相关阅读:
    tcpdump 命令的常用选项:一
    Centos系统中 Systemd 的Unit文件配置说明
    如何使用PowerShell获取物理磁盘的信息
    tcpdump 命令的常用选项:二
    Google报告:大量被入侵的 Google Cloud 实例被用来挖掘加密货币
    Ubuntu中使用pdftk合并、分离PDF文档等操作
    tcpdump 命令的常用选项:三
    优麒麟Ubuntu Kylin 20.04 Pro SP1 上线
    为SSH登录设置电子邮件提醒
    图片上传并显示(兼容ie),图片大小判断
  • 原文地址:https://www.cnblogs.com/shanmao/p/3412340.html
Copyright © 2020-2023  润新知