'==================================
'=文 件 名:news.asp
'=适用版本:蓝色世纪WAP网站管理系统(CMS)V1.1
'=官方版权:http://www.wapls.com
'=文件功能:网站新闻前台
'=文件作者:蓝色阳光
'=发行时间:2007-02-01
'==================================
IF Request.QueryString("Action")="view" Then
call view
elseIF Request.QueryString("Action")="cat" Then
call cat
elseIF Request.QueryString("Action")="money" Then
call money
elseIF Request.QueryString("Action")="remarklist" Then
call remarklist
else
call main
End IF
'========新闻主页列表=======
Function main
dim sql
%>
set rs=server.createobject("ADODB.Recordset")
Sql="select * from wapls_news_cat order by cat_num asc"
rs.open Sql,conn,1,1
if not (rs.bof and rs.eof) then
For i=1 to rs.RecordCount
If Rs.Eof Then
exit For
End If
if rs("cat_br")="1" then
br=""
else
br=""
end if%>
Rs.MoveNext
Next
end if
if len(mb_news)>1 then
response.write ""&outHTM(mb_news)&""
end if
%>
set rsc=server.createobject("ADODB.Recordset")
Sqlc="select top "&pagenum&" * from wapls_news order by istop=1,news_date desc"
rsc.open Sqlc,conn,1,1
if not (rsc.bof and rsc.eof) then
For i=1 to rsc.RecordCount
If Rsc.Eof Then
exit For
End If
if len(mb_logo)>1 then
response.write ""
end if%>[顶](./:) response.write "↑此条内容属于"
if rsc("user_view")="1" then
response.write "会员"
end if
if rsc("user_view")="2" then
response.write "VIP"
end if
response.write "需要"&rsc("moneypay")&"金币阅读↑"
end if
Rsc.MoveNext
Next
end if
Rsc.close
set rsc=nothing
Rs.close
set rs=nothing
if len(mb_logo)>1 then
response.write ""
else
%>
----------
end if
end Function
'========新闻分类列表=======
Function cat
catid=TRim(Request("id"))
set rs=server.createobject("ADODB.Recordset")
Sql="select * from wapls_news_cat WHERE cat_id="&catid
rs.open Sql,conn,1,1
if not (rs.bof and rs.eof) then
title=rs("cat_name")
%>
set rsv=server.createobject("ADODB.Recordset")
Sqlv="select * from wapls_news WHERE cat_id="&catid&" order by istop=1,news_date desc"
rsv.open Sqlv,conn,1,1
if not (rsv.bof and rsv.eof) then
page = Request("Page")
rsv.PageSize = pagenum '一页显示记录
IF Not IsEmpty(Page) Then
IF Not IsNumeric(Page) Then '判断Page是否为数字
Page=1
Else
Page=Cint(Page) '转换成短整形Integer
End IF
IF Page > rsv.PageCount Then
rsv.AbsolutePage = rsv.PageCount '设置当前显示页等于最后一页
ElseIF Page rsv.AbsolutePage = 1 '设置当前页等于第一页
Else
rsv.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
End IF
Else
rsv.AbsolutePage = 1
End IF
Page = rsv.AbsolutePage
For i=1 to rsv.PageSize
If rsv.Eof Then
Exit For
End If
if len(mb_logo)>1 then
response.write ""
end if%>[顶](.-:) response.write "↑此条内容属于"
if rsv("user_view")="1" then
response.write "会员"
end if
if rsv("user_view")="2" then
response.write "VIP"
end if
response.write "需要"&rsv("moneypay")&"金币阅读↑"
end if
rsv.MoveNext
Next
if page>=rsv.PageCount then
'Response.Write ("[下-页]")
else
Response.Write("[下-页]")
end if
if page 'Response.Write ("[上-页] ")
else
Response.Write("[上-页]")
end if
if rsv.PageCount>2 then
%>
GO>>
共(/)页
else
response.write "暂无新闻!"
end if
Rsv.close
set rsv=nothing
else
response.redirect "wapls_404.asp?id=2"
end if
if len(mb_logo)>1 then
response.write ""
else
%>
----------
[新闻资迅]
end Function
'========新闻内容=======
Function view
newsid=TRim(Request("id"))
set rsv=server.createobject("ADODB.Recordset")
Sqlv="select * from wapls_news WHERE news_id="&newsid
rsv.open Sqlv,conn,1,3
content=rsv("news_content")
if rsv("news_pic")"" then
logo=""
end if
Set Rs0 = Server.CreateObject("Adodb.Recordset")
Sql0 = "SELECT remark_id FROM wapls_remark WHERE class_id=0 and list_id="&rsv("news_id")&" order by remark_id desc"
Rs0.Open Sql0,conn,1,1
remark=rs0.RecordCount
Rs0.close
set rs0=nothing
pageWordNum=200
StartWord = 1
Length=len(content)
PageAll=(Length+PageWordNum-1)\PageWordNum
i=request("i")
if isnull(i) or i="" then
i=0
end if
page2 = mid(content,StartWord+i*PageWordNum,PageWordNum)
%>
(.-:)
if rsv("user_view")=1 then
response.write "会员新闻[消费"&rsv("moneypay")&"个金币]"
elseif rsv("user_view")=2 then
response.write "VIP新闻[消费"&rsv("moneypay")&"个金币]"
else
response.write "普通新闻"
end if
response.write ""
if len(mb_logo)>1 then
response.write ""
else
%>
----------
end if
if cint(i) response.write logo
End if
response.write utf8(page2) & ""
if cint(i)=cint(PageAll)-1 then
response.write "[完]来源:"&utf8(rsv("news_from"))&"作者:"&utf8(rsv("news_poster"))&""
End if
%>
浏览:次
相关评论()
if 0 if cint(i) Response.Write "[下-页]"
End if
if cint(i)>0 then
Response.Write "[上-页]"
End if
End if
if cint(i) response.write "("&i+1&"/"&PageAll&")"
End if
Set Rs1 = Server.CreateObject("Adodb.Recordset")
Sql1="SELECT * FROM wapls_news WHERE cat_id="&rsv("cat_id")&" and news_id>"&rsv("news_id")&" order by news_id asc"
Rs1.Open Sql1,conn,1,1
if not (rs1.bof and rs1.eof) then
Response.Write("下一篇:"&rs1("news_title")&"")
if rs1("user_money")"0" then
response.write "↑此条内容属于"
if rs1("user_view")="1" then
response.write "会员"
end if
if rs1("user_view")="2" then
response.write "VIP"
end if
response.write "需要"&rs1("moneypay")&"金币阅读↑"
end if
end if
Rs1.close
set rs1=nothing
Set Rs1 = Server.CreateObject("Adodb.Recordset")
Sql1="SELECT * FROM wapls_news WHERE cat_id="&rsv("cat_id")&" and news_id Rs1.Open Sql1,conn,1,1
if not (rs1.bof and rs1.eof) then
Response.Write("上一篇:"&rs1("news_title")&"")
if rs1("user_view")"0" then
response.write "↑此条内容属于"
if rs1("user_view")="1" then
response.write "会员"
end if
if rs1("user_view")="2" then
response.write "VIP"
end if
response.write "需要"&rs1("moneypay")&"金币阅读↑"
end if
end if
Rs1.close
set rs1=nothing
%>
[返回上级]
rsv("news_count")=rsv("news_count")+1
rsv.update()
Rsv.close
set rsv=nothing
end Function
'========新闻处理=======
Function money
newsid=TRim(Request("id"))
set rsv=server.createobject("ADODB.Recordset")
Sqlv="select * from wapls_news WHERE news_id="&newsid
rsv.open Sqlv,conn,1,3
if user_system0 and rsv("user_view")0 then
if session("userlogin")=user_session then
sql="select * from wapls_user where lock=0 and name='"&session("name")&"' and passed=1"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,3
if not rs2.eof then
if rs2("user_money")-rsv("moneypay") response.redirect "wapls_404.asp?id=28"
elseif rsv("user_view")=2 then
if rs2("user_type")2 then
response.redirect "wapls_404.asp?id=29"
else
rs2("user_money")=rs2("user_money")-rsv("moneypay")
rs2.update
end if
elseif rsv("user_view")=1 then
rs2("user_money")=rs2("user_money")-rsv("moneypay")
rs2.update
end if
else
response.redirect "wapls_404.asp?id=8"
end if
response.redirect "?Action=view&id="&newsid
else
response.redirect "wapls_404.asp?id=27"
end if
else
response.redirect "?Action=view&id="&newsid
end if
Rsv.close
set rsv=nothing
end Function
'========新闻评论=======
Function remarklist
if request.form("addremark")="true" then
listid=TRim(Request("id"))
yz=Request("yz")
yz1=Request("yz1")
if yzyz1 then
response.redirect "wapls_404.asp?id=9"
else
remark=utf8(Request("remark"))
remarker=utf8(Request("remarker"))
if remarker"" then
else
remarker="游客"
end if
if remark="" then response.redirect "wapls_404.asp?id=12"
if Session("remark")=remark and remark"" then response.redirect "wapls_404.asp?id=13"
Session("remark")=remark
Session.Timeout=60
sql="select * from wapls_remark"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("class_id")="0"
rs("remark")=remark
rs("list_id")=listid
rs("remarker")=remarker
rs("remarker_ip")=userip
rs.update
rs.close
set rs=nothing
response.redirect "?Action=view&id="&listid
end if
end if
listid=TRim(Request("id"))
%>
set rs=server.createobject("ADODB.Recordset")
Sqlv="select * from wapls_remark WHERE class_id=0 and list_id="&listid&" order by remark_id desc"
rs.open Sqlv,conn,1,1
if not (rs.bof and rs.eof) then
page = Request("Page")
rs.PageSize = pageremark '一页显示记录
IF Not IsEmpty(Page) Then
IF Not IsNumeric(Page) Then '判断Page是否为数字
Page=1
Else
Page=Cint(Page) '转换成短整形Integer
End IF
IF Page > rs.PageCount Then
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后一页
ElseIF Page rs.AbsolutePage = 1 '设置当前页等于第一页
Else
rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
End IF
Else
rs.AbsolutePage = 1
End IF
Page = rs.AbsolutePage
For i=1 to rs.PageSize
If rs.Eof Then
Exit For
End If
%>
.(-/:)
rs.MoveNext
Next
if page>=rs.PageCount then
'Response.Write ("[下-页]")
else
Response.Write("[下-页]")
end if
if page 'Response.Write ("[上-页] ")
else
Response.Write("[上-页]")
end if
if rs.PageCount>2 then
%>
GO>>
共(/)页
else
response.write "暂无评论!"
end if
rs.close
set rs=nothing
%>
系统暂停开放发表评论
目前只对会员开放评论功能
发表评论:
验证:
[确认提交]
end if
end if
if len(mb_logo)>1 then
response.write ""
else
%>
----------
[返回新闻]
[新闻资迅]
[返回首页]