📄 class_qq.asp
字号:
rs.PageSize = iPage
rs.movefirst
lPages = rs.PageCount
If lPage>lPages Then lPage=lPages
rs.AbsolutePage = lPage
Do While Not rs.Eof And i < rs.PageSize
'写内容
sTitle=""
If rs("istop")=1 Then
sTitle= icoTop & sTitle
ElseIf rs("isbest")=1 Then
sTitle= icoGood & sTitle
Else
If rs("logid")>0 Or 1=1 Then sTitle= icoBlog & sTitle
End if
if Int(i/2)*2=i then r=1 else r=2
If isIndex Then
sRet1=" <td class=""t1"">"&sTitle&"<a href=""group.asp?cmd=show&gid="& g_Id &"&pid=" & rs("postid")&""" title="""&OB_IIF(rs("topic"),"无题")&""">"&OB_IIF(rs("topic"),"无题")&"</a></td>" & vbcrlf
sRet1=sRet1&" <td class=""t2"">"&rs("replys")&"</td>" & vbcrlf
sRet1=sRet1&" <td class=""t3""><a href=""go.asp?user="&rs("author")&""" title="""&rs("author")&""">"&rs("author")&"</a><span>"&rs("Lastupdate")&"</span></td>" & vbcrlf
' sRet1=sRet1&"<td class='s4'>"&rs("Lastupdate")&"</td>"
sRet1= vbcrlf & " <tr class=""r"&r&""">" & vbcrlf &sRet1&" </tr>" & vbcrlf
Else
sRet1=" <td class=""t1"">"&sTitle&"</td>" & vbcrlf
sRet1=sRet1&" <td class=""t2""><a href=""group.asp?cmd=show&gid="& g_Id &"&pid=" & rs("postid")&""" title="""&OB_IIF(rs("topic"),"无题")&""">"&OB_IIF(rs("topic"),"无题")&"</a></td>" & vbcrlf
sRet1=sRet1&" <td class=""t3""><a href=""go.asp?user="&rs("author")&""" title="""&rs("author")&""">"&rs("author")&"</a><span>"&rs("addtime")&"</span></td>" & vbcrlf
sRet1=sRet1&" <td class=""t4"">"&rs("replys")&"/"&rs("views")&"</td>" & vbcrlf
sRet1=sRet1&" <td class=""t5""><span>"&rs("Lastupdate")&"</span></td>" & vbcrlf
sRet1= vbcrlf & " <tr class=""r"&r&""">" & vbcrlf &sRet1&" </tr>" & vbcrlf
End if
sRet=sRet & sRet1 & vbcrlf
i=i+1
rs.MoveNext
Loop
rs.Close
Set rs=Nothing
'生成一个底部分页条
If isIndex Then
If iMode = "1" Then
sRet= vbcrlf & "<!-- " &oblog.CacheConfig(69)& "精华文章 -->" & vbcrlf & "<div id=""GroupBestLog"">" & vbcrlf & " <table id=""LogList"">" & vbcrlf & " <thead>" & vbcrlf & " <tr>" & vbcrlf & " <th class=""t1"">话题</th>" & vbcrlf & " <th class=""t2"">回复</th>" & vbcrlf & " <th class=""t3"">作者/最后更新</th>" & vbcrlf & " </tr>" & vbcrlf & " </thead>" & vbcrlf & " <tbody>" & vbcrlf & sRet & vbcrlf & " </tbody>" & vbcrlf & " </table>" & vbcrlf & "</div>" & vbcrlf & "<!-- " &oblog.CacheConfig(69)& "精华文章 end -->" & vbcrlf
Else
sRet= vbcrlf & "<!-- " &oblog.CacheConfig(69)& "最新文章 -->" & vbcrlf & "<div id=""GroupNewLog"">" & vbcrlf & " <table id=""LogList"">" & vbcrlf & " <thead>" & vbcrlf & " <tr>" & vbcrlf & " <th class=""t1"">话题</th>" & vbcrlf & " <th class=""t2"">回复</th>" & vbcrlf & " <th class=""t3"">作者/最后更新</th>" & vbcrlf & " </tr>" & vbcrlf & " </thead>" & vbcrlf & " <tbody>" & vbcrlf & sRet & vbcrlf & " </tbody>" & vbcrlf & " </table>" & vbcrlf & "</div>" & vbcrlf & "<!-- " &oblog.CacheConfig(69)& "最新文章 end -->" & vbcrlf
End if
Else
sRet="<table id=""GroupLogList"">" & vbcrlf & " <thead>" & vbcrlf & " <tr>" & vbcrlf & " <th class=""t1""></th>" & vbcrlf & " <th class=""t2"">话题</th>" & vbcrlf & " <th class=""t3"">作者</th>" & vbcrlf & " <th class=""t4"">回复/点击</th>" & vbcrlf & " <th class=""t5"">最后更新</th>" & vbcrlf & " </tr>" & vbcrlf & " </thead>" & vbcrlf & " <tbody>"&sRet& vbcrlf & " </tbody>" & vbcrlf & "</table>"
End if
If Not isIndex Then sRet=sRet & "<div id=""GroupPages"">" & vbcrlf & PageBarNum(lAll,iPage,lPage,G_P_Filename) & vbcrlf & "</div>"
'兼容脚本错误
'sRet= sRet & vbcrlf & "<div id=""comment_list""></div>"
GetIndexList=sRet
sRet=""
End Function
Function GetUsers()
Dim sRet
Dim rs,lPage,lAll,lPages,i
G_P_Filename="group.asp?gid=" & g_id & "&cmd="&cmd&"&page="
Sql="select a.userid,a.province,a.city,username,nickname,blogname,user_icon1,log_count,user_group,scores From oblog_user a,"
Sql= Sql & "(select userid,state From oblog_teamusers Where Teamid=" & g_id & ") b Where a.userid=b.userid and b.state>2 Order By b.state Desc"
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.open sql,conn,1,1
If rs.EOF Then
GetUsers="<div> 管理员帐号不存在或者已经被删除 </div>"
Exit Function
End if
If Request("page") = "" Or Request("page") ="0" then
lPage = 1
Else
lPage = Int(Request("page"))
End If
lAll=Int(rs.recordcount)
'设置缓存大小 = 每页需显示的记录数目
rs.CacheSize = iPage
rs.PageSize = iPage
rs.movefirst
lPages = rs.PageCount
If lPage>lPages Then lPage=lPages
rs.AbsolutePage = lPage
Do While Not rs.Eof and i < rs.PageSize
sRet= sRet & " <ul class=""UserList"">" & vbcrlf
sRet= sRet & " <li class=""userimg""><a href=""go.asp?userid=" & rs("userid") & """ target=""_blank""><img src=""" & OB_IIF(rs("user_icon1"),""&blogurl&"images/ico_default.gif") & """ border=0 /></a></li>" & vbcrlf
sRet= sRet & " <li class=""username""><a href=""go.asp?userid=" & rs("userid") & """ target=""_blank"">" & rs("username") & "</a></li>" & vbcrlf
sRet= sRet & " <li class=""usercity"">(" & rs("province") & rs("city") &")</li>" & vbcrlf
sRet= sRet & " </ul>" & vbcrlf
i=i+1
rs.Movenext
Loop
rs.Close
Set rs=Nothing
GetUsers=" <div id=""GroupBestUser"">" & vbcrlf & sRet & vbcrlf & " </div>"
sRet=""
GetUsers=GetUsers & "<div id=""GroupPages"">" & vbcrlf & PageBarNum(lAll,iPage,lPage,G_P_Filename) & vbcrlf & "</div>"
End Function
Sub SaveComment()
Dim title,content,author,userid,url,sql,rs,pid,iDepth,modify
modify=Trim(Request("modify"))
author=Request.Form("username")
pid=Request("pid")
If pid="" Then
pid=0
iDepth=0
Else
iDepth=1
End If
pid=Int(pid)
title=RemoveHtml(Request.Form("commenttopic"))
content=Request.Form("oblog_edittext")
'验证码校验
if oblog.CacheConfig(30)=1 Then
If Request("CodeStr")="" then
oblog.ShowMsg "验证码错误,请返回刷新后重新输入!",""
exit sub
Else
if not oblog.codepass then
oblog.ShowMsg "验证码错误,请返回刷新后重新输入!",""
exit sub
end if
End If
end if
If Len(content)=0 Or Len(content)>50000 Then
oblog.ShowMsg "发布的内容不能为空,且长度不能大于50000",""
exit sub
End If
If oblog.checkuserlogined() Then
Author= oblog.l_uName
userid=oblog.l_uid
End If
If Len(Author)=0 Or Len(Author)>20 Then
oblog.ShowMsg "用户名不能为空,且长度不能大于20",""
exit sub
End If
If IsMember=False Then
If pid=0 Then
oblog.ShowMsg "非本" &oblog.CacheConfig(69)& "成员不可以发起主题,仅可回复,您可以申请加入该" &oblog.CacheConfig(69)& "",""
exit Sub
Else
If g_OtherPost = 0 And Not g_ViewLimit="-1" Then
oblog.ShowMsg "非本" &oblog.CacheConfig(69)& "成员无权参与回复,您可以申请加入该" &oblog.CacheConfig(69)& "",""
exit Sub
End if
End If
End If
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "select * From oblog_teampost Where postid=" & pid,conn,1,3
If rs.Eof Then
If pid>0 Then
rs.Close
Set rs=Nothing
ErrMsg= "目标主题不存在"
Exit Sub
End If
else
If IsManager=False And modify="1" then
if rs("userid")<>oblog.l_uid then
rs.Close
Set rs=Nothing
ErrMsg= "无权限"
Exit Sub
end if
end if
End If
If pid > 0 And modify <>"1" Then
title = "Re:"&rs("topic")
End if
if modify<>"1" then
rs.AddNew
rs("teamid")=g_Id
rs("author")=Author
rs("parentid")=pid
rs("iDepth")=iDepth
rs("logid")=0
rs("userid")=OB_IIF(userid,0)
rs("addip")=oblog.userip
rs("addtime")=oblog.ServerDate(Now)
rs("LastUpdate")=oblog.ServerDate(Now)
rs("ispass")=1
rs("istop")=0
rs("isbest")=0
end if
if pid>0 and modify<>"1" then
rs("content")=oblog.Ubb_comment(EncodeJP(oblog.filt_badword(content)))
else
rs("content")=EncodeJP(oblog.filt_badword(content))
end if
rs("topic")=EncodeJP(oblog.InterceptStr(oblog.filt_badword(title),50))
rs.Update
if modify<>"1" Then
If pid>0 Then
oblog.Execute("Update oblog_teampost Set replys=replys+1,LastUpdate='" & oblog.ServerDate(Now) & "' Where teamid=" & g_id &" and postid="&pid)
oblog.Execute("Update oblog_team Set icount2=icount2+1 Where teamid=" & g_id)
Else
oblog.Execute("Update oblog_team Set icount1=icount1+1 Where teamid=" & g_id)
End If
End if
If userid>0 and modify<>"1" Then oblog.Execute("Update oblog_teamusers Set post_replys=post_replys+1 Where userid=" & userid & " And teamid=" & g_id)
rs.Close
Set rs=Nothing
If pid=0 Then
Response.Redirect "group.asp?gid=" & g_id
Else
Response.Redirect "group.asp?gid=" & g_id & "&pid=" & pid
End If
End Sub
'管理模式:置顶/取消置顶/精华/取消精华/删除
Sub PostManage(cmd,pid)
Dim targetUrl
If IsManager=false and cmd<>"del" Then
ErrMsg= "你没有权限进行此操作"
Exit Sub
End If
pid=Int(pid)
select Case Cstr(cmd)
Case "good1"
Sql="Update oblog_teampost Set isbest=1 Where postid=" & pid
targetUrl= "group.asp?gid=" & g_id & "&pid=" &pid
Case "good0"
Sql="Update oblog_teampost Set isbest=0 Where postid=" & pid
targetUrl= "group.asp?gid=" & g_id & "&pid=" &pid
Case "top1"
Sql="Update oblog_teampost Set istop=1 Where postid=" & pid
targetUrl= "group.asp?gid=" & g_id & "&pid=" &pid
Case "top0"
Sql="Update oblog_teampost Set istop=0 Where postid=" & pid
targetUrl= "group.asp?gid=" & g_id & "&pid=" &pid
Case "del"
if IsManager then
sql="select userid,parentid From oblog_teampost Where postid=" & Pid
else
if oblog.CheckUserLogined then
sql="select userid,parentid From oblog_teampost Where postid=" & Pid&" and userid="&oblog.l_uid
else
exit sub
end if
end if
Set rs=oblog.Execute(sql)
If Not rs.Eof Then
oblog.Execute "Update oblog_teampost Set replys=replys-1,scores=scores-1 Where postid=" & rs(1)
'Response.End()
If Ob_IIF(rs(0),0)>0 Then oblog.Execute "Update oblog_teamusers Set post_all=post_all-1 ,post_replys=post_replys-1 Where userid=" & rs(0) & " And teamid=" & g_Id
oblog.Execute "Delete From oblog_teampost Where postid=" & pid
Sql="Update oblog_team Set icount1=icount1-1 Where teamid=" & g_id
end if
targetUrl= "group.asp?gid=" & g_id
'oblog.Execute Sql
Case "6"
Dim rs
Set rs=oblog.Execute("select userid,parentid From oblog_teampost Where postid=" & Pid)
If Not rs.Eof Then
oblog.Execute "Delete From oblog_teampost Where postid=" & pid
'重新结算回复数目
oblog.Execute "Update oblog_teampost Set replys=replys-1,scores=scores-1 Where postid=" & rs(1)
If Ob_IIF(rs(0),0)>0 Then oblog.Execute "Update oblog_teamusers Set post_all=post_all-1 ,post_replys=post_replys-1 Where userid=" & rs(0) & " And teamid=" & g_Id
Sql="Update oblog_team Set icount2=icount2-1 Where teamid=" & g_id
End If
'删除一个回复
Sql="Delete From oblog_teampost Where postid=" & pid
oblog.Execute Sql
targetUrl= "group.asp?gid=" & g_id & "&pid=" &pid
End select
If Sql<>"" Then oblog.Execute Sql
oblog.ShowMsg "操作成功!",targetUrl
'Response.Redirect targetUrl
End Sub
Function Search()
End Function
'-----------------------------
'构建显示页面
'-----------------------------
'构建基础页面模型 action 0 主模板 1 副模板
Private Function MakeMainPage(action)
Dim sMList,sMButtons,sRet,sRet1,rs,Sql
'进行模板处理
If action = 0 Then
sRet=g_Show_main
Else
sRet=g_Show_list
End if
If postid = 0 And fileID = 0 Then
If action = 0 Then sRet=Replace(sRet,"$title$",g_Name)
End If
sRet=Replace(sRet,"$group_ico$",ProIco(g_Ico,2))
sRet=Replace(sRet,"$group_url$",g_URL)
' sRet=Replace(sRet,"$title$",g_show_title)
sRet=Replace(sRet,"$group_guide$",g_guide)
sRet=Replace(sRet,"$group_m_buttons$","")
sRet=Replace(sRet,"$group_id$",g_Id)
sRet=Replace(sRet,"$group_name$",vbcrlf & "<!-- " &oblog.CacheConfig(69)& "名称 -->" & vbcrlf & "<div id=""GroupName"">"&g_Name&"</div>" & vbcrlf & "<!-- " &oblog.CacheConfig(69)& "名称 end -->")
If OB_IIF(g_Ico,"")="" Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -