<% Call Header(""&Homepage_Title&" - 显示信息内容") Call Content() Call Footer() Sub GetNewsCata() Dim cRs, cSql, i, TempCataStr Set cRs = Server.CreateObject( "ADODB.Recordset" ) cSql = "SELECT * FROM NewsCata WHERE C_ID <> 1 ORDER BY C_RootID" cRs.Open cSql, oConn, 1, 3 Do While Not cRs.EOF TempCataStr = "" Response.Write TempCataStr cRs.MoveNext Loop cRs.Close Set cRs = Nothing End Sub ' 本页内容区 Sub Content() ' 传入参数:新闻ID Dim sNewsID sNewsID = GetSafeInt(Trim(Request("id")),0) ' 新闻ID有效性验证,防止有些人恶意的破坏此演示程序 If sNewsID < 1 Then GoError "请通过页面上的链接进行操作,不要试图进行任何非法操作。" End If sSql="UPDATE NewsData SET D_Hits = D_Hits+1 WHERE D_ID="&sNewsID oConn.Execute sSql ' 从数据库中取初始值 Dim sCataID, sTitle, sContent, sPicture, sOriginalFileName, sSaveFileName, sSavePathFileName, sFrom, sAddTime, sHits sSql = "SELECT * FROM NewsData WHERE D_ID=" & sNewsID oRs.Open sSql, oConn, 0, 1 If Not oRs.Eof Then sCataID = oRs("D_CataID") sTitle = oRs("D_Title") sContent = oRs("D_Content") sFrom = oRs("D_From") sAddTime = oRs("D_AddTime") sHits = oRs("D_Hits") Else GoError "无效的信息ID,请点页面上的链接进行操作!" End If oRs.Close Set oRs = Nothing ' 禁用某些标签,如出于安全考虑的Script标签,等 ' 要使用此功能需要先包含"Include/DeCode.asp"文件。 ' 此例只过滤SCRIPT标签,即意味着内容中的客户端脚本不会生效,您可根据实际的需要加入其它标签。 ' 当前支持过滤的标签,可以查看DeCode.asp文件中的说明。 sContent = eWebEditor_DeCode(sContent, "SCRIPT") %> <% '查找信息类别ID Set Rs = Server.CreateObject( "ADODB.Recordset" ) sSql = "SELECT D_CataId FROM NewsData WHERE D_ID=" & sNewsID Rs.Open sSql, oConn, 0, 1 If Not Rs.Eof Then C_ID = Rs("D_CataId") End If Rs.Close Set Rs = Nothing %> <% Set Rs = Server.CreateObject( "ADODB.Recordset" ) sSql = "select C_Title,C_RootID from NewsCata where C_ID="&C_ID Rs.open sSql,oConn,0,1 if not Rs.eof then C_Title = Rs("C_Title") C_RootID = Rs("C_RootID") end if Rs.close set Rs = nothing %>

<%=sTitle%>

<%=sAddTime%>| 被阅览数: <%=sHits%> 次| 信息来源: <%If sFrom <> "" then response.write ""& sFrom &"" Else response.write ""& Homepage_title &"" End If%> |

<% = sContent%>



下一篇: <% Dim preSql,PreRs preSql ="select top 1 d_iD,d_title from newsData where d_cataId="&sCataID&" and d_id <"&sNewsId&" order by d_id Desc" Set PreRs=Conn.Execute(preSql) If PreRs.Eof And PreRs.Bof Then %> 没有下一篇了! <% Else %> "><%=preRs("d_title")%> <% End if %>
上一篇: <% Dim NextSql,NextRs NextSql ="Select top 1 d_id ,d_title from newsData where d_cataId="&sCataId&" and d_id>"&sNewsId&" " Set NextRs =Conn.Execute(nextSql) If NextRs.Eof And NextRs.Bof Then %> 没有上一篇了! <% Else %> "><%=NextRs("d_title")%> <% End if %>



 
 
QQ在线咨询
售前咨询热线
138-8665-4054
售后服务热线
139-7260-1093
返回顶部
<% conn.close set conn = nothing End Sub %>