<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/dv_clsother.asp"-->
<!--#include file="inc/dv_ubbcode.asp"-->
<!--#include file="inc/ubblist.asp"-->
<%
Dim TemplateStr,dhy_rs,dhy_sql,dhy_name,dhy_user,dhy_email,rs,sql,dbid,usid,i,boards,dhy_company,tmid
Dvbbs.LoadTemplates("")
TemplateStr="<tr><td class={$BgColor}><li>{$VarName}&nbsp;{$VarDesc}</td><td class={$BgColor}>&nbsp;当前值：<font color="&Dvbbs.MainSetting(1)&"><b>{$VarValue}</b></font></td></tr>"
dbid=request("ID")
usID=request("usID")
if usID="" or not isnumeric(usID) then errs("请勿从外部提交数据！")
if dbid="" or not isnumeric(dbid) then errs("请勿从外部提交数据！")
set dhy_rs =Dvbbs.Execute("select site_name,user,company,E_mail,yn from [dhy_index] where userID="&usid)
if dhy_rs.eof then
   dhy_rs.close:set dhy_rs=nothing
   errs("你还没有申请自己的个人主页！<a href=dhy_reg.asp><font color=red>我要申请</font></a>")
elseif dhy_rs("yn")=0 then
   dhy_rs.close:set dhy_rs=nothing
   errs("该个人主页已被管理员锁定或正在申核中...")
elseif dhy_rs("yn")=2 then
   dhy_rs.close:set dhy_rs=nothing
   errs("该个人主页已被删除，如有疑问请<a href=mailto:"&Dvbbs.Forum_Info(5)&">联系管理员</a>")
end if
dhy_name=dhy_rs("site_name")
dhy_user=dhy_rs("user")
dhy_email=dhy_rs("E_mail")
dhy_company=dhy_rs("company")
dhy_rs.close:set dhy_rs=nothing
Dvbbs.Stats="<a href=dhy_index.asp?usID="&usid&">"&dhy_name&"</a> → 文章浏览"
Dvbbs.Nav()
If Dvbbs.BoardID=0 Then
	Dvbbs.Head_var 2,0,"",""
Else
	Dvbbs.Head_var 1,Dvbbs.Board_Data(4,0),"",""
End If
Dvbbs.Execute("update [Dv_Topic] set hits=hits+1 where TopicID="&dbid)
'call reconstruct()
call disp()
Dvbbs.ActiveOnline()
'Dvbbs.Footer()

function topinfo(str)
Response.Write "<table style=width:100% cellpadding=4 cellspacing=1 align=center class=tableborder1 style=word-break:break-all><tr><th colspan=2>"&str&"</th></tr></table>"
end function

function errs(str)
Response.redirect "showerr.asp?ErrCodes=<li>"&str&"&action=OtherErr"
end function

public sub disp()
dim file_id,title,click_num,re_num,file_class,add_time,rs_class,bbstable,title_id,rsu,boardid
set rs=Dvbbs.Execute("select TopicID,title,BoardID,child,hits,Posttable,DateAndTime from [Dv_Topic] where TopicID="&dbid)
if rs.eof or rs.bof then errs("请勿从外部提交数据！")
file_id=rs("TopicID")
title=rs("title")
click_num=rs("hits")
re_num=rs("child")
add_time=rs("DateAndTime")
bbstable=rs("PostTable")
rs.close:set rs=nothing
set rs=Dvbbs.Execute("select FileID from [dhy_file] where FileClass=(select FileClass from [dhy_file] where FileID="&dbid&")")
do while not rs.eof
if tmid="" then
   tmid=rs("fileID")
else
   tmid=tmid&","&rs("fileID")
end if
rs.movenext()
loop
rs.close:set rs=nothing
Response.Write "<table cellpadding=4 cellspacing=1 align=center class=tableborder1 style=word-break:break-all><tr><th colspan=2>"&title&"</th></tr></table>"
Response.Write "<table cellpadding=0 cellspacing=1 align=center class=tableborder1 style=word-break:break-all>"
response.write "<tr>"
response.write "<td width=23% class=tablebody2 valign=top>"
Response.Write "<table style=width:100% cellpadding=4 cellspacing=0 class=tableborder1 style=word-break:break-all>"
response.write "<tr><td class=tablebody1>"
response.write "</td></tr></table>"
Response.Write "<table style=width:100% cellpadding=4 cellspacing=0 class=tableborder1 style=word-break:break-all>"
response.write "<tr><td class=tablebody1>"
Response.Write "<table style=width:100% cellpadding=2 cellspacing=0 class=tableborder1 style=word-break:break-all>"
response.write "<tr><td class=tablebody1 width=40%  valign=top>[文章名称]</td><td class=tablebody1>"&title&"</td></tr>"
response.write "<tr><td class=tablebody1 valign=top>[作者名称]</td><td class=tablebody1><a href=dispuser.asp?name="&dhy_user&" title=查看&nbsp;"&dhy_user&"&nbsp;的详细信息>"&dhy_user&"</a></td></tr>"
response.write "<tr><td class=tablebody1 valign=top>[所属分类]</td><td class=tablebody1>"
set rs_class=Dvbbs.Execute("select class_name from [dhy_class] where userid="&usid&" and id=(select FileClass from [dhy_file] where FileID="&dbid&")")
response.write rs_class("class_name")
rs_class.close:set rs_class=nothing
response.write "</td></tr>"
response.write "<tr><td class=tablebody1 valign=top>[发表时间]</td><td class=tablebody1>"&formatdatetime(add_time,2)&"</td></tr>"
response.write "<tr><td class=tablebody1 valign=top>[访问次数]</td><td class=tablebody1>"&click_num&" 人次</td></tr>"
response.write "<tr><td class=tablebody1 valign=top>[回贴数量]</td><td class=tablebody1>"&re_num&" 篇</td></tr>"
response.write "</table>"
response.write "</td></tr></table>"
topinfo("相关文章 TOP10")
Response.Write "<table style=width:100% cellpadding=0 cellspacing=0 class=tableborder1 style=word-break:break-all>"
set rs=Dvbbs.Execute("select TopicID,title,postuserName,hits,child,DateAndTime from [Dv_Topic] where postuserid="&usid&" and TopicID in ("&tmid&") order by DateAndTime desc")
response.write "<tr><td class=tablebody1>"
   Response.Write "<table style=width:100% cellpadding=4 cellspacing=0 class=tableborder1 style=word-break:break-all>"
   for i=1 to 10
   if not rs.eof then
      response.write "<tr><td class=tablebody1 width=1% valign=top><li></td>"
	  response.write "<td class=tablebody1><a href=dhy_disp.asp?ID="&rs("TopicID")&"&usID="&usid&" title=标题&nbsp;"&rs("title")&"&#13;作者&nbsp;"&rs("postuserName")&"&#13;时间&nbsp;"&formatdatetime(rs("DateAndTime"),1)&"&#13;人气&nbsp;"&rs("hits")&"&#13;回复&nbsp;"&rs("child")&">"&rs("title")&"</a></td>"
	  response.write "</tr>"
      rs.movenext()
   else
      response.write "<tr><td class=tablebody1 width=1% valign=top><li></td>"
	  response.write "<td class=tablebody1><font color=#aaaaaa>未找到任何文章</font><br></td></tr>"
   end if
   next
   rs.close:set rs=nothing
   response.write "</table>"
response.write "</td></tr></table>"
response.write "</td>"
response.write "<td class=tablebody1>."
response.write "</td>"
response.write "<td class=tablebody1 valign=top>"
set rs=Dvbbs.Execute("select AnnounceID,Body,BoardID,RootID from "&bbstable&" where ParentID=0 and RootID="&file_ID)
boards=rs("boardid")
    Response.Write "<table style=width:90% cellpadding=4 align=center cellspacing=0 class=tableborder1 style=word-break:break-all>"
    response.write "<tr><td class=tablebody1>"
	response.write "<a href=friendlist.asp?action=addF&myFriend="&dhy_user&" target=_blank><img src=Skins/Default/friend.gif border=0 alt=把"&dhy_user&"加入好友></a>&nbsp;"
	response.write "<a href=dispuser.asp?id="&usID&" target=_blank><img src=Skins/Default/profile.gif border=0 alt=查看"&dhy_user&"的个人资料></a>&nbsp;"
	response.write "<a href=mailto:"&dhy_email&"><img src=Skins/Default/email.gif border=0 alt=点击这里发送电邮给"&dhy_user&"></a>&nbsp;"
	response.write "<a href=dhy_index.asp?usID="&usID&"><img src=Skins/Default/homepage.gif border=0 alt=访问"&dhy_user&"的个人主页></a>&nbsp;"
	response.write "<a href=dispbbs.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/reply.gif border=0 alt=查看该文章的引用贴></a>&nbsp;"
	response.write "<a href='#res'><img src=Skins/Default/reply_a.gif border=0 alt=对该文章发表评论></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
	response.write "<a href=report.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/report.gif border=0 alt=报告本贴给版主></a>&nbsp;&nbsp;"
	response.write "<a href=printpage.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/printpage.gif border=0 alt=显示可打印的版本></a>&nbsp;&nbsp;"
	response.write "<a href=pag.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/pag.gif border=0 alt=将本文章打包邮递></a>&nbsp;&nbsp;"
	response.write "<a href=favadd.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/fav_add.gif border=0 alt=将本文章加入社区收藏夹></a>&nbsp;&nbsp;"
	response.write "<a href=sendpage.asp?boardID="&rs("BoardID")&"&ID="&rs("RootID")&"><img src=Skins/Default/emailtofriend.gif border=0 alt=将本文章发送给朋友></a>"
	response.write "</td></tr>"
    response.write "</table>"
    response.write "<table class=tableborder1 style=width:90% cellspacing=0 cellpadding=0 align=center border=0>"
	response.write "<tr><td></td></tr></table>"
    Response.Write "<table style=width:100% cellpadding=15 cellspacing=0 class=tableborder1 style=word-break:break-all>"
    response.write "<tr><td class=tablebody1>"
    response.write dhy_html(rs("body"))
    response.write "</td></tr>"
	boardid=rs("BoardID")
    title_id=rs("AnnounceID")
    rs.close:set rs=nothing
    response.write "</table>"
response.write "</td>"
response.write "</tr>"
response.write "<tr><td class=tablebody2 height=25 colspan=3>&nbsp;版权声明："&dhy_company&"</td></td></tr>"
response.write "</table>"
Response.Write "<br><table cellpadding=4 cellspacing=1 align=center class=tableborder1 style=word-break:break-all><tr><th colspan=2>网友评论</th></tr></table>"
set rs=Dvbbs.Execute("select body,username,PostUserID,topic,DateAndTime from "&bbstable&" where ParentID<>0 and RootID="&dbid&" order by Announceid")
do while not rs.eof
   Response.Write "<table cellpadding=0 cellspacing=1 align=center class=tableborder1 style=word-break:break-all>"
   if rs("topic")<>"" then
      response.write "<tr height=25><td class=tablebody2 colspan=2><b>&nbsp;回复主题："&rs("topic")&"</b></td></td></tr>"
   else
      response.write "<tr height=25><td class=tablebody2 colspan=2><b>&nbsp;回复主题：Re:"&title&"</b></td></td></tr>"
   end if
   response.write "<tr><td width=23% class=tablebody2 valign=top style='word-break:break-all'>"
      set rsu=Dvbbs.Execute("select userclass,userWealth,userEp,userCP,userPost,usersex from Dv_user where UserID="&rs("PostUserID"))
      Response.Write "<table style=width:90% cellpadding=3 align=center cellspacing=0 style='word-break:break-all'>"
      response.write "<tr><td><a href=dispuser.asp?name="&rs("username")&" title=查看&nbsp;"&rs("username")&"&nbsp;的详细信息><font color=#cc0000 size=2px><b>"&rs("username")&"</b></font></a></td></tr>"
	  response.write "<tr><td>等级:"&rsu("userclass")&"</td></tr>"
	  response.write "<tr><td>金钱:"&rsu("userWealth")&"</td></tr>"
	  response.write "<tr><td>经验:"&rsu("userEP")&"</td></tr>"
	  response.write "<tr><td>魅力:"&rsu("userCP")&"</td></tr>"
	  response.write "<tr><td>文章:"&rsu("userpost")&"</td></tr>"
      response.write "<tr><td>发表:"&formatdatetime(rs("DateAndTime"),1)&"</td></tr>"
      response.write "</table>"
	  rsu.close:set rsu=nothing
   response.write "</td>"
   response.write "<td class=tablebody1 height=100 valign=top>"
      Response.Write "<table cellpadding=15 cellspacing=0 style=word-break:break-all>"
      Response.Write "<tr><td class=tablebody1 valign=top>"
      response.write dhy_html(rs("body"))
      response.write "</td></tr></table>"
response.write "</td></tr>"
response.write "</table>"
rs.movenext()
loop
rs.close:set rs=nothing
if request.form("submit")<>"" then
   set rs = Server.CreateObject("ADODB.Recordset")
   sql="select * from "&bbstable
   rs.open sql,conn,1,3
      rs.addnew
      rs("parentID")=title_id
      rs("BoardID")=boardid
      rs("username")=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@username").text
      rs("PostUserID")=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userid").text
	  rs("topic")=""
      rs("body")=request.form("body")
      rs("DateAndTime")=now()
	  rs("length")=CountStr(request.form("body"))
	  rs("RootID")=dbid
	  rs("layer")=2
	  rs("orders")=2
	  rs("ip")=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userlastip").text
	  rs("Expression")="face1.gif"
	  rs("signflag")=1
	  rs("ubblist")=",39,"
      rs.update
   rs.close:set rs=nothing
   Dvbbs.Execute("update [Dv_User] set userWealth=userWealth+"&Dvbbs.Forum_User(2)&",userEP=userEP+'"&Dvbbs.Forum_User(7)&"',userCP=userCP+'"&Dvbbs.Forum_User(12)&"',userpost=userpost+1 where userID="&usid)
   set rs=Dvbbs.Execute("select top 1 AnnounceID from "&bbstable&" where boardID="&boardid&" and ip='"&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userlastip").text&"' order by AnnounceID desc")
   dim lastpost
  lastpost=Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@username").text&"$"&rs("AnnounceID")&"$"&now()&"$"&Replace(request.form("body"),"$","&#36;")&"$$"&Dvbbs.UserSession.documentElement.selectSingleNode("userinfo/@userid").text&"$"&dbid&"$"&boardid
   rs.close:set rs=nothing
   Dvbbs.Execute("update [Dv_Board] set ToDayNum=ToDayNum+1,PostNum=PostNum+1,LastPost='"&lastpost&"' where BoardID="&boardid)
   set rs = Server.CreateObject("ADODB.Recordset")
   sql="select child,LastPostTime,LastPost from [Dv_Topic] where TopicID="&dbid
   rs.open sql,conn,1,3
   rs("child")=rs("child")+1
   rs("LastPostTime")=now()
   rs("LastPost")=lastpost
   rs.update
   rs.close:set rs=nothing
response.redirect "?ID="&dbid&"&usID="&usid
end if
%>
<Script Src="images/post/reply.js"></Script>
<script language = "JavaScript" src = "images/post/post.js"></script>
<br>
<link rel="STYLESHEET" type="text/css" href="images/post/edit.css">
<table cellpadding="1" cellspacing="1" class="tableborder1" align="center">
<tr>
<th width="100%" height="23" colspan="2" align="left">&nbsp;<a name='res'>快速回复</a>：<%=title%></th>
</tr>
<%
if not Dvbbs.Founduser then
response.write "<tr>"
response.write "<td height=25 class=tablebody1>"
response.write "<li>您还没有<a href=login.asp>登录论坛</a>，不能进行快速复。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！ "
response.write "</td>"
response.write "</tr>"
response.write "</table>"
else
%>
<form name="dvform" method="POST" onSubmit="chk();" >
<input type="hidden" id="Body" name="Body" value="">
<tr>
<td width="80%" class="tablebody2">
<!--post.asp##ubb部分-->
<table border="0" style="width:100%;height:30%;" cellpadding="2" cellspacing="1" align=center>
<tr><td width="1">
<select ID="Dvbbs_formatSelect" class="Dvbbs_TBGen" onchange="Dvbbs_doSelectClick('FormatBlock',this)">
<option>段落格式</option>
<option VALUE="&lt;P&gt;">普通格式
<option VALUE="&lt;H1&gt;">标题 1
<option VALUE="&lt;H2&gt;">标题 2
<option VALUE="&lt;H3&gt;">标题 3
<option VALUE="&lt;H4&gt;">标题 4
<option VALUE="&lt;H5&gt;">标题 5
<option VALUE="&lt;H6&gt;">标题 6
<option VALUE="&lt;H7&gt;">标题 7
<option VALUE="&lt;PRE&gt;">已编排格式
<option VALUE="&lt;ADDRESS&gt;">地址
</select>
</td><td width=1>
<select language="javascript" class="Dvbbs_TBGen" id="FontName" onchange="FormatText ('fontname',this[this.selectedIndex].value);"> 
<option class="heading" selected>字体
<option value="宋体">宋体
<option value="黑体">黑体
<option value="楷体_GB2312">楷体
<option value="仿宋_GB2312">仿宋
<option value="隶书">隶书
<option value="幼圆">幼圆
<option value="新宋体">新宋体
<option value="细明体">细明体
<option value="Arial">Arial
<option value="Arial Black">Arial Black
<option value="Courier">Courier
<option value="Verdana">Verdana
<option value="Wide Latin">Wide Latin
<option value="Wingdings">Wingdings</option>
</select>
</td><td width=1>
<select language="javascript" class="Dvbbs_TBGen" id="FontSize" onchange="FormatText('fontsize',this[this.selectedIndex].value);">
<option class="heading" selected>字号
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
<option value="6">6
<option value="7">7</option>
</select>
</td>
<td width=1><img src="images/post/separator.gif"></td>
<td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Dvbbs_foreColor();this.className='IcoOnClick';">
<img src="images/post/fgcolor.gif" alt="字体颜色" >
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Dvbbs_backColor();this.className='IcoOnClick';">
<img src="images/post/fbcolor.gif" alt="字体背景颜色" >
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="FormatText('RemoveFormat', '');this.className='IcoOnClick';">
<img src="images/post/removeformat.gif" alt="格式取消">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="FormatText('bold', '');this.className='IcoOnClick';">
<img src="images/post/bold.gif" alt="粗体" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="FormatText('italic', '');this.className='IcoOnClick';">
<img src="images/post/italic.gif" alt="斜体">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="FormatText('underline', '');this.className='IcoOnClick';">
<img src="images/post/underline.gif" alt="下划线">
</td>
<td width=1><img src="images/post/separator.gif"></td>
<td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Curl();this.className='IcoOnClick';">
<img src="images/post/wlink.gif" alt="超级连接" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Dv_Signal('IMG');this.className='IcoOnClick';">
<img src="images/post/img.gif" alt="插入图片" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Cswf();this.className='IcoOnClick';">
<img src="images/post/swf.gif" alt="Flash图片" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Crm();this.className='IcoOnClick';">
<img src="images/post/rm.gif" alt="realplay视频文件" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Cwmv();this.className='IcoOnClick';">
<img src="images/post/wmv.gif" alt="Media Player视频文件" border="0">
</td>
<td width=1><img src="images/post/separator.gif"></td>
<td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Dv_ubb('QUOTE');this.className='IcoOnClick';">
<img src="images/post/quote.gif" alt="引用" border="0">
</td><td class="IcoOver" onmouseover=this.className='IcoOverMouseOver'; onmouseout=this.className='IcoOver'; onclick="Dvbbs_CleanCode();this.className='IcoOnClick';">
<img src="images/post/cleancode.gif" alt="清理代码">
<td>
</td><td width="*"></tr></table>
<!--post.asp##ubb部分-->
</td>
</tr>
<tr>
<td class="tablebody1" height="100%" valign="middle">
<table border=0 width="100%" height="100%"><tr height="*"><td height="150">
<iframe class="Dvbbs_Reply" ID="Dvbbs_Composition" MARGINHEIGHT="5" MARGINWIDTH="5" width="100%" height="100%" onBlur="CheckCount('Body','total');"></iframe></td></tr>
<tr>
<td class="tablebody2">
<input type="Submit" value="OK!发表回复" name="Submit">&nbsp;<input type="reset" name=Clear value="清空内容！" onclick="ClearReset()">
内容限制：<INPUT class="Dvbbs_Reply" disabled maxLength=6 size=5 value="1000" name="total">字节.
</td>
</tr>
</form>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
var Dvbbs_bIsIE5=document.all
if (Dvbbs_bIsIE5)
{var IframeID=frames["Dvbbs_Composition"];}
else
{
var IframeID=document.getElementById("Dvbbs_Composition").contentWindow;
}
//function chk()
//{
//	if(document.form.body.value=="1")
//	{
//	alert("分类名称不能为空");
//	document.form.name.focus();
//	return false;
//	}
//return true;
//}
Dvbbs_InitDocument('Body','gb2312');
//-->
</SCRIPT>
<%
end if
end sub

Function CountStr(byval str_str)
Dim k,i,c
k=0 
For i=1 to Len(str_str)
     c=Abs(Asc(Mid(str_str,i,1)))
     If c>255 Then
         k=k+2
     Else
         k=k+1
     End If     
Next
CountStr=k
End Function

function dhy_html(fString)
if not isnull(fString) then
    fString = Replace(fString, CHR(9),"&nbsp;")
    fString = Replace(fString, CHR(34),"'")
    fString = Replace(fString, CHR(39),"""")
'    fString = replace(fString, ">","&gt;")
'    fString = replace(fString, "<","&lt;")
    fString = Replace(fString, CHR(13),"<br>")
	fString = Replace(fString,"<br><","<")
	fString = Replace(fString,"><br>",">")
	fString = Replace(fString,"[align=right]","<div align=right>")
	fString = Replace(fString,"[align=left]","<div align=left>")
	fString = Replace(fString,"[align=conter]","<div align=conter>")
	fString = Replace(fString,"[/align]","</div>")
	fString = Replace(fString,"[color=#000066]","<font color=#000066>")
	fString = Replace(fString,"[/color]","</font>")
	fString = Replace(fString,"[upload=jpg]UploadFile/","<img SRC='showimg.asp?BoardID="&boards&"&filename=")
	fString = Replace(fString,"[upload=gif]UploadFile/","<img SRC='showimg.asp?BoardID="&boards&"&filename=")
	fString = Replace(fString,"[upload=bmp]UploadFile/","<img SRC='showimg.asp?BoardID="&boards&"&filename=")
	fString = Replace(fString,"[/upload]","'><br>")
	fString = Replace(fString,"[IMG]","<img SRC='")
	fString = Replace(fString,"[img]","<img SRC='")
	fString = Replace(fString,"[/IMG]","'><br>")
	fString = Replace(fString,"[/img]","'><br>")
	fString = Replace(fString,"[URL=","<a href=")
	fString = Replace(fString,"[url=","<a href=")
	fString = Replace(fString,"]",">")
	fString = Replace(fString,"]",">")
	fString = Replace(fString,"[URL]","<a href=")
	fString = Replace(fString,"[url]","<a href=")
	fString = Replace(fString,"[/URL","</a")
	fString = Replace(fString,"[/url","</a")
	fString = Replace(fString,".jpg'",".jpg' onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' ")
	fString = Replace(fString,".jpg"">",".jpg"" onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
	fString = Replace(fString,".jpg"" border=0>",".jpg"" border=0 onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
    fString = Replace(fString,".gif'",".gif' onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' ")
	fString = Replace(fString,".gif"">",".gif"" onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
	fString = Replace(fString,".gif"" border=0>",".gif"" border=0 onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
    fString = Replace(fString,".bmp'",".bmp' onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' ")
	fString = Replace(fString,".bmp"">",".bmp"" onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
	fString = Replace(fString,".bmp"">",".bmp"" border=0 onload='javascript:if(this.width>screen.width-500)this.style.width=screen.width-500;' >")
	for i=1 to 89
	    if i<10 then
 	       fString = Replace(fString,"[em0"&i&">","<img src=Skins/Default/emot/em0"&i&".gif>")
		else
 	       fString = Replace(fString,"[em"&i&">","<img src=Skins/Default/emot/em"&i&".gif>")
		end if
	next
    dhy_html = fString
end if
end function

public sub reconstruct()
response.write "<li>正在修复个人主页查看新贴错误,如果你的论坛贴子量较大，可以需要较长时间，请稍后......<br>"
response.write "<li>如果提示找不到名，请打开dhy_disp.asp文件，找到423行，将表名改成你的即可!"
set rs = Server.CreateObject("ADODB.Recordset")
sql="select topic from [Dv_bbs1]"
rs.open sql,conn,1,3
do while not rs.eof
if isnull(rs("topic")) then rs("topic")=""
rs.update
rs.movenext()
loop
rs.close:set rs=nothing
response.write "<li><font color=red>数据修复已成功！请用记事本打开dhy_disp.asp文件，找到 <font color=blue>call reconstruct()</font> 语句，请其前面加上一个点( ' )(即屏蔽该语句,下次执行该页面不再执行修复)就行了。"
response.end
end sub
%>