<%
dim m_Name, id, sql, rs
if request.QueryString("id")<>"" then
if not isInteger(request.QueryString("id")) then
GradeError "非法的内容ID参数。"
end if
id =  CLng(request.QueryString("id"))
else
id =  0
end if
sql = "select * from [newsmk]"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
m_Name = news_name
PageGrade = rs("Grade")
end if
set rs=nothing
PageTitle = m_Name
if Flash_Cms_Grade<PageGrade then
GradeError "grade"
end if
sub NewsContent()
if  id=0 then
NewsList
else
NewsItem
end if
end sub
sub NewsList()
pagetop
Response.Write "<ul data-role=""listview"">" & VbCrLf
Response.Write "<li data-role=""list-divider"">"& m_Name &"</li>" & VbCrLf
sql="select * from [news] order by istop desc,news_id desc"
set rs = Server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write "<li>"
Response.Write "<img src=""../img/nesw_nopic0.jpg"" />"
Response.Write "<h1>暂无内容</h1>"
Response.Write "<p>该栏目暂未添加内容.....</p>"
Response.Write "</li>"
Response.Write "</ul>"
rs.close
set rs=nothing
pagefoot
exit sub
end if
dim picspic
Dim adflperpage, pic_Nums,MultiPages,j
adflperpage = 1
rs.PageSize=adflperpage
rs.AbsolutePage=CurPage
Nums=rs.RecordCount
MPages = PageNav(Nums,adflperpage,"a=1")
Do Until rs.EOF or j=adflperpage
picspic = SeconFilePath(rs("simages"))
if picspic="" then picspic="../img/nesw_nopic"& (j mod 2) &".jpg"
Response.Write "<li><a href=""news.asp?m_id=" & m_id & "&id=" & rs("news_id") & """>"
Response.Write "<img src=""" & picspic & """ />"
Response.Write "<h1>"& rs("news_title") &"</h1>"
Response.Write "<p class=""ui-li-aside"">"& year(rs("news_date"))&"-"&month(rs("news_date"))&"-"&day(rs("news_date")) &"</p>"
Response.Write "<p>" & rs("daodu") & "</p>"
Response.Write "</a></li>" & VbCrLf
j = j +1
rs.movenext
loop
rs.close
set rs=nothing
Response.Write "</ul>" & VbCrLf
Response.Write MPages  & VbCrLf
pagefoot
end sub
sub NewsItem() 
pagetop
sql="select * from [news] where news_id=" & id
set rs = Server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("参数错误，内容不存在。")
else
Response.Clear
PageTitle = rs("news_title")
pagetop
Response.Write "<div style=""text-align:center;"">"
Response.Write "<h3>"& rs("news_title") &"</h3>"
Response.Write "<span>" & rs("news_date") & "</span>"
Response.Write "</div>"
Response.Write "<div style=""padding:5px;"">"& Replace(rs("news_content"),"<img ","<img  onload=""javascript:previewload(this);""") &"</div>"
end if
rs.close
set rs=nothing
pagefoot
end sub
%>