⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_news_lm_edit.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
字号:
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("News_Class") Then
	Call ArtErr("","")
End If

Dim Action
Action = LCase(Request("action"))

Select Case Trim(Action)
Case "saveedit"
	Call saveedit()
Case Else
	Call showmain()
End Select
call CloseConn() 
call AdminPageEnd()

sub saveedit()

if request("lm")<>"" then
  id=request("id")
  lm=trim(request("lm"))
  fontcolor=trim(request("fontcolor"))
  pic=trim(request("pic"))
  mbid=trim(request("mbid"))
  ClassDescription = Request.Form("ClassDescription")
  ClassKeywords = Request.Form("ClassKeywords")
  GroupIDClass=s("GroupIDClass")
  
    if trim(request("lm_path"))<>"" then
      lm_path=trim(request("lm_path"))
    end if   
  
    lm_path_sql = "select lm_path from lm where lm_path='"&lm_path&"' and id<>"&id
    Set lm_path_rs = Server.CreateObject("ADODB.RecordSet")
    lm_path_rs.Open lm_path_sql,conn,1,3
    n_recordcount=lm_path_rs.recordcount
    lm_path_rs.close
    set lm_path_rs=nothing
    if  n_recordcount>0 then  
         response.write "<script>alert('目录名称["&lm_path&"]已重复,请重新命名!');history.go(-1);</Script>"
         conn.close
          set conn=nothing
		 response.end
    end if
  sql = "select * from lm where id="&id
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,3
  if trim(rs("lm3"))<>"" then 
  	rs("lm3")=lm
  elseif trim(rs("lm2"))<>"" then
    rs("lm2")=lm
  elseif trim(rs("lm"))<>"" then 
    rs("lm")=lm
  end if
  rs("fontcolor")=fontcolor
  rs("pic")=pic
  rs("mb")=mbid
  rs("ClassKeywords") = ClassKeywords
  rs("ClassDescription") = ClassDescription
  rs("GroupIDClass") = GroupIDClass
 if lm_path<>"" then
      rs("lm_path")=lm_path
  else
      rs("lm_path")="lm_"&trim(cstr(rs("id")))
  end if   
  rs.update
  rs.close:set rs=nothing
  Dim ShowErr:ShowErr=ShowErr & "<br><li>栏目相关内容修改成功!</li>"
 
If config("listHtml")=0 then
  Dim HtmllmPath:HtmllmPath=config("path")&"html/"&lm_path&"/"
  Set fso=Server.CreateObject("Scripting.FileSystemObject")
    If fso.FolderExists(server.mappath(HtmllmPath))=False Then
              fso.CreateFolder(server.mappath(HtmllmPath))
		ShowErr=ShowErr & "<br><li>创建"&HtmllmPath&"文件夹成功!</li>"
      End If
  Dim HtmlName: HtmlName=config("path")&"html/"&lm_path&"/list_1."&config("file_type")&""
  Dim HtmlName2: HtmlName2=config("path")&"html/"&lm_path&"/index.html"
  
  'Dim html_index_fileName :html_index_fileName=config("path")&"news_more.asp?lm="&id&""
   Dim html_index_fileName :html_index_fileName="<meta HTTP-EQUIV=REFRESH CONTENT=""0;URL=list_1."&config("file_type")&""">"
   if fso.FileExists(server.mappath(HtmlName))=false then 
      Set f=fso.CreateTextFile(Server.MapPath(HtmlName),true)
      dim str:str=""
              str=str&"<div><li>暂无任何内容!或尚未更新!</li></div>"
	  f.WriteLine str
       f.close
      ShowErr=ShowErr & "<br><li>创建"&HtmlName&"文件成功!</li>"
	 End If
     Set f=fso.CreateTextFile(Server.MapPath(HtmlName2),true)
	  f.WriteLine html_index_fileName
       f.close
      ShowErr=ShowErr & "<br><li>更新"&HtmlName2&"文件成功!</li>"	 
 
  ' if fso.FileExists(server.mappath(HtmlName2))=false then 
	 
	  'if SaveHtmlFile(HtmlName2,html_index_fileName) then
        'ShowErr=ShowErr & "<br><li>更新"&HtmlName2&"文件成功!</li>"
     ' else
        'ShowErr=ShowErr & "<br><li>更新"&HtmlName2&"文件失败!</li>"
     ' end if
   'End If
End If  
Call ArtErr(ShowErr,"2")
end if
end sub



sub showmain()

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改栏目</title>
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
</head>
<script src="Include/Common.js" type="text/javascript"></script>
<%
  id=request("id")
  sql = "select * from lm where id="&id
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,1
  if trim(rs("lm3"))<>"" then 
  	lm=rs("lm3")
  elseif trim(rs("lm2"))<>"" then
    lm=rs("lm2")
  elseif trim(rs("lm"))<>"" then 
    lm=rs("lm")
  end if
  fontcolor=rs("fontcolor")
  pic=rs("pic")
  mbid=rs("mb")
 if (not isNumeric(mbid)) then
	mbid=0
end if
   ClassKeywords=rs("ClassKeywords")
   ClassDescription=rs("ClassDescription")
   GroupIDClass=rs("GroupIDClass")

  if trim(rs("lm_path"))<>"" then 
          lm_path=rs("lm_path")   '豪--增加.目录位置
  else
         lm_path="lm_"&trim(cstr(rs("id")))
 end if
  rs.close: set rs=nothing
%>
   <table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
	<tr align=center>
    <th height=25 align=center colspan="2"><strong>修改新闻信息栏目</strong></th></tr>
	<tr>
	<td width=12% height=30 class=forumRow>&nbsp;<strong>管理导航:</strong></td>
	<td width=88% height=30 class=forumRow><a href='admin_news_lm.asp'>栏目管理</a> | <a href='admin_news_lm_move.asp'>栏目移动</a></td>
    </tr>
</TABLE>      
<table width="100%" border=0 align=center cellPadding=3 cellSpacing=1 bordercolor="#FFFFFF" bgcolor="#C4D8ED">
<script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

//判断目录存放的名称。不允许一些特殊符号和中文名称。

	var reg=/[^A-Za-z0-9_-]/    //豪增加---包含大小写字母A-Z,a-z,数字0-9和下划线_,中划线-

  if (theForm.lm_path.value.length >=1)  //填空值时,自动取值等于lmid,所以不管空值
  {
  
   if (reg.test(theForm.lm_path.value)==true)
     {
	   alert("目录名称只允许英文字母、数字、下划线和中划线!");
       theForm.lm_path.focus();
       return (false);
	  }
  }
    if (theForm.mbid.selectedIndex == 0)
  {
    alert(" 请选择栏目模版!");
    theForm.mbid.focus();
    return (false);
  }

  return (true);
}
//--></script>
<!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="?Action=saveedit&id=<%=id%>" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
                   <tr>
			        <td height="30" align="center" colspan="2" class="forumRow">[<font color="#FF0000"><%=lm%></font>]的新闻数量是<font color="red">(<%=request("xwsl")%>)</font></td>
		           </tr>
                    <tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td  height="30">&nbsp;&nbsp;<b><u>栏目名称:</u></b></td>
						<td  height="30">&nbsp;<input type="text" name="lm" size="20" value="<%=lm%>"></td>
					</tr>
					
                    <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td  height="30">&nbsp;&nbsp;<b><u>栏目模版:</u></b></td>
						<td  height="30">&nbsp;<select size="1"  id="mbid" name="mbid">
                      <option value=0>请选择模版:::---></option>
                      <%
					  mb_sql = "select id,title from newsmb where lx='1' order by id desc"
					  Set mb_rs = Server.CreateObject("ADODB.RecordSet")
					  mb_rs.Open mb_sql,conn,1,1
					  while not mb_rs.eof
					  %>
                     <option value="<%=mb_rs("id")%>" <% if clng(mbid)=clng(mb_rs("id")) then Response.Write " selected "%>><%=mb_rs("title")%></option>
                    <% mb_rs.movenext
					wend
					mb_rs.close:set mb_rs=nothing
					%>
                    </select></td>
					</tr>

                    <tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td width=32% height="40">&nbsp;&nbsp;<b><u>新闻存放目录:</u></b><br>&nbsp; 在html文件夹中的文件夹名称。</td>
						<td  height="40">&nbsp;<input type="text" name="lm_path" size="20" value="<%=lm_path%>"></td>
					</tr>
                    <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td width=32%  height="30">&nbsp;&nbsp;<b><u>栏目颜色:</u></b></td>
						<td >&nbsp;<input type="text" name="fontcolor" size="20" value="<%=fontcolor%>" maxlength="7"> <img border=0 src="../images/admin/rect.gif" align="absmiddle" style="cursor:pointer;background-Color:<%=fontcolor%>;" onClick="Getcolor(this,'Include/selectcolor.asp','fontcolor');" title="选取标题颜色!">
						</td>
					</tr>

                    <tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td  height="40">&nbsp;&nbsp;<b><u>图片新闻:</u></b><br>&nbsp; 当有图片时,在标题后显示<font color="red">[图]</font>。</td>
						<td  height="40">&nbsp;<select size="1" name="pic">
							<option <%if pic="0" then Response.Write " selected "%> value="0">不显示</option>
							<option <%if pic="1" then Response.Write " selected "%> value="1">显示</option></select></td>
					</tr>
					
                    <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td  height="40">&nbsp;&nbsp;<b><u>栏目META关键字:</u></b><br>&nbsp; 栏目META关键字。</td>
						<td  height="40">&nbsp;<textarea name="ClassKeywords" style="width:80%" rows="4" id="ClassKeywords"><%=ClassKeywords %></textarea> </td>
					</tr>
                    <tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
						<td  height="40">&nbsp;&nbsp;<b><u>栏目META描述</u></b><br>&nbsp; 栏目META描述。</td>
						<td  height="40">&nbsp;<textarea name="ClassDescription" style="width:80%" rows="4" id="ClassDescription"><%=ClassDescription %></textarea> </td>
					</tr>
                    <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
					  <td  height="40">&nbsp;&nbsp;<b><u>浏览/查看权限:</u></b><br>&nbsp; 不选为<span class="red">开放栏目</span>:<br>&nbsp;&nbsp;任何人(包括游客)可以浏览和查看此栏目下的信息。<br>
                       选择为<span class="red">认证栏目</span>:<br>&nbsp;&nbsp;游客不能浏览和查看,其他会员根据会员组的栏目权限设置决定是否可以浏览和查看。</td>
					  <td  height="40" valign="top"><%= GetGroup_CheckBox("GroupIDClass",GroupIDClass,4)  %> </td>
					</tr>                    
                    
                    <tr>
			            <td colspan="2" align="center" height="40" class="forumRow">				
				         &nbsp;<input type="submit" value=" 修 改 " name="B1">
				         &nbsp;<input type="button" value=" 返 回 " name="B2" onClick="javascript:location='admin_news_lm.asp'"></td>
		           </tr></form></table>
<%
 end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -