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

· 13년 전 · 658
목록에 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,313
13년 전 조회 2,919
13년 전 조회 3,131
13년 전 조회 640
13년 전 조회 1,144
13년 전 조회 621
13년 전 조회 1,198
13년 전 조회 981
13년 전 조회 866
13년 전 조회 1,182
13년 전 조회 455
13년 전 조회 1,853
13년 전 조회 1,590
13년 전 조회 1,322
13년 전 조회 756
13년 전 조회 1,243
13년 전 조회 1,455
13년 전 조회 1,061
13년 전 조회 2,239
13년 전 조회 905
13년 전 조회 633
13년 전 조회 819
13년 전 조회 3,605
13년 전 조회 2,490
13년 전 조회 1,043
13년 전 조회 1,217
13년 전 조회 2,606
13년 전 조회 1,608
13년 전 조회 777
13년 전 조회 836
13년 전 조회 2,239
13년 전 조회 727
13년 전 조회 974
13년 전 조회 481
13년 전 조회 626
13년 전 조회 1,367
13년 전 조회 2,904
13년 전 조회 667
13년 전 조회 933
13년 전 조회 1,317
13년 전 조회 732
13년 전 조회 2,349
13년 전 조회 950
13년 전 조회 1,624
13년 전 조회 1,864
13년 전 조회 1,687
13년 전 조회 999
13년 전 조회 1,287
13년 전 조회 805
13년 전 조회 659
13년 전 조회 1,325
13년 전 조회 1,018
13년 전 조회 864
13년 전 조회 780
13년 전 조회 954
13년 전 조회 734
13년 전 조회 1,259
13년 전 조회 964
13년 전 조회 666
13년 전 조회 1,266
13년 전 조회 892
13년 전 조회 1,632
13년 전 조회 1,052
13년 전 조회 3,530
13년 전 조회 1,590
13년 전 조회 2,180
13년 전 조회 808
13년 전 조회 468
13년 전 조회 1,144
13년 전 조회 1,933
13년 전 조회 827
13년 전 조회 2,074
13년 전 조회 770
13년 전 조회 1,125
13년 전 조회 1,827
13년 전 조회 1,145
13년 전 조회 811
13년 전 조회 1,512
13년 전 조회 3,821
13년 전 조회 539
13년 전 조회 607
13년 전 조회 801
13년 전 조회 3,928
13년 전 조회 1,278
13년 전 조회 1,450
13년 전 조회 1,468
13년 전 조회 770
13년 전 조회 645
13년 전 조회 791
13년 전 조회 1,595
13년 전 조회 969
13년 전 조회 1,296
13년 전 조회 2,495
13년 전 조회 962
13년 전 조회 1,282
13년 전 조회 1,392
13년 전 조회 745
13년 전 조회 3,490
13년 전 조회 1,254
13년 전 조회 2,770
🐛 버그신고