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

📄 tiwen.asp

📁 类似于baidu的百度知道
💻 ASP
📖 第 1 页 / 共 3 页
字号:
			AddText(AddTxt);
		}        
	}  
}

function Code() {
	if (basic) {
		AddTxt="\r[CODE][/CODE]";
		AddText(AddTxt);
	} else {   
		txt=prompt("插入标记的代码","文本");     
		if (txt!=null) {          
			AddTxt="\r[CODE]"+txt;
			AddText(AddTxt);
			AddTxt="[/CODE]";
			AddText(AddTxt);
		}	       
	}
}

function Quote() {
	if (basic) {
		AddTxt="\r[QUOTE][/QUOTE]";
		AddText(AddTxt);
	} else {   
		txt=prompt("插入引用文本","文本");     
		if(txt!=null) {          
			AddTxt="\r[QUOTE]"+txt;
			AddText(AddTxt);
			AddTxt="[/QUOTE]";
			AddText(AddTxt);
		}	        
	}
}

function Sound() {
 	if (basic) {
		AddTxt="\r[SOUND][/SOUND]";
		AddText(AddTxt);
	} else {                  
		txt=prompt("sound 背景音乐文件的地址","http://");
		if (txt!=null) {             
			AddTxt="\r[SOUND]"+txt;
			AddText(AddTxt);
			AddTxt="[/SOUND]";
			AddText(AddTxt);
		}        
	}  
}

</script>
<script language=javascript>
 function checkform(obj)
{
gcv();
 if(obj.BoardNlass.value=="" || obj.BoardClass.value==0)
  {
    alert("请选择问题分类");return false;
	}
 if(obj.title.value =="" || obj.title.value.length ==0)
 {
  	alert("请输入问题标题");obj.title.focus();return false;
 }
   var leftChars = getLeftChars(obj.title,50);
   
    if ( leftChars < 0) 
	{   
	  ls_str = "问题字数限定在50个汉字以内,请缩短提问字数";
      alert(ls_str);
      obj.title.focus();
      return false;    
    }
   if(leftChars>92)
   {
	 ls_str = "问题标题不详细,请重新输入";
      alert(ls_str);
      obj.title.focus();
      return false;    
   }
   var content_length = obj.content.value.length;
	 if ( content_length >3000) 
	{   
	  ls_str = "问题补充说明字数限定在3000字节以内,请缩短字数";
      alert(ls_str);
      obj.content.focus();
      return false;    
    }
}
function getLeftChars(varField,limit_len) {
    var i = 0;
    var counter = 0;
    var cap = limit_len*2;    
    var j=0;
   var runtime = (varField.value.length>cap)?(cap+1):varField.value.length;
    for (i = 0; i< runtime; i++) {     
     if (varField.value.charCodeAt(i) > 127 || varField.value.charCodeAt(i) == 94) {
        j=j+2;  
        } 
     else {
        j=j+1
     }   
    }  //结束FOR循环
    //var leftchars = cap - varField.value.length;    
    var leftchars = cap - j;    
    return (leftchars);
}
function  gcv()  
{  
   var  aa  =  document.getElementsByName("ra");  
   for  (var  i=0;  i<aa.length;  i++)  
   {  
         if(aa[i].checked)
         document.ftiwen.cid.value = aa[i].value;
   }  
}  
</script>
<style type="text/css">
<!--
.STYLE2 {color: red}
-->
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25"><a href="<%=weburl%>"><%=webname%></a> &gt; 提问</td>                                                                                        
  </tr>
</table>

<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
	<tr>
<td valign="top" width="200">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
	<tr>
		<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
	<tr>
		<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong>相关问题</strong></td>
	</tr>
	<tr>
		<td align=center><br>
<table border="0" width="98%" cellspacing="0" cellpadding="0">
	<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class=zhtable>
<%
if HTMLcode(request("content"))<>"" then
content=HTMLcode(request("content"))
rs.open"select top 10 * from question where title like '%"&content&"%' or content like '%"&content&"%'",conn,1,1
if rs.eof then
else
while not rs.eof
i=i+1
%>
<tr><td width="25" align=center><%=i%>.</td>
<td width="25" align=center><%if rs("jie")=0 then %><img src=img/icn_time.gif  alt=待解决问题><%elseif rs("jie")=1 or rs("jie")=3 then%><img src=img/icn_ok.gif  alt =已解决问题><%elseif rs("jie")=2 then%><img src=img/icn_cancel.gif  alt =问题已关闭><%elseif rs("jie")=4 then%><img src=img/icn_vote.gif  alt =投票中问题><%end if%></td>
<td><a href="Show_Question.asp?id=<%=rs("id")%>" target=_blank><%=HTMLcode(rs("title"))%></a></td></tr>
<%
rs.movenext
	  wend
end if
rs.close
end if
%>
</table>
</td>
	</tr>
</table>
<br></td>
	</tr>
</table>
		</td>
	</tr>
</table>
<br>

</td>
		<td valign="top" width="8"></td>
		<td valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="t1">
	<tr>
		<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
	<tr>
		<td height="36" align="center" onmouseover="this.className='tbb'" onmouseout="this.className='taa'" class="taa"><strong>提问</strong></td>
	</tr>
	<tr>
		<td align=center><br>
<table border="0" width="98%" cellspacing="0" cellpadding="0">
	<tr>
<td>
<%if request("send")="提交问题" then
        if session("person")="" then
        response.write"<script>alert('用户超时,请重新登录!');history.back();</script>"
        end if
    if (request.form("nm")="1" ) then
	nmfen=mdf
	niming=1
	else
	nmfen=0
	niming=0
	end if
	if request("shang")="" then
	shang=0
	else
	shang=cINT(request("shang"))
	end if
	rs3.open"select * from person where name='"&session("person")&"'",conn,1,1
	shang1=rs3("jifen")
	rs3.close
	if shang >= shang1 then
	response.write"<script>alert('您的积分不够!');history.back();</script>"
	response.end
	end if
	if request("BoardNlass")="" then
	response.write"<script>alert('一级分类不能为空!');history.back();</script>"
	response.end
	elseif request("BoardClass")="" then
	response.write"<script>alert('二级分类不能为空!');history.back();</script>"
	response.end
	elseif request("title")="" then
	response.write"<script>alert('标题不能为空!');history.back();</script>"
	response.end
	elseif request("content")="" then
	response.write"<script>alert('补充说明不能为空!');history.back();</script>"
	response.end
	rs3.open"select * from person where name='"&session("person")&"' and jie=3",conn,1,1
	if not rs3.eof then
	response.write"<script>alert('您还有过期问题没有处理,请处理后再发表新问题!');history.back();</script>"
	response.end
	end if
	rs3.close
	else
	rs3.open"select * from assort where id="&request("BoardClass")&"",conn,1,1
	topic=rs3("topic")
	rs3.close
	title=request("title")
	content=request("content")
	rs.open"select * from question",conn,1,3
	rs.addnew
	rs("topic")=topic
	rs("title")=title
	rs("content")=content
	rs("sender")=session("person")
	rs("sendtime")=now
	rs("overtime")=now+30 '修改问题结束时间!
	rs("shuxing")=request("BoardNlass")
	rs("fenleiid")=request("BoardClass")
	rs("shang")=shang
	rs("niming")=niming
	rs.update
	rs.close
	rs3.open"select * from person where name='"&session("person")&"'",conn,1,3
		  rs3("asknum")=rs3("asknum")+1
		  rs3("qtfa")=rs3("qtfa")+twf+nmfen
		  rs3("jifen")=rs3("jifen")-twf-shang-nmfen
		  if rs3("jifen")-twf-shang-nmfen<fen1 then
		  rs3("touxian")=""&ji1&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen1 and rs3("jifen")-twf-shang-nmfen<fen2 then
		  rs3("touxian")=""&ji1&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen2 and rs3("jifen")-twf-shang-nmfen<fen3 then
		  rs3("touxian")=""&ji2&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen3 and rs3("jifen")-twf-shang-nmfen<fen4 then
		  rs3("touxian")=""&ji3&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen4 and rs3("jifen")-twf-shang-nmfen<fen5 then
		  rs3("touxian")=""&ji4&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen5 and rs3("jifen")-twf-shang-nmfen<fen6 then
		  rs3("touxian")=""&ji5&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen6 and rs3("jifen")-twf-shang-nmfen<fen7 then
		  rs3("touxian")=""&ji6&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen7 and rs3("jifen")-twf-shang-nmfen<fen8 then
		  rs3("touxian")=""&ji7&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen8 and rs3("jifen")-twf-shang-nmfen<fen9 then
		  rs3("touxian")=""&ji8&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen9 and rs3("jifen")-twf-shang-nmfen<fen10 then
		  rs3("touxian")=""&ji9&" "
		  elseif rs3("jifen")-twf-shang-nmfen>=fen10 then
		  rs3("touxian")=""&ji10&" "
		  end if
		  rs3.update
		  rs3.close
	response.write"<script>alert('发表问题成功!');window.navigate('Index.asp');</script>"
	end if
	end if
	%>
<table width="729" border="0" cellpadding="0" cellspacing="0">
   <form name="ftiwen" method="post" action="TiWen.asp" onSubmit="return checkform(this);" class="postform">
   
<tr><td width="729" class="bgcntLn">
	<table width="83%" border="0" cellpadding="0" cellspacing="0" >
              <tr valign="top"> 
                <td width="11%"><font color="#FF0000">您的提问:</font></td>
                <td width="89%"> <input name="title" type="text" value="<%=HTMLcode(request("content"))%>" size="48" class=formfont>
                  <br>
                  <font color="#0000FF">提问前,请您参考其他用户提问过的相关问题。</font></td>
              </tr>
            </table>
            <br>
            <table width="98%" border="0" cellpadding="0" cellspacing="0" class="zhtable" >
              <tr valign="top"> 
                <td width="9%"><br>
                  问题补充</br>说明:</td>
                <td width="49%">
                  <table border="0" width="97%" cellspacing="0" cellpadding="0">
                    <TR>
                <TD class=INDEX_XMALL width="98%" height="25">
                  <select class=input1 name="FONT" onChange="Font(this.options[this.selectedIndex].value)">
                  <option value="宋体" selected>宋体</option>
                  <option value="楷体_GB2312">楷体_GB2312</option>
                  <option value="新宋体">新宋体</option>
                  <option value="黑体">黑体</option>
                  <option value="隶书">隶书</option>

⌨️ 快捷键说明

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