📄 favorite.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'****************************************************************
'* joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'* 版权所有: JoinBoard V2.3
'*
'* 程序制作: 友盟工作室
'*
'* 主页地址: http://joinboard.com 友盟论坛
'*
'* 论坛地址: http://bbs.joinboard.com/、http://youmeng.com
'*
'****************************************************************
'* Powered by: JoinBoard V2.3
'* Copyright 2003-2004. - All Rights Reserved.
'* JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
function errorMsg(theError)
response.write"<script language=javascript>alert('"& theError &"');history.back();</script>"
response.End
End function
'--------------------------------------------
userid = trim(request.Cookies(JBBMasterCookies)("userid"))
if Not(IsNumeric(userid)) then
errorMsg "您尚未登录,无法进行此操作!"
End if
threadid = trim(request.QueryString("threadID"))
if not(Isnumeric(threadid)) then
errorMsg "参数错误!"
End if
%>
<!--#include file = "admin/BBSConfig.asp"-->
<%
action=trim(request.QueryString("action"))
select case action
case "add"
call add()
case "del"
call del()
end select
'----------------------------------------------
Sub add()
if threadid <> "" then
set rs = server.CreateObject("adodb.recordset")
rs.open "select threadid from JBB_thread where threadid = "&threadid,conn,1,1
if rs.eof or rs.bof then
erroradd = "对不起,该文章不存在或者已经删除。"
else
set rs1 = server.CreateObject("adodb.recordset")
sql = "select * from JBB_favorite where thread_id="& threadid &" and user_ID="&userid
rs1.open sql,conn,1,1
if Not(rs1.eof and rs1.bof) then
erroradd = "对不起,您已经添加了此文章到您的收藏夹,请不要重复添加。"
End if
rs1.close
set rs1 = nothing
'---------------------------------------------------
set rs1 = server.CreateObject("adodb.recordset")
sql = "select * from JBB_favorite where user_ID="&userid
rs1.open sql,conn,1,1
if Not(rs1.eof and rs1.bof) then
if Cint(rs1.recordCount) => 50 then
erroradd = "对不起,您最多可以添加50篇文章到您的收藏夹中。"
End if
End if
rs1.close
set rs1 = nothing
End if
rs.close
set rs = nothing
'---------------------------
if erroradd = "" then
Conn.ExeCute("insert into JBB_favorite(thread_ID,user_ID,favoriteTime) values("& threadid &","& userid &",'"& now() &"')")
response.write"<script language=javascript>if (confirm('添加成功,点击 确定 转到您的收藏夹,点击 取消 返回')) {location.href='usercp.asp?action=favorites'}else {history.back()}</script>"
else
errorMsg(erroradd)
End if
End if
End sub
'-----------------------------------------------
Sub del()
FavoriteID = trim(request.QueryString("FavoriteID"))
if Not(IsNumeric(FavoriteID)) then
errorMsg "参数错误!"
End if
Conn.ExeCute("delete From JBB_Favorite where FavoriteID="&FavoriteID)
response.write"<script language=javascript>alert('删除完毕!~'); location.href='usercp.asp?action=favorites';</script>"
End Sub
set conn = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -