Eccolo 
Codice PHP:
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require_once('admin/config.php');
$num_page = (!isset($_GET['pag']) || empty($_GET['pag']) ? 0 : $_GET['pag']);
$perpage = 8;
$query = "SELECT count(*) as conta FROM pagine";
$res = mysql_query($query);
list($conta) = mysql_fetch_array($res);
?>
<?php
$query = "SELECT * FROM pagine order by id limit $num_page, $perpage ";
$res = mysql_query($query);
while($row = mysql_fetch_array($res)) {
$html .= "<a href='#' onClick=\"java-script: opensite('more.php?id=$row[id]',0 ,screen.availWidth, screen.availHeight)\">";
$html .= "<div id='new' title='Clicca e approfondisci'>";
$html .= "<div id='data'>";
$html .= "<div id='day'>";
$html .= "$row[giorno]";
$html .= "</div>";
$mese = $row[mese];
$mese_mod = substr($mese,0,3);
$html .= "$mese_mod";
$html .= "</div>";
$html .= "<div id='sezione'>";
$html .= "$row[sezione]";
$html .= "</div>";
$html .= "<div id='titolo'>";
$titolo = "$row[titolo]";
$preview = substr($titolo,0 , 250);
$html .= "$preview" ."
";
$html .= "</div>";
$html .= "<div id='img_news'></div>";
$html .= "</div>";
$html .="</a>";
}
echo $html;
?>
Pagina:
<?php
//----- Numero di pagine
$x = $conta/$perpage ;
$y = (integer) $x;
//
if ( $x <> $y ) { $x++; }
$numPagine = $x;
$index = 1;
while ($index <= $numPagine) {
$inizio = ($index - 1) * $perpage;
if ($inizio == $numpage) {
print $index; // METTI QUELLO CHE VUOI
} else { ?>
<a style="color:#BC040E;text-decoration:none" href=news.php?pag=<?php print $inizio ?>>
<?php print $index ?>
</a><?php
} // if ($inizio == $numpage)
$index++;
} // while ($index <= $numPagine)
?>