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

📄 user_addblog.asp.bak1

📁 个人博客
💻 BAK1
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/usercode.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="user_chkpass.asp"-->
<!--#include file="inc/function.asp"-->
<%
if CheckUserLogined()=False then
	response.Redirect "user_login.asp"
end if
dim needclassid,user_showlogword_num,blogname
needclassid=Application(cachename&"info")(3)
set rs=conn.execute("select user_showlogword_num,blogname from [user] where username='"&username&"'")
user_showlogword_num=rs(0)
blogname=rs(1)
set rs=nothing
%>
<SCRIPT language=javascript>


function del_space(s)
{
	for(i=0;i<s.length;++i)
	{
	 if(s.charAt(i)!=" ")
		break;
	}

	for(j=s.length-1;j>=0;--j)
	{
	 if(s.charAt(j)!=" ")
		break;
	}

	return s.substring(i,++j);
}


function VerifySubmit()
{
	submits(); 
	topic = del_space(document.form2.topic.value);
     if (topic.length == 0)
     {
        alert("您忘了填写题目!");
	return false;
     }
	 
	 var needclassid=<%=needclassid%>
	 if (needclassid==true) {
	 if (document.form2.classid.value == 0)
     {
        alert("请选择日志的类别!");
	return false;
     }
	 }
	 
	 	 
	 showword = del_space(document.all("showword").value);
      for(i = 0; i < showword.length; i++){
	  if(showword.charAt(i) < "0" || showword.charAt(i) > "9"){
	  alert("请输入正确的显示字数!");
	  return false;  
		 }
     }
 	if (document.form2.edit.value == "")
     {
        alert("请输入日志内容!");
	return false;
     }
	var date=document.form2.selecty.value+"-"+document.form2.selectm.value+"-"+document.form2.selectd.value
	var datereg=/^(\d{4})-(\d{1,2})-(\d{1,2})$/
	var datareg=/^(\d){1,2}$/
	if (!datereg.test(date)){
	  alert("日志时间输入格式错误");
	   return false;
	 }
	var r=date.match(datereg)
	var d=new Date(r[1],r[2]-1,r[3])
	if (!(d.getFullYear()==r[1]&&d.getMonth()==r[2]-1&&d.getDate()==r[3])){
	  alert("日志时间输入格式错误");
	   return false;
	 }
	
	var sdate=document.form2.serverdate.value
	date = date.replace(/\-/g,"\/");
	sdate = sdate.replace(/\-/g,"\/");	
	if ((new Date(date) > new Date(sdate))){
		alert("日志日期不能大于今天!");
	return false;
	}
	 
	 return true;
}
</SCRIPT>
<html>
<head>
<title>ShareBlog后台管理--添加新日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Admin_STYLE.CSS">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor" >
<br><FORM action="user_saveblog.asp" target='_top' method="post" name="form2" id="form2" onSubmit="return VerifySubmit()">
  <table width="98%" border="0" align=center cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
    <tr align="center"> 
    <td height=25 colspan=5 class="topbg"><strong>添 加 新 日 志</strong> 
  <tr> 
    <td width="11%"  class="tdbg" height=23>日志标题:</td>
    <td width="89%" colspan="4" class="tdbg"><input name="topic" type=text class="cont" id="topic" size="50" maxlength="50"> 
      <font color="#FF0000"> *</font></td>
  </tr>
  <tr> 
    <td width="11%" class="tdbg" height=23>日志心情:</td>
    <td colspan="4" class="tdbg"><FONT COLOR="#FF0000"> 
      <input type="radio" name="face" value="1" checked>
      <img src="images/face/1.gif" width="20" height="20"> 
      <input type="radio" name="face" value="2">
      <img src="images/face/2.gif" width="20" height="20"> 
      <input type="radio" name="face" value="3">
      <img src="images/face/3.gif" width="20" height="20"> 
      <input type="radio" name="face" value="4">
      <img src="images/face/4.gif" width="20" height="20"> 
      <input type="radio" name="face" value="5">
      <img src="images/face/5.gif" width="20" height="20"> 
      <input type="radio" name="face" value="6">
      <img src="images/face/6.gif" width="18" height="20"> 
      <input type="radio" name="face" value="7">
      <img src="images/face/7.gif" width="20" height="20"> 
      <input type="radio" name="face" value="8">
      <img src="images/face/8.gif" width="20" height="20"> 
      <input type="radio" name="face" value="9">
      <img src="images/face/9.gif" width="20" height="20"> </FONT></td>
  </tr>
  <tr> 
    <td height=23 colspan="5" class="tdbg">系统分类: 
      <select name="classid" id="classid">
          <option value="0" selected>请选择分类</option>
        <%
		set rs=conn.execute("select id,classname from classname")
		do while not rs.eof  %>
	        <option value=<%=rs(0)%>><%=rs(1)%></option>
        <%
			rs.movenext
		loop
		set rs=nothing  
	    %>
        </select>         
      我的专题(分类): 
        <select name="subjectid" id="subjectid">
	  <option value="0" selected>      </option>
         <%
		 dim rs
		set rs=conn.execute("select id,subjectname from subject where username='"&username&"'")
		do while not rs.eof  %>
	        <option value=<%=rs(0)%>><%=rs(1)%></option>
        <%
			rs.movenext
		loop
		set rs=nothing  
	    %>
        </select>
         是否隐藏这篇日志: 
      <select name="ishide" id="ishide">
          <option value="true">是</option>
          <option value="false" selected>否</option>
        </select></td>
  </tr>
  <tr> 
    <td height=23 colspan="5" class="tdbg">日志密码:
      <input name="ispassword" type="password" id="ispassword" size="15" maxlength="15">
      (无密码请留空 )  部分显示字数: 
        <input name="showword" type="text" id="showword" value="<%=user_showlogword_num%>" size="6" maxlength="10">
        (全部显示请留空)
		<input type="hidden" id="edit" name="edit" value="">
        <!--#include file="edit.asp"-->		
      </td>
  </tr>
  <tr> 
      <td height=23 colspan="5" class="tdbg"> 团队博客:
        <select name="blogteam" id="blogteam">
          <option value="<%=username%>" selected><%=blogname%></option>
          <%
		set rs=conn.execute("select blogteam.mainuser,[user].blogname from blogteam,[user] where blogteam.otheruser='"&username&"' and blogteam.mainuser=[user].username")
		do while not rs.eof  %>
          <option value=<%=rs(0)%>><%=rs(1)%></option>
          <%
			rs.movenext
		loop
		set rs=nothing  
	    %>
        </select>
        (选择日志发表在哪个BLOG)</td>
  </tr>
  <tr> 
    <td height=23 colspan="5" class="tdbg">引用地址: 
      <input name="url" type="text" id="url" size="60"></td>
  </tr>
  <tr>
    <td height=23 colspan="5" class="tdbg">设置发表时间:
      <select name="selecty" id="selecty">
	  <%
	  dim y
	  y=2000
	  while y<=2008
	  	if year(blognow())=y then
		  	response.Write "<option value="&y&" selected>"&y&"</option>"
		else
		  	response.Write "<option value="&y&">"&y&"</option>"
		end if
		y=y+1
	  wend
		%>
       </select>
      <select name="selectm" id="selectm" >
        <%
	  dim m
	  m=1
	  while m<=12
	  	if month(blognow())=m then
		  	response.Write "<option value="&m&" selected>"&m&"</option>"
		else
		  	response.Write "<option value="&m&">"&m&"</option>"
		end if
		m=m+1
	  wend
		%>
      </select>
	  <select name="selectd" id="selectd" >
	  <%
	  dim d,maxday
	  d=1
	  
	  while d<=31
	  	if day(blognow())=d then
		  	response.Write "<option value="&d&" selected>"&d&"</option>"
		else
		  	response.Write "<option value="&d&">"&d&"</option>"
		end if
		d=d+1
	  wend
		%>
      </select>
      <input name="serverdate"  type="hidden" id="serverdate" value=<%=date()%> ></td>
  </tr>
  <tr> 
      <td height=23 colspan="5" class="tdbg"> <INPUT type="hidden" name="action" value="addlog">
        <input type="submit" name="Submit2" value="提交日志">
             
        <input type="reset" name="Submit" value="清除重写">
     </td>
  </tr>
</table> 
</form>
<br>
<div align="center"><BR>
  <BR>
</div>
</body>
</html>

⌨️ 快捷键说明

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