
<!--#include file="../inc/Conn.asp"-->
<!--#include file="../inc/base64.asp"-->
<!--#include file="../inc/Function.asp"-->
<%
'*****************************************
' 作者：guke
' QQ：6692103
' http://www.my478.com
'*****************************************
Dim XH_Post,XH_In,XH_Inf,XH_Xh 
'自定义需要过滤的字串,用 "|" 分隔     ## 防注入 ##
XH_In = "<|>|(script)|on(mouseover|mouseon|mouseout|click|dblclick|blur|focus|change)|src|'|eval|\t|and|="
XH_Inf = split(XH_In,"|") 
For Each XH_Post In Request.Form 
For XH_Xh=0 To Ubound(XH_Inf) 
If Instr(LCase(Request.Form(XH_Post)),XH_Inf(XH_Xh))<>0 Then 
Response.End 
End If 
Next 
Next

Public Function ReplaceTrim(ByVal strContent) 
On Error Resume Next 
Dim re 
Set re = New RegExp 
re.IgnoreCase = True 
re.Global = True 
re.Pattern = "(" & Chr(8) & "|" & Chr(9) & "|" & Chr(10) & "|" & Chr(13) & ")" 
strContent = re.Replace(strContent, vbNullString)
Set re = Nothing 
ReplaceTrim = strContent 
Exit Function 
End Function

function RemoveHTML(fString)
  dim   re   
  set   re   =   New   RegExp   
  re.Global   =   True   
  re.IgnoreCase   =   True   
  if   not   isnull(fString)   then   
  re.Pattern   =   "<(.[^>]*)>"   
  fString   =   re.Replace(fString,"") 
   fString   =  Replace(fString,"&nbsp;","")  
  RemoveHTML   =   fString   
  end   if 
end function

function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function

Dim last,amount
response.charset = "gb2312"
last = request.form("last")
amount = request.form("amount")
cid = request("cid")
mkid = request("mkid")

str_order=""
if cid<>0 and cid<>"" then
str_sql=str_sql&" and Dream_ClassID in (select id from Dream_Class where Dream_Classid="&cid&" or id="&cid&")"
end if

str_order=" id desc"

if last="" or amount="" then
Response.End
end if

i=0
set rs=server.createobject("adodb.recordset")
if last=0 then
sql="select top "&amount&" * from [Dream_Articles] where Dream_ModularID="&mkid&" and id<>0 "&str_sql&" order by "&str_order
else
sql="select top "&amount&" * from [Dream_Articles] where Dream_ModularID="&mkid&" and id<>0 "&str_sql&" and id not in (select top "&last&" id from [Dream_Articles] where Dream_ModularID="&mkid&" and id<>0 "&str_sql&" order by "&str_order&") order by "&str_order
end if
rs.open sql,conn,1,1
if rs.eof then
Response.End
else
response.write "["
do while not rs.eof
if i=0 then
response.write "{""url"":""about.asp?id="&rs("id")&""",""new_mplist_t"":"""&rs("Dream_Title")&""",""new_mplist_con"":"""&cutstr(ReplaceTrim(rs("Dream_TitleCon")),60)&"""}"
else
response.write ",{""url"":""about.asp?id="&rs("id")&""",""new_mplist_t"":"""&rs("Dream_Title")&""",""new_mplist_con"":"""&cutstr(ReplaceTrim(rs("Dream_TitleCon")),60)&"""}"
end if
i=i+1
rs.movenext
loop
end if
response.write "]"
rs.close
%>