sub moveblog() if id="" then Oblog.adderrstr("请指定要移动的日志") Oblog.showusererr exit sub end if dim subjectid subjectid=trim(request("subject")) if subjectid="" then Oblog.adderrstr("请指定要移动的目标专题") Oblog.showusererr exit sub else subjectid=Clng(subjectid) end if if instr(id,",")>0 then ‘如果id变量中含有逗号,去掉变量中的空格,执行下面的sql语句。设为第一条 id=replace(id," ","") sql="Update [Oblog_log] set subjectid="&subjectid&" where logid in (" & id & ")"&wsql ‘否则执行这个sql语句,设为第二条。 else sql="Update [Oblog_log] set subjectid="&subjectid&" where logid=" & id &wsql end if Oblog.Execute sql dim blog,rs1 set blog=new class_blog blog.userid=Oblog.logined_uid blog.update_allsubjectid() blog.update_index_subject 0,0,0,"" set blog=nothing set rs=Oblog.execute("select subjectid from Oblog_subject where userid="&Oblog.logined_uid) while not rs.eof set rs1=Oblog.execute("select count(logid) from Oblog_log where Oblog_log.subjectid="&rs(0)) Oblog.execute("update Oblog_subject set subjectlognum="&rs1(0)&" where Oblog_subject.subjectid="&rs(0)) rs.movenext wend set rs=nothing set rs1=nothing Oblog.showok "更新专题成功,需要重新发布首页,才可使专题统计准确!","" end sub |