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

· 13년 전 · 1203
목록에 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,885
13년 전 조회 3,477
13년 전 조회 3,706
13년 전 조회 1,195
13년 전 조회 1,672
13년 전 조회 1,151
13년 전 조회 1,761
13년 전 조회 1,547
13년 전 조회 1,411
13년 전 조회 1,747
13년 전 조회 980
13년 전 조회 2,404
13년 전 조회 2,231
13년 전 조회 1,889
13년 전 조회 1,322
13년 전 조회 1,823
13년 전 조회 2,025
13년 전 조회 1,635
13년 전 조회 2,811
13년 전 조회 1,445
13년 전 조회 1,173
13년 전 조회 1,377
13년 전 조회 4,181
13년 전 조회 3,122
13년 전 조회 1,611
13년 전 조회 1,865
13년 전 조회 3,164
13년 전 조회 2,161
13년 전 조회 1,297
13년 전 조회 1,400
13년 전 조회 2,774
13년 전 조회 1,288
13년 전 조회 1,641
13년 전 조회 1,009
13년 전 조회 1,160
13년 전 조회 1,906
13년 전 조회 3,454
13년 전 조회 1,223
13년 전 조회 1,486
13년 전 조회 1,907
13년 전 조회 1,307
13년 전 조회 2,911
13년 전 조회 1,495
13년 전 조회 2,168
13년 전 조회 2,412
13년 전 조회 2,240
13년 전 조회 1,567
13년 전 조회 1,819
13년 전 조회 1,340
13년 전 조회 1,204
13년 전 조회 1,872
13년 전 조회 1,555
13년 전 조회 1,386
13년 전 조회 1,304
13년 전 조회 1,520
13년 전 조회 1,267
13년 전 조회 1,860
13년 전 조회 1,521
13년 전 조회 1,222
13년 전 조회 1,811
13년 전 조회 1,453
13년 전 조회 2,183
13년 전 조회 1,660
13년 전 조회 4,061
13년 전 조회 2,124
13년 전 조회 2,710
13년 전 조회 1,361
13년 전 조회 1,006
13년 전 조회 1,695
13년 전 조회 2,472
13년 전 조회 1,384
13년 전 조회 2,604
13년 전 조회 1,330
13년 전 조회 1,681
13년 전 조회 2,362
13년 전 조회 1,699
13년 전 조회 1,349
13년 전 조회 2,076
13년 전 조회 4,361
13년 전 조회 1,086
13년 전 조회 1,150
13년 전 조회 1,326
13년 전 조회 4,431
13년 전 조회 1,785
13년 전 조회 1,989
13년 전 조회 2,002
13년 전 조회 1,289
13년 전 조회 1,157
13년 전 조회 1,315
13년 전 조회 2,118
13년 전 조회 1,477
13년 전 조회 1,797
13년 전 조회 2,998
13년 전 조회 1,470
13년 전 조회 1,789
13년 전 조회 1,873
13년 전 조회 1,238
13년 전 조회 3,984
13년 전 조회 1,757
13년 전 조회 3,298