📄 user_bookmarker.asp
字号:
<!--#include file="user_popedom.asp"-->
<%'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
%>
<div class="text" style="margin:2px;height:25px;padding-top:8px;text-align=center;"><img src="images/user/cat.gif"> <a href="user_center.asp?action=bookmarker">我的所有书签</a> <img src="images/user/cat.gif"> <a href="user_center.asp?action=bookmarker&viewmarker=root">根目录</a> <img src="images/user/cat.gif"> <a href="#addnewgroup">添加书签组</a> <img src="images/user/cat.gif"> <a href="#addnewmarker">添加书签</a> <img src="images/user/share.gif"> <a href="user_center.asp?action=bookmarker&operation=viewShare">网友共享书签</a></div>
<%
dim group_str
select case request("operation")
case "maosin_appgroup"
addgroup
case "maosin_appbookmarker"
addbookmarker
case "maosin_delbookmarker"
delBookMarker
case "maosin_mdfGroup"
group
modifyGroup
case "maosin_mdfBookMarker"
group
modifyBookMarker
case "maosin_saveBookMarker"
saveBookMarker
case "maosin_setShare"
setShare
case "viewShare"
shareGroup
shareBookMarker
case else
group
viewbookmarker
addgroupform
addbookmarkerform
end select
if session(userVar)=userVal then
userinfo=session("userinfo")
else
showmsg "错误信息","您还有<a href=user.asp>注册</a>或还没有登录,请赶快注册或登录吧!"
end if
sub group()%>
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="tableBC">
<tr class="tdT">
<td width="*" height="22" valign="middle"> 我的书签组</td>
<td width="60" align="center" valign="middle">状态</td>
<td width="60" align="center" valign="middle">操作选项</td>
</tr>
<%
dim temp_str,share_str
Set bmrs=conn.execute("select * from ms_user_bookmarker where s_id=0 and r_id=0 and userName='"&replace(trim(userinfo(1)),"'","")&"'")
if not bmrs.eof and not bmrs.bof then
temp_str=""
do while not bmrs.eof
if bmrs("isShare")=1 then
share_str="<a href=""user_center.asp?action=bookmarker&operation=maosin_setShare&isShare=no&id="&bmrs("id")&""" title=""取消共享"">共享</a>(<font color=""#ff0000"">√</font>)"
else
share_str="<a href=""user_center.asp?action=bookmarker&operation=maosin_setShare&isShare=yes&id="&bmrs("id")&""" title=""设为共享"">共享</a>(<font color=""#ff0000"">×</font>)"
end if
temp_str=temp_str&"<tr class=""tdBC""><td height=""22"" valign=""middle""> <img src=""images/user/bookgroup.gif"" align=""absmiddle""> <a href=user_center.asp?action=bookmarker&viewmarker=group&r_id="&bmrs("id")&">"&bmrs("bmName")&"</a></td><td valign=""middle"" align=""center"">"&share_str&"</td><td valign=""middle"" align=""center""><a href=""user_center.asp?action=bookmarker&operation=maosin_mdfGroup&id="&bmrs("id")&"&bmName="&bmrs("bmName")&""" title=""编辑该书签组""><img src=""images/user/edit.gif"" border=""0""></a> <a href=""user_center.asp?action=bookmarker&operation=maosin_delbookmarker&del=group&id="&bmrs("id")&""" onClick=""javascript:{if(confirm('您确定要删除该书签组吗?')){return true;}else{return false;}}"" title=""删除该书签组""><img src=""images/user/delete.gif"" border=""0""></a></td></tr>"
'group_str=group_str&"<option value="""&bmrs("id")&""">"&bmrs("bmName")&"</option>"
bmrs.movenext
loop
bmrs.movefirst
response.Write(temp_str)
else
response.Write("<tr class=""tdBC""><td height=""22"" colspan=""3"" align=""center"" valign=""middle"">您还没有添加分类</td></tr>")
end if
%>
</table>
<%
end sub
sub viewbookmarker()
dim r_id,url,share_str
r_id=request("r_id")
if isNumeric(r_id)=false then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if%>
<table width="100%" border="0" cellpadding="2" cellspacing="1" style="margin-top:8px;" class="tableBC">
<tr class="tdT">
<td width="160" height="22" valign="middle"> 我的书签名称</td>
<td width="310" valign="middle"> 我的书签地址</td>
<td width="60" align="center" valign="middle">状态</td>
<td width="60" valign="middle" align="center">操作选项</td>
</tr>
<%
if request("viewmarker")="root" then
sql="select * from ms_user_bookmarker where r_id=0 and s_id=1 and userName='"&replace(trim(userinfo(1)),"'","")&"'"'根
url="user_center.asp?action=bookmarker&viewmarker=root&"
elseif request("viewmarker")="group" then
sql="select * from ms_user_bookmarker where r_id="&r_id&" and s_id=1 and userName='"&replace(trim(userinfo(1)),"'","")&"'"'分类
url="user_center.asp?action=bookmarker&viewmarker=group&r_id="&r_id&"&"
else
sql="select * from ms_user_bookmarker where s_id=1 and userName='"&replace(trim(userinfo(1)),"'","")&"'"
url="user_center.asp?action=bookmarker&"
end if
set bmrs=server.createobject("adodb.recordset")
bmrs.open sql,connstr,1,1
dim n:n=20'每页显示记录数
nextpage=pagetitle(bmrs,n,url,"条书签")
if not bmrs.eof and not bmrs.bof then
temp_str=""
dim lineNo:lineNo=1
do while not bmrs.eof and lineNo<=bmrs.pagesize
if bmrs("isShare")=1 then
share_str="<a href=""user_center.asp?action=bookmarker&operation=maosin_setShare&isShare=no&id="&bmrs("id")&""" title=""取消共享"">共享</a>(<font color=""#ff0000"">√</font>)"
else
share_str="<a href=""user_center.asp?action=bookmarker&operation=maosin_setShare&isShare=yes&id="&bmrs("id")&""" title=""设为共享"">共享</a>(<font color=""#ff0000"">×</font>)"
end if
temp_str=temp_str&"<tr class=""tdBC""><td height=""22"" valign=""middle""> <img src=""images/user/bookmark.gif"" align=""absmiddle""> <a href="""&bmrs("url")&""" target=""_blank"">"&bmrs("bmName")&"</a></td><td valign=""middle""> <a href="""&bmrs("url")&""" target=""_blank"">"&bmrs("url")&"</a></td><td valign=""middle"" align=""center"">"&share_str&"</td><td valign=""middle"" align=""center""><a href=""user_center.asp?action=bookmarker&operation=maosin_mdfBookMarker&id="&bmrs("id")&"&r_id="&bmrs("r_id")&"&bmName="&bmrs("bmName")&"&url="&bmrs("url")&"&share="&bmrs("isShare")&""" title=""编辑该书签""><img src=""images/user/edit.gif"" border=""0""></a> <a href=""user_center.asp?action=bookmarker&operation=maosin_delbookmarker&del=bookmarker&id="&bmrs("id")&""" onClick=""javascript:{if(confirm('您确定要删除该书签吗?')){return true;}else{return false;}}"" title=""删除该书签""><img src=""images/user/delete.gif"" border=""0""></a></td></tr>"
bmrs.movenext
lineNo=lineNo+1
loop
response.write(temp_str)
bmrs.movefirst
else
response.write("<tr><td height=""22"" class=""tdBC"" colspan=""4"" valign=""middle"" align=""center"">您还没有添加书签!</td></tr>")
end if
if bmrs.RecordCount>n then
%>
<tr>
<td height="22" colspan="4" valign="top" class="tdBC"><%=nextpage%></td>
</tr>
<%end if%>
</table>
<%
bmrs.close
set bmrs=nothing
end sub
sub addgroupform()%>
<table width="100%" border="0" cellpadding="1" cellspacing="1" style="margin-top:8px;" class="tableBC">
<tr>
<td height="21" valign="middle" class="tdT"> <a name="addnewgroup">添加新的书签组</a></td>
</tr>
<form action="user_center.asp?action=bookmarker&operation=maosin_appgroup" name="addgroupform" method="post">
<tr>
<td height="30" valign="middle" align="center" class="tdBC">
书签组名:<input type="text" class="wenbenkang" size="30" name="bmgroup">
<input name="addgroup" type="submit" id="addgroup" value="添加书签组" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'"> </td>
</tr>
</form>
</table>
<%end sub
sub addbookmarkerform()%>
<table width="100%" border="0" cellpadding="1" cellspacing="1" style="margin-top:8px;" class="tableBC">
<tr>
<td width="100%" height="22" valign="middle" class="tdT"> <a name="addnewmarker">添加新的书签</a></td>
</tr>
<form action="?action=bookmarker&operation=maosin_appbookmarker" name="addbmform" method="post">
<tr>
<td valign="middle" height="60" class="tdBC"> 书签名称:
<input name="bmName" type="text" id="bmName" size="30" class="wenbenkang">
所属组名:
<select name="groupName" id="groupName">
<option value="0">[根目录]
<%set rs=conn.execute("select id,bmName from ms_user_bookmarker where r_id=0 and s_id=0 and userName='"&userInfo(1)&"'")
do while not rs.eof
response.write("<option value="""&rs(0)&""">"&rs(1)&"</option>")
rs.movenext
loop
rs.close
set rs=nothing
%>
</select>
<br>
书签地址:
<input name="url" type="text" id="url" size="40" class="wenbenkang">
<input type="checkbox" name="share" id="share" value="1"><label for="share">共享该组书签</label>
<input name="addbm" type="submit" id="addbm" value="添加书签" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'"> </td>
</tr>
</form>
</table>
<%
end sub
sub addbookmarker()
if request("addbm")<>"" then
dim bmName,url,r_id,errMsg:errmsg=""
bmName=replace(trim(request("bmname")),"'","''")
url=replace(trim(request("url")),"'","")
r_id=request("groupName")
if Request("share")<>"" then
share=1
else
share=0
end if
if not isNumeric(r_id) then
r_id=0
end if
if bmName="" then
errMsg="<li>书签名不能为空</li>"
elseif strLength(bmName)>30 then
errMsg="<li>书签名不能大于 30 个字符</li>"
end if
if url="" then
errMsg=errMsg&"<li>书签地址不能为空</li>"
elseif strLength(url)>100 then
errMsg=errMsg&"<li>书签地址不能大于 100 个字符</li>"
end if
if errMsg<>"" then
showmsg "<font color=""#ff0000"">您在操作中产生如下错误:</font><br><br>"&errMsg,"操作出错信息"
exit sub
end if
bmName=chkFormStr(bmName)
url=chkFormStr(url)
if instr(1,url,"http://",1)=0 then
url="http://"&url
end if
conn.execute("insert into ms_user_bookmarker(r_id,s_id,userName,bmName,url,isShare) values("&r_id&",1,'"&userinfo(1)&"','"&bmName&"','"&url&"',"&share&")")
response.redirect "user_center.asp?action=bookmarker"
end if
exit sub
end sub
sub addgroup()
if Request("addgroup")<>"" then
dim bmgroup
if ms_submit=0 then
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂 盛系统返回提示信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
end if
bmgroup=replace(trim(Request("bmgroup")),"'","''")
if bmgroup="" then
showmsg "书签组名不能为空,请输入书签名","出错信息"
elseif strLength(bmgroup)>30 then
showmsg "书签组名最不能大于20个字符","出错信息"
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -