有码?q码怎么获得得?谢谢

(过鑫影客)
(第九个尾巴)
第三方登录:共有 1005 人关注过本帖
标题:评论怎样按最新发表排列??有代码懂的来看看,谢谢!
等 级:新手上路
结帖率:100%
&&已结贴√
&&问题点数:20&&回复次数:7&&&
评论怎样按最新发表排列??有代码懂的来看看,谢谢!
意思是说:在内容页显示把最新发表的排在最上面,以前发表的排后面。
应该是这个文件:\plug\comment\commentList.asp
程序代码:&%
commentList
Sub commentList
&&& Response.Buffer=True
&&& Response.ContentType=&text/charset=gbk&
&&& Dim rsObj,ContentID,page,pCount,pSize,i,pagerStr,pPage,nPage,numPage
&&& pSize=<font color=#&&&&&&&&'评论显示数
&&& numPage=<font color=#&&& '显示页码数
&&& ContentID=filterPara(getForm(&id&,&get&))
&&& page=filterPara(getForm(&page&,&get&))
&&& dim sql
&&& if SwitchCommentsStatus=<font color=# then
&&&&&&&&sql=&select * from {prefix}Comments where ContentID=&&ContentID
&&&&&&&&sql=&select * from {prefix}Comments where CommentStatus=1 and ContentID=&&ContentID&&&
&&& end if
&&& set rsObj=conn.Exec(sql,&<font color=#&)&&&
&&& if not rsObj.eof then
&&&&&&&&rsObj.pageSize=pSize
&&&&&&&&pCount=rsObj.pageCount
&&&&&&&&if isNul(page) or not isnum(page) or page&<font color=# then page=<font color=# else page=clng(page)
&&&&&&&&if page&pCount then page=pCount
&&&&&&&&rsObj.absolutepage = page
&&&&&&&&for i = <font color=# to pSize&&&&&&&&&
&&&&&&&&&&&&echo&&div class=&&clistbox&&&& &vbcrlf& _
&&&&&&&&&&&&&&div class=&&line1&&&&span&发表于:&&rsObj(&AddTime&)&&&/span& 评论者:&&filterDirty(rsObj(&Commentator&))&& &/div&& &vbcrlf& _
&&&&&&&&&&&&&&div class=&&line2&&&&&filterDirty(rsObj(&CommentContent&))&&&/div&& &vbcrlf& _
&&&&&&&&&&&&&&/div&& &vbcrlf&&&&&&&&&
&&&&&&&&&&&&rsObj.moveNext
&&&&&&&&&&&&if rsObj.eof then exit for
&&&&&&&&next
&&&&&&&&pagerStr=makePageNumber(page, numPage, pCount, &commentlist&,ContentID,&&)&&&&&&&&
&&&&&&&&if page&<font color=# then pPage=page-<font color=# else pPage=<font color=#
&&&&&&&&if page=pCount then nPage=page else nPage=page+<font color=#
&&&&&&&&echo &&div class=&&pages&&&&&&&a href=&&javascript:pager(&&ContentID&&<font color=#)&&&首页&/a&&a href=&&javascript:pager(&&ContentID&&,&&pPage&&)&&&上一页&/a&&
&&&&&&&&echo pagerStr
&&&&&&&&echo &&a href=&&javascript:pager(&&ContentID&&,&&nPage&&)&&&下一页&/a&&&&&a href=&&javascript:pager(&&ContentID&&,&&pCount&&)&&&末页&/a&&&&&/div&&
&&&&&&&&echo &还没有评论!&
&&& end if
&&& rsObj.close()
&&& set rsObj=nothing
怎么改呢?
搜索更多相关主题的帖子:
等 级:贵宾
威 望:12
帖 子:138
专家分:1003
&&得分:10&
sql改成:sql=&select * from {prefix}Comments where ContentID=&&ContentID&&order by ContentID DESC&
sql=&select * from {prefix}Comments where CommentStatus=1 and ContentID=&&ContentID&&order by ContentID DESC&
来 自:红土地
等 级:友情版主
威 望:308
帖 子:10607
专家分:39250
&&得分:10&
也可以按发表日期排序。
活到老,学到老!
E-mail:hu-
等 级:新手上路
回复 2楼 elongtown
提示错误!
提示:【执行SQL语句错误】
错误号:-<font color=#7217900
错误描述:语法错误 (操作符丢失) 在查询表达式 'ContentID=75order by ContentID DESC' 中。sql=select * from AspCms_Comments where ContentID=75order by ContentID DESC
来 自:红土地
等 级:友情版主
威 望:308
帖 子:10607
专家分:39250
你的表中记录日期时间或者自动编号的字段是哪个,以这个字段降序排序就成。
活到老,学到老!
E-mail:hu-
等 级:新手上路
回复 5楼 hu9jj
好像是这个:评论时间:&&now()
那代码应该怎么改呢?谢谢!
来 自:红土地
等 级:友情版主
威 望:308
帖 子:10607
专家分:39250
以下是引用po09999在 06:51:42的发言:
好像是这个:评论时间:&&now()
那代码应该怎么改呢?谢谢!这是取得当前时间的函数,不是字段名。
活到老,学到老!
E-mail:hu-
等 级:新手上路
回复 7楼 hu9jj
你好,又要麻烦你一下了~谢谢!
我今天把打开数据库了,请你看一下下面的附件图片。
那这两句代码该怎样改呢?
猀焀氀=&select * from {prefix}Comments where ContentID=&&ContentID
猀焀氀=&select * from {prefix}Comments where CommentStatus=1 and ContentID=&&ContentID
附件: 您没有浏览附件的权限,请
版权所有,并保留所有权利。
Powered by , Processed in 0.045290 second(s), 8 queries.
Copyright&, BCCN.NET, All Rights Reserved我想问下现在哪里还有码?随便哪里都行?谢谢了_dota2吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0可签7级以上的吧50个
本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:2,989,348贴子:
我想问下现在哪里还有码?随便哪里都行?谢谢了
如题小白上图
就业前景不好吧。看网站...
正版授权奇迹3D页游,震撼开启!原汁原味还原奇迹,重铸经典辉煌!
全球 邀请 3key 出
同求呀.....
贴吧热议榜
使用签名档&&
保存至快速回贴安装Spss要代码怎么解决?谁有代码给我用一下!发到谢谢!?
已有帐号?
无法登录?
社交帐号登录急用51种码怎么获得呢?谁有种子码给我一个!谢谢了!在线等_百度知道}

我要回帖

更多关于 q码怎么获得 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信