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$startrow = 0;
// First query to find out how many reco
// rds we have
$query = "Select * from ".$DBprefix."news ORDER BY postDate DESC";
// Number of records found
// Number of records you want to display
// per page
$display = 3;
$nav = $rqw["nave"];
//////////////////////////////
// Message when no records found
$XX = 'No hay resultados.';
// If there are no records then startrow
// is 0
$startrow=0;
}
// Actual query, watch the end of the qu
// ery, here's where we set the LIMIT per p
// age
$query2 = "Select * from ".$DBprefix."news ORDER BY postDate DESC LIMIT $startrow, $display";
//* I want only 3 results (in this case pictures) on 1 line, therefore i need a counter
aqui lo que se va a mostrar de las PAGINAS
}
// End loop
// Calculate the previous results, only
// print 'Previous' if startrow is not equa
// l to zero
if ($startrow != 0) {
$prevrow = $startrow - $display;
print("<a name='setlng' href=\"".$page_url."index.php?mod=news&startrow=$prevrow\">Anterior</a> "); // Of cource here you can send more
} //variables seperated by &
// Calculate the total number of pages
$pages = intval($num_record / $display); // $pages now contains number of pages n
// eeded unless there are left over from di
// vision
if ($num_record % $display) {
// has left over from division, so add one page
$pages++;
}
// Print the next pages, first check if
// there are more pages then 1
if ($pages > 1) {
for ($i=1; $i <= $pages; $i++) { // Begin loop
$nextrow = $display * ($i - 1);
print("<a href=\"".$page_url."index.php?mod=news&startrow=$nextrow\">$i</a> "); //\\ Also here you can send more
} //variables seperatd by &
}
//End loop
// Check if we are at the last page, if
// so, dont print 'Next'
if (!((round(($startrow / $display)+0.5)) == $pages) && $pages != 1) { // not the last page so print 'Next'
$nextrow = $startrow + $display;
print("<a name='setlng' href=\"".$page_url."index.php?mod=news&startrow=$nextrow\">Siguiente</a>");
}
// If there are no results at all
if ($num_record < 1) {
print("<table border=0 width='90%'><tr><td>{$XX}</td></tr></table>");
}