Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/02/2014, 14:33
blackmel25
 
Fecha de Ingreso: enero-2010
Mensajes: 59
Antigüedad: 14 años, 3 meses
Puntos: 0
Pregunta como hacer lista de paginacion?

hola

tengo un paginador creado (lo hice en dreamweaver) pero no tengo la lista donde estan los enlces numericos para ir directamente a cada pagina (no me gusto el estilo que tenia dreamweaver, por eso no use ese), necestio hacer esa lista y quisisera que cuando el enlace este en la misma pagina este se resalta o se diferencie de los demas pero no se como

desde ya gracias y espero sus respuesta :D

mas abajo pondre el codigo

Código PHP:
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$currentPage $_SERVER["PHP_SELF"];

$maxRows_KLKEstoSeBorraraKLK 2;
$pageNum_KLKEstoSeBorraraKLK 0;
if (isset(
$_GET['pageNum_KLKEstoSeBorraraKLK'])) {
  
$pageNum_KLKEstoSeBorraraKLK $_GET['pageNum_KLKEstoSeBorraraKLK'];
}
$startRow_KLKEstoSeBorraraKLK $pageNum_KLKEstoSeBorraraKLK $maxRows_KLKEstoSeBorraraKLK;

mysql_select_db($database_conexionpeli$conexionpeli);
$query_KLKEstoSeBorraraKLK "SELECT * FROM tbpelicula ORDER BY tbpelicula.id_pelicula DESC";
$query_limit_KLKEstoSeBorraraKLK sprintf("%s LIMIT %d, %d"$query_KLKEstoSeBorraraKLK$startRow_KLKEstoSeBorraraKLK$maxRows_KLKEstoSeBorraraKLK);
$KLKEstoSeBorraraKLK mysql_query($query_limit_KLKEstoSeBorraraKLK$conexionpeli) or die(mysql_error());
$row_KLKEstoSeBorraraKLK mysql_fetch_assoc($KLKEstoSeBorraraKLK);

if (isset(
$_GET['totalRows_KLKEstoSeBorraraKLK'])) {
  
$totalRows_KLKEstoSeBorraraKLK $_GET['totalRows_KLKEstoSeBorraraKLK'];
} else {
  
$all_KLKEstoSeBorraraKLK mysql_query($query_KLKEstoSeBorraraKLK);
  
$totalRows_KLKEstoSeBorraraKLK mysql_num_rows($all_KLKEstoSeBorraraKLK);
}
$totalPages_KLKEstoSeBorraraKLK ceil($totalRows_KLKEstoSeBorraraKLK/$maxRows_KLKEstoSeBorraraKLK)-1;

$queryString_KLKEstoSeBorraraKLK "";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_KLKEstoSeBorraraKLK") == false && 
        
stristr($param"totalRows_KLKEstoSeBorraraKLK") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_KLKEstoSeBorraraKLK "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_KLKEstoSeBorraraKLK sprintf("&totalRows_KLKEstoSeBorraraKLK=%d%s"$totalRows_KLKEstoSeBorraraKLK$queryString_KLKEstoSeBorraraKLK);

?>
Código HTML:
 <table border="0">
        <tr>
          <td></td>
          <td><?php if ($pageNum_KLKEstoSeBorraraKLK > 0) { // Show if not first page ?>
              <a href="<?php printf("%s?pageNum_KLKEstoSeBorraraKLK=%d%s", $currentPage, max(0, $pageNum_KLKEstoSeBorraraKLK - 1), $queryString_KLKEstoSeBorraraKLK); ?>"><img src="Previous.gif" /></a>
          <?php } // Show if not first page ?></td>
              <td>
            
                 aqui va la lista
            
              </td>
          <td><?php if ($pageNum_KLKEstoSeBorraraKLK < $totalPages_KLKEstoSeBorraraKLK) { // Show if not last page ?>
              <a href="<?php printf("%s?pageNum_KLKEstoSeBorraraKLK=%d%s", $currentPage, min($totalPages_KLKEstoSeBorraraKLK, $pageNum_KLKEstoSeBorraraKLK + 1), $queryString_KLKEstoSeBorraraKLK); ?>"><img src="Next.gif" /></a>
          <?php } // Show if not last page ?></td>
        </tr>
      </table>