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

· 13년 전 · 637
목록에 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,275
13년 전 조회 2,884
13년 전 조회 3,091
13년 전 조회 604
13년 전 조회 1,107
13년 전 조회 586
13년 전 조회 1,168
13년 전 조회 949
13년 전 조회 833
13년 전 조회 1,157
13년 전 조회 424
13년 전 조회 1,812
13년 전 조회 1,557
13년 전 조회 1,288
13년 전 조회 721
13년 전 조회 1,210
13년 전 조회 1,424
13년 전 조회 1,027
13년 전 조회 2,203
13년 전 조회 866
13년 전 조회 597
13년 전 조회 779
13년 전 조회 3,567
13년 전 조회 2,454
13년 전 조회 1,013
13년 전 조회 1,184
13년 전 조회 2,579
13년 전 조회 1,570
13년 전 조회 747
13년 전 조회 808
13년 전 조회 2,206
13년 전 조회 699
13년 전 조회 945
13년 전 조회 442
13년 전 조회 594
13년 전 조회 1,327
13년 전 조회 2,877
13년 전 조회 636
13년 전 조회 896
13년 전 조회 1,286
13년 전 조회 700
13년 전 조회 2,317
13년 전 조회 917
13년 전 조회 1,592
13년 전 조회 1,833
13년 전 조회 1,649
13년 전 조회 966
13년 전 조회 1,263
13년 전 조회 769
13년 전 조회 638
13년 전 조회 1,294
13년 전 조회 983
13년 전 조회 834
13년 전 조회 750
13년 전 조회 915
13년 전 조회 701
13년 전 조회 1,223
13년 전 조회 935
13년 전 조회 632
13년 전 조회 1,232
13년 전 조회 860
13년 전 조회 1,599
13년 전 조회 1,022
13년 전 조회 3,496
13년 전 조회 1,563
13년 전 조회 2,151
13년 전 조회 780
13년 전 조회 430
13년 전 조회 1,112
13년 전 조회 1,905
13년 전 조회 800
13년 전 조회 2,038
13년 전 조회 739
13년 전 조회 1,091
13년 전 조회 1,795
13년 전 조회 1,118
13년 전 조회 777
13년 전 조회 1,478
13년 전 조회 3,786
13년 전 조회 507
13년 전 조회 578
13년 전 조회 762
13년 전 조회 3,904
13년 전 조회 1,250
13년 전 조회 1,421
13년 전 조회 1,438
13년 전 조회 736
13년 전 조회 613
13년 전 조회 757
13년 전 조회 1,572
13년 전 조회 934
13년 전 조회 1,269
13년 전 조회 2,467
13년 전 조회 927
13년 전 조회 1,251
13년 전 조회 1,364
13년 전 조회 711
13년 전 조회 3,463
13년 전 조회 1,222
13년 전 조회 2,736
🐛 버그신고