News.asp
资源名称:7.rar [点击查看]
上传用户:lfyh0123
上传日期:2020-11-04
资源大小:200k
文件大小:14k
源码类别:
手机WAP编程
开发平台:
ASP/ASPX
- <!--#include file="wapls_up.asp"-->
- <%
- '==================================
- '=文 件 名:news.asp
- '=适用版本:蓝色世纪WAP网站管理系统(CMS)V1.1
- '=官方版权:http://www.songfr.cn
- '=文件功能:网站新闻前台
- '=文件作者:蓝色阳光
- '=发行时间: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
- %>
- <card id="index" title="新闻资迅">
- <p align="<%=const1%>">
- <%
- 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="<br/>"
- else
- br=""
- end if%>
- <a href="?Action=cat&id=<%=rs("cat_id")%>"><%=utf8(rs("cat_name"))%></a><%=br%>
- <%
- Rs.MoveNext
- Next
- end if
- if len(mb_news)>1 then
- response.write ""&outHTM(mb_news)&"<br/>"
- 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 "<img src='"&mb_logo&"/biao.gif' alt='.'/>"
- end if%><%if rsc("istop")=1 then%>[顶]<%end if%><a href="?Action=money&id=<%=rsc("news_id")%>"><%=utf8(rsc("news_title"))%></a>(<%=Month(rsc("news_date"))%>.<%=day(rsc("news_date"))%>/<%=Hour(rsc("news_date"))%>:<%=Minute(rsc("news_date"))%>)<br/><%if rsc("user_view")<>"0" then
- response.write "<small>↑此条内容属于"
- 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")&"金币阅读↑</small><br/>"
- 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 "<img src='"&mb_logo&"/fgx.gif' alt='.'/><br/>"
- else
- %>
- ----------<br/>
- <%
- 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")
- %>
- <card id="index" title="<%=title%>新闻">
- <p align="<%=const1%>">
- <%
- 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 <= 0 Then
- 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 "<img src='"&mb_logo&"/biao.gif' alt='.'/>"
- end if%><%if rsv("istop")=1 then%>[顶]<%end if%><a href="?Action=money&id=<%=rsv("news_id")%>"><%=utf8(rsv("news_title"))%></a>(<%=Month(rsv("news_date"))%>.<%=day(rsv("news_date"))%>-<%=Hour(rsv("news_date"))%>:<%=Minute(rsv("news_date"))%>)<br/><%if rsv("user_view")<>"0" then
- response.write "<small>↑此条内容属于"
- 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")&"金币阅读↑</small><br/>"
- end if
- rsv.MoveNext
- Next
- if page>=rsv.PageCount then
- 'Response.Write ("[下-页]")
- else
- Response.Write("[<a href='?Action=cat&id="&catid&"&Page=" & (Page+1) & "'>下-页</a>]<br/>")
- end if
- if page<=1 then
- 'Response.Write ("[上-页] ")
- else
- Response.Write("[<a href='?Action=cat&id="&catid&"&Page=" & (Page-1) & "'>上-页</a>]<br/>")
- end if
- if rsv.PageCount>2 then
- %><input name="Page<%=minute(now)%><%=second(now)%>" format="*N" maxlength="50" size="2" value="<%=page+1%>"/>
- <anchor>GO>><go href="?Action=cat&id=<%=catid%>" method="post">
- <postfield name="Page" value="$(Page<%=minute(now)%><%=second(now)%>)"/></go></anchor><br/>
- 共(<%=utf8(page)%>/<%=rsv.pageCount%>)页<br/><%end if%>
- <%
- else
- response.write "暂无新闻!<br/>"
- 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 "<img src='"&mb_logo&"/fgx.gif' alt='.'/><br/>"
- else
- %>
- ----------<br/>
- <%end if%>
- <a href="news.asp">[新闻资迅]</a>
- <%
- 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="<img src='"&rsv("news_pic")&"' alt='LOGO..'/><br/>"
- 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)
- %>
- <card id="index" title="新闻正文">
- <p align="<%=const1%>">
- <b><%=utf8(rsv("news_title"))%></b>(<%=Month(rsv("news_date"))%>.<%=day(rsv("news_date"))%>-<%=Hour(rsv("news_date"))%>:<%=Minute(rsv("news_date"))%>)<br/>
- <%
- 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 "<br/>"
- if len(mb_logo)>1 then
- response.write "<img src='"&mb_logo&"/fgx.gif' alt='.'/><br/>"
- else
- %>
- ----------<br/>
- <%
- end if
- if cint(i)<1 then
- response.write logo
- End if
- response.write utf8(page2) & "<br/>"
- if cint(i)=cint(PageAll)-1 then
- response.write "[完]<br/>来源:"&utf8(rsv("news_from"))&"<br/>作者:"&utf8(rsv("news_poster"))&"<br/>"
- End if
- %>
- 浏览:<%=rsv("news_count")%>次<br/>
- <a href="?Action=remarklist&id=<%=rsv("news_id")%>">相关评论(<%=remark%>)</a><br/>
- <%
- if 0<=i<PageAll then
- if cint(i)<cint(PageAll)-1 then
- Response.Write "[<a href='?Action=view&i="&i+1&"&id="&rsv("news_id")&"'>下-页</a>]"
- End if
- if cint(i)>0 then
- Response.Write "<br/>[<a href='?Action=view&i="&i-1&"&id="&rsv("news_id")&"'>上-页</a>]"
- End if
- End if
- if cint(i)<cint(PageAll)-1 then
- response.write "<br/>("&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("<br/>下一篇:<a href='?Action=money&id="&rs1("news_id")&"'>"&rs1("news_title")&"</a>")
- if rs1("user_money")<>"0" then
- response.write "<br/><small>↑此条内容属于"
- 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")&"金币阅读↑</small>"
- 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<"&rsv("news_id")&" order by news_id desc"
- Rs1.Open Sql1,conn,1,1
- if not (rs1.bof and rs1.eof) then
- Response.Write("<br/>上一篇:<a href='?Action=view&id="&rs1("news_id")&"'>"&rs1("news_title")&"</a>")
- if rs1("user_view")<>"0" then
- response.write "<br/><small>↑此条内容属于"
- 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")&"金币阅读↑</small>"
- end if
- end if
- Rs1.close
- set rs1=nothing
- %>
- <br/><a href="?Action=cat&id=<%=rsv("cat_id")%>">[返回上级]</a>
- <%
- 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_system<>0 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")<0 then
- 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 yz<>yz1 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"))
- %>
- <card id="index" title="新闻评论">
- <p align="<%=const1%>">
- <%
- 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 <= 0 Then
- 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
- %>
- <%=utf8(i+(page-1)*rs.PageSize)%>.<%=utf8(rs("remarker"))%>(<%=Month(rs("remark_date"))%>-<%=day(rs("remark_date"))%>/<%=Hour(rs("remark_date"))%>:<%=Minute(rs("remark_date"))%>)<br/><%=utf8(rs("remark"))%><br/>
- <%
- rs.MoveNext
- Next
- if page>=rs.PageCount then
- 'Response.Write ("[下-页]")
- else
- Response.Write("[<a href='?Action=remarklist&id="&listid&"&Page=" & (Page+1) & "'>下-页</a>]<br/>")
- end if
- if page<=1 then
- 'Response.Write ("[上-页] ")
- else
- Response.Write("[<a href='?Action=remarklist&id="&listid&"&Page=" & (Page-1) & "'>上-页</a>]<br/>")
- end if
- if rs.PageCount>2 then
- %><input name="Page<%=minute(now)%><%=second(now)%>" format="*N" maxlength="50" size="2" value="<%=page+1%>"/>
- <anchor>GO>><go href="?Action=remarklist&id=<%=listid%>" method="post">
- <postfield name="Page" value="$(Page<%=minute(now)%><%=second(now)%>)"/></go></anchor><br/>
- 共(<%=utf8(page)%>/<%=rs.pageCount%>)页<br/><%end if%>
- <%
- else
- response.write "暂无评论!<br/>"
- end if
- rs.close
- set rs=nothing
- %>
- <br/>
- <%if newsremark_ok=0 then%>
- 系统暂停开放发表评论<br/>
- <%else%>
- <%if newsremark_ok=2 and session("name")="" then%>
- 目前只对会员开放评论功能<br/>
- <%else%>
- 发表评论:<br/>
- <input name="remark<%=minute(now)%><%=second(now)%>" maxlength="25" value="不错!支持!"/><br/>
- 验证:<input name="yz<%=minute(now)%><%=second(now)%>" format="*N" maxlength="4" size="7"/> <%=s%><br/><br/>
- <anchor>[确认提交]<go href="?Action=remarklist&id=<%=listid%>" method='post'>
- <postfield name="remark" value="$(remark<%=minute(now)%><%=second(now)%>)"/>
- <postfield name="addremark" value="true"/>
- <postfield name="remarker" value="<%=session("name")%>"/>
- <postfield name="yz" value="$(yz<%=minute(now)%><%=second(now)%>)"/>
- <postfield name="yz1" value="<%=s%>"/>
- </go>
- </anchor><br/>
- <%
- end if
- end if
- if len(mb_logo)>1 then
- response.write "<img src='"&mb_logo&"/fgx.gif' alt='.'/><br/>"
- else
- %>
- ----------<br/>
- <%end if%>
- <a href="?Action=view&id=<%=listid%>">[返回新闻]</a><br/>
- <a href="news.asp">[新闻资迅]</a>
- <%end Function%>
- <br/><a href="index.asp">[返回首页]</a>
- <!--#include file="wapls_down.asp"-->