Article.Asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:9k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="Inc/Cls_Conn.asp"-->
- <!--#include file="Inc/Cls_Config.asp"-->
- <%
- '=====================================================================
- ' 作者声明:转载请保留版权信息,鄙视不要脸的人
- '=====================================================================
- ' 程序名称:蓝宇网络发布系统
- ' 软件版本:Version 3.3.0 Sp1
- ' 程序作者:蓝宇 QQ:18159079 ╲、随心゛ QQ:6821845
- '=====================================================================
- ' 联系方式:Tel:13203117383,QQ:18159079,hi.baidu.com/hezeyu
- ' 程序开发:蓝宇,╲、随心゛
- ' 官方网站:蓝宇网络(http://hi.baidu.com/hezeyu)
- '=====================================================================
- ' Copyright 2004-2007 蓝宇 - All Rights Reserved.
- '=====================================================================
- start="技术文章"
- Dim Rs2, Rs3, Rs4
- founderr=false
- if request.querystring("cat_id")<>"" then
- if not tee5.isInteger(request.querystring("cat_id")) then
- founderr=true
- Response.Write "<script language=javascript>alert('参数不正确');javascript:history.back();</script>"
- End If
- End If
- if request("page")<>"" then
- if not isInteger(request("page")) then
- founderr=true
- Response.Write "<script language=javascript>alert('参数非法');javascript:history.back();</script>"
- End If
- End If
- if request("keyword")<>"" then
- if instr(request("keyword"),"'")>0 then
- founderr=true
- Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
- End If
- End If
- tee5.head()
- dim totalart,totalpages,j,colname
- sql="select id,cat_id,art_title,art_date,art_count,content,isbest from Gq_article order by id DESC"
- if request("cat_id")<>"" then
- sql="select id,cat_id,art_title,art_date,art_count,content,isbest from Gq_article where cat_id="&request("cat_id")&" order by id DESC"
- elseif request("keyword")<>"" then
- sql="select id,cat_id,art_title,art_date,art_count,content,isbest from Gq_article where "&request("select")&" like '%"&request("keyword")&"%'order by id DESC"
- End If
- set rs=server.createobject("adodb.recordset")
- rs.open sql,conn,1,1
- %>
- <TABLE width=<%=tee5.TabWidth%> border=0 align=center cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
- <TR>
- <TD width="240" vAlign=top>
- <table width="98%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>文章分类</th>
- </tr>
- <tr>
- <td height="3" bgcolor="#CCCCCC" width="195"></td>
- </tr>
- <tr>
- <td height="5"></td>
- </tr>
- <tr><td valign="top">
- <%
- sql="select cat_id,cat_name from Gq_newsClass"
- set rs2=server.createobject("adodb.recordset")
- rs2.open sql,conn,1,1
- if rs2.eof and rs2.bof then
- response.write "<div align=center><br>当前没有文章分类<br><br></div>"
- Else
- i = 1
- Response.Write "<table width=100% align='center' border='0' cellspacing='3' cellpadding='2'>"
- Response.Write "<tr>"
- do while not rs2.eof
- if request("cat_id")=cstr(rs2("cat_id")) then
- response.write "<td> · <font color='#FF0000'>"&rs2("cat_name")&"</font></td>"
- else
- response.write "<td> · <a href='?cat_id="&rs2("cat_id")&"'>"&rs2("cat_name")&"</a></td>"
- End If
- If i Mod 2=0 Then
- Response.Write"</tr>"
- End If
- i=i+1
- rs2.movenext
- loop
- rs2.Close: Set rs2=Nothing
- response.write "</table>"
- End If
- %>
- </td>
- </tr>
- <tr>
- <td height="5"></td>
- </tr>
- </table>
- <table width="98%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>文章搜索</th>
- </tr>
- <tr height="3">
- <td height="3" bgcolor="#CCCCCC" width="195"></td>
- </tr>
- <tr>
- <td valign="top"><table width="100%" border="0" cellspacing="5" cellpadding="0">
- <tr>
- <td height="47" valign="top"><form name="form2" method="post" action="article.asp">
- <input type="radio" name="select" value="art_title" checked>
- 标题
- <input type="radio" name="select" value="art_content">
- 内容 <br><br>
- <input type='text' name='keyword' size='25' value='搜索关键字' maxlength='50' onFocus='this.select();'>
- <br>
- <input type='submit' name='search' value=' 搜 索 '>
- </form></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="98%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>推荐文章top10</th>
- </tr>
- <tr height="3">
- <td height="3" bgcolor="#CCCCCC" width="195"></td>
- </tr>
- <tr>
- <td valign="top">
- <%
- set rs4=server.createobject("adodb.recordset")
- sql="select top 10 id,art_title,art_count,cat_id,art_date from Gq_article where isbest=1 order by id DESC"
- rs4.open sql,conn,1,1
- if rs4.eof and rs4.bof then
- response.write "<div align=center><br>没有任何推荐文章<br><br></div>"
- Else
- do while not rs4.eof
- %>
- <TABLE cellSpacing=1 cellPadding=1 width="90%" border=0 align="center">
- <TR>
- <TD height="20" valign="middle">· <a href='showarticle.asp?cat_id=<%=rs4("cat_id")%>&id=<%=rs4("id")%>' target='_blank' Title='文章标题:<%=rs4("art_title")%>
发表时间:<%=rs4("art_date")%>
阅读次数:<%=rs4("art_count")%>次'><font color="#333333"><%=left(rs4("art_title"),20)%>...</font></a></TD>
- </TR>
- </TABLE>
- <%
- rs4.movenext
- loop
- End If
- rs4.close
- set rs4=nothing
- %>
- </td>
- </tr>
- </table>
- <table width="98%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>热门文章top10</th>
- </tr>
- <tr height="3">
- <td height="3" bgcolor="#CCCCCC" width="195"></td>
- </tr>
- <tr>
- <td valign="top">
- <%
- set rs3=server.createobject("adodb.recordset")
- sql="select top 10 id,art_title,art_count,cat_id,art_date from Gq_article order by art_count DESC"
- rs3.open sql,conn,1,1
- if rs3.eof and rs3.bof then
- response.write "<div align=center><br>当前没有热门文章<br><br></div>"
- Else
- do while not rs3.eof
- %>
- <TABLE cellSpacing=1 cellPadding=1 width="90%" border=0 align="center">
- <TR>
- <TD height="20" valign="middle">· <a href='showarticle.asp?cat_id=<%=rs3("cat_id")%>&id=<%=rs3("id")%>' target='_blank' Title='文章标题:<%=rs3("art_title")%>
发表时间:<%=rs3("art_date")%>
阅读次数:<%=rs3("art_count")%>次'><font color="#333333"><%=left(rs3("art_title"),20)%>...</font></a></TD>
- </TR>
- </TABLE>
- <%
- rs3.movenext
- loop
- End If
- rs3.close
- set rs3=nothing
- %>
- </td>
- </tr>
- </table></TD>
- <TD width=1 vAlign=top bgcolor="#CCCCCC"></TD>
- <TD width="76%" vAlign=top align='right'>
- <table width="99%" border="0" cellspacing="1" cellpadding="3">
- <tr>
- <th><b><font color="FFFFFF">文章标题</font></b></th>
- <th><b><font color="FFFFFF">人气</font></b></th>
- <th><b><font color="FFFFFF">更新时间</font></b></th>
- </tr>
- <tr>
- <td height="3" bgcolor="#CCCCCC"></td>
- <td height="3" bgcolor="#CCCCCC"></td>
- <td height="3" bgcolor="#CCCCCC"></td>
- </tr>
- <%
- Dim tablestyle
- Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
- maxperpage = Clng(tee5.MaxPerPage)
- totalrec = 0
- Pcount = 1
- CurrentPage = tee5.ChkNumeric(Request("page"))
- If CurrentPage = 0 Then CurrentPage = 1
- Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
- if rs.eof and rs.bof then
- Response.write "<tr align=""center"">"
- Response.write "<td align=middle height=""60"" colSpan=4>"
- if request("cat_id") <> "" then
- Response.write "该分类暂时没有文章"
- ElseIf request("keyword")<>"" then
- Response.write "没有找到包含[<b><font color=red>" & request("keyword") & "</font></b>]的文章!"
- Else
- Response.write "没有任何文章,请管理员到后台添加!"
- End If
- Response.write "</TD>"
- Response.write "</TR>"
- Else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- Dim rscat
- sql="select cat_id,cat_name from Gq_newsclass where cat_id="&rs("cat_id")
- set rscat=server.createobject("adodb.recordset")
- rscat.open sql,conn,1,1
- %>
- <tr>
- <td width="74%"><UL class=nl><LI> [<a href="?cat_id=<%=rscat("cat_id")%>"><%=rscat("cat_name")%></a>] <a href='showarticle.asp?cat_id=<%=rs("cat_id")%>&id=<%=rs("id")%>' target='_blank' Title='文章标题:<%=rs("art_title")%>
发表时间:<%=rs("art_date")%>
阅读次数:<%=rs("art_count")%>次'><%=left(rs("art_title"),60)%>...</a></li></ul></td>
- <TD width="10%" align=Center><%=rs("art_count")%></TD>
- <td width="16%" align="center">
- <%if Rs("art_date")>=date() then
- Response.Write "<FONT color=""#FF0000"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
- else
- Response.Write "<FONT color=""#999999"">"&year(Rs("art_date"))&"-"&month(Rs("art_date"))&"-"&day(Rs("art_date"))&"</FONT >" & vbCrLf
- End If
- %></td>
- </tr>
- <%
- Response.Write "<tr><td colSpan=4 height=""1"" bgColor=#F7F7F7></td></tr>"
- Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- Response.Write "<tr><td colSpan=4 align=right>"
- tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","技术文章"
- Response.Write "</td></tr>"
- Response.write "</TABLE></TD>"
- Response.write "</TR>"
- Response.write "</TABLE>"
- tee5.footer()
- CloseConn()
- %>