61,825
社区成员




private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
long reviewID=0;
if(Request["act"]==null)
{
DataRow row=DB.News_Show(Request["id"]);
string newstitle="";
bool IsReview=false;
int reviewNum=0;
string quyu="2";
string ip=Page.Request.UserHostAddress;
string u=DB.GetUrl(Request["id"]);
if(row!=null)
{
newstitle=row["title"].ToString().Trim();
quyu=row["quyu"].ToString().Trim();
try
{
reviewID=long.Parse(row["reviewID"].ToString());
reviewNum=Convert.ToInt32(row["reviewNum"]);
}
catch
{
}
IsReview=(bool)row["IsReview"];
}
if(IsReview)
{
Response.Write("document.write(\"<script language='javascript'>function RegMemberForm() {if (document.postform.message.value == '') {alert('内容不能为空');document.postform.message.focus();}else {return true;}return false;}</script><TABLE cellSpacing=0 cellPadding=0 width='100%' border=0><TBODY><form method='post' OnSubmit='return RegMemberForm()' name='postform' id='postform' action='review.aspx?act=p' enctype='multipart/form-data' ><TR><TD style='BORDER-RIGHT: #394994 1px solid; BORDER-TOP: #394994 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #394994 1px solid; BORDER-BOTTOM: #394994 1px solid; BACKGROUND-COLOR: #f7f7f7' bgColor=#f7f7f7><input type=hidden name=newsid value="+Request["ID"]+"><input type=hidden name=url value='"+u+"'><input type=hidden name=ip value='"+ip+"'><input type=hidden name=rid value='"+reviewID+"'><input type='hidden' id='title' name='title' size='84' tabindex='1' value='"+newstitle+"' class='colorblue' /><DIV align=center><TABLE cellSpacing=0 cellPadding=0 width='100%' border=0><TBODY><TR><TD height=3></TD></TR><TR><TD height=22> <SPAN class=bt1></SPAN> <FONT color=#ff0000><STRONG>共 "+reviewNum+" 条评论 <a href=http://localhost/showtopic-"+reviewID+".aspx target=_blank>最新评论</a> <a href=http://bbs.dezhoudaily.com/default.aspx?g=topics&f=2 target=_blank>全部评论</a></STRONG></FONT></TD></TR><TR><TD bgColor=#ff0000 height=2></TD></TR><TR><TD height=29> </TD></TR><TR><TD height=80><p align='center'><span class='navtextarea'><textarea rows='7' cols='80' name='message' id='message' tabindex='2' class='autosave colorblue' ></textarea></span></TD></TR><TR><TD height=28> <INPUT type=submit value=提交 name=Submit22></TD></TR></TBODY></TABLE></DIV></TD></TR></form></TBODY></TABLE>\");");
}
}
else
{
string m="原文地址:<a href="+Request.Form["url"]+">"+Request.Form["url"]+"</a>\n"+Server.HtmlEncode(Request.Form["message"]);
//添加评论
reviewID=ForumDB.topic_add(3,Request.Form["title"],Request.Form["ip"],m);
DB.News_Review(Request.Form["newsid"],reviewID);
Response.Write("<meta http-equiv='refresh' content='10;URL=http://localhost/showtopic-"+reviewID+".aspx'>谢谢您的留言,10秒后本页面将自动跳转到评论页面。或者点击<a href='http://localhost/showtopic-"+reviewID+".aspx'>此处跳转页面</a>");
}
}