Foros del Web » Programando para Internet » PHP »

Paginador

Estas en el tema de Paginador en el foro de PHP en Foros del Web. Hola amigos.. quería consultarles si conocen donde puedo bajar un paginador que funcione con register_globals = OFF. Sé que hay uno dando vueltas de un ...
  #1 (permalink)  
Antiguo 28/07/2011, 09:37
 
Fecha de Ingreso: marzo-2011
Ubicación: Argentina
Mensajes: 3
Antigüedad: 13 años, 1 mes
Puntos: 0
Paginador

Hola amigos.. quería consultarles si conocen donde puedo bajar un paginador que funcione con register_globals = OFF. Sé que hay uno dando vueltas de un tal Jpinedo pero no logro conectarme son su sitio.. Alguno tiene referencias del mismo?
  #2 (permalink)  
Antiguo 28/07/2011, 09:45
Avatar de Eleazan  
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Paginador

Mira este si te vale
http://www.forosdelweb.com/f18/aport...ing-v2-638538/

(Lo he encontrado en el post de Aportes ;) )
  #3 (permalink)  
Antiguo 28/07/2011, 14:17
 
Fecha de Ingreso: marzo-2011
Ubicación: Argentina
Mensajes: 3
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Paginador

Intenté ver esa página pero se ve que el link no está. :(
  #4 (permalink)  
Antiguo 28/07/2011, 14:29
Avatar de jotaincubus  
Fecha de Ingreso: mayo-2005
Ubicación: Medellin - Colombia
Mensajes: 1.797
Antigüedad: 18 años, 11 meses
Puntos: 394
Respuesta: Paginador

Pues a mi me abre sin ningún problema...
__________________
Por que existe gente que no agradece después de que se le ha brindado tiempo y ayuda ???
  #5 (permalink)  
Antiguo 28/07/2011, 14:32
Avatar de anacona16  
Fecha de Ingreso: marzo-2010
Ubicación: Bogota DC
Mensajes: 610
Antigüedad: 14 años, 1 mes
Puntos: 52
Respuesta: Paginador

Igual a mi!!!

Pero siempre que hablan de paginador en FW yo recomiendo este http://objetivophp.com/?p=101
__________________
Aprendiendo!!!
  #6 (permalink)  
Antiguo 28/07/2011, 17:28
 
Fecha de Ingreso: septiembre-2009
Ubicación: Queretaro
Mensajes: 51
Antigüedad: 14 años, 7 meses
Puntos: 2
Respuesta: Paginador

bueno este implemento con mi sistema tengo algo de prisa hay q depurar el código y q esta adaptado a mi web pero espero q sea aporte.
no he leido ningún post, entonces no se si ya lo solucionaron solo leí el titulo y estoy posteando, una disculpa :).

saludos.

Código PHP:
Ver original
  1. $startrow = 0;
  2.     // First query to find out how many reco
  3.     //     rds we have
  4.     $query = "Select * from ".$DBprefix."news ORDER BY postDate DESC";
  5.     $result = mysql_query($query);
  6.     // Number of records found
  7.     $num_record = mysql_num_rows($result);
  8.     // Number of records you want to display
  9.     //     per page
  10.    
  11.  
  12.     $display = 3;
  13.     $nav = $rqw["nave"];    
  14.    
  15.    
  16.    
  17.  
  18.  
  19. //////////////////////////////
  20.  
  21.     // Message when no records found
  22.     $XX = 'No hay resultados.';
  23.     // If there are no records then startrow
  24.     //     is 0
  25.     if (empty($startrow)) {
  26.     $startrow=0;
  27.     }
  28.     // Actual query, watch the end of the qu
  29.     //     ery, here's where we set the LIMIT per p
  30.     //     age
  31.     $query2 = "Select * from ".$DBprefix."news ORDER BY postDate DESC LIMIT $startrow, $display";
  32.     $result2 = mysql_query($query2);
  33.     //* I want only 3 results (in this case pictures) on 1 line, therefore i need a counter
  34. while($row = mysql_fetch_array($result2)){
  35.  
  36. aqui lo que se va a mostrar de las PAGINAS
  37.  
  38. }
  39.  
  40. // End loop
  41.     // Calculate the previous results, only
  42.     //     print 'Previous' if startrow is not equa
  43.     //     l to zero
  44.     if ($startrow != 0) {
  45.     $prevrow = $startrow - $display;
  46.     print("<a name='setlng' href=\"".$page_url."index.php?mod=news&amp;startrow=$prevrow\">Anterior</a> "); // Of cource here you can send more
  47.     } //variables seperated by &
  48.     // Calculate the total number of pages
  49.     $pages = intval($num_record / $display);
  50.     // $pages now contains number of pages n
  51.     //     eeded unless there are left over from di
  52.     //     vision
  53.     if ($num_record % $display) {
  54.         // has left over from division, so add one page
  55.     $pages++;
  56.     }
  57.     // Print the next pages, first check if
  58.     //     there are more pages then 1
  59.     if ($pages > 1) {
  60.     for ($i=1; $i <= $pages; $i++) { // Begin loop
  61.     $nextrow = $display * ($i - 1);
  62.     print("<a href=\"".$page_url."index.php?mod=news&amp;startrow=$nextrow\">$i</a>  "); //\\ Also here you can send more
  63.     } //variables seperatd by &
  64.     }
  65.     //End loop
  66.     // Check if we are at the last page, if
  67.     //     so, dont print 'Next'
  68.     if (!((round(($startrow / $display)+0.5)) == $pages) && $pages != 1)  {
  69.     // not the last page so print 'Next'
  70.     $nextrow = $startrow + $display;
  71.     print("<a name='setlng' href=\"".$page_url."index.php?mod=news&amp;startrow=$nextrow\">Siguiente</a>");
  72.     }
  73.     // If there are no results at all
  74.     if ($num_record < 1) {
  75.     print("<table border=0 width='90%'><tr><td>{$XX}</td></tr></table>");
  76.     }

Última edición por Curda; 28/07/2011 a las 17:35

Etiquetas: paginador
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:19.