BVB Source Codes

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

Return Download Jie Yang v0.6.3 article system: download admin_infotype.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. <!--#include file="../../inc/commonfunction.asp" -->
  6. <%
  7. dim cid,action,id,ChannelName
  8. cid=request.QueryString("cid")
  9. if cid="" or Not Isnumeric(cid) then
  10.         cid=3
  11. end if
  12. If Not JYAdminLevel(30&cid) Then
  13.         Call ErrorMsg()
  14. End If
  15. ChannelName=ChannelNames(cid)
  16. %>
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  21. <title><%=ChannelName%>类别管理--<%=sitenames%></title>
  22. <link href="../style/style.css" rel="stylesheet" type="text/css" />
  23. </head>
  24. <script language="javascript">
  25. function check()
  26. {
  27. if (document.form2.typenames.value=="")
  28. {
  29.         alert("请输入类别名称!");
  30.         document.form2.typenames.focus();
  31.         return false;
  32. }
  33. if (document.form2.typeorder.value=="")
  34. {
  35.         alert("请输入类别排序!");
  36.         document.form2.typeorder.focus();
  37.         return false;
  38. }
  39. var objv = document.form2.typeorder.value;
  40. var pattern = /^([0-9])+$/;
  41. flag = pattern.test(objv);
  42. if(!flag)
  43. {
  44.         alert("类别排序只能为数字!");
  45.         document.form2.typeorder.focus();
  46.         return false;
  47. }
  48. }
  49. </script>
  50. <body>
  51. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  52.   <tr>
  53.     <td class="td28"><%=ChannelName%>管理</td>
  54.   </tr>
  55.   <tr>
  56.     <td bgcolor="#FFFFFF" class="td26"><b>管理选项:</b><a href="admin_info.asp?cid=<%=cid%>&action=add">添加<%=ChannelName%></a> | <a href="admin_info.asp?cid=<%=cid%>">管理<%=ChannelName%></a> | <a href="admin_infotype.asp?cid=<%=cid%>&action=InfoType#2">添加<%=ChannelName%>类别</a> | <a href="admin_infotype.asp?cid=<%=cid%>&action=InfoType">管理<%=ChannelName%>类别</a> | <a href="admin_Properties.asp?action=p">管理文章属性</a> | [<a href="javascript:location.reload()">刷新页面</a>]</td>
  57.   </tr>
  58. </table>
  59. <%
  60. action=Request("action")
  61. select case action
  62.         case "InfoType"
  63.                 Call InfoType()
  64.         case "typeadd"
  65.                 Call typesave()
  66.         case "typedel"
  67.                 Call typedel()
  68.         case "del"
  69.                 Call del()
  70. end select
  71. %>
  72. <%Sub InfoType()%>
  73. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  74.   <tr>
  75.     <td colspan="5" class="td28"><%=ChannelName%>管理</td>
  76.   </tr>
  77.   <tr class="tdcenter" bgcolor="#ECF5FE">
  78.     <td width="6%">编号</td>
  79.     <td width="36%">类别名称</td>
  80.     <td width="21%">显示顺序</td>
  81.     <td width="20%">添加时间</td>
  82.     <td width="17%">操作</td>
  83.   </tr>
  84. <%
  85. sql="select * from Article_NewsSort where S_cid="&cid&" order by S_order asc,S_id desc"
  86. rs.open sql,conn,1,1
  87. if not rs.eof then
  88.         for i=1 to rs.recordcount
  89. %>
  90.   <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#ECF7FE'">
  91.     <td align="center"><%=rs("S_id")%></td>
  92.     <td>&nbsp;&nbsp;<img src="../img/-.gif" width="15" height="15" /><%=rs("S_name")%>(文章数:<%=ArticleCount(rs("S_id"))%>)</td>
  93.     <td align="center"><%=rs("S_order")%></td>
  94.     <td align="center"><%=rs("S_addtime")%></td>
  95.     <td align="center">&nbsp;<a href="admin_infotype.asp?typeid=<%=rs("S_id")%>&cid=<%=cid%>&action=InfoType#2" title="修改<%=ChannelName%>类别">修改</a>┆<a href="admin_infotype.asp?action=typedel&cid=<%=cid%>&typeid=<%=rs("S_id")%>" title="删除<%=ChannelName%>类别">删除</a></td>
  96.   </tr>
  97. <%
  98.         rs.movenext
  99.         next
  100. end if
  101. closers(rs)
  102. %>
  103. </table>
  104. <%
  105. sql="select top 1 S_order from Article_NewsSort where S_cid="&cid&" order by S_order desc"
  106. rs.open sql,conn,1,1
  107. if not rs.eof then
  108.         Porder=rs("S_order")+1
  109. else
  110.         Porder=0
  111. end if
  112. closers(rs)
  113.        
  114. typeid=request("typeid")
  115. if typeid<>"" and Isnumeric(typeid)=true then
  116.         sql="select * from Article_NewsSort where S_id="&typeid
  117.         rs.open sql,conn,1,1
  118.         if not rs.eof then
  119.                 typenames=rs("S_name")
  120.                 typeorder=rs("S_order")
  121.                 keywords=rs("S_keywords")
  122.                 descriptions=rs("S_description")
  123.         end if
  124.         closers(rs)
  125. end if
  126. %>
  127. <a name="2" id="2"></a>
  128. <table width="98%" align="center" border="0" cellpadding="2" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  129.   <tr>
  130.     <td colspan="2" class="td28"><%=ChannelName%>类别<%if typeid="" then%>添加<%else%>修改<%end if%></td>
  131.   </tr>
  132. <form name="form2" action="admin_infotype.asp?action=typeadd&typeid=<%=typeid%>&cid=<%=cid%>" method="post" onsubmit="return check();">
  133.   <tr>
  134.     <td width="19%" align="right" bgcolor="#FFFFFF">类别名称:</td>
  135.     <td width="81%" bgcolor="#FFFFFF">&nbsp;<input name="typenames" type="text" id="typenames" value="<%=typenames%>" /></td>
  136.   </tr>
  137.   <tr>
  138.     <td align="right" bgcolor="#FFFFFF">类别关键词:</td>
  139.     <td bgcolor="#FFFFFF">&nbsp;<input name="keywords" type="text" id="keywords" value="<%=keywords%>" size="72" />
  140.       <span class="fontcolor">建议长度小于100</span></td>
  141.   </tr>
  142.   <tr>
  143.     <td align="right" bgcolor="#FFFFFF">类别描述:</td>
  144.     <td bgcolor="#FFFFFF">&nbsp;<textarea name="description" cols="70" rows="4" id="description"><%=descriptions%></textarea>
  145.       <span class="fontcolor">建议长度小于200</span> </td>
  146.   </tr>
  147.   <tr>
  148.     <td align="right" bgcolor="#FFFFFF">显示顺序:</td>
  149.     <td bgcolor="#FFFFFF">&nbsp;<input name="typeorder" type="text" id="typeorder" <%if typeid="" then%>value="<%=Porder%>"<%else%>value="<%=typeorder%>"<%end if%> size="10" />
  150.       <span class="fontcolor">*请填写数字(数字越小排在越前面)</span></td>
  151.   </tr>
  152.   <tr>
  153.     <td colspan="2" bgcolor="#FFFFFF" class="td30"><%if typeid="" then%><input type="submit" name="Submit3" value="新增类别" class="submit1" /><%else%><input type="submit" name="Submit3" value="修改类别" class="submit1" /><%end if%></td>
  154.     </tr>
  155. </form>
  156. </table>
  157. <%End Sub%>
  158. <%
  159. Sub typedel()
  160. typeid=request.QueryString("typeid")
  161. %>
  162. <table width="98%" align="center" border="0" cellpadding="2" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  163.   <tr>
  164.     <td colspan="2" class="td28">删除资讯类别</td>
  165.   </tr>
  166.   <form id="form1" name="form1" method="post" action="admin_infotype.asp?action=del&cid=<%=cid%>&typeid=<%=typeid%>">
  167.   <tr>
  168.         <td width="19%" align="right" bgcolor="#FFFFFF">删除类别选择:</td>
  169.     <td width="81%" bgcolor="#FFFFFF">&nbsp;<select name="cz">
  170.         <option value="1">删除该资讯类别和类别下所有文章</option>
  171.         <%
  172.                 sql="select S_id,S_name,S_cid from Article_NewsSort where S_id<>"&typeid&" order by S_cid asc,S_order asc"
  173.                 rs.open sql,conn,1,1
  174.                 if not rs.eof then
  175.                 for i=1 to rs.recordcount
  176.         %>
  177.         <option value="<%=rs("S_cid")%>,<%=rs("S_id")%>">转移到 <%=ChannelNames(rs("S_cid"))%> 频道的 <%=rs("S_name")%> 类别下</option>
  178.         <%
  179.                 rs.movenext
  180.                 next
  181.                 end if
  182.                 closers(rs)
  183.         %>
  184.       </select>
  185.     </td>
  186.   </tr>
  187.   <tr>
  188.     <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
  189.     <td bgcolor="#FFFFFF">&nbsp;<input name="Submit" type="submit" class="submit1" value="删除资讯类别" /></td>
  190.   </tr>
  191.   </form>
  192. </table>
  193. <%
  194. End Sub
  195. %>
  196. </body>
  197. </html>
  198. <%
  199. '保存类别数据
  200. Sub typesave()
  201.         typeid=request("typeid")
  202.         typenames=trim(request.Form("typenames"))
  203.         typeorder=trim(request.Form("typeorder"))
  204.         keywords=Trim(Request.Form("keywords"))
  205.         descriptions=Trim(Request.Form("description"))
  206.         if typeid="" then
  207.                 sql="Insert into Article_NewsSort(S_name,S_cid,S_keywords,S_description,S_addtime,S_order) values('"&typenames&"','"&cid&"','"&keywords&"','"&descriptions&"','"&now()&"','"&typeorder&"')"
  208.         else
  209.                 sql="update Article_NewsSort set S_name='"&typenames&"',S_keywords='"&keywords&"',S_description='"&descriptions&"',S_order='"&typeorder&"' where S_id="&typeid
  210.         end if
  211.         conn.execute(sql)
  212.         if typeid="" then
  213.                 response.Write("<script>alert(""新增"&ChannelName&"类别完成!""),location.href(""admin_infotype.asp?cid="&cid&"&action=InfoType"");</script>")
  214.         else
  215.                 response.Write("<script>alert(""修改"&ChannelName&"类别完成!""),location.href(""admin_infotype.asp?cid="&cid&"&action=InfoType"");</script>")
  216.         end if
  217.         response.End()
  218. End Sub
  219. %>
  220. <%
  221. Sub del()      
  222.         typeid=request("typeid") '要删除的类别
  223.         cz=request.Form("cz")
  224.         if cz=1 then
  225.                 '删除类别同时删除其下的文章
  226.                 if ishtml=1 then
  227.                         sql="select N_pic,N_id,N_addtime,N_cid,N_sid,N_content,N_homepic from Article_News where N_sid="&typeid&""
  228.                 else
  229.                         sql="select N_pic,N_homepic from Article_News where N_sid="&typeid&""
  230.                 end if
  231.                 rs.open sql,conn,1,1
  232.                
  233.                 '如果存在图片新闻,则同时删除该图片
  234.                 if not rs.eof then
  235.                         for i=1 to rs.recordcount
  236.                                 if rs("N_homepic")=1 then
  237.                                         N_pic="../../Upfiles/Article/"+rs("N_pic")
  238.                                         '删除新闻图片
  239.                                         Call DoDelFile(N_pic)
  240.                                 end if
  241.                                 '如果生成静态则也删除静态文件
  242.                                 if ishtml=1 then
  243.                                         '判断内容是否有分页,有循环删除分页文件
  244.                                         dim page,contentNum
  245.                                         contentNum=""
  246.                                         MMText=replace(rs("N_content"),"[JYPage]"," [JYPage] ")
  247.                                         MMfText=split(MMText,"[JYPage]")
  248.                                         for pagenums=0 to ubound(MMfText)
  249.                                                 htmlname=FormatLink(rs("N_addtime"),rs("N_cid"),rs("N_sid"),rs("N_id"),pagenums+1)
  250.                                                 '删除静态文件
  251.                                                 Call DelArticleHtml(htmlname)
  252.                                         next
  253.                                 end if
  254.                         rs.movenext
  255.                         next
  256.                 end if
  257.                 closers(rs)
  258.                
  259.                 '删除文章内容图片
  260.                 sql="select N_content from Article_News where N_sid="&typeid&""
  261.                 rs.open sql,conn,1,1
  262.                 '如果存在图片新闻,则同时删除该图片
  263.                 if not rs.eof then
  264.                         '删除编辑器里的图片
  265.                         '截取内容里的图片
  266.                         for i=1 to rs.recordcount
  267.                                 N_content=rs("N_content")
  268.                                 if Instr(N_content,"<IMG src=")>0 then                         
  269.                                         editorpic=split(N_content,"<IMG src=")                         
  270.                                         for pi=1 to ubound(editorpic)
  271.                                                 editorpic1=split(editorpic(pi),"Article/")
  272.                                                 if ubound(editorpic1)>0 then
  273.                                                         editorpic2=split(editorpic1(1)," ")
  274.                                                         '截图到的图片的名称
  275.                                                         editorpic3=left(editorpic2(0),len(editorpic2(0))-1)
  276.                                                         editorpic4="../../Upfiles/Article/"+editorpic3
  277.                                                         Call DoDelFile(editorpic4)
  278.                                                 end if
  279.                                         next
  280.                                 end if
  281.                         rs.movenext
  282.                         next   
  283.                 end if
  284.                 closers(rs)
  285.                
  286.                 '删除文章数据
  287.                 conn.execute("Delete from Article_News where N_sid="&typeid&"")
  288.         else
  289.                 '转移数据到其他类别下
  290.                 czs=split(cz,",")
  291.                 if ubound(czs)=1 then
  292.                         sql="Update Article_News set N_cid="&czs(0)&",N_sid="&czs(1)&" where N_sid="&typeid&""
  293.                         conn.execute(sql)
  294.                 end if
  295.         end if
  296.         '删除该类别的文章
  297.         conn.execute("delete from Article_NewsSort where S_id="&typeid)
  298.         response.Redirect("admin_infotype.asp?cid="&cid&"&action=InfoType")
  299.         response.End()
  300. End Sub
  301.  
  302. Function ArticleCount(infoid)
  303. if infoid<>"" then
  304.         sqlcount="select count(N_id) as nums from Article_News where N_sid="&infoid&""
  305.         set rscount=Server.CreateObject("ADODB.RecordSet")
  306.         rscount.open sqlcount,conn,1,1
  307.         if not rscount.eof then
  308.                 ArticleCount=rscount("nums")
  309.         else
  310.                 ArticleCount=0
  311.         end if
  312.         closers(rscount)
  313. else
  314.         ArticleCount=0
  315. end if
  316. End Function
  317.  
  318. '删除静态文件
  319. Function DelArticleHtml(htmlname)
  320.         On Error Resume Next
  321.         if htmlname<>"" then
  322.         Dim fso
  323.         Set fso = Server.CreateObject("Scripting.FileSystemObject")
  324.         if fso.FileExists(Server.MapPath(htmlname)) then
  325.                 fso.DeleteFile(Server.MapPath(htmlname))
  326.         end if
  327.         Set fso = Nothing
  328.         end if
  329. End Function
  330. %>
  331. <%call CloseConn()%>
downloadadmin_infotype.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