📄 class_qq.asp
字号:
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 pid>0 and modify<>"1" then oblog.Execute("Update oblog_teampost Set replys=replys+1,LastUpdate='" & ServerDate(Now) & "' Where teamid=" & Group_id &" and postid="&pid)
if modify<>"1" then oblog.Execute("Update oblog_team Set icount2=icount2+1 Where teamid=" & Group_id)
If userid>0 and modify<>"1" Then oblog.Execute("Update oblog_teamusers Set post_replys=post_replys+1 Where userid=" & userid & " And teamid=" & Group_id)
rs.Close
Set rs=Nothing
If pid=0 Then
Response.Redirect "group.asp?gid=" & Group_id
Else
Response.Redirect "group.asp?gid=" & Group_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=" & Group_id & "&pid=" &pid
Case "good0"
Sql="Update oblog_teampost Set isbest=0 Where postid=" & pid
targetUrl= "group.asp?gid=" & Group_id & "&pid=" &pid
Case "top1"
Sql="Update oblog_teampost Set istop=1 Where postid=" & pid
targetUrl= "group.asp?gid=" & Group_id & "&pid=" &pid
Case "top0"
Sql="Update oblog_teampost Set istop=0 Where postid=" & pid
targetUrl= "group.asp?gid=" & Group_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=" & Group_Id
oblog.Execute "Delete From oblog_teampost Where postid=" & pid
Sql="Update oblog_team Set icount1=icount1-1 Where teamid=" & Group_id
end if
targetUrl= "group.asp?gid=" & Group_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=" & Group_Id
Sql="Update oblog_team Set icount2=icount2-1 Where teamid=" & Group_id
End If
'删除一个回复
Sql="Delete From oblog_teampost Where postid=" & pid
oblog.Execute Sql
targetUrl= "group.asp?gid=" & Group_id & "&pid=" &pid
End Select
If Sql<>"" Then oblog.Execute Sql
oblog.showok "操作成功!",targetUrl
'Response.Redirect targetUrl
End Sub
Function Search()
End Function
'-----------------------------
'构建显示页面
'-----------------------------
'构建基础页面模型
Private Function MakeMainPage()
Dim sMList,sMButtons,sRet,sRet1,rs,Sql
'进行模板处理
if postid<>"" then
sRet=Application(cache_name&"_group_theme_more")
else
sRet=Application(cache_name&"_group_theme_main")
end if
sRet=Replace(sRet,"$group_m_buttons$","")
sRet=Replace(sRet,"$group_id$",Group_Id)
sRet=Replace(sRet,"$group_name$",Group_Name)
If OB_IIF(Group_Ico,"")="" Then
sRet=Replace(sRet,"$group_ico$",Group_Ico)
Else
sRet=Replace(sRet,"$group_ico$","")
End If
sRet=Replace(sRet,"$group_creater$",Group_creater)
sRet=Replace(sRet,"$group_id$",Group_Id)
'顶部
sRet=Replace(sRet,"$group_top$","<div id=""ad_teamtop""><script src='ad/ad_teamtopjs.htm'></script></div>"&index_showtop())
'底部
sRet=Replace(sRet,"$group_bottom$",oblog.CacheConfig(10)&"<div id=""ad_teambot""><script src='ad/ad_teambotjs.htm'></script></div>")
Dim arr
Call GetGroupInfo(arr)
if postid<>"" then
sRet=Replace(sRet,"$group_mini_list$",getminilist())
else
'公告
sRet=Replace(sRet,"$group_placard$", arr(1))
'友情连接
sRet=Replace(sRet,"$group_links$",arr(2)&"<div id=""ad_teamlinks""><script src='ad/ad_teamlinksjs.htm'></script></div>")
'群组信息
sRet=Replace(sRet,"$group_info$","")
'活跃用户
sRet=Replace(sRet,"$group_bestuser$",index_showuser("best"))
'最新加入
sRet=Replace(sRet,"$group_newuser$",index_showuser("new"))
end if
'最新群组
'最活跃群组
MakeMainPage=sRet
End Function
function index_showtop()
Dim sRet
sRet=""
sRet=sRet & "<img class=""g_img"" src=""" &OB_IIF(Group_Ico,"images/default_groupico.gif") & """ border=0 width=80 height=80/>"
sRet=sRet & "<div class=""g_name"">" & Group_Name &"</div>"
sRet=sRet & "<div class=""g_url""> <a href=""group.asp?gid="&group_id&""">"&oblog.cacheConfig(3)&"group.asp?gid="&group_id&"</a> <a href=""javascript:window.clipboardData.setData('Text','"&oblog.cacheConfig(3)&"group.asp?gid="&group_id&"');void('0');"">复制</a> / <a href=""javascript:window.external.AddFavorite(document.location,'"&replace(Group_Name,"'","")&"')"">收藏</a></div>"
'sRet=sRet & "<div class=""g_info"">"&rs("intro")&"</div>"
sRet="<div id=""group_top"">"&sRet&"</div>"
index_showtop=sRet
sRet=""
Set rs=Nothing
end function
function index_showuser(action)
dim sql,tmp,i
if action="best" then
tmp="Order By post_replys Desc"
else
tmp="Order By addtime Desc"
end if
Sql="Select a.*,b.nickname,b.username,b.user_icon1 From (Select top 9 * From oblog_teamusers Where state>2 and teamid=" & Group_Id & " "&tmp&") a,oblog_user b Where a.userid=b.userid"
'response.Write(sql)
Set rs=oblog.Execute(Sql)
If Not rs.Eof Then
Do While Not rs.Eof
i=i+1
if i>9 then exit do
index_showuser=index_showuser & "<ul class=""bestuser"">"
index_showuser=index_showuser & "<li class=""userimg""><a href=""go.asp?userid=" & rs("userid")&""" target=_blank><img src=""" & OB_IIF(rs("user_icon1"),"images/ico_default.gif")&""" /></a></li>"
index_showuser=index_showuser & "<li class=""username""><a href=""go.asp?userid=" & rs("userid")&""" target=_blank>" & OB_IIF(rs("nickname"),rs("username"))&"</a></li>"
index_showuser=index_showuser & "</ul>"
rs.movenext
Loop
End If
Set rs=Nothing
end function
'主题内容置顶,其它分页
Function GetPost(byval pid,sRet,sRet1)
Dim i,rs,Sql,sTitle,sMBar
Dim lPage,lAll,lPages
Set rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select a.*,b.user_icon1 From oblog_teampost a,oblog_user b Where a.postid="& pid &" and a.userid=b.userid And iDepth=0"
G_P_Filename="group.asp?gid="&Group_Id&"&pid=" & pid & "&page="
Set rs=oblog.execute(Sql)
If rs.Eof Then
sRet="<li>编号为" & pid & "的主题不存在</li>"
Set rs=Nothing
Exit Function
End If
sTitle=OB_IIF(rs("topic"),"无题")
If rs("isbest")=1 Then
sMBar="<a href=""group.asp?cmd=good0&gid=" & Group_Id & "&pid=" & rs("postid") & """>取消精华</a> | "
Else
sMBar="<a href=""group.asp?cmd=good1&gid=" & Group_Id & "&pid=" & rs("postid") & """>设为精华</a> | "
End If
If rs("istop")=1 Then
sMBar=" | <a href=""group.asp?cmd=top0&gid=" & Group_Id & "&pid=" & rs("postid") & """>取消置顶</a> | " & sMBar
Else
sMBar=" | <a href=""group.asp?cmd=top1&gid=" & Group_Id & "&pid=" & rs("postid") & """>设为置顶</a> | " & sMBar
End If
'If rs("logid")>0 Then sTitle= icoBlog & sTitle
sMBar=sMBar & "<a href=""group.asp?cmd=del&gid=" & Group_Id & "&pid=" & rs("postid") & """ onclick=""return confirm('确定删除此帖子?');"">删除</a> | "
sMBar=sMBar & "<a href=""group.asp?cmd=post&modify=1&gid=" & Group_Id & "&pid=" & rs("postid") & """>编辑</a>"
sRet=Application(cache_name&"_group_theme_post")
'替换ID,进行显示
sRet=Replace(sRet,"c_content_down", "c_content_down1")
sRet=Replace(sRet,"$group_post_title$", sTitle)
sRet=Replace(sRet,"$group_content$",rs("content"))
sRet=Replace(sRet,"$group_post_userico$",OB_IIF(rs("user_icon1"),"images/ico_default.gif"))
sRet=Replace(sRet,"$group_post_user$",rs("author"))
sRet=Replace(sRet,"$group_post_time$",rs("addtime"))
sRet=Replace(sRet,"$group_post_content$",filtscript(rs("content")))
sRet=Replace(sRet,"$group_post_id$",rs("postid"))
sRet=Replace(sRet,"$group_post_replys$",rs("replys"))
sRet=Replace(sRet,"$group_tags$",OB_IIF(rs("tags"),""))
sRet=Replace(sRet,"$group_post_link$","#")
sRet=Replace(sRet,"$group_post_userurl$","go.asp?user="&rs("author"))
If imMode=1 Then
sRet=Replace(sRet,"$group_post_m$",sMBar)
Else
if oblog.CodeCookie(rs("author"))=Request.Cookies(cookies_name)("username") then
sRet=Replace(sRet,"$group_post_m$","<a href=""group.asp?cmd=del&gid=" & Group_Id & "&pid=" & rs("postid") & """>删除</a> | <a href=""group.asp?cmd=post&modify=1&gid=" & Group_Id & "&pid=" & rs("postid") & """>编辑</a>")
else
sRet=Replace(sRet,"$group_post_m$","")
end if
End If
rs.Close
'挂广告
sRet=sRet & vbcrlf & "<div id=""oblog_ad_team_post_1""></div>" & Vbcrlf
'挂内容
rs.Open "Select a.*,b.user_icon1,b.username From (Select top 500 * From oblog_teampost Where idepth>0 And parentid=" & pid & " Order By postid Desc) a,oblog_user b Where a.userid=b.userid",conn,1,1
If rs.Eof Then
sRet1=""
Else
i=0
'分页
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
sRet1=""
i=0
Do While Not rs.Eof And i < rs.PageSize
i=i+1
sRet1=sRet1 & vbcrlf & Replace(Application(cache_name&"_group_theme_reply"),"$group_topic$","") & vbcrlf
sRet1=Replace(sRet1,"$group_reply_content$",rs("content"))
sRet1=Replace(sRet1,"$group_reply_user$","<a href='go.asp?user="&rs("author")&"'>"&rs("author")&"</a>")
sRet1=Replace(sRet1,"$group_reply_time$",rs("addtime"))
sRet1=Replace(sRet1,"$group_reply_userico$",OB_IIF(rs("user_icon1"),"images/ico_default.gif"))
sRet1=Replace(sRet1,"$group_reply_high$","第<span class=""xx"">" & i & "</span>楼")
If imMode=1 or oblog.CodeCookie(rs("author"))=Request.Cookies(cookies_name)("username") Then
sRet1=Replace(sRet1,"$group_reply_m$","<a href=""group.asp?cmd=del&gid=" & Group_id &"&pid=" & rs("postid")& """>删除</a>")
Else
sRet1=Replace(sRet1,"$group_reply_m$","")
End If
rs.MoveNext
Loop
End If
sRet1= vbcrlf & "<div id=""comment_list"">" & sRet1 &"</div>" & vbcrlf
'挂分页代码
sRet1= sRet1 & "<div id=team_post_pages>" & PageBarNum(lAll,iPage,lPage,G_P_Filename) & "</div>"
'挂回复
sRet1=sRet1 & CommentForm(pid)
End Function
'获取最新回复
Function GetNewComments()
Dim rs,Sql,sRet
Sql="Select top 5 content From oblog_teampost Where iDepth>0 And teamid=" & Group_id & " Order By postid Desc"
Set rs=oblog.Execute(Sql)
If rs.Eof Then
sRet="<li>-<li>"
Else
Do While Not rs.Eof
sRet=sRet & "<li>" & Left(RemoveHtml(rs(0)),10) & "...</li>"
rs.MoveNext
Loop
End if
Set rs=Nothing
GetNewComments=sRet
sRet=""
End Function
'获得群组信息
Sub GetGroupInfo(byref arrInfo)
Dim rs,rst,sRet
Redim arrInfo(2)
Sql="Select * From oblog_team Where teamid=" & Group_id
Set rs=oblog.Execute(Sql)
If rs.Eof Then
Set rs=Nothing
Exit Sub
End If
'获取群组基本信息
sRet=""
sRet=sRet & "<li>" & rs("t_name") &"</li>"
sRet=sRet & "<li>创建者:" & rs("managername") &"</li>"
sRet=sRet & "<li>创建时间:" & rs("createtime") &"</li>"
sRet=sRet & "<li>成员人数:" & rs("icount0") &"</li>"
sRet=sRet & "<li>主题回复:" & rs("icount1") &"/"& rs("icount2") &"</li>"
arrInfo(0)=sRet
sRet=""
'获取公告信息
arrInfo(1)=OB_IIF(rs("announce"),"没有设置")
'获取有情连接信息
arrInfo(2)=OB_IIF(rs("links"),"没有设置")
Set rs=Nothing
Set rst=Nothing
sRet=""
Set rs=Nothing
End Sub
function GetInfo()
Dim rs,rst,sRet
Sql="Select * From oblog_team Where teamid=" & Group_id
Set rs=oblog.Execute(Sql)
If rs.Eof Then
Set rs=Nothing
Exit function
End If
sRet=""
sRet=sRet & "<div id=""group_info""><h1>" &P_QQ_NAME& "信息</h1><li>" &P_QQ_NAME& "名称:" & rs("t_name") &"</li>"
sRet=sRet & "<li>创建者:" & rs("managername") &"</li>"
sRet=sRet & "<li>创建时间:" & rs("createtime") &"</li>"
sRet=sRet & "<li>成员人数:" & rs("icount0") &"</li>"
sRet=sRet & "<li>主题回复:" & rs("icount1") &"/"& rs("icount2") &"</li></div>"
GetInfo=sRet
sRet=""
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,addtime From oblog_teamusers Where Teamid=" & Group_id & ") b Where a.userid=b.userid and b.state=5 Order By b.addtime Desc"
Set rs=Oblog.Execute(Sql)
Do While Not rs.Eof
sRet= sRet & "<ul><li class=""u1""><img src=""" & OB_IIF(rs("user_icon1"),"images/ico_default.gif") & """ border=0 width=48 height=48></li>" & vbcrlf
sRet= sRet & "<li class=""u2""><a href=""go.asp?userid=" & rs("userid") & """ target=_blank>" & rs("username") &"</a></li>" & vbcrlf
sRet= sRet & "<li class=""u3"">(" & rs("province") & rs("city") &")</li>" & vbcrlf
sRet= sRet & "</ul>" & vbcrlf
rs.MoveNext
Loop
GetInfo=GetInfo&"<div id=""user_list""><h1>" &P_QQ_NAME& "管理员</h1>"&sRet&"</div>"
end function
'获取相关的群组列表信息
Function GetTeams(byval sNumber,byval sType)
Dim Sql,rs,sRet,sField1,sField2
Select Case sType
Case 1
' hot 最热,回复最多
sField1="icount2"
sField2="icount2 Desc"
Case 2
'active 最积极,发表文章最多
sField1="icount1"
sField2="icount1 Desc"
Case 3
'最庞大
sField1="icount0"
sField2="icount0 Desc"
Case 4
'最新加入
sField= "icount0"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -