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

· 13년 전 · 709
목록에 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,365
13년 전 조회 2,966
13년 전 조회 3,188
13년 전 조회 694
13년 전 조회 1,189
13년 전 조회 678
13년 전 조회 1,253
13년 전 조회 1,034
13년 전 조회 924
13년 전 조회 1,215
13년 전 조회 500
13년 전 조회 1,892
13년 전 조회 1,636
13년 전 조회 1,368
13년 전 조회 814
13년 전 조회 1,290
13년 전 조회 1,496
13년 전 조회 1,114
13년 전 조회 2,281
13년 전 조회 940
13년 전 조회 676
13년 전 조회 868
13년 전 조회 3,648
13년 전 조회 2,531
13년 전 조회 1,086
13년 전 조회 1,255
13년 전 조회 2,659
13년 전 조회 1,662
13년 전 조회 818
13년 전 조회 879
13년 전 조회 2,281
13년 전 조회 778
13년 전 조회 1,028
13년 전 조회 532
13년 전 조회 677
13년 전 조회 1,410
13년 전 조회 2,953
13년 전 조회 720
13년 전 조회 968
13년 전 조회 1,361
13년 전 조회 778
13년 전 조회 2,403
13년 전 조회 998
13년 전 조회 1,675
13년 전 조회 1,908
13년 전 조회 1,735
13년 전 조회 1,051
13년 전 조회 1,334
13년 전 조회 851
13년 전 조회 710
13년 전 조회 1,371
13년 전 조회 1,062
13년 전 조회 910
13년 전 조회 824
13년 전 조회 994
13년 전 조회 771
13년 전 조회 1,307
13년 전 조회 1,015
13년 전 조회 713
13년 전 조회 1,307
13년 전 조회 936
13년 전 조회 1,673
13년 전 조회 1,107
13년 전 조회 3,569
13년 전 조회 1,629
13년 전 조회 2,221
13년 전 조회 848
13년 전 조회 524
13년 전 조회 1,195
13년 전 조회 1,972
13년 전 조회 871
13년 전 조회 2,111
13년 전 조회 828
13년 전 조회 1,179
13년 전 조회 1,865
13년 전 조회 1,191
13년 전 조회 852
13년 전 조회 1,562
13년 전 조회 3,863
13년 전 조회 586
13년 전 조회 663
13년 전 조회 851
13년 전 조회 3,966
13년 전 조회 1,323
13년 전 조회 1,498
13년 전 조회 1,517
13년 전 조회 819
13년 전 조회 688
13년 전 조회 833
13년 전 조회 1,644
13년 전 조회 1,010
13년 전 조회 1,336
13년 전 조회 2,535
13년 전 조회 1,006
13년 전 조회 1,316
13년 전 조회 1,439
13년 전 조회 793
13년 전 조회 3,535
13년 전 조회 1,290
13년 전 조회 2,813
🐛 버그신고