﻿<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%'============================================================
' Copyright 2007-09 燃点真情. All Rights Reserved.
' Last Update: 2008-3-22  13:28
' ADD:wap.nowtx.cn
' E-Mail: xivn@163.com  QQ:531233814
'============================================================
%>
<%
dim tid
tid=request("tid")
if tid="" or Isnumeric(tid)=false then
  Call Error("<card title='出错了'><p>ID无效！")
end if
 Response.write "<card id='card1' title='下载帖子'>"
 Response.write "<p align='left'>"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from sell where id="&tid,conn,1,1

'过滤论坛的换行符USBCODE
function usbcode(str)
	str=trim(str)
	if IsNull(str) then exit function
	str=replace(str,"<br/>","\\")
	str=replace(str,"(br)","\\")
	str=replace(str,"[br]","\\")
	str=replace(str,"[tid]","")
	str=replace(str,"@@sid@@","")
	usbcode=str
end function
 Dim fs,yd
yd=""&rs("name")&""
yd =  yd & chr(13) & chr(10)
yd=yd &"来源:"&bbstitle&""
yd =  yd & chr(13) & chr(10)
	dim ccc,sss
	ccc=instr(usbcode(rs("txt")),"\\")
	if ccc>0 then
	sss=split(usbcode(rs("txt")),"\\")
for i=0 to ubound(sss)
yd =  yd & chr(13) & chr(10)
yd=yd & sss(i)
next
else
yd=yd &rs("txt")
end if
yd =  yd & chr(13) & chr(10)
yd =  yd & "-------"
yd =  yd & chr(13) & chr(10)
yd =  yd & chr(13) & chr(10)
yd =  yd & chr(13) & chr(10)
yd =  yd & "时间:"&rs("tm")
yd =  yd & chr(13) & chr(10)
yd =  yd & "作者:"&rs("fname")&"ID:("&rs("fid")&")"
yd =  yd & chr(13) & chr(10)
yd =  yd & ""&waptitle&""
yd =  yd & chr(13) & chr(10)
yd =  yd & request.ServerVariables("Server_NAME")
yd =  yd & chr(13) & chr(10)

set fs=server.CreateObject("scripting.FileSystemObject")
set xTextFile=fs.CreateTextFile(Server.MapPath("file/"&request.ServerVariables("Server_NAME")&".txt"),1,true)
xTextFile.write(""&yd&"")
response.redirect "file/"&request.ServerVariables("Server_NAME")&".txt"
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.write "</p></card></wml>"
%>
