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

📄 hover_news_modi.asp

📁 后台默认管理账号密码:admin 后台主要功能如下:一、系统管理:管理员管理
💻 ASP
字号:
<!--#include file="toptable.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim ID,rs_news,FoundErr,ErrMsg
dim sql
dim count
ID=trim(request("ID"))
FoundErr=False
if ID="" then 
	response.Redirect("Hover_News_Manage.asp")
end if
sql="select * from Hover_News where ID=" & ID & ""
Set rs_news= Server.CreateObject("ADODB.Recordset")
rs_news.open sql,conn,1,1
if FoundErr=True then
	call WriteErrMsg()
else
%>
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from Hover_SmallClass_New order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}
  
function CheckForm()
{
   if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
   else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

	if (document.myform.title.value.length == 0) {
		alert("新闻标题没有填写.");
		document.myform.title.focus();
		return false; 
	}
		if (document.myform.user.value.length == 0) {
		alert("新闻发布人没有填写");
		document.myform.user.focus();
		return false;
	}
	return true;
}
function loadForm()
{
  editor.HtmlEdit.document.body.innerHTML=document.myform.Content.value;
  return true
}
</script>
<!-- #include file="Inc/Head.asp" -->
<body onLoad="javascipt:setTimeout('loadForm()',1000);">
<table  width="97%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">
        <form method="POST" name="myform" onSubmit="return CheckForm();" action="Hover_News_save.asp?action=Modify" target="_self">

<tr align="center"> 
            <td class="title" height="30" colspan="2"> <strong> 修 改 新 闻</strong> 内 容</td>
          </tr>
		  <tr> 
            <td class="title2" height="30" colspan="2"  >选择您需要更改的新闻信息。</td>
          </tr>          <tr bgcolor="#ECF5FF"> 
            <td width="20%" height="24" align="right" class="table"><font color="#FF0000">*</font>新闻标题:</td>
            <td width="80%" valign="top" class="table">  
              
                <input name="title" type="text" class="input" value="<%=rs_news("title")%>" size="50" maxlength="200">
            </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right" class="table"><font color="#FF0000">*</font>新闻类别:</td>
            <td valign="top" class="table">   
              
                <%			
        sql= "select * from Hover_BigClass_New  "
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
             <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
                  <%
		    do while not rs.eof
			%>
                  <option <% if rs("BigClassName")=rs_news("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                  <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
            </select>
                <select name="SmallClassName">
                  <option value="" <%if rs_news("SmallClassName")="" then response.write "selected"%>>不指定小类</option>
                  <%
			sql="select * from Hover_SmallClass_New where BigClassName='" & rs_news("BigClassName") & "'" 
			rs.open sql,conn,1,1 
			if not(rs.eof and rs.bof) then  
				do while not rs.eof %>
                  <option <% if rs("SmallClassName")=rs_news("SmallClassName") then response.Write("selected") end if%> value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>
                  <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                </select>
            </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td align="right" valign="top" class="table"><font color="#FF0000">*</font>新闻内容:</td>
            <td valign="top" class="table">
			<textarea name="Content" style="display:none" ><%=rs_news("Content")%></textarea> 
              <iframe ID="editor" src="../editor.asp" frameborder=1 scrolling=no width="620" height="405"></iframe>
		</td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right" class="table">首页图片: 
                <input name="IncludePic" type="hidden" id="IncludePic" value="yes">
            </td>
            <td valign="top" class="table"><input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="<%=rs_news("FirstImageName")%>" size="50" maxlength="200"> 
              <br>
              首页的图片,直接从上传图片中选择: 
              <select name="DefaultPicList" id="DefaultPicList" onChange="DefaultPicUrl.value=this.value;">
                <option value=""<% if rs_news("FirstImageName")="" then response.write "selected" %>>不指定首页图片</option>
                <%
				if rs_news("UploadFiles")<>"" then
					dim IsOtherUrl
					IsOtherUrl=True
					if instr(rs_news("UploadFiles"),"|")>1 then
						dim arrUploadFiles,intTemp
						arrUploadFiles=split(rs_news("UploadFiles"),"|")						
						for intTemp=0 to ubound(arrUploadFiles)
							if rs_news("FirstImageName")=arrUploadFiles(intTemp) then
								response.write "<option value='" & arrUploadFiles(intTemp) & "' selected>" & arrUploadFiles(intTemp) & "</option>"
								IsOtherUrl=False
							else
								response.write "<option value='" & arrUploadFiles(intTemp) & "'>" & arrUploadFiles(intTemp) & "</option>"
							end if
						next
					else
						if rs_news("UploadFiles")=rs_news("FirstImageName") then
							response.write "<option value='" & rs_news("UploadFiles") & "' selected>" & rs_news("UploadFiles") & "</option>"
							IsOtherUrl=False
						else
							response.write "<option value='" & rs_news("UploadFiles") & "'>" & rs_news("UploadFiles") & "</option>"		
						end if
					end If
					if IsOtherUrl=True then
						response.write "<option value='" & rs_news("FirstImageName") & "' selected>" & rs_news("FirstImageName") & "</option>"
					end if
				end if
				 %>
              </select> <input name="UploadFiles" type="hidden" id="UploadFiles" value="<%=rs_news("UploadFiles")%>"> 
            </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right" class="table"><font color="#FF0000">*</font>发布人:</td>
            <td valign="top" class="table">  
              
                <input name="user" type="text" class="input" size="30" value="<%=rs_news("user")%>">
            </td>
          </tr>
          <tr bgcolor="#ECF5FF"> 
            <td height="24" align="right" class="table">首页图片新闻:</td>
            <td class="table">  
              
                <input type="radio" value="Yes" <%if rs_news("Ok")=True then Response.Write "checked"%>  name="Ok">
                <input type="radio" value="No" <%if rs_news("Ok")=False then Response.Write "checked"%> name="Ok">
            否  <font color="#FF0000">(设为首页图片新闻,选择此项时请注意文章中是否添加有图片!)</font></td>
          </tr>
          <tr  bgcolor="#ECF5FF"> 
            <td height="35" align="right" class="table">录入时间:</td>
            <td height="35" class="table">
                <input name="UpdateTime" type="text" id="UpdateTime" value="<%=rs_news("UpdateTime")%>" maxlength="50">
            </td>
          </tr>
          <tr align="center" bgcolor="#ECF5FF"> 
		   <input type="hidden" name="Id" value="<%=Id%>">
            <td height="35" colspan="2" class="table"> <input type="submit" name="Submit" value="提交" class="btn">          
                
            <input type="reset" name="Submit" value="重置" class="btn">  </td>
          </tr>
        </form>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%
end if
rs_news.close
set rs_news=nothing
call CloseConn()
%>

⌨️ 快捷键说明

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