首页  ·  知识 ·  编程语言
文章存档模块功能实现
柳永法  http://www.yongfa365.com/  ASP  编辑:dezai  图片来源:网络
Set rsyear=Server.Createobject("Adodb.Recordset")sql="select year(addtime) as y from BlogArticle group by year(addtime) or

Set rsyear=Server.Createobject("Adodb.Recordset")
sql="select year(addtime) as y from BlogArticle group by year(addtime) order by year(addtime) desc "
rsyear.open sql,conn,1,1
do while not rsyear.eof
        Set rsmonth=Server.Createobject("Adodb.Recordset")
        sql="select count(*),month(addtime) from BlogArticle where year(addtime)="&rsyear(0)&" group by month(addtime)  order by month(addtime) desc "
        rsmonth.open sql,conn,1,1
        do while not rsmonth.eof
                content_temp=content
                content_temp=replace(content_temp,"$yearmonth$",rsyear(0) & rsmonth(1))
                content_temp=replace(content_temp,"$yearmonth2$",rsyear(0) & "年" & rsmonth(1) &"月")
                content_temp=replace(content_temp,"$yearno$",rsmonth(0))
                content_all=content_all & content_temp
        rsmonth.movenext
        loop
rsyear.movenext
loop


本文作者:柳永法 来源:http://www.yongfa365.com/
CIO之家 www.ciozj.com 微信公众号:imciow
    >>频道首页  >>网站首页   纠错  >>投诉
版权声明:CIO之家尊重行业规范,每篇文章都注明有明确的作者和来源;CIO之家的原创文章,请转载时务必注明文章作者和来源;
延伸阅读