BVB Source Codes

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

Return Download Jie Yang v0.6.3 article system: download admin_info.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. <!--#include file="../inc/SaveRemoteImg.asp" -->
  7. <%
  8. dim action,id,pageshow
  9. id=request("id")
  10. Cid=Request.QueryString("cid")
  11. if cid="" then cid=3
  12. If Not JYAdminLevel(30&cid) Then
  13.         Call ErrorMsg()
  14. End If
  15. sUploadDir=UpFilesPath("Article")
  16. ChannelName=ChannelNames(cid)
  17. pageshow=request("pageshow")
  18. keyword=request.Form("keyword")
  19. typeid=request("typeid")
  20.  
  21. if typeid=0 then
  22.         typeid=""
  23. end if
  24. %>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  29. <title><%=ChannelName%>--<%=sitenames%></title>
  30. <link href="../style/style.css" rel="stylesheet" type="text/css" />
  31. </head>
  32. <script language="javascript">
  33. function check()
  34. {
  35. if(document.form1.N_title.value=="")
  36. {
  37. alert("请输入文章标题!");
  38. document.form1.N_title.focus();
  39. return false;
  40. }
  41. if(document.form1.N_sid.value=="文章类别")
  42. {
  43. alert("请选择文章类别!");
  44. return false;
  45. }
  46. }
  47. function checks()
  48. {
  49. if(confirm("确定要删除选中的记录!"))       
  50. {
  51.         document.form3.submit();               
  52. }
  53. return false;
  54. }
  55. function show()
  56. {
  57. if (document.getElementById("N_homepic").checked==true)
  58. {document.getElementById("N_pic").style.display="block";}
  59. else
  60. {document.getElementById("N_pic").style.display="none";}
  61. }
  62.  
  63. function opw(url,name,width,height)
  64. {
  65. window.open(url,name,''+'width='+width+',height='+height+',scrollbars=yes'+'');
  66. }
  67. function CheckAll(form)
  68. {
  69. for (var i=0;i<form.elements.length;i++)
  70. {
  71. var e = form.elements[i];
  72. if (e.Name != "chkAll")
  73.    e.checked = form.chkAll.checked;
  74. }
  75. }
  76. </script>
  77. <body>
  78. <%
  79. action=Request("action")
  80. select case action
  81.         case "add"
  82.                 Call Top()
  83.                 Call add()
  84.         case "save"
  85.                 Call SaveData()
  86.         case "del"
  87.                 Call Del()
  88.         case else
  89.                 Call Top()
  90.                 Call main()
  91. end select
  92. %>
  93. <%Sub Top()%>
  94. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  95.   <tr>
  96.     <td class="td28"><%=ChannelName%>管理</td>
  97.   </tr>
  98.   <tr>
  99.     <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>
  100.   </tr>
  101.   <tr>
  102.     <td bgcolor="#FFFFFF" class="td26"><b>二级选项:</b><%set infotypers=server.createobject("ADODB.Recordset")
  103.                 infotypesql="select S_id,S_name from Article_NewsSort where S_cid="&cid&" order by S_order asc"
  104.                 infotypers.open infotypesql,conn,1,1
  105.                 do while not infotypers.eof
  106.                         response.write "<a href='admin_info.asp?cid="&cid&"&typeid="&infotypers("S_id")&"'>"&infotypers("S_name")&"</a>&nbsp;&nbsp;"
  107.                 infotypers.movenext
  108.                 loop
  109.                 closers(infotypers)%></td>
  110.   </tr>
  111. <form name="infoform" method="post" action="admin_info.asp?cid=<%=cid%>">
  112.   <tr>
  113.     <td bgcolor="#FFFFFF" class="td26"><b>文章搜索</b>:
  114.       <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; <select name="typeid">
  115.           <option value="0">所有文章类别</option>
  116.         <%
  117.                 set infotypers=server.createobject("ADODB.Recordset")
  118.                 infotypesql="select S_id,S_name from Article_NewsSort where S_cid="&cid&" order by S_order asc"
  119.                 infotypers.open infotypesql,conn,1,1
  120.                 do while not infotypers.eof
  121.                         if cstr(typeid)=cstr(infotypers("S_id")) then
  122.                         response.write"<option value="&infotypers("S_id")&" selected>"&infotypers("S_name")&"</option>"
  123.                         else
  124.                         response.write"<option value="&infotypers("S_id")&">"&infotypers("S_name")&"</option>"
  125.                         end if
  126.                 infotypers.movenext
  127.                 loop
  128.                 closers(infotypers)
  129.         %></select>&nbsp;<input name="Submit3" type="submit" class="submit1" value=" 搜 索 " /></td>
  130.   </tr>
  131. </form>
  132. </table>
  133. <%End Sub%>
  134. <%Sub main()
  135. sql="select * from Article_News where N_cid="&cid&""
  136. if (keyword<>"请输入搜索关键字" and keyword<>"") then
  137.         sql=sql&" and N_title like'%"&keyword&"%'"
  138. end if
  139. if typeid<>"" then
  140.         sql=sql&" and N_sid="&typeid&""
  141. end if
  142. sql=sql&" order by N_id desc"
  143.  
  144. %>
  145. <table width="98%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  146.   <tr>
  147.     <td colspan="9" class="td28"><%=ChannelName%>列表</td>
  148.   </tr>
  149.   <tr class="tdcenter" bgcolor="#ECF5FE">
  150.     <td width="8%">全选</td>
  151.     <td width="45%">文章标题</td>
  152.     <td width="14%">文章类别</td>
  153.     <td width="16%">发布日期</td>
  154.     <td width="7%">点击数</td>
  155.     <td width="10%">操作</td>
  156.   </tr>
  157. <form name="form3" action="admin_info.asp?action=del&cid=<%=cid%>" method="post" onsubmit="return checks();">
  158. <%
  159. rs.open sql,conn,1,1
  160. linkURL="admin_info.asp?cid="&cid&"&typeid="&typeid&""
  161. const maxperpage=14
  162. if not(rs.bof and rs.eof) then  '判别数据表中的记录是否为空
  163.         dim recordtotal  '总记录条数
  164.         dim pagetotal  '总的页数
  165.         recordtotal=rs.recordcount '总的记录条数
  166.         rs.pagesize=maxperpage   '每页显示的最多条数
  167.         pagetotal=rs.pagecount  '总的页数
  168.         if pageshow<>"" and IsNumeric(pageshow) then
  169.                 if pageshow<1 Or Len(pageshow)>10 Then
  170.                         pageshow=1
  171.                 else
  172.                         pageshow=CLng(pageshow)
  173.                 end If
  174.         else
  175.                 pageshow=1
  176.         end If
  177. end if 
  178. if Not(Rs.bof and Rs.eof) then
  179.         Rs.move(Cint(pageshow)-1)*maxperpage,1
  180. for i=1 to Rs.pagesize
  181. %>
  182.   <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#ECF7FE'">
  183.     <td align="center"><input name="id" type="checkbox" id="id" value="<%=rs("N_id")%>"></td>
  184.     <td>&nbsp;<a href="<%=FormatLink(Rs("N_addtime"),rs("N_cid"),rs("N_sid"),rs("N_id"),0)%>" title="查看文章内容" target="_blank"><%=rs("N_title")%></a><%if rs("N_homepic")=1 then%>&nbsp;<img src="../Img/haveimg.gif" alt="此文章为图片文章:&lt;br&gt;&lt;img src='../../Upfiles/Article/<%=rs("N_pic")%>' border=1 width=220 height=150" /><%end if%><%if Rs("N_Properties")<>"" and Not Isnull(Rs("N_Properties")) then%>&nbsp;<img src="../Img/32.gif" title="<%=Article_Properties(Rs("N_Properties"))%>" width="12" height="12" /><%end if%></td>
  185.     <td align="center"><%=NewsSort(rs("N_sid"))%></td>
  186.     <td align="center"><%=rs("N_addtime")%></td>
  187.     <td align="center"><%=rs("N_hits")%></td>
  188.     <td align="center"><a href="admin_info.asp?action=add&id=<%=rs("N_id")%>&cid=<%=cid%>&pageshow=<%=pageshow%>" title="编辑信息">编辑</a> <a href="../comment/admin_index.asp?nid=<%=rs("N_id")%>" title="查看该文章评论">评论</a></td>
  189.     </tr>
  190. <%
  191. Rs.movenext
  192. if Rs.eof then exit for
  193. next
  194. %>
  195. <input type="hidden" name="pageshow" value="<%=pageshow%>">
  196. <tr>
  197.   <td colspan="9" align="left" bgcolor="#FFFFFF" class="td30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中本页显示的所有记录&nbsp;<input name="button" type='Submit' class="submit1" value='删除选定的记录'>  </td>
  198. </tr>
  199. <tr>
  200.         <td colspan="9" align="right" bgcolor="#FFFFFF" class="tdright" style="height:30px;">&nbsp;
  201.         <%Call ShowPage(linkURL,recordtotal,MaxPerPage,true,true,"篇文章")%>&nbsp;
  202. </td>
  203. </tr>
  204. </form>
  205. <%end if
  206. closers(rs)
  207. %>
  208. </table>
  209. <div id="pltsTipLayer" name="pltsTipLayer" style="display:none; position:absolute; z-index:10001; text-align:left;"></div>
  210. <script language="javascript" src="../../Js/tit.js"></script>
  211. <%End Sub%>
  212. <%Sub add()
  213. if (id<>"" and Isnumeric(id)) then
  214.         sql="select * from Article_News where N_id="&id
  215.         rs.open sql,conn,1,1
  216.         if not rs.eof then
  217.                 N_title=rs("N_title")
  218.                 N_content=rs("N_content")
  219.                 N_cid=rs("N_cid")
  220.                 N_sid=rs("N_sid")
  221.                 N_overview=rs("N_overview")
  222.                 N_color=rs("N_color")
  223.                 N_author=rs("N_author")
  224.                 N_pic=rs("N_pic")
  225.                 N_addtime=rs("N_addtime")
  226.                 N_hits=rs("N_hits")
  227.                 N_from=rs("N_from")            
  228.                 N_Properties=rs("N_Properties")
  229.                 N_homepic=rs("N_homepic")
  230.                 N_hits=rs("N_hits")
  231.                 N_keywords=rs("N_keywords")
  232.                 N_isAspJpeg=rs("N_isAspJpeg")
  233.         end if
  234.         closers(rs)
  235. else
  236.         if IsAspJpeg=1 then
  237.                 N_isAspJpeg=1
  238.         end if
  239. end if
  240. %>
  241. <table width="98%" align="center" border="0" cellpadding="1" cellspacing="1" bgcolor="#8ED1FF" class="mtab">
  242. <form name="form1" action="admin_info.asp?action=save&id=<%=id%>&picold=<%=N_pic%>&cid=<%=cid%>&pageshow=<%=pageshow%>" method="post" onsubmit="return check();">
  243.   <tr>
  244.     <td colspan="2" class="td28">文章<%if id="" then%>添加<%else%>修改<%end if%></td>
  245.     </tr>
  246.   <tr>
  247.     <td width="12%" align="right" bgcolor="#FFFFFF">文章标题:</td>
  248.     <td width="88%" bgcolor="#FFFFFF">&nbsp;<input name="N_title" type="text" id="N_title" size="50" value="<%=N_title%>" />
  249.        &nbsp; <select name="N_color">
  250.            <option value='' selected>颜色</option>
  251.                         <option value='#000000' style='background-color:#000000' <%if N_color="#000000" then%>selected="selected"<%end if%>></option>
  252.                         <option value='#008000' style='background-color:#008000' <%if N_color="#008000" then%>selected="selected"<%end if%>></option>
  253.                         <option value='#800000' style='background-color:#800000' <%if N_color="#800000" then%>selected="selected"<%end if%>></option>
  254.                         <option value='#808000' style='background-color:#808000' <%if N_color="#808000" then%>selected="selected"<%end if%>></option>
  255.                         <option value='#0000FF' style='background-color:#0000FF' <%if N_color="#0000FF" then%>selected="selected"<%end if%>></option>
  256.                         <option value='#FF0000' style='background-color:#FF0000' <%if N_color="#FF0000" then%>selected="selected"<%end if%>></option>
  257.       </select>      </td>
  258.   </tr>
  259.   <tr>
  260.     <td align="right" bgcolor="#FFFFFF">文章类别:</td>
  261.     <td bgcolor="#FFFFFF">&nbsp;<select name="N_sid">
  262.         <%if id="" then%>
  263.         <option value="文章类别" selected="selected">请选择文章类别</option>
  264.         <%else%>
  265.         <option value="<%=N_sid%>" selected><%=NewsSort(N_sid)%>&nbsp;类信息</option>
  266.         <%end if%>
  267.         <%
  268.                 set Infotypers=server.createobject("ADODB.Recordset")
  269.                 Infotypesql="select * from Article_NewsSort where S_cid="&cid&" order by S_order asc"
  270.                 Infotypers.open Infotypesql,conn,1,1
  271.                 do while not Infotypers.eof
  272.                         response.write"<option value="&Infotypers("S_id")&">"&Infotypers("S_name")&"&nbsp;类信息</option>"
  273.                         Infotypers.movenext
  274.                 loop
  275.                 closers(Infotypers)
  276.         %>
  277.       </select>  <a href="admin_infotype.asp?action=InfoType&cid=<%=cid%>#2"><font color="#FF0000">添加</font></a> </td>
  278.   </tr>
  279.   <tr>
  280.     <td align="right" bgcolor="#FFFFFF">文章属性:</td>
  281.     <td bgcolor="#FFFFFF">&nbsp;<%
  282.                 sqlp="Select P_id,P_name from Article_Properties order by P_order asc"
  283.                 set rsp=Server.CreateObject("ADODB.RecordSet")
  284.                 rsp.open sqlp,conn,1,1
  285.                 if not rsp.eof then
  286.                 for i=1 to rsp.recordcount                     
  287.         %><input type="checkbox" name="N_p" value="<%=rsp("P_id")%>" <%
  288.         if N_Properties<>"" then
  289.                 N_Propertiess=split(N_Properties,"|")
  290.                 For j=0 to ubound(N_Propertiess)
  291.                         if cstr(rsp("P_id"))=Trim(cstr(N_Propertiess(j))) then
  292.                                 Response.Write "checked='checked'"
  293.                         end if
  294.                 Next
  295.         end if
  296.         %> /> <%=rsp("P_name")%>
  297.         <%
  298.                 rsp.movenext
  299.                 next
  300.                 end if
  301.                 closers(rsp)
  302.         %></td>
  303.   </tr>
  304.   <tr>
  305.     <td align="right" bgcolor="#FFFFFF">图片文章:</td>
  306.     <td bgcolor="#FFFFFF">&nbsp;<input type="checkbox" name="N_homepic" id="N_homepic" value="1" onclick="javascript:show();" <%if N_homepic=1 then%>checked="checked"<%end if%> /> 是(图片文章则上传图片)
  307.       <input type="checkbox" name="N_isAspJpeg" value="1" <%if N_isAspJpeg=1 then%>checked="checked"<%end if%> />
  308.       图片加水印(服务器支持AspJpeg和网站信息选中水印才有效)</td>
  309.   </tr>
  310.   <tr id="N_pic" <%if N_homepic=0 then%>style="display:none;"<%end if%>>
  311.     <td align="right" bgcolor="#FFFFFF" style="height:30px;">文章图片:</td>
  312.     <td bgcolor="#FFFFFF">&nbsp;<input name="N_pic" type="text" id="N_pic" value="<%=N_pic%>" size="30" readonly/> <input name="upfile" type="button" class="submit1" onClick="javascript:opw('../../inc/picup.asp?fromForm=form1&fromEdit=N_pic&saveTo=../Upfiles/Article/&showPath=','N_pic',420,165)" value="上传图片"></td>
  313.   </tr>
  314.   <tr>
  315.     <td align="right" bgcolor="#FFFFFF">文章作者:</td>
  316.     <td bgcolor="#FFFFFF">&nbsp;<input name="N_author" type="text" id="N_author" value="<%=N_author%>" /> <font color='blue'><=【<font color='green' onclick="document.form1.N_author.value='未知'" style="cursor:pointer;">未知</font>】</font></td>
  317.   </tr>
  318.   <tr>
  319.     <td align="right" bgcolor="#FFFFFF">文章来源:</td>
  320.     <td bgcolor="#FFFFFF">&nbsp;<input type="text" name="N_from" id="N_from" <%if id<>"" then%>value="<%=N_from%>"<%else%>value="<%=sitenames%>"<%end if%> />      <font color='blue'><=【<font color='green' onclick="document.form1.N_from.value='互联网'" style="cursor:pointer;">互联网</font>】</font></td>
  321.   </tr>
  322.   <tr>
  323.     <td align="right" bgcolor="#FFFFFF">添加时间:</td>
  324.     <td bgcolor="#FFFFFF">&nbsp;<input type="text" name="N_addtime" <%if id="" then%>value="<%=now()%>"<%else%>value="<%=N_addtime%>"<%end if%> /></td>
  325.   </tr>
  326.   <tr>
  327.     <td align="right" bgcolor="#FFFFFF">点击数:</td>
  328.     <td bgcolor="#FFFFFF">&nbsp;<input name="N_hits" type="text" <%if id="" then%>value="10"<%else%>value="<%=N_hits%>"<%end if%> size="10" />
  329.       <span class="fontcolor">点击数作弊</span></td>
  330.   </tr>
  331.   <tr>
  332.     <td align="right" bgcolor="#FFFFFF">关键字:</td>
  333.     <td bgcolor="#FFFFFF">&nbsp;<input name="N_keywords" type="text" value="<%=N_keywords%>" size="60" maxlength="100" />
  334.       <span class="fontcolor">&nbsp; 建议长度:小于100个字符</span></td>
  335.   </tr>
  336.   <tr>
  337.     <td width="12%" align="right" bgcolor="#FFFFFF">文章简介:</td>
  338.     <td width="88%" bgcolor="#FFFFFF">&nbsp;<textarea name="N_overview" cols="60" rows="4"><%=N_overview%></textarea>
  339.       <span class="fontcolor">建议长度:小于200个字符</span></td>
  340.   </tr>
  341.   <tr>
  342.     <td align="right" bgcolor="#FFFFFF">文章内容:<br />
  343.       (换行请按&nbsp;&nbsp;&nbsp; Shift+Enter)</td>
  344.     <td bgcolor="#FFFFFF"><input type="hidden" name="N_content" value="<%=server.HTMLEncode(N_content)%>" />
  345. <%if Editor=2 then%><iframe ID="eWebEditor1" src="../editor/ewebeditor.asp?id=N_content&style=standard&originalfilename=d_originalfilename&savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="100%" HEIGHT="400"></iframe><%else%><iframe id="content___Frame" src="../Fckeditor/editor/fckeditor.html?InstanceName=N_content&amp;Toolbar=Default" width="100%" height="400" frameborder="0" scrolling="no"></iframe><%end if%><br />(分页符为: [JYPage] ) </td>
  346.   </tr>
  347.   <tr>
  348.     <td width="12%" align="right" bgcolor="#FFFFFF">文章简介:</td>
  349.     <td width="88%" bgcolor="#FFFFFF">&nbsp;<input type="checkbox" name="IsSaveImg" value="1" /> 保存远程图片到本地</td>
  350.   </tr>
  351.   <tr>
  352.     <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>
  353.   </tr>
  354. </form>
  355. </table>
  356. <%End Sub%>
  357. <%Sub SaveData()
  358. N_ps=Request.Form("N_p")
  359. if N_ps<>"" then
  360.         N_pss=Replace((Replace(N_ps,",","|"))," ","")
  361.         N_pss="|"&N_pss&"|"
  362. else
  363.         N_pss=""
  364. end if
  365. pageshow=Request("pageshow")
  366. picold=request.QueryString("picold")
  367. N_title=Replace_Text(request.Form("N_title"))
  368. N_color=Replace_Text(request.Form("N_color"))
  369. N_sid=Replace_Text(request.Form("N_sid"))
  370. N_homepic=Replace_Text(request.Form("N_homepic"))
  371. if N_homepic="" then
  372.         N_homepic=0
  373. end if
  374. N_pic=Replace_Text(request.Form("N_pic"))
  375. N_author=Replace_Text(request.Form("N_author"))
  376. N_from=Replace_Text(request.Form("N_from"))
  377. N_addtime=request.Form("N_addtime")
  378. N_overview=Replace_Text(request.Form("N_overview"))
  379. N_content=request.Form("N_content")
  380. N_keywords=Request.Form("N_keywords")
  381. N_isAspJpeg=Request.Form("N_isAspJpeg")
  382. if N_isAspJpeg="" then N_isAspJpeg=0
  383. N_hits=Request.Form("N_hits")
  384. if Not Isnumeric(N_hits) then N_hits=10
  385. IsSaveImg=Request.Form("IsSaveImg")
  386. if IsSaveImg="" Or islink=1 then IsSaveImg=0
  387.  
  388. if N_content="" then
  389.         response.Write("<script>alert(""请输入文章内容!"");history.go(-1);</script>")
  390.         response.End()
  391. end if
  392.  
  393. if id="" then
  394.         sql="select N_title,N_sid from Article_News where N_title='"&N_title&"' and N_sid="&N_sid&""
  395. else
  396.         sql="select N_title,N_sid from Article_News where N_title='"&N_title&"' and N_sid="&N_sid&" and N_id<>"&id&""
  397. end if
  398. rs.open sql,conn,1,1
  399. if not rs.eof then
  400.         response.Write("<script>alert(""文章["&N_title&"]已经加过了,请不要重复添加!"");history.go(-1);</script>")
  401.         response.End()
  402. end if
  403. closers(rs)
  404.  
  405. '如果是修改文章,则判断是否修改了图片,是则删除系统原来存在的图片
  406. if id<>"" then
  407.         if N_homepic=1 then
  408.                 if StrComp(N_pic,picold)<>0 then
  409.                         picold="../../Upfiles/Article/"+picold
  410.                         call DoDelFile(picold)
  411.                 end if
  412.         end if
  413. end if
  414.  
  415. '给图片缩略图加水印
  416. if IsAspJpeg=1 and N_isAspJpeg=1 and N_homepic=1 then
  417.         if N_pic<>"" then
  418.                 Call PicAspJpeg(N_pic)
  419.         end if
  420. end if
  421.  
  422. '给编辑器里图片加水印
  423. if Instr(N_content,"<IMG src=")>0 then
  424.         if IsAspJpeg=1 and N_isAspJpeg=1 then
  425.                 editorpic=split(N_content,"<IMG src=")                         
  426.                 for pi=1 to ubound(editorpic)
  427.                         editorpic1=split(editorpic(pi),"Article/")
  428.                         '上传到本地的图片才能加水印处理
  429.                         if ubound(editorpic1)>0 then
  430.                                 editorpic2=split(editorpic1(1)," ")
  431.                                 '截图到的图片的名称
  432.                                 editorpic3=left(editorpic2(0),len(editorpic2(0))-1)
  433.                                 editorpic4="../../Upfiles/Article/"+editorpic3
  434.                                 Call PicAspJpeg(editorpic4)
  435.                         end if
  436.                 next
  437.         end if
  438. end if
  439.  
  440. '截取内容里的图片
  441. if Instr(N_content,"<IMG src=")>0 then
  442.         '存在图片提取第一张图片为网站缩略图
  443.         editorpic=split(N_content,"<IMG src=")
  444.         '截取article后
  445.         editorpic1=split(editorpic(1),"Article/")
  446.         if ubound(editorpic1)>0 then
  447.                 editorpic2=split(editorpic1(1)," ")
  448.                 '截图到的图片的名称
  449.                 editorpic3=left(editorpic2(0),len(editorpic2(0))-1)
  450.                 if N_homepic=0 then
  451.                         N_homepic=1
  452.                         N_pic=editorpic3
  453.                 end if
  454.         end if
  455. end if
  456.  
  457. '添加和更新文章
  458. if id="" then
  459. sqls="select * from Article_News"
  460. else
  461. sqls="select * from Article_News where N_id="&id&""
  462. end if
  463. set rs=Server.CreateObject("ADODB.RecordSet")
  464. rs.open sqls,conn,1,3
  465. if id="" then
  466.         rs.addnew
  467. end if
  468.         rs("N_title")=N_title
  469.         if IsSaveImg=1 then
  470.                 rs("N_content")=ReplaceRemoteUrl(N_content,sUploadDir,N_isAspJpeg)
  471.         else
  472.                 rs("N_content")=N_content
  473.         end if
  474.         rs("N_sid")=N_sid
  475.         rs("N_cid")=cid
  476.         rs("N_author")=N_author
  477.         rs("N_from")=N_from
  478.         rs("N_pic")=N_pic
  479.         rs("N_addtime")=N_addtime
  480.         rs("N_overview")=N_overview
  481.         rs("N_color")=N_color
  482.         rs("N_Properties")=N_pss
  483.         rs("N_homepic")=N_homepic
  484.         rs("N_isAspJpeg")=N_isAspJpeg
  485.         rs("N_keywords")=N_keywords
  486.         rs("N_hits")=N_hits
  487. rs.update
  488. rs.close
  489. set rs=nothing
  490. '如果启用了生成则生成文章的静态文件
  491. if ishtml=1 then
  492.         '查新添加的文章的编号
  493.         sqln="select N_id from Article_News where N_title='"&N_title&"'"
  494.         set rsn=Server.CreateObject("ADODB.RecordSet")
  495.         rsn.open sqln,conn,1,1
  496.         if not rsn.eof then
  497.                 newsid=rsn("N_id")
  498.                 '生成文章内容页
  499.                 Call NewsContentHtml(newsid)
  500.         end if
  501.         closers(rsn)   
  502. end if
  503. if id="" then
  504.         msg="添加文章完成!"
  505. else
  506.         msg="修改文章完成!"
  507. end if
  508. Call SucessMsg(msg,"admin_info.asp?cid="&cid&"&keyword="&keyword&"&typeid="&typeid&"")
  509. response.End()
  510. End Sub
  511. %>
  512. <%
  513. '删除文章
  514. Sub Del()
  515.         '如果是文章图片同时删除该文章的图片
  516.         dim ids
  517.         ids=split(id,",")
  518.         for i=0 to ubound(ids)
  519.                
  520.                 sql="select N_pic from Article_News where N_id="&ids(i)&""
  521.                 rs.open sql,conn,1,1
  522.                 '如果存在图片新闻,则同时删除该图片
  523.                 if not rs.eof then
  524.                         if rs("N_pic")<>"" then
  525.                                 N_pic="../../Upfiles/Article/"+rs("N_pic")
  526.                                 '删除新闻图片
  527.                                 Call DoDelFile(N_pic)
  528.                         end if
  529.                 end if
  530.                 closers(rs)
  531.                
  532.                 sql="select N_content from Article_News where N_id="&ids(i)&""
  533.                 rs.open sql,conn,1,1
  534.                 '如果存在图片新闻,则同时删除该图片
  535.                 if not rs.eof then
  536.                         '删除编辑器里的图片
  537.                         '截取内容里的图片
  538.                         N_content=rs("N_content")
  539.                         if Instr(N_content,"<IMG src=")>0 then                         
  540.                                 editorpic=split(N_content,"<IMG src=")                         
  541.                                 for pi=1 to ubound(editorpic)
  542.                                         editorpic1=split(editorpic(pi),"Article/")
  543.                                         if ubound(editorpic1)>0 then
  544.                                                 editorpic2=split(editorpic1(1)," ")
  545.                                                 '截图到的图片的名称
  546.                                                 editorpic3=left(editorpic2(0),len(editorpic2(0))-1)
  547.                                                 editorpic4="../../Upfiles/Article/"+editorpic3
  548.                                                 Call DoDelFile(editorpic4)
  549.                                         end if
  550.                                 next
  551.                         end if                 
  552.                 end if
  553.                 closers(rs)
  554.                
  555.                 '如果生成静态则也删除静态文件
  556.                 if ishtml=1 then
  557.                         sql="select N_id,N_addtime,N_cid,N_sid,N_content from Article_News where N_id="&ids(i)&""
  558.                         set rs=Server.CreateObject("ADODB.RecordSet")
  559.                         rs.open sql,conn,1,1
  560.                         if not rs.eof then
  561.                                 '判断内容是否有分页,有循环删除分页文件
  562.                                 dim page,contentNum
  563.                                 contentNum=""
  564.                                 MMText=replace(rs("N_content"),"[JYPage]"," [JYPage] ")
  565.                                 MMfText=split(MMText,"[JYPage]")
  566.                                 for pagenums=0 to ubound(MMfText)
  567.                                         htmlname=FormatLink(rs("N_addtime"),rs("N_cid"),rs("N_sid"),rs("N_id"),pagenums+1)
  568.                                         '删除静态文件
  569.                                         Call DelArticleHtml(htmlname)
  570.                                 next
  571.                         end if
  572.                         closers(rs)
  573.                 end if         
  574.         next
  575.         conn.execute("delete from Article_News where N_id in("&id&")")
  576.         response.Redirect("admin_info.asp?cid="&cid&"")
  577. End Sub
  578.  
  579. Function Article_Properties(ppid)
  580.         if ppid<>"" and Not Isnull(ppid) then
  581.                 ppids=split(ppid,"|")
  582.                 set rsp=Server.CreateObject("ADODB.RecordSet")
  583.                 pim=ubound(ppids)-1
  584.                 Article_Properties="<b>文章属性:</b>"
  585.                 for pi=1 to pim
  586.                         sqlp="select P_name from Article_Properties where P_id="&clng(ppids(pi))&""
  587.                         rsp.open sqlp,conn,1,1
  588.                         if not rsp.eof then
  589.                                 Article_Properties=Article_Properties&rsp("P_name")&"&nbsp;"
  590.                         end if
  591.                         rsp.close
  592.                 next
  593.                 set rsp=nothing
  594.         else
  595.                 Article_Properties=""
  596.         end if
  597. End Function
  598.  
  599. '删除静态文件
  600. Function DelArticleHtml(htmlname)
  601.         On Error Resume Next
  602.         if htmlname<>"" then
  603.         Dim fso
  604.         Set fso = Server.CreateObject("Scripting.FileSystemObject")
  605.         if fso.FileExists(Server.MapPath(htmlname)) then
  606.                 fso.DeleteFile(Server.MapPath(htmlname))
  607.         end if
  608.         Set fso = Nothing
  609.         end if
  610. End Function
  611.  
  612. '图片水印功能
  613. Sub PicAspJpeg(picname)
  614.         Dim Jpeg                                                   '声明变量
  615.         Set Jpeg = Server.CreateObject("Persits.Jpeg")             '调用组件
  616.         Jpeg.Open Server.MapPath(picname)   '源图片位置           
  617.         Jpeg.Canvas.Font.Color = "&H"&""&DrawFontColor&""          '水印字体颜色
  618.         Jpeg.Canvas.Font.Family = DrawFontFamily                   '水印字体               
  619.         Jpeg.Canvas.Font.Size = DrawFontSize                       '水印字体大小
  620.         Jpeg.Canvas.Font.Bold = False                              '字体是否加粗
  621.         Jpeg.Canvas.Font.BkMode = "&H"&""&DrawShadowColor&""       '字体背景颜色
  622.         Jpeg.Canvas.Font.Quality = 4                               '文字清晰度
  623.         Jpeg.Canvas.Print Jpeg.OriginalWidth-DrawXWidth-10,Jpeg.OriginalHeight-10-DrawFontSize,DrawText             '水印文字,xy座标             
  624.         Jpeg.Save Server.MapPath(picname) '//生成有水印的新图片及保存位置
  625.         Set Jpeg = Nothing
  626. End Sub
  627. %>
  628. <%Call CloseConn()%>
downloadadmin_info.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