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

· 13년 전 · 650
목록에 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,296
13년 전 조회 2,900
13년 전 조회 3,110
13년 전 조회 622
13년 전 조회 1,131
13년 전 조회 606
13년 전 조회 1,183
13년 전 조회 968
13년 전 조회 853
13년 전 조회 1,169
13년 전 조회 440
13년 전 조회 1,833
13년 전 조회 1,578
13년 전 조회 1,305
13년 전 조회 743
13년 전 조회 1,225
13년 전 조회 1,440
13년 전 조회 1,046
13년 전 조회 2,221
13년 전 조회 886
13년 전 조회 613
13년 전 조회 798
13년 전 조회 3,586
13년 전 조회 2,472
13년 전 조회 1,030
13년 전 조회 1,200
13년 전 조회 2,596
13년 전 조회 1,588
13년 전 조회 765
13년 전 조회 824
13년 전 조회 2,223
13년 전 조회 715
13년 전 조회 967
13년 전 조회 463
13년 전 조회 614
13년 전 조회 1,350
13년 전 조회 2,891
13년 전 조회 654
13년 전 조회 915
13년 전 조회 1,304
13년 전 조회 718
13년 전 조회 2,337
13년 전 조회 934
13년 전 조회 1,615
13년 전 조회 1,847
13년 전 조회 1,669
13년 전 조회 987
13년 전 조회 1,276
13년 전 조회 790
13년 전 조회 651
13년 전 조회 1,309
13년 전 조회 1,001
13년 전 조회 850
13년 전 조회 772
13년 전 조회 935
13년 전 조회 722
13년 전 조회 1,241
13년 전 조회 954
13년 전 조회 652
13년 전 조회 1,251
13년 전 조회 882
13년 전 조회 1,617
13년 전 조회 1,045
13년 전 조회 3,515
13년 전 조회 1,578
13년 전 조회 2,168
13년 전 조회 794
13년 전 조회 452
13년 전 조회 1,134
13년 전 조회 1,922
13년 전 조회 819
13년 전 조회 2,059
13년 전 조회 761
13년 전 조회 1,112
13년 전 조회 1,819
13년 전 조회 1,133
13년 전 조회 798
13년 전 조회 1,496
13년 전 조회 3,804
13년 전 조회 525
13년 전 조회 595
13년 전 조회 779
13년 전 조회 3,917
13년 전 조회 1,270
13년 전 조회 1,439
13년 전 조회 1,457
13년 전 조회 755
13년 전 조회 631
13년 전 조회 775
13년 전 조회 1,590
13년 전 조회 957
13년 전 조회 1,288
13년 전 조회 2,486
13년 전 조회 946
13년 전 조회 1,272
13년 전 조회 1,383
13년 전 조회 731
13년 전 조회 3,481
13년 전 조회 1,241
13년 전 조회 2,753
🐛 버그신고