<%@ Language=VBScript %>
<!-- #include file="../dsn.asp" -->
<%
Response.Buffer=true
Response.Expires=0
pppid=cint(Request.QueryString ("pppid"))
ppid=cint(Request.QueryString ("ppid"))
pid=cint(Request.QueryString ("pid"))
tabname=trim(Request.QueryString("tabname"))
set cn = Server.CreateObject("ADODB.Connection")
cn.Open(mycnstr)
set rs = Server.CreateObject("ADODB.Recordset")
%>
<html>
<head>
<title>预览</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000000; font-family: 宋体}
td {font-size: 12px; color: #000000; font-family: 宋体;}
.t1 {font:12px 宋体;color=000000} 
.t2 {font:12px 宋体;color:ffffff} 

.bt1 {font:14px 宋体;color=000000} 
.bt2 {font:14px 宋体;color:ffffff} 

A:link {color: #000066}
A:visited {color: #000066}
A:hover {color: #ff0000}

A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#ff6600;}

A.r2:link {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:visited {font-size:12px;text-decoration:underline;color:#ffffff;}
A.r2:hover {font-size:12px;text-decoration:underline;color:#ff6600;}
-->
</style>
</head>

<body bgcolor="#CFCDC7" text="#000000" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="460" valign=top>
  <tr> 
    <td bgcolor="#ffffff" valign=top> 
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align=center>
        <tr> 
          <td align=center height=10>&nbsp;</td>
        </tr>
        <tr> 
          <td valign=top style="line-height:100%">
			<%sqltext="select * from "+tabname+" where enable=1 and pppid="&pppid&" and ppid="&ppid&" and pid="&pid&" order by pl"
			  rs.Open sqltext,cn,1,1
			  do while not rs.EOF %>
			      <%if rs("picflag1")=1 then
			           pictitle=trim(rs("pictitle1"))
			           picplace=rs("picplace1")
			           if picplace=0 then
			                picplacetxt="left"
			           elseif picplace=1 then
							picplacetxt="center"     
					   elseif picplace=2 then
							picplacetxt="right"		
					   end if		
			      %>
			      <%if picplace=1 then%>
			          <table width="100%" border="0" cellspacing="0" cellpadding="0" align=center style="line-height:150%">
			             <tr>
			               <td align=center><img src="../upfile/<%=rs("picname1")%>" align=<%=picplacetxt%>><br><br><%=pictitle%></td>
			             </tr>  
			          </table>   
			      <%else%>    
					  <img src="../upfile/<%=rs("picname1")%>" align=<%=picplacetxt%>>
			      <%end if%>         
			      <%end if%>
			      <%=checkstr(trim(rs("body")))%>
			  <%rs.MoveNext 
			    loop
			    rs.Close %>    
			<%'=Server.HTMLEncode(checkstr(content))%>
          </td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
function checkstr(str)
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True

    re.Pattern="(script)"
    str=re.Replace(str,"sc ript")
    re.Pattern="(>"+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(> "+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(>  "+chr(13)+")"
    str=re.Replace(str,">")

    re.Pattern="("+chr(13)+")"
    str=re.Replace(str,"<br>&nbsp;&nbsp;&nbsp;")

	str=str
	checkstr=str
end function	
%>