*jancis38* Posted January 5, 2011 Report Share Posted January 5, 2011 Kāds varētu man pastāstīt, kā sadalīt lappuses kā GIGN memberu sadaļā? Piemēram: ja skatos pirmo lappusi, tad man rāda iespējamās klikšķināmās lapas no 1 līdz 11, ja skatos 11 lappusi, tad man rāda iespējamās klikšķināmās lapas no 6 līdz 16 un 11 (current'ā) ir pa vidu. Jo es nevaru izdomāt... Link to comment Share on other sites More sharing options...
w4p1337 Posted January 5, 2011 Report Share Posted January 5, 2011 izmanto defektologs.lv pagination updeit skriptu. Tur ir tieši tākā tu domā. Manā citātu lapā arī tas pats tiek izmantots. Link to comment Share on other sites More sharing options...
Sh0n Posted January 6, 2011 Report Share Posted January 6, 2011 <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 More sharing options...
DoubleT Posted January 6, 2011 Report Share Posted January 6, 2011 #15 posts un vienā no pēdējiem postiem updeits ar mazo drukas kļūdu Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now