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

· 13년 전 · 1265
목록에 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,949
13년 전 조회 3,546
13년 전 조회 3,774
13년 전 조회 1,261
13년 전 조회 1,748
13년 전 조회 1,223
13년 전 조회 1,845
13년 전 조회 1,611
13년 전 조회 1,475
13년 전 조회 1,816
13년 전 조회 1,048
13년 전 조회 2,470
13년 전 조회 2,279
13년 전 조회 1,946
13년 전 조회 1,393
13년 전 조회 1,896
13년 전 조회 2,092
13년 전 조회 1,694
13년 전 조회 2,885
13년 전 조회 1,514
13년 전 조회 1,255
13년 전 조회 1,442
13년 전 조회 4,247
13년 전 조회 3,176
13년 전 조회 1,679
13년 전 조회 1,918
13년 전 조회 3,237
13년 전 조회 2,232
13년 전 조회 1,382
13년 전 조회 1,476
13년 전 조회 2,846
13년 전 조회 1,359
13년 전 조회 1,695
13년 전 조회 1,086
13년 전 조회 1,235
13년 전 조회 1,988
13년 전 조회 3,537
13년 전 조회 1,303
13년 전 조회 1,563
13년 전 조회 1,966
13년 전 조회 1,371
13년 전 조회 2,978
13년 전 조회 1,567
13년 전 조회 2,234
13년 전 조회 2,491
13년 전 조회 2,315
13년 전 조회 1,629
13년 전 조회 1,899
13년 전 조회 1,403
13년 전 조회 1,266
13년 전 조회 1,938
13년 전 조회 1,628
13년 전 조회 1,452
13년 전 조회 1,367
13년 전 조회 1,592
13년 전 조회 1,340
13년 전 조회 1,930
13년 전 조회 1,585
13년 전 조회 1,282
13년 전 조회 1,874
13년 전 조회 1,526
13년 전 조회 2,262
13년 전 조회 1,718
13년 전 조회 4,127
13년 전 조회 2,198
13년 전 조회 2,780
13년 전 조회 1,429
13년 전 조회 1,065
13년 전 조회 1,770
13년 전 조회 2,541
13년 전 조회 1,461
13년 전 조회 2,677
13년 전 조회 1,409
13년 전 조회 1,750
13년 전 조회 2,430
13년 전 조회 1,779
13년 전 조회 1,418
13년 전 조회 2,148
13년 전 조회 4,424
13년 전 조회 1,152
13년 전 조회 1,217
13년 전 조회 1,383
13년 전 조회 4,497
13년 전 조회 1,846
13년 전 조회 2,045
13년 전 조회 2,056
13년 전 조회 1,346
13년 전 조회 1,205
13년 전 조회 1,371
13년 전 조회 2,187
13년 전 조회 1,542
13년 전 조회 1,856
13년 전 조회 3,051
13년 전 조회 1,533
13년 전 조회 1,857
13년 전 조회 1,928
13년 전 조회 1,295
13년 전 조회 4,042
13년 전 조회 1,811
13년 전 조회 3,359