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

· 13년 전 · 639
목록에 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년 전 조회 587
13년 전 조회 1,168
13년 전 조회 951
13년 전 조회 836
13년 전 조회 1,158
13년 전 조회 424
13년 전 조회 1,814
13년 전 조회 1,559
13년 전 조회 1,289
13년 전 조회 723
13년 전 조회 1,210
13년 전 조회 1,425
13년 전 조회 1,028
13년 전 조회 2,204
13년 전 조회 870
13년 전 조회 598
13년 전 조회 781
13년 전 조회 3,569
13년 전 조회 2,454
13년 전 조회 1,016
13년 전 조회 1,184
13년 전 조회 2,579
13년 전 조회 1,573
13년 전 조회 748
13년 전 조회 811
13년 전 조회 2,207
13년 전 조회 702
13년 전 조회 948
13년 전 조회 444
13년 전 조회 597
13년 전 조회 1,327
13년 전 조회 2,877
13년 전 조회 639
13년 전 조회 897
13년 전 조회 1,290
13년 전 조회 700
13년 전 조회 2,318
13년 전 조회 919
13년 전 조회 1,596
13년 전 조회 1,834
13년 전 조회 1,654
13년 전 조회 968
13년 전 조회 1,264
13년 전 조회 769
13년 전 조회 640
13년 전 조회 1,294
13년 전 조회 983
13년 전 조회 834
13년 전 조회 751
13년 전 조회 916
13년 전 조회 704
13년 전 조회 1,224
13년 전 조회 935
13년 전 조회 633
13년 전 조회 1,234
13년 전 조회 864
13년 전 조회 1,599
13년 전 조회 1,023
13년 전 조회 3,499
13년 전 조회 1,563
13년 전 조회 2,152
13년 전 조회 780
13년 전 조회 432
13년 전 조회 1,115
13년 전 조회 1,906
13년 전 조회 803
13년 전 조회 2,041
13년 전 조회 743
13년 전 조회 1,093
13년 전 조회 1,798
13년 전 조회 1,120
13년 전 조회 777
13년 전 조회 1,478
13년 전 조회 3,789
13년 전 조회 508
13년 전 조회 581
13년 전 조회 765
13년 전 조회 3,905
13년 전 조회 1,252
13년 전 조회 1,423
13년 전 조회 1,441
13년 전 조회 739
13년 전 조회 613
13년 전 조회 758
13년 전 조회 1,574
13년 전 조회 935
13년 전 조회 1,271
13년 전 조회 2,469
13년 전 조회 930
13년 전 조회 1,253
13년 전 조회 1,364
13년 전 조회 711
13년 전 조회 3,465
13년 전 조회 1,223
13년 전 조회 2,738
🐛 버그신고