主题 : orderBy无效
级别: 解元
UID: 5336
积分:202 加为好友
威望: 0 精华: 0
主题:18 回复:86
注册时间:2010-04-07
在线时长:0
1#   发表于:2011-03-06 23:31:19  IP:122.4.*.*
[@cms_content_list count='10' titLen='15' orderBy='9' channelOption='1']

 orderBy='9'

orderBy :排序方式 0:ID降序 1:ID升序 2:发布时间降序 3:发布时间升序 4:固定级别降序,发布时间降序 5: 固定级别降序,发布时间升序 6:日访问降序(推荐)7:周访问降序 8:月访问降序 9:总访问降序 10: 日评论降序(推荐) 11: 周评论降序 12: 月评论降序 13: 总评论降序 14: 日下载降序(推荐)15: 周下载降序 16: 月下载降序 17: 总下载降序 18: 日顶降序(推荐) 19: 周顶降序 20: 月顶降序 21: 总顶降序

AbstractContentDirective这个类
protected int getOrderBy(Map<String, TemplateModel> params)
throws TemplateException {
Integer orderBy = DirectiveUtils.getInt(PARAM_ORDER_BY, params);
if (orderBy == null || orderBy < 0 || orderBy > 8) { (搞不明白为啥>8就返回 0 那 大于8的排序不就没有啥用处了吗?严重bug)
return 0;
} else {
return orderBy;
}
}
级别: 童生
UID: 10739
积分:3 加为好友
威望: 0 精华: 0
主题:0 回复:3
注册时间:2010-09-08
在线时长:0
2#   发表于:2011-03-07 08:42:26  IP:59.246.*.*
您试试一个个的写能调用排序吗?
级别: 解元
UID: 5336
积分:202 加为好友
威望: 0 精华: 0
主题:18 回复:86
注册时间:2010-04-07
在线时长:0
3#   发表于:2011-03-07 11:42:55  IP:202.93.*.*
一个个的写是什么意思? 没有明白。。。  8以后的排序都下起作用~~~~没试过吗?
级别: 童生
UID: 10739
积分:3 加为好友
威望: 0 精华: 0
主题:0 回复:3
注册时间:2010-09-08
在线时长:0
4#   发表于:2011-03-07 11:48:34  IP:220.14.*.*
本地测试这些属性是有用的
级别: 解元
UID: 5336
积分:202 加为好友
威望: 0 精华: 0
主题:18 回复:86
注册时间:2010-04-07
在线时长:0
5#   发表于:2011-03-07 13:04:30  IP:202.93.*.*
我的也是下载的3.0.4版本的。。
AbstractContentDirective这个类 
protected int getOrderBy(Map<String, TemplateModel> params) 
throws TemplateException { 
Integer orderBy = DirectiveUtils.getInt(PARAM_ORDER_BY, params); 
if (orderBy == null || orderBy < 0 || orderBy > 8) { (搞不明白为啥>8就返回 0 那 大于8的排序不就没有啥用处了吗?严重bug) 
return 0; 
} else { 
return orderBy; 

}

你看看这个源代码,8以后的就不排序了的。
1 共1页