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

📄 showessay.asp

📁 动感系统XP Access版,服务器需要安装Jmail 组件 配置SendMessages.asp 最后部分的参数
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/Char.asp" -->
<!-- #include file="inc/function.asp" -->
<!-- #include file="Create_Soft_View_inc.asp" -->
<% dim CateName,CateID,SubCateName,SubCateID
	if Request("SoftID")="" then
		response.write "您没有选择相关软件,请返回"
		response.end
	end if
strHeader=replace(strHeader,"</HEAD>","</HEAD>"&Copyright&"")
strHeader=replace(strHeader,"$Title$","用户评论")
Response.Write(replace(strHeader,"../","./")) 
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set rs=server.createobject("adodb.recordset")
%>

<SCRIPT LANGUAGE=javascript>
<!--
function Juge(myform)
{
    if (document.myform.UserName.value==""){
       alert ("你的用户名不可为空!");
       document.myform.UserName.focus();
       return(false);
    }
	if ((document.myform.Email.value.indexOf("@") == -1) || (document.myform.Email.value.indexOf(".") == -1)){
		alert("请查看您的E-mail地址是否正确,请重录入!");
		document.myform.Email.focus();
       return(false);
	}
	

	if (myform.content.value == "")
	{
		alert("评论内容不能为空!");
		myform.content.focus();
                return (false);
	}
}
function SelectAll() {
	for (var i=0;i<document.form4.ID.length;i++) {
		var e=document.form4.ID[i];
		e.checked=!e.checked;
	}
}
//-->
</script>
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td height="22" bgcolor="#FFFFFF">  <img src="images/dotdb.gif" width="10" height="10" align="absmiddle"> 
      当前位置:首页</td>
  </tr>
  <tr> 
    <td height="1" background="Images/bgLine.gif"></td>
  </tr>
  <tr> 
    <td height="2"></td>
  </tr>
</table>
<table cellspacing=0 cellpadding=0 width=770 align=center border=0>
  <tbody>
    <tr> 
      <td valign=top width=170 bgcolor=#efefef height="200"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="20" bgcolor="#0099FF"> <img src="images/d_1.gif" width="13" height="13" align="absmiddle"> 
              <strong><font color="#FFFFFF">本日下载爬行</font></strong></td>
          </tr>
          <tr> 
            <td> 
			<%= get_WeekTop(0,10,22,0,0) %>
              </td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="20" bgcolor="#0099FF"> <img src="images/d_1.gif" width="13" height="13" align="absmiddle"> 
              <strong><font color="#FFFFFF">本周下载爬行</font></strong></td>
          </tr>
          <tr> 
            <td><%= get_DayTop(0,10,22,0,0) %></td>
          </tr>
        </table>
        
      </td>
      <td width=1 bgcolor=#949494></td>
      <td width="5" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"> 
<%   
	select case request("action")
	case "savereinfo"  '保存评论信息
         call SaveReInfo()
    case "del"
	     call delEssay()
    case else
         call ShowSoftInfo() '查看ftp信息
    end select  
	 
sub SaveReInfo()
	dim userip_temp
    userip_temp=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    if userip_temp="" then userip_temp=Request.ServerVariables("REMOTE_ADDR")
	sql="select * from "&CategoryName&"_SoftEssay where (ID is null)"
	rs.open sql,conn,1,3
	rs.addnew
	rs("SoftID")=trim(request("SoftID"))
	rs("UserName")=trim(request.form("UserName"))
	rs("Email")=trim(request.form("Email"))
	rs("Grade")=trim(request.form("Grade"))	
	rs("content")=UBBCode(request.form("content"))
	rs("dateTime")=Now()
    rs("UserIP")=userip_temp
	rs("type")="soft"	
	rs.update	
	rs.close
	sql="select count(ID),sum(Grade) from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&" and type='soft'"
     rs.open sql,conn,1,1 
	 reNum=rs(0)
	 if rs(1)=0 then
	 avgGrade=50
	 else
	 avgGrade=rs(1)
	 end if	 
	 rs.close
	 conn.execute("update "&CategoryName&"_SoftInfo set avgGrade="&avgGrade&",EssayNum="&reNum&" where SoftID="&request("SoftID")&" ")
	'*********************************************更新静态网页***********************************    
		 '读取默认模板
   sql="select ID,Header,Footer,SoftView_htm from "&CategoryName&"_Template where isActive=true"
   rs.open sql,conn,1,1 
   if rs.eof and rs.bof then
   		response.write "您没有添加模板,或者没有设置默认模板。"
		response.end
   else
   	HtmlTemplate=rs("Header")&rs("SoftView_htm")&rs("Footer")
   end if
   rs.close
    Response.Write Create_SoftView(request("SoftID"),HtmlTemplate)&"<br>" & vbcrlf
   '*************************************************************************************
	 call ShowSoftInfo()	 	
end sub  
	
Sub delEssay()
	if not isnull(cUserName) and cUserName<>"" then 
		if chkSoftEdit(cUserName,trim(request("SoftID"))) then
			conn.execute("delete from "&CategoryName&"_SoftEssay where ID in ("&Request.Form("ID")&")")	 	 
	  '*************************************************************************************
			sql="select count(ID),sum(Grade) from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&""
			rs.open sql,conn,1,1 
			if not(rs.eof and rs.bof) then 
	    		reNum=rs(0)
	   		  	if rs(1)=0 or isnull(rs(1)) then avgGrade=60 else avgGrade=rs(1)/rs(0) end if
			else
				reNum=0
				avgGrade=0
			end if
			rs.close
	 		conn.execute("update "&CategoryName&"_SoftInfo set avgGrade="&avgGrade&" , EssayNum="&reNum&" where SoftID="&request("SoftID"))
	   
	'*********************************************更新静态网页***********************************    
		 '读取默认模板
			sql="select ID,Header,Footer,SoftView_htm from "&CategoryName&"_Template where isActive=true"
			rs.open sql,conn,1,1 
			if rs.eof and rs.bof then
				response.write "您没有添加模板,或者没有设置默认模板。"
				response.end
			else
				HtmlTemplate=rs("Header")&rs("SoftView_htm")&rs("Footer")
			end if
			rs.close
			Response.Write Create_SoftView(request("SoftID"),HtmlTemplate)&"<br>" & vbcrlf
		end if
	end if
	call ShowSoftInfo()
end sub
	
Sub ShowSoftinfo()
	dim isMaster
	if not isnull(cUserName) and cUserName<>"" then 
	   if chkSoftEdit(cUserName,trim(request("SoftID"))) then
	   isMaster=True
	   else
	   isMater=false
	   end if
	end if
	sql="select * from "&CategoryName&"_SoftInfo where SoftID="&request("SoftID")   
	rs.open sql,conn,1,1  
	PubUserName=rs("UserName") 
	avgGrade=rs("avgGrade")
	EssayNum=rs("EssayNum")
%> 
        <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC" align="center" style=" table-layout:fixed;word-break:break-all">
          <tr bgcolor="#FFFFFF"> 
            <td width="65" align="center"  height="20">评论软件</td>
            <td  height="20" width="88%" > <b><a href="SoftView/SoftView_<%=request("SoftID")%>.html"><%=trim(rs("SoftName"))%><%=trim(rs("SoftVer"))%></a></b></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align="center">评价情况</td>
            <td>共有 <font color="#FF0000"><%=rs("EssayNum")%></font> 人参与评价,评均得分:<font color="#FF0000"><%=rs("avgGrade")%></font> 分</td>
          </tr>
<% rs.close
if isMaster then 
	Response.Write("<form name=""form4"" method=""post"" action="""">")
	Response.Write("<input type=""Hidden"" name=""SoftID"" value="""&Trim(Request("SoftID"))&""">")
    Response.Write("<input type=""Hidden"" name=""action"" value=""del"">")
end if		  
sql="select * from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&" order by ID desc " 
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then
	do while not rs.eof 
		 %>
          <tr bgcolor="#F7F7F7"> 
            <td colspan="2">
			<% if isMaster then
			Response.Write("<input type=""checkbox"" name=""ID"" value="""&Rs("ID")&""">")
			 else
			 Response.Write("<img src=""images/ico_re.gif"" align=""absmiddle"">")
			 end if
			 %> 
            用户:<b><%=rs("UserName")%></b> 打分:<font color="#FF0000"><%=rs("Grade")%></font> 分 时间:<%=DateTimeFormat(rs("DateTime"),1)%> 来自:<b><%=rs("UserIP")%></b></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"><%=rs("Content")%></td>
          </tr>
          <%
		rs.movenext
	    loop
	   	end if 
	    rs.close
		if isMaster then
		%>
		<tr bgcolor="#FFFFFF"> 
            <td colspan="2"><strong><font color="#FF0000">评论管理操作:</font></strong>全选/反选 
          <input type=checkbox name=chkall value=on onClick="javascript:SelectAll()">
			<input type="submit" name="Submit" value=" 删 除 "> </td>
        </tr>
		<%  
		 Response.Write("</form>")
	    end if
		if cUserName<>pubUserName then
		%>
          <tr bgcolor="#FFFFFF"> 
            <td align="center">参与评论</td>
            <td> <table width="100%" border="0" cellspacing="0" cellpadding="1">
                <form name="myform" method="post" action="" target="_top" onSubmit="return Juge(this)" >
                  <tr> 
                    <td>用户:</td>
                    <td> <input type="text" name="UserName" maxlength="15" size="28" style="height: 16px;BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt"> 
                    </td>
                    <td>Email:</td>
                    <td> <input type="text" name="Email" maxlength="50" size="28" style="height: 16px;BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt"> 
                    </td>
                  </tr>
                  <tr> 
                    <td>分值:</td>
                    <td colspan="3"> <input type="Hidden" name="SoftID" value='<%=request("SoftID")%>'> 
                      <input type="Hidden" name="action" value='savereinfo'> 
					  <input type="radio" name="Grade" value="100">100分 
                      <input type="radio" name="Grade" value="85" checked> 85分 
                      <input type="radio" name="Grade" value="70">70分 
                      <input type="radio" name="Grade" value="55">55分 
                      <input type="radio" name="Grade" value="40">40分 
                      <input type="radio" name="Grade" value="25">25分 
                      <input type="radio" name="Grade" value="10">10分 
                      <input type="radio" name="Grade" value="0"> 0分</td>
                  </tr>
                  <tr> 
                    <td>说明:</td>
                    <td colspan="3"> <textarea name="content" cols="48" rows="5" style="BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt"></textarea> 
                      <font color="#FF0000">(支持UBB)!<br>
                      * 请注意用语文明且合法,不要发布带有攻击性的言论,谢谢合作! </font></td>
                  </tr>
                  <tr> 
                    <td>&nbsp;</td>
                    <td colspan="3"> <input type="submit" name="Submit" value=" 提 交 "> 
                      <input type="reset" name="Submit2" value=" 重 设 ">
                      (注:“<font color="#FF0000">!</font>”为必填内容。) </td>
                  </tr>
                </form>
              </table></td>
          </tr>
          <%end if %>
          <tr bgcolor="#FFFFFF"> 
            <td align="center">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <%end sub %> </td>
    </tr>
  </tbody>
</table>
<%
set rs=nothing
set fso=nothing
CloseDatabase
Response.Write(replace(strFooter,"../","./")) 
%>

⌨️ 快捷键说明

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