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

· 13년 전 · 1299
목록에 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,993
13년 전 조회 3,587
13년 전 조회 3,822
13년 전 조회 1,300
13년 전 조회 1,777
13년 전 조회 1,272
13년 전 조회 1,890
13년 전 조회 1,656
13년 전 조회 1,514
13년 전 조회 1,853
13년 전 조회 1,086
13년 전 조회 2,505
13년 전 조회 2,299
13년 전 조회 1,983
13년 전 조회 1,429
13년 전 조회 1,933
13년 전 조회 2,127
13년 전 조회 1,740
13년 전 조회 2,921
13년 전 조회 1,549
13년 전 조회 1,294
13년 전 조회 1,486
13년 전 조회 4,288
13년 전 조회 3,199
13년 전 조회 1,706
13년 전 조회 1,936
13년 전 조회 3,280
13년 전 조회 2,272
13년 전 조회 1,425
13년 전 조회 1,518
13년 전 조회 2,883
13년 전 조회 1,394
13년 전 조회 1,717
13년 전 조회 1,112
13년 전 조회 1,263
13년 전 조회 2,030
13년 전 조회 3,578
13년 전 조회 1,338
13년 전 조회 1,597
13년 전 조회 2,005
13년 전 조회 1,412
13년 전 조회 3,010
13년 전 조회 1,614
13년 전 조회 2,285
13년 전 조회 2,526
13년 전 조회 2,359
13년 전 조회 1,666
13년 전 조회 1,936
13년 전 조회 1,441
13년 전 조회 1,300
13년 전 조회 1,973
13년 전 조회 1,656
13년 전 조회 1,489
13년 전 조회 1,421
13년 전 조회 1,639
13년 전 조회 1,377
13년 전 조회 1,982
13년 전 조회 1,621
13년 전 조회 1,314
13년 전 조회 1,918
13년 전 조회 1,570
13년 전 조회 2,296
13년 전 조회 1,757
13년 전 조회 4,160
13년 전 조회 2,235
13년 전 조회 2,820
13년 전 조회 1,465
13년 전 조회 1,100
13년 전 조회 1,812
13년 전 조회 2,580
13년 전 조회 1,497
13년 전 조회 2,708
13년 전 조회 1,443
13년 전 조회 1,803
13년 전 조회 2,467
13년 전 조회 1,812
13년 전 조회 1,450
13년 전 조회 2,184
13년 전 조회 4,455
13년 전 조회 1,186
13년 전 조회 1,254
13년 전 조회 1,419
13년 전 조회 4,533
13년 전 조회 1,880
13년 전 조회 2,076
13년 전 조회 2,087
13년 전 조회 1,381
13년 전 조회 1,252
13년 전 조회 1,406
13년 전 조회 2,217
13년 전 조회 1,577
13년 전 조회 1,886
13년 전 조회 3,086
13년 전 조회 1,563
13년 전 조회 1,888
13년 전 조회 1,955
13년 전 조회 1,336
13년 전 조회 4,068
13년 전 조회 1,842
13년 전 조회 3,391