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

📄 js_news_pl.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
字号:
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<%
id=chkhtm(trim(request("id")))
plfb=chkhtm(trim(request("form")))
if (not isNumeric(id)) then
		id=0
	end if
TAction=request("TAction")	
Plid=request("Plid")
'Yyid=request("Yyid")
if TAction="Support" then
		OpType=request("Type")
		IF Cbool(Request.Cookies(Cstr(Plid))("SupportCommentID"))<>true Then
			Set TRS=Server.CreateObject("Adodb.Recordset")
			TRS.Open "Select * From NewsPL Where ID=" & Plid ,Conn,1,3
			 if not TRS.eof then
				  if OpType=1 Then
				TRS("Y")=TRS("Y")+1
				  else
				 TRS("N")=TRS("N")+1
				  end if
			 TRS.UpDate
			 TRS.Close:Set TRS=Nothing
		   end if
			 Response.Cookies(Cstr(Plid))("SupportCommentID")=true
		Else
		call alert("你已投过票了!","")
		End If
		Response.Write "<script>location.href='" & Request.ServerVariables("HTTP_REFERER") & "';</script>"
end if

'if TAction="Quote" then
			'Set YRS=Server.CreateObject("Adodb.Recordset")
			'YRS.Open "Select * From NewsPL Where ID=" & Yyid ,Conn,1,1
			'yycontent=YRS("content")
			'yyusername=YRS("username")
			'yyaddtime=YRS("addtime")
			
						'yycontent1=yycontent1&"============= 下面是引用信息 ==============<br>"
						'yycontent1=yycontent1&"原评论由:"&yyusername&"于"&yyaddtime&"发表<br>"
						'yycontent1=yycontent1&yycontent
						'yycontent1=yycontent1&"================================================"
			
			
			' YRS.Close:Set YRS=Nothing
		 
		'Response.Write "<script>location.href='" & Request.ServerVariables("HTTP_REFERER") & "';<//script>"
'end if

%>
 function newspl(url) {
    var 
   look=window.open(url,"","width=805,height=400,top=70,left=100,scrollbars=yes");
   
    return (false);
    }

<%
	set rspl = Server.CreateObject("ADODB.RecordSet")
	rspl.Open "select * from [NewsPL] where NewsID="&id&" and sh=1 order by id desc",conn,1,1
	pls=rspl.recordcount
	rspl.close
	set rspl=nothing


 root_path=finddir(request.servervariables("URL"))   '取出系统程序的工作目录.

sql = "select top 5 * from newspl where sh=1 and newsid="&clng(id)
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1


%>

document.write("<div class=comment><div class=commentbox>");
document.write("<dl>");
document.write("<dt><span style='vertical-align:middle'><font style='font-size:9pt'>相关网友评论</font>    <a href= <%=root_path%>newspl.asp?id=<%=id%> onclick='return newspl(this.href);' target=_blank><font style='font-size:9pt'>发表/查看所有评论(总共:<font color=red><%=pls%></font> 条评论)</font></a></span></dt>");
document.write("</dl>");

<%
b=0
while not rs.eof
username=rs("username")
addtime=rs("addtime")
content=rs("content")
content=replace(content,"""","'")
content=replace(content,chr(10),"")
content=replace(content,chr(13),"<BR>")
N=N+1
UserIP=RS("IP")
UserIP=Replace(UserIP,split(UserIP,".")(3),"*")
IF RS("Anonymous")=0 Then
    Others= "<font color=red>会员</font>:"& username
Else
	Others= "游客:"& username
End IF

%>
document.write("<dl>");
document.write("<dt><%=Others%>&nbsp;&nbsp;发表时间: <%=addtime%>  &nbsp;&nbsp;IP地址:<%=UserIP%> &nbsp;&nbsp;第 <font color=red> <%=N %></font> 楼   &nbsp;&nbsp;<a href='<%=root_path%>js_news_pl.asp?TAction=Support&Plid=<%=rs("id")%>&Type=1'>支持\(<font color=red><%=rs("Y")%></font>\)</a> <a href='<%=root_path%>js_news_pl.asp?TAction=Support&Plid=<%=rs("id")%>&Type=0'>反对\(<font color=green><%=rs("N")%></font>\)</a></dt>");
document.write("<dd><%=content%></dd>");
document.write("</dl>");




<%
rs.movenext
wend
if rs.recordcount=0 then
	Response.Write "document.write(""<dl><dd>暂时无评论</dd></dl>"");"
end if
rs.close
set rs=nothing
%>
document.write("</div></div>");
<%
if plfb="1" then
%>

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.username.value == "")
  {
    alert("请在 作者 域中输入值。");
    theForm.username.focus();
    return (false);
  }

  if (theForm.username.value.length < 4)
  {
    alert("在 作者 域中,请至少输入 4 个字符。");
    theForm.username.focus();
    return (false);
  }

  if (theForm.username.value.length > 16)
  {
    alert("在 作者 域中,请最多输入 16 个字符。");
    theForm.username.focus();
    return (false);
  }
  
  if (theForm.Anonymous.checked==false && theForm.Pass.value=='')
  {
	 alert('请输入密码或选择游客发表!');
	 theForm.Pass.focus();
	 return (false);
  }
    
  if (theForm.content.value == "")
  {
    alert("请在 评论 域中输入值。");
    theForm.content.focus();
    return (false);
  }
 
  if (theForm.Artyzm.value == "")
  {
    alert("请在 验证码 域中输入值。");
    theForm.Artyzm.focus();
    return (false);
  }

  if (theForm.Artyzm.value.length < 4)
  {
    alert("在 验证码 域中,请至少输入 4 个字符。");
    theForm.Artyzm.focus();
    return (false);
  }

  if (theForm.Artyzm.value.length > 6)
  {
    alert("在 验证码 域中,请最多输入 6 个字符。");
    theForm.Artyzm.focus();
    return (false);
  }

  if (theForm.content.value.length < 5)
  {
    alert("在 评论 域中,请至少输入 5 个字符。");
    theForm.content.focus();
    return (false);
  }

  if (theForm.content.value.length > 300)
  {
    alert("在 评论 域中,请最多输入 300 个字符。");
    theForm.content.focus();
    return (false);
  }
  return (true);
}
<% 
IF Request.Cookies(Art2008)("UserName")<>"" and Request.Cookies(Art2008)("PassWord") <>"" then  

Plusername=Request.Cookies(Art2008)("UserName")
Plpass=Request.Cookies(Art2008)("PassWord")

end if
%>
	document.write("<form method='POST' action='<%=root_path%>NewsPL_save.asp?id=<%=id%>&action=js' onsubmit='return FrontPage_Form1_Validator(this)' language='JavaScript' name='FrontPage_Form1'>");
	document.write("<div align='center'><table border='1' cellpadding='5' width='100%' id='table1' style='border-collapse: collapse' bordercolor='#C0C0C0' bgcolor='#F5F5F5'>");
	document.write("<tr><td height=30 >发表评论&nbsp;&nbsp;<font color=#ff6600>特别声明:评论内容只代表网友个人观点,与本站立场无关。</font></td></tr>");
    document.write("<tr><td  align='left'>用户名:<input type='text' name='username' size='12'  value='<%=Plusername%>'  style='background-color: #F5F5F5'>");
    document.write("<span id='pp' > 密码:<input class='textbox' name='Pass' size='10' type='password' value='<%=Plpass%>' ></span>");
    //document.write("<span id='Em' > 邮箱:<input class='textbox' name='Email' size='10' type='text' id='Email' value= ></span>");
    document.write("&nbsp;&nbsp;认证码:<input name='Artyzm' size='6' maxlength='5'>   <img align='absmiddle' src='<%=root_path%>Include/vCode.asp?' onClick='this.src+=Math.random()' alt='图片看不清?点击重新得到验证码' style='cursor:hand;'>");
    document.write("&nbsp;&nbsp;<span><input value='1' onclick=if(this.checked==true){document.all.Pass.disabled=true;document.all.pp.style.display=\'none\';}else{document.all.Pass.disabled=false;document.all.pp.style.display=\'\';} type=checkbox  name=Anonymous >匿名发表</span>&nbsp;&nbsp;<a href='<%=root_path%>user/reg.asp' target=_parent ><font color=red><u>注册</u><font></a></td></tr>");
	document.write("<tr><td align='left' bgcolor='#FFFFFF'>");
	document.write("<textarea rows='5' name='content' cols='70'><%=yycontent1%></textarea></td>");
	document.write("</tr></table></div>");
	document.write("<div align='center'><input type='submit' value=' 提 交 发 表 ' name='B1'>&nbsp;&nbsp;&nbsp; <a href= <%=root_path%>newspl.asp?id=<%=id%> onclick='return newspl(this.href);' target=_blank><font style='font-size:9pt'>查看所有评论</font></a></div></form>");
    
<%
end if

conn.close
set conn=nothing

%>

⌨️ 快捷键说明

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