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

· 13년 전 · 675
목록에 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,327
13년 전 조회 2,939
13년 전 조회 3,153
13년 전 조회 661
13년 전 조회 1,163
13년 전 조회 649
13년 전 조회 1,218
13년 전 조회 1,005
13년 전 조회 891
13년 전 조회 1,191
13년 전 조회 474
13년 전 조회 1,865
13년 전 조회 1,610
13년 전 조회 1,341
13년 전 조회 777
13년 전 조회 1,265
13년 전 조회 1,473
13년 전 조회 1,086
13년 전 조회 2,258
13년 전 조회 918
13년 전 조회 646
13년 전 조회 836
13년 전 조회 3,622
13년 전 조회 2,503
13년 전 조회 1,059
13년 전 조회 1,223
13년 전 조회 2,625
13년 전 조회 1,636
13년 전 조회 791
13년 전 조회 853
13년 전 조회 2,255
13년 전 조회 749
13년 전 조회 995
13년 전 조회 495
13년 전 조회 641
13년 전 조회 1,378
13년 전 조회 2,923
13년 전 조회 689
13년 전 조회 944
13년 전 조회 1,334
13년 전 조회 750
13년 전 조회 2,370
13년 전 조회 966
13년 전 조회 1,643
13년 전 조회 1,879
13년 전 조회 1,699
13년 전 조회 1,023
13년 전 조회 1,307
13년 전 조회 832
13년 전 조회 676
13년 전 조회 1,346
13년 전 조회 1,033
13년 전 조회 875
13년 전 조회 797
13년 전 조회 974
13년 전 조회 748
13년 전 조회 1,270
13년 전 조회 988
13년 전 조회 681
13년 전 조회 1,282
13년 전 조회 905
13년 전 조회 1,648
13년 전 조회 1,071
13년 전 조회 3,545
13년 전 조회 1,602
13년 전 조회 2,194
13년 전 조회 826
13년 전 조회 487
13년 전 조회 1,163
13년 전 조회 1,950
13년 전 조회 846
13년 전 조회 2,086
13년 전 조회 792
13년 전 조회 1,146
13년 전 조회 1,845
13년 전 조회 1,163
13년 전 조회 836
13년 전 조회 1,533
13년 전 조회 3,838
13년 전 조회 554
13년 전 조회 625
13년 전 조회 816
13년 전 조회 3,942
13년 전 조회 1,294
13년 전 조회 1,464
13년 전 조회 1,482
13년 전 조회 789
13년 전 조회 664
13년 전 조회 810
13년 전 조회 1,610
13년 전 조회 983
13년 전 조회 1,316
13년 전 조회 2,509
13년 전 조회 978
13년 전 조회 1,298
13년 전 조회 1,407
13년 전 조회 760
13년 전 조회 3,505
13년 전 조회 1,266
13년 전 조회 2,789
🐛 버그신고