페이지 개수를 정하고 싶어요

· 13년 전 · 641
목록에 1~ 몇페이지 까지 있으면 다 출력이 되고 있어요  이걸 1-10개 정도만 보이게 하고 다음은 11~20 이런식으로 보일려고 해요 도와주세요

function PageControl($start,$total,$scale,$page_scale,$link,$pretxt='이전',$nexttxt='다음') {
global $PHP_SELF;
if ($total > 0) {
$totalpage = ceil($total/$scale);
$page = floor($start/($scale*$page_scale));
print "<table border='0' cellpadding='0' cellspacing='0' width='100%'>\n";
print "  <tr>\n";
print "    <td height='30' class='style9'>\n";
print "      <div style='text-align:center; clear:both; margin:5px 0 10px 0; padding:5px 0; font-family:gulim;'>\n";
print "      <div class='sel center'>\n";
print "          <img src='../img/btn_prev.gif'  align='absmiddle' onclick='window.location.href=\"$PHP_SELF?start=0$link\"'>\n";
       
if ($total > $scale) {
if($start+1>$scale*$page_scale) {
$pre_start=($page-1)*$scale*$page_scale;
print "          <a href='$PHP_SELF?start=$pre_start$link'>$pretxt</a>\n";
}
}
for ($vj=0;$vj<$page_scale;$vj++) {
$ln = ($page*$page_scale+$vj)*$scale;
$page_num = $page*$page_scale+$vj+1;
if ($ln < $total) {
if ($vj>0) {
print "";
}
if($ln!=$start) {
print "          <span class='style9'><a href='$PHP_SELF?start=$ln$link'>$page_num</a></span>\n";
}
else {
print "          <strong>$page_num</strong>\n";
}
}
}
if ($total > (($page+1) * $scale * $page_scale)) {
$n_start=($page+1)*$scale*$page_scale;
print "          <td style='padding:0 5 0 5;'><a href='$PHP_SELF?start=$n_start$link'>$nexttxt</a></td>\n";
}
//print "        <img src='../img/btn_next.gif'  align='absmiddle' onclick='window.location.href=\"$PHP_SELF?start=$ln$link\"'>\n";
print "        </div>\n";
print "      </div>\n";
print "    </td>\n";
print "  </tr>\n";
print "</table>\n";
}
}
|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,280
13년 전 조회 2,885
13년 전 조회 3,093
13년 전 조회 606
13년 전 조회 1,109
13년 전 조회 588
13년 전 조회 1,168
13년 전 조회 952
13년 전 조회 837
13년 전 조회 1,158
13년 전 조회 425
13년 전 조회 1,814
13년 전 조회 1,559
13년 전 조회 1,290
13년 전 조회 723
13년 전 조회 1,211
13년 전 조회 1,425
13년 전 조회 1,029
13년 전 조회 2,205
13년 전 조회 870
13년 전 조회 598
13년 전 조회 781
13년 전 조회 3,570
13년 전 조회 2,455
13년 전 조회 1,016
13년 전 조회 1,185
13년 전 조회 2,579
13년 전 조회 1,574
13년 전 조회 748
13년 전 조회 812
13년 전 조회 2,207
13년 전 조회 703
13년 전 조회 948
13년 전 조회 444
13년 전 조회 597
13년 전 조회 1,327
13년 전 조회 2,878
13년 전 조회 640
13년 전 조회 897
13년 전 조회 1,290
13년 전 조회 701
13년 전 조회 2,319
13년 전 조회 920
13년 전 조회 1,596
13년 전 조회 1,834
13년 전 조회 1,655
13년 전 조회 970
13년 전 조회 1,265
13년 전 조회 769
13년 전 조회 642
13년 전 조회 1,294
13년 전 조회 984
13년 전 조회 835
13년 전 조회 752
13년 전 조회 916
13년 전 조회 704
13년 전 조회 1,225
13년 전 조회 936
13년 전 조회 634
13년 전 조회 1,234
13년 전 조회 865
13년 전 조회 1,600
13년 전 조회 1,023
13년 전 조회 3,500
13년 전 조회 1,564
13년 전 조회 2,152
13년 전 조회 780
13년 전 조회 434
13년 전 조회 1,115
13년 전 조회 1,906
13년 전 조회 803
13년 전 조회 2,042
13년 전 조회 744
13년 전 조회 1,093
13년 전 조회 1,799
13년 전 조회 1,121
13년 전 조회 777
13년 전 조회 1,478
13년 전 조회 3,789
13년 전 조회 510
13년 전 조회 581
13년 전 조회 767
13년 전 조회 3,906
13년 전 조회 1,253
13년 전 조회 1,424
13년 전 조회 1,441
13년 전 조회 740
13년 전 조회 613
13년 전 조회 759
13년 전 조회 1,575
13년 전 조회 936
13년 전 조회 1,272
13년 전 조회 2,469
13년 전 조회 930
13년 전 조회 1,253
13년 전 조회 1,364
13년 전 조회 713
13년 전 조회 3,466
13년 전 조회 1,224
13년 전 조회 2,739
🐛 버그신고