Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Encontrei este sistema de noticias, mas o unico defeito dele é que n tem paginação.
Como criar isso?
Já tentei alguns scripts para paginação, mas n funcionaram.
conectar.asp
<%
Set Conexao = CreateObject("ADODB.CONNECTION")
conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath(db)
ConexaoAberta = FALSE
Sub AbreConexao()
if not ConexaoAberta then
Conexao.Open ConStr
ConexaoAberta = True
end if
end sub
Sub FechaConexao()
if ConexaoAberta then
Conexao.close
ConexaoAberta = False
end if
end sub
%>
ver.asp
<% Response.Buffer = True %>
<!--#include file="conectar.asp"-->
<%
AbreConexao
SQL = "SELECT * FROM noticias ORDER BY id DESC"
Set rs = Conexao.Execute(SQL)
While not rs.EOF
%>
<body text="#FFFFFF" bgcolor="#000000">
<table border="0" cellpadding="3" cellspacing="0" width="85%" bordercolorlight="#FFFFFF" style="border-collapse: collapse">
<tr>
<td bgcolor="#BE2F60"><font size="1"><%=RS("data")%><br><b>» <%=Rs("assunto")%></b></font></td>
</tr>
<tr>
<td><font size="1"><%=Rs("noticia")%></font></td>
</tr>
<tr>
<td><hr noshade color="#BE2F60" size="1"></td>
</tr>
<tr>
<td></td>
</tr>
</table>ultimos.asp
<!--#include file="conectar.asp"-->
<%
intRecsPerPage = ultimos
AbreConexao
set rs=Server.CreateObject("ADODB.Recordset")
sSQL="SELECT * FROM noticias ORDER BY id DESC"
rs.Open sSQL, Conexao,3,3
rs.PageSize=intRecsPerPage
for intRecord=1 to rs.PageSize
If Len(rs("assunto")) < 25 Then
Resumo = rs("assunto")
Else
Resumo = Mid(rs("assunto"),1,30) & "..."
End If
%>
<body text="#FFFFFF" bgcolor="#303437" link="#28FFF1" vlink="#28FFF1" alink="#BE2F60" topmargin="10">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="100%" bgcolor="#BE2F60" height="20"><font face="Verdana" size="1">» <a href="noticia.asp?id=<%=rs("id")%>"><%=Resumo%></a></font></td>
</tr>
<tr>
<td width="100%" bgcolor="#303437">
<font size="1" face="Verdana" color="#303437">--</font></td>
</tr>
</table>
<%
rs.MoveNext
If rs.EOF then
Exit For
End if
next
rs.Close
%>Carregando comentários...