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

· 13년 전 · 1410
목록에 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년 전 조회 2,100
13년 전 조회 3,696
13년 전 조회 3,919
13년 전 조회 1,400
13년 전 조회 1,875
13년 전 조회 1,370
13년 전 조회 1,994
13년 전 조회 1,749
13년 전 조회 1,640
13년 전 조회 1,955
13년 전 조회 1,199
13년 전 조회 2,598
13년 전 조회 2,363
13년 전 조회 2,072
13년 전 조회 1,519
13년 전 조회 2,022
13년 전 조회 2,219
13년 전 조회 1,815
13년 전 조회 3,026
13년 전 조회 1,652
13년 전 조회 1,388
13년 전 조회 1,604
13년 전 조회 4,378
13년 전 조회 3,254
13년 전 조회 1,809
13년 전 조회 1,985
13년 전 조회 3,387
13년 전 조회 2,385
13년 전 조회 1,530
13년 전 조회 1,659
13년 전 조회 2,980
13년 전 조회 1,502
13년 전 조회 1,788
13년 전 조회 1,223
13년 전 조회 1,371
13년 전 조회 2,140
13년 전 조회 3,676
13년 전 조회 1,444
13년 전 조회 1,687
13년 전 조회 2,112
13년 전 조회 1,511
13년 전 조회 3,134
13년 전 조회 1,698
13년 전 조회 2,389
13년 전 조회 2,625
13년 전 조회 2,473
13년 전 조회 1,768
13년 전 조회 2,035
13년 전 조회 1,551
13년 전 조회 1,411
13년 전 조회 2,074
13년 전 조회 1,769
13년 전 조회 1,627
13년 전 조회 1,513
13년 전 조회 1,733
13년 전 조회 1,504
13년 전 조회 2,106
13년 전 조회 1,743
13년 전 조회 1,405
13년 전 조회 2,013
13년 전 조회 1,672
13년 전 조회 2,416
13년 전 조회 1,877
13년 전 조회 4,269
13년 전 조회 2,346
13년 전 조회 2,914
13년 전 조회 1,564
13년 전 조회 1,194
13년 전 조회 1,916
13년 전 조회 2,686
13년 전 조회 1,581
13년 전 조회 2,795
13년 전 조회 1,545
13년 전 조회 1,900
13년 전 조회 2,567
13년 전 조회 1,937
13년 전 조회 1,569
13년 전 조회 2,275
13년 전 조회 4,553
13년 전 조회 1,281
13년 전 조회 1,354
13년 전 조회 1,499
13년 전 조회 4,637
13년 전 조회 1,965
13년 전 조회 2,186
13년 전 조회 2,196
13년 전 조회 1,487
13년 전 조회 1,361
13년 전 조회 1,516
13년 전 조회 2,314
13년 전 조회 1,680
13년 전 조회 1,991
13년 전 조회 3,170
13년 전 조회 1,680
13년 전 조회 1,979
13년 전 조회 2,056
13년 전 조회 1,446
13년 전 조회 4,155
13년 전 조회 1,932
13년 전 조회 3,489