Ver Mensaje Individual
  #5 (permalink)  
Antiguo 28/03/2003, 09:30
Avatar de meru-kun
meru-kun
 
Fecha de Ingreso: noviembre-2002
Ubicación: Madrid
Mensajes: 854
Antigüedad: 22 años, 5 meses
Puntos: 0
Bueno, yo te pongo TODO el codigo...
Código:
<%
' *******************
' ***** PAGINAS *****
' *******************

' ****** VARIABLES PARA PAGINAR ******
Dim PaginaActual		   ' en qué pagina estamos
Dim PaginasTotales	   ' cuántas páginas tenemos
Dim TamPagin             ' cuantos registros por pagina
Dim CuantosRegistros	   ' para imprimir solo el nº de registro por pagina 
Const adCmdText = &H0001
Const adOpenStatic = 3

' ***** CONTROL ERRORES *****
If txtPagina = "" Then
	PaginaActual=1
Else
	PaginaActual=CInt(txtPagina)
End if

' ***** TAMAÑO PAGINA *****
If txtGameSecc = "Personajes" Then
 TamPagina = 2     ' ** AQUI EL TAMAÑO QUE QUIERA
Else

TamPagina = 5     ' ** AQUI EL TAMAÑO QUE QUIERA

End If
 
' ***** DEFINIMOS EL RECORDSET *****
strSQLSecc = "Select ID, CONTENIDO, SECC_JUEGO, TITULO FROM GAMES_INFO"
strSQLSecc = strSQLSecc & " WHERE ID_JUEGO =" & txtGameEsID 
strSQLSecc = strSQLSecc & " AND ID_SECCION=" &  txtGameSeccID
'                                                **   response.write(strSQLSecc)
' ***** ABRIMOS EL RECORDSET *****
MyRecordset.Open strSQLSecc, myConn, adopenstatic,adcmdtext

' ***** CONTAMOS LAS PAGINAS *****
PaginasTotales = MyRecordset.PageCount
'                                                **     response.write PaginasTotales
' ***** COMPROBAMOS QUE LA PAGINA ACTUAL ESTA EN EL RANGO *****
If PaginaActual < 1 then 
	PaginaActual = 1
end if
if PaginaActual > PaginasTotales then
	PaginaActual = PaginasTotales
end if

' ***** CONTROLAMOS LOS ERRORES QUE PUEDAN SURGIR *****
If PaginasTotales =< 0 Then
  response.write("<div align=""center""><br>")
  response.write("<font class=""CABECERA"">Error</font><br>") 
  response.write("<font class=""NORMAL"">La informacin que ha solicitado no esta")
  response.write("<br>disponible o los datos no han sido introducidos correctamente.")
  response.write("<br>Si usted piensa que ha accedido correctamente, por favor, no dude")
  response.write("<br>en ponerse en contacto con nosotros, bien a traves de nuestra 
direccion de")
  response.write("<br><a href=""redireccionar.asp?secc=Mail"">e-mail</a>
 o a traves de los")
  response.write("<br><a href=""redireccionar.asp?secc=foro"">foros</a>")
  response.write("<br><br></font><font class=""CABECERA"">Disculpen las molestias</font>")
  response.write("</div>")
 Else
  MyRecordset.AbsolutePage = PaginaActual
   CuantosRegistros=0 
     Do While NOT MyRecordSet.EOF And CuantosRegistros < TamPagina
     
  ' ** ¡¡ AQUI VAN LAS SENTENCIAS PARA COGER DE LA DB **
   
   txtContenido = Myrecordset("CONTENIDO")
   txtTitulo = MyRecordset("TITULO")

  ' ** ¡¡ FIN DE LA CAPTURA DE DATOS **  
  ' ** ¡¡ IMPRESION DE CONTENIDOS    **   
   response.write("<tr><td width=""465"" align=""left"">")
   response.write("<br><font class=""CABECERA"">")
   response.write(txtTitulo & "<br><br>")
   'response.write(aqui la linea separadora)
   response.write("</font>")
   response.write("<font class=""NORMAL"">")
    response.write(txtContenido)
   response.write("</font>")
   response.write("</td></tr>")
'   response.write("</table>")
' ** ¡¡ FIN DE LA IMPRESION DE CONTENIDOS ** 
     CuantosRegistros=CuantosRegistros+1 
 MyRecordset.MoveNext
  Loop 
   MyRecordset.Close
    response.write("</table>")
End If

' ***** MOSTRAMOS LOS ENLACES PARA AVANZAR Y RETROCEDER *****
Response.Write("<table bgColor=""#666666"" width=""485"" cellspacing=""0""
 cellpading=0>")
Response.Write("<tr height=2>")
Response.write("<td height=2></td>")
Response.Write("</tr>")

If PaginaActual > 1 And PaginaActual < PaginasTotales Then
   Response.Write("<tr><td align=""left"" bgColor=""#888888"">")
	Response.Write("<A HREF=index.asp?accion=VerTodas&pag="& PaginaActual-1& ">
[Anterior]&nbsp;<img src=""archivos/
icono_menu_inv.gif""
border=0></A>&nbsp;&nbsp;&nbsp;")
	' ***** NUM PAGS, COMO EN SNITZ *****
	Response.Write("</td><td align=""center"" bgColor=""#888888"">")
	 For ContPags = 1 To PaginasTotales
	  If ContPags = PaginaActual Then
	   response.write("<font class=""NORMAL"">&nbsp;<b>" &ContPags& "</b></font>")
	  Else
      Response.write ("&nbsp;")
      Response.Write ("<a href=index.asp?accion=VerTodas&pag=" & ContPags & ">
[" & ContPags)
      Response.Write ("]</a>")
     End If 
     Next
	Response.Write("</td><td align=""right"" bgColor=""#888888"">")
   Response.Write("<A HREF=index.asp?accion=VerTodas&pag="
& PaginaActual+1 &"><img src=""archivos/
icono_menu.gif"" 
border=0>&nbsp;[Siguiente]</A>")
   Response.Write("</td></tr>")
   AvPag = True
End If
If PaginaActual > 1 then  ' ** Pag Ultima
 If AvPag = True Then 
 Else
   Response.Write("<tr><td align=""left"" bgColor=""#888888"">")
	Response.Write("<A HREF=index.asp?accion=VerTodas&pag="& PaginaActual-1& ">
[Anterior]&nbsp;<img src=""archivos/
icono_menu_inv.gif"" 
border=0></A>&nbsp;&nbsp;&nbsp;")
   Response.Write("</td><td align=""right"" bgColor=""#888888"">")
   For ContPags = 1 To PaginasTotales
    If ContPags = PaginaActual Then
	   response.write("<font class=""NORMAL"">&nbsp;<b>" &ContPags& "</b></font>")
	  Else
      Response.write ("&nbsp;")
      Response.Write ("<a href=index.asp?accion=VerTodas&pag=" & ContPags & 
">" & "[" & ContPags)
      Response.Write ("]</a>")
     End If 
     Next
   Response.Write("</td></tr>")
  End If 
End If
If PaginaActual < PaginasTotales then ' ** Pag 1
 If AvPag = True Then
 Else
   Response.Write("<tr>")
   Response.Write("<td align=""left"" bgColor=""#888888"">")
   For ContPags = 1 To PaginasTotales
    If ContPags = PaginaActual Then
	   response.write("<font class=""NORMAL"">&nbsp;<b>"
 &ContPags& "</b></font>")
	  Else
      Response.write ("&nbsp;")
      Response.Write ("<a href=index.asp?accion=VerTodas&pag=" & ContPags & ">
[" & ContPags)
      Response.Write ("]</a>")
     End If 
     Next
   Response.Write("</td><td align=""right"" bgColor=""#888888"">")
	Response.Write("<A HREF=index.asp?accion=VerTodas&pag=" 
& PaginaActual+1 &"><img src=""archivos/
icono_menu.gif"" border=0>&nbsp;
[Siguiente]</A>")
    Response.Write("</td></tr>")
 End If
End If
   response.write("</table>")

' ***** FIN *****
%>
__________________
Tu portal de manga y anime.

Última edición por meru-kun; 28/03/2003 a las 09:39