1
On the site I took over from a client, some pages have a pagination scheme. For example, a news page that shows record of 100 published news appear 7 news per page. The pagination will show me from 1 to 15. Here is the predefined code of the pagination:
<?php if(@$data['quantidade_paginas'] > 1){;?>
<div class="blocoPaginacao">
<div class="paginacao">
<span pg="anterior" class="btnSetaVoltar" style="opacity: 0"></span>
<span pg="anterior" class="linkControle font12" style="opacity: 0"> ANTERIOR </span>
<ul class="btsPaginacao">
<?php for($i=1; $i<=$data['quantidade_paginas']; $i++){ ?>
<li>
<span pg="<?php echo $i?>" pagina_="<?php echo $i?>" class="btnPaginar<?php echo ($i==1 ? ' Sel' : ''); ?>"> <?php echo $i?> </span>
</li>
<?php } ?>
</ul>
<span pg="proxima" class="linkControle font12"> PRÓXIMA </span>
<span pg="proxima" class="btnSetaAvancar"></span>
</div>
<input type="hidden" id="total_paginas" value="<?php echo $i-1?>">
<input type="hidden" id="pagina_atual" value="1">
</div>
<?php } ?>
The problem is if I have 50 pages. The paging scheme will show me 50 page numbers so I can choose. I wanted it to only appear from 1 to 10, for example. And clicking from 10, for example, start to appear from 11 to 19 and so on.
Have it be?
I don’t think it’ll do. For example, if I have 20 pages and I am on page 9: variable1 = 20*9 = 180 and variable2 = 180-20+1 = 161; why would I use these large variables?
– Gustavo Hoppe Levin