Jump to content
GIGN Forum

Pagination


*jancis38*
 Share

Recommended Posts

<center>

<?php

$iepriekseejaa_lapa = $lapa-1;

$naakoshaa_lapa = $lapa+1;

$rakstu_skaits_datubaazee = mysql_result(mysql_query("SELECT COUNT(*) FROM raksti"),0,'COUNT(*)');

?>

<table width='100%' align='left'>

<tr>

<td>

<div id="pages">

<?php

if($rakstu_skaits_datubazee / $raksti_1_lapaa > 1){

echo $lapa > 0 ? '<a href="index.php?lapa='.(int)$iepriekseejaa_lapa.'">«</a>' : '';

$current = 0;

while($current < $rakstu_skaits_datubaazee/$raksti_1_lapaa){

if($lapa == $current){

echo '<span class="current">'.($current + 1).'</span>';

}

else{

echo '<a href="index.php?lapa='.(int)$current.'">«</a>';

}

$current++;

}

echo $rakstu_skaits_datubaazee > $raksti_1_lapaa*$lapa+$raksti_1_lapaa ? '<a href="index.php?lapa='.(int)$naakoshaa_lapa.'">»</a>' : '';

}

else{

echo '<span class="current">1</span>';

}

?>

</div>

</td>

</tr>

</table>

</center>

Neesmu testējis ja kautkas nesanāk raksti te pat!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...