BVB Source Codes

Jie Yang v0.6.3 article system Show admin_links.asp Source code

Return Download Jie Yang v0.6.3 article system: download admin_links.asp Source code - Download Jie Yang v0.6.3 article system Source code - Type:.asp
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="../../conn/conn.asp" -->
  3. <!--#include file="../admin_check.asp" -->
  4. <!--#include file="../../inc/commoncode.asp" -->
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  9. <title>友情链接管理--<%=sitename%></title>
  10. <link href="../style/style.css" rel="stylesheet" type="text/css" />
  11. </head>
  12. <script language="javascript">
  13. function show(ids)
  14. {
  15.                 //document.getElementById("text").style.display = "none";
  16.                 document.getElementById(ids).style.display="block";
  17. }
  18. function shows(ids)
  19. {
  20.                 document.getElementById("logo").style.display = "none";
  21.                 document.getElementById(ids).style.display="block";
  22. }
  23. function check()
  24. {
  25. if (document.form1.linkurl.value=="")
  26. {
  27.         alert("请输入网站网址!");
  28.         document.form1.linkurl.focus();
  29.         return false;
  30. }
  31. if (document.form1.L_order.value=="")
  32. {
  33.         alert("请输入显示顺序!");
  34.         document.form1.L_order.focus();
  35.         return false;
  36. }
  37. var objv = document.form1.L_order.value;
  38. var pattern = /^([0-9])+$/;
  39. flag = pattern.test(objv);
  40. if(!flag)
  41. {
  42.         alert("显示顺序只能为数字!");
  43.         document.form1.L_order.focus();
  44.         return false;
  45. }
  46. }
  47. function CheckAll(form)
  48. {
  49. for (var i=0;i<form.elements.length;i++)
  50. {
  51. var e = form.elements[i];
  52. if (e.Name != "chkAll")
  53.    e.checked = form.chkAll.checked;
  54. }
  55. }
  56. function opw(url,name,width,height)
  57. {
  58. window.open(url,name,''+'width='+width+',height='+height+',scrollbars=yes'+'');
  59. }
  60. </script>
  61. <body>
  62. <%
  63. dim action,id,linktype,pageshow
  64. pageshow=request("pageshow")
  65. linktype=request("linktype")
  66. id=request("id")
  67. action=Request("action")
  68. if linktype="" then
  69.         linktype=0
  70. end if
  71. keyword=request.Form("keyword")
  72. sql="select * from Article_Link where L_type="&linktype&""
  73. if (keyword<>"" and keyword<>"请输入网站名称") then
  74. sql=sql&" and L_name like'%"&keyword&"%'"
  75. end if
  76. sql=sql&"  order by L_order asc"
  77. %>
  78. <%
  79. select case action
  80.         case "add"
  81.                 Call Top()
  82.                 call add()
  83.         case "save"
  84.                 call savedata()
  85.         case "del"
  86.                 call del()
  87.         case else
  88.                 Call Top()
  89.                 call main()
  90. end select
  91. Sub Top()
  92. %>
  93. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  94.   <tr>
  95.     <td class="td28">友情链接管理</td>
  96.   </tr>
  97.   <tr>
  98.     <td bgcolor="#FFFFFF" class="td26"><b>管理选项</b>:<a href="admin_links.asp?linktype=0" target="main">文字链接列表</a> | <a href="admin_links.asp?linktype=1" target="main">logo链接列表</a> | <a href="admin_links.asp?action=add" target="main">友情链接添加</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td>
  99.   </tr>
  100.   <form name="linkform" method="post" action="admin_links.asp?linktype=<%=linktype%>">
  101.   <tr>
  102.     <td bgcolor="#FFFFFF" class="td26"><b>链接搜索</b>:
  103.       <input name="keyword" type="text" id="keyword"<%if keyword<>"" then%>value=<%=keyword%><%else%>value="请输入网站名称"<%end if%> onblur="if(this.value=='') this.value='请输入网站名称';" onfocus="if(this.value=='请输入网站名称') this.value='';" />&nbsp; &nbsp;<input name="Submit3" type="submit" class="submit1" value=" 搜 索 " /></td>
  104.   </tr>
  105. </form>
  106. </table>
  107. <%End Sub%>
  108. <%Sub main()%>
  109. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  110.   <tr>
  111.     <td colspan="8" class="td28"><%if linktype=0 then%>文字<%else%>logo<%end if%>链接列表</td>
  112.   </tr>
  113.   <tr class="tdcenter" bgcolor="#ECF5FE">
  114.     <td width="5%">全选</td>
  115.     <td width="18%">网站名称</td>
  116.     <td width="33%">网站网址</td>
  117.     <td width="9%">是否审核</td>
  118.     <td width="9%">显示顺序</td>
  119.     <td width="20%">添加时间</td>
  120.     <td width="6%">编辑</td>
  121.     </tr>
  122. <form name="form1" action="admin_links.asp?action=del&linktype=<%=linktype%>" method="post">
  123. <%
  124. rs.open sql,conn,1,1
  125. linkURL="admin_links.asp?linktype="&linktype&""
  126. const maxperpage=20
  127. if not(rs.bof and rs.eof) then  '判别数据表中的记录是否为空
  128.         dim recordtotal  '总记录条数
  129.         dim pagetotal  '总的页数
  130.         recordtotal=rs.recordcount '总的记录条数
  131.         rs.pagesize=maxperpage   '每页显示的最多条数
  132.         pagetotal=rs.pagecount  '总的页数
  133.         if pageshow<>"" and IsNumeric(pageshow) then
  134.                 if pageshow<1 Or Len(pageshow)>10 Then
  135.                         pageshow=1
  136.                 else
  137.                         pageshow=CLng(pageshow)
  138.                 end If
  139.         else
  140.                 pageshow=1
  141.         end If
  142. end if 
  143. %>
  144. <%  
  145. if Not(Rs.bof and Rs.eof) then
  146.         Rs.move(Cint(pageshow)-1)*maxperpage,1
  147. for i=1 to Rs.pagesize
  148. %>
  149.   <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#ECF7FE'" bgcolor="#FFFFFF">
  150.     <td align="center"><input name="id" type="checkbox" id="id" value="<%=rs("L_id")%>"></td>
  151.     <td>&nbsp;<%if linktype=0 then%><%=rs("L_name")%><%else%><img <%if left(rs("L_logo"),7)="http://" then%>src="<%=rs("L_logo")%>"<%else%>src="../../Upfiles/links/<%=rs("L_logo")%>"<%end if%> width="88" height="31" style="padding:3px 0 0 0;" /><%end if%></td>
  152.     <td>&nbsp;<a href="<%=rs("L_url")%>" target="_blank"><%=rs("L_url")%></a></td>
  153.     <td align="center"><%if rs("L_flag")=1 then%><font color="#006633">已审核</font><%else%><font color="#FF0000">未审核</font><%end if%></td>
  154.     <td align="center"><%=rs("L_order")%></td>
  155.     <td align="center"><%=rs("L_addtime")%></td>
  156.     <td align="center"><a href="admin_links.asp?action=add&id=<%=rs("L_id")%>">修改</a></td>
  157.     </tr>
  158. <%
  159. Rs.movenext
  160. if Rs.eof then exit for
  161. next
  162. %>
  163. <input type="hidden" name="pageshow" value="<%=pageshow%>">
  164. <tr>
  165.   <td colspan="8" align="left" bgcolor="#FFFFFF" class="td30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中本页显示的所有记录&nbsp;<input name="submit" type='submit' class="submit1" value='删除选定的记录' onclick='javascript:if(confirm("确定要删除吗?"))location.href="admin_links.asp?action=del"'>  </td>
  166. </tr>
  167. </form>
  168. <tr>
  169.         <td colspan="8" align="right" bgcolor="#FFFFFF" class="tdright"><%Call ShowPage(linkURL,recordtotal,MaxPerPage,true,true,"个友情链接")%></td>
  170. </tr>
  171. <%end if
  172. closers(rs)
  173. %>
  174. </table>
  175. <%End Sub%>
  176. <%Sub add()
  177. if id<>"" then
  178.         sql="select * from Article_Link where L_id="&id
  179.         rs.open sql,conn,1,1
  180.         if not rs.eof then
  181.                 linkname=rs("L_name")
  182.                 linklogo=rs("L_logo")
  183.                 linkurl=rs("L_url")
  184.                 linktype=rs("L_type")
  185.                 L_flag=rs("L_flag")
  186.                 L_info=rs("L_info")
  187.                 L_order=rs("L_order")
  188.         end if
  189.         closers(rs)
  190. else
  191.         L_flag=999
  192. end if
  193. if id="" then
  194.         set rsorder=Server.CreateObject("ADODB.RecordSet")
  195.         sqlorder="select top 1 L_order from Article_Link order by L_order desc"
  196.         rsorder.open sqlorder,conn,1,1
  197.         if not rsorder.eof then
  198.                 L_order=rsorder("L_order")+1
  199.         else
  200.                 L_order=0
  201.         end if
  202.         Closers(rsorder)
  203. end if
  204. %>
  205. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  206.   <tr>
  207.     <td colspan="2" class="td28">链接<%if id="" then%>添加<%else%>修改<%end if%></td>
  208.     </tr>
  209. <form name="form1" action="admin_links.asp?action=save&id=<%=id%>&links=<%=linklogo%>" method="post" onsubmit="return check();">
  210.   <tr>
  211.     <td width="15%" align="right" bgcolor="#FFFFFF">链接类型:</td>
  212.     <td width="85%" bgcolor="#FFFFFF">&nbsp;<input name="linktype" id="linktype" onclick=shows("text") type="radio" value="0" checked="checked" />文字链接<input type="radio" id="linktypes" onclick=show("logo") name="linktype" value="1" <%if linktype=1 then%>checked="checked"<%end if%>/>logo链接   </td>
  213.   </tr>
  214.   <tr id="text">
  215.     <td align="right" bgcolor="#FFFFFF">网站名称:</td>
  216.     <td bgcolor="#FFFFFF">&nbsp;<input name="linkname" type="text" id="linkname" size="40" value="<%=linkname%>" /></td>
  217.   </tr>
  218.   <tr id="logo" <%if linktype<>1 then%>style="display:none;"<%end if%> class="td30">
  219.     <td align="right" bgcolor="#FFFFFF">网站logo:</td>
  220.     <td bgcolor="#FFFFFF">&nbsp;<input name="linklogo" type="text" id="linklogo" value="<%=linklogo%>" size="40" /> <input name="upfile" type="button" class="submit1" onClick="javascript:opw('../inc/picup.asp?fromForm=form1&fromEdit=linklogo&saveTo=../../Upfiles/links/&showPath=','pic',420,165)" value="上传logo"> <span class="fontcolor">*logo大小为88*31以到达最好的效果</span> </td>
  221.   </tr>
  222.   <tr>
  223.     <td align="right" bgcolor="#FFFFFF">网站网址:</td>
  224.     <td bgcolor="#FFFFFF">&nbsp;<input name="linkurl" type="text" id="linkurl" value="<%=linkurl%>" size="40" />
  225.       <span class="fontcolor">*请填写正确的网址</span> </td>
  226.   </tr>
  227.   <tr>
  228.     <td align="right" bgcolor="#FFFFFF">是否审核:</td>
  229.     <td bgcolor="#FFFFFF">&nbsp;<input name="L_flag" id="radio" type="radio" value="1" checked="checked" />已审核
  230.         <input type="radio" id="radio" name="L_flag" value="0" <%if L_flag=0 then%>checked="checked"<%end if%>/>未审核 </td>
  231.   </tr>
  232.   <tr>
  233.     <td align="right" bgcolor="#FFFFFF">显示顺序:</td>
  234.     <td bgcolor="#FFFFFF">&nbsp;<input name="L_order" type="text" size="6" value="<%=L_order%>" /></td>
  235.   </tr>
  236.   <tr>
  237.     <td align="right" bgcolor="#FFFFFF">备&nbsp;&nbsp;&nbsp; 注:</td>
  238.     <td bgcolor="#FFFFFF">&nbsp;<textarea name="L_info" cols="60" rows="4"><%=L_info%></textarea></td>
  239.   </tr>
  240.   <tr>
  241.     <td colspan="2" bgcolor="#FFFFFF" class="td30" align="center"><input name="Submit" type="submit" class="submit1" <%if id="" then%>value="添加链接"<%else%>value="修改链接"<%end if%>/>  <input name="Submit2" type="reset" class="submit1" <%if id="" then%>value="取消添加"<%else%>value="取消修改"<%end if%>/></td>
  242.   </tr>
  243. </form>
  244. </table>
  245. <%End Sub%>
  246. <%
  247. Sub savedata()
  248. linkname=trim(request.Form("linkname"))
  249. linklogo=request.Form("linklogo")
  250. linktype=request("linktype")
  251. linkurl=request.Form("linkurl")
  252. linktime=now()
  253. linklogos=request.QueryString("links")
  254. L_flag=request.Form("L_flag")
  255. L_info=request.Form("L_info")
  256. L_order=request.Form("L_order")
  257. if linktype=0 then
  258.         if linkname="" then
  259.                 response.Write("<script>alert(""网站名称不能为空!"");history.go(-1);</script>")
  260.                 response.End()
  261.         end if
  262. else
  263.         if linklogo="" then
  264.                 response.Write("<script>alert(""网站logo不能为空!"");history.go(-1);</script>")
  265.                 response.End()
  266.         end if
  267. end if
  268. if left(linkurl,7)<>"http://" or len(linkurl)<8 then
  269.         response.Write("<script>alert(""网站网址不正确!"");history.go(-1);</script>")
  270.         response.End()
  271. end if
  272.  
  273. '查信息是否重复
  274. if id="" then  
  275.         sqls="select L_id from Article_Link where L_url='"&linkurl&"' and L_type="&linktype&""
  276. else
  277.         sqls="select L_id from Article_Link where L_url='"&linkurl&"' and L_type="&linktype&" and L_id<>"&id
  278. end if
  279. rs.open sqls,conn,1,1
  280. if not rs.eof then
  281.         closers(rs)
  282.         response.Write("<script>alert(""链接["&linkurl&"]已经存在,不用重复添加!"");history.go(-1);</script>")
  283.         response.End()
  284. end if
  285.  
  286. '文字链接添加和修改
  287. if linktype=0 then
  288.         if id="" then
  289.                 sql="Insert into Article_Link(L_name,L_addtime,L_type,L_url,L_flag,L_info,L_order) values('"&linkname&"','"&linktime&"','"&linktype&"','"&linkurl&"','"&L_flag&"','"&L_info&"','"&L_order&"')"
  290.         else
  291.                 sql="Update Article_Link set L_name='"&linkname&"',L_addtime='"&linktime&"',L_type='"&linktype&"',L_url='"&linkurl&"',L_flag='"&L_flag&"',L_info='"&L_info&"',L_order='"&L_order&"' where L_id="&id
  292.         end if 
  293. 'logo链接添加和修改
  294. elseif linktype=1 then
  295.         if id="" then
  296.                 sql="Insert into Article_Link(L_logo,L_name,L_addtime,L_type,L_url,L_flag,L_info,L_order) values('"&linklogo&"','"&linkname&"','"&linktime&"','"&linktype&"','"&linkurl&"','"&L_flag&"','"&L_info&"','"&L_order&"')"
  297.         else
  298.                 '判断若logo重新上传,则删除原来上传的logo
  299.                 if StrComp(linklogo,linklogos)<>0 then
  300.                         linklogos="../../Upfiles/links/"+linklogos
  301.                         call DoDelFile(linklogos)
  302.                 end if
  303.                 sql="Update Article_Link set L_name='"&Linkname&"',L_logo='"&linklogo&"',L_addtime='"&linktime&"',L_type='"&linktype&"',L_url='"&linkurl&"',L_flag='"&L_flag&"',L_info='"&L_info&"',L_order='"&L_order&"' where L_id="&id
  304.         end if
  305. end if
  306.   conn.execute(sql)
  307. if id="" then
  308.         msg="链接添加完成!"
  309. else
  310.         msg="链接修改完成!"
  311. end if
  312. Call SucessMsg(""&msg&"","admin_links.asp?linktype="&linktype&"")
  313. response.End()
  314. End Sub
  315. %>
  316. <%
  317. Sub del()
  318.         if id="" then
  319.                 response.Write "<script>alert(""请选择你要删除的选项!"");location.href=""admin_links.asp"";</script>"
  320.                 response.End()
  321.         else
  322.                 '根据id查询表,若是logo链接则也删除logo,否则就只删除数据
  323.                 ids=split(id,",")
  324.                 for i=0 to ubound(ids)
  325.                         sql="select L_logo from Article_Link where L_id="&ids(i)
  326.                         rs.open sql,conn,1,1
  327.                         if not rs.eof then
  328.                                 L_logo=rs("L_logo")
  329.                                 if L_logo<>"" then
  330.                                         linklogos="../../Upfiles/links/"+rs("L_logo")
  331.                                         '删除logo图片
  332.                                         call DoDelFile(linklogos)
  333.                                 end if
  334.                                 conn.execute("delete from Article_Link where L_id="&ids(i))
  335.                         end if
  336.                         closers(rs)
  337.                 next
  338.                 response.Redirect ("admin_links.asp?linktype="&linktype&"")
  339.                 response.End()
  340.         end if
  341. End Sub
  342. %>
  343. </body>
  344. </html>
  345. <%call CloseConn()%>
downloadadmin_links.asp Source code - Download Jie Yang v0.6.3 article system Source code
Related Source Codes/Software:
Jilin classification information release system v5.0 trial version - A ready-made classifieds site publishing system, h... 2016-09-21
Linyi CMS v6.5 market classification information - A. supply and demand information function: informa... 2016-09-21
Tesco discount net SQL version - And presentations, faster. 2016-09-21
- electronic enterprise website management system In a fully functional version - Super suitable for enterprise agents build a corpo... 2016-09-21
Rio mesh network hard disk system v3.0 - System functions: 1, increase the progress of Asp... 2016-09-21
Classified information network business in suzhou - Overall module: classification of supply and deman... 2016-09-21
NPOINT virtual host v1.7.0 formal version management system - The system main function is introduced 2016-09-21
IDC sales web site - Beautiful IDC sales web site source code 2016-09-21
Oo 126 CMS movie site system - This procedure ASP + ACC/ASP + SQL, using new kern... 2016-09-21
Pcook CMS bubble guest v3.0 SDCMS version - Developed by Asp+Access, and meet the needs of sma... 2016-09-21
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top