PHPWPS

 找回密码
 立即加入

QQ登录

只需一步,快速开始

搜索
热搜: php discuz
查看: 8902|回复: 0

[DEDECMS] dedecms让arclist标签也支持currentstyle属性

[复制链接]

280

主题

420

帖子

1970

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1970
发表于 2013-5-26 17:20:58 | 显示全部楼层 |阅读模式
arclist默认不支持currentstyle属性。参照channel标签的currentstyle属性的实现方法,修改了下arclist标签的系统文件。
修改include/taglib/arclist.lib.php
1、查找到:
  1. $channelid = $ctag->GetAtt('channelid');
复制代码
在下面插入:
  1. $currentstyle = $ctag->GetAtt('currentstyle');
复制代码
2、查找:
  1. return lib_arclistDone  

  2.           (  

  3.             $refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,  

  4.             $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,  

  5.             $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,  

  6.             $ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),  

  7.             $tagid,$pagesize,$isweight           );
复制代码
替换为:
  1. return lib_arclistDone  

  2.           (  

  3.             $refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen,  

  4.             $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby,  

  5.             $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid,  

  6.             $ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'),  

  7.             $tagid,$pagesize,$isweight,$currentstyle  

  8.           );
复制代码
3、查找
  1. function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,  

  2.         $imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',  

  3.         $innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N')
复制代码
替换为:
  1. function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,  

  2.         $imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='',  

  3.         $innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N',$currentstyle='')
复制代码
4、查找
  1. $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
复制代码
在下面插入:
  1. if($currentstyle==1){  

  2.                 if($row['id']==$arcid)  $row['arcurl']="<li class='focus'><a href='".$row['filename']."' style='color:#FFF'> ".$row['title']." </a>";  

  3.                 else $row['arcurl']="<li ><a href='".$row['filename']."' > ".$row['title']." </a>";}
复制代码
保存,即可。
调用方法是
{dede:arclist   currentstyle='1'}
[field:arcurl/]  
{/dede:arclist}
根据自己的选择修改第四步中的<liclass='focus'>样式名称即可。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即加入

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

本版积分规则

QQ|小黑屋|手机版|Archiver|phpwps Inc. ( 鄂ICP备14011625号-1 )

GMT+8, 2025-5-4 16:18 , Processed in 0.057187 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表