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

· 13년 전 · 632
목록에 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,273
13년 전 조회 2,879
13년 전 조회 3,086
13년 전 조회 600
13년 전 조회 1,104
13년 전 조회 583
13년 전 조회 1,164
13년 전 조회 945
13년 전 조회 830
13년 전 조회 1,155
13년 전 조회 420
13년 전 조회 1,809
13년 전 조회 1,552
13년 전 조회 1,283
13년 전 조회 719
13년 전 조회 1,205
13년 전 조회 1,420
13년 전 조회 1,022
13년 전 조회 2,200
13년 전 조회 861
13년 전 조회 592
13년 전 조회 776
13년 전 조회 3,564
13년 전 조회 2,450
13년 전 조회 1,008
13년 전 조회 1,178
13년 전 조회 2,574
13년 전 조회 1,567
13년 전 조회 740
13년 전 조회 803
13년 전 조회 2,202
13년 전 조회 692
13년 전 조회 942
13년 전 조회 436
13년 전 조회 589
13년 전 조회 1,321
13년 전 조회 2,868
13년 전 조회 629
13년 전 조회 889
13년 전 조회 1,278
13년 전 조회 694
13년 전 조회 2,313
13년 전 조회 913
13년 전 조회 1,588
13년 전 조회 1,828
13년 전 조회 1,646
13년 전 조회 963
13년 전 조회 1,259
13년 전 조회 765
13년 전 조회 633
13년 전 조회 1,287
13년 전 조회 976
13년 전 조회 827
13년 전 조회 746
13년 전 조회 912
13년 전 조회 699
13년 전 조회 1,216
13년 전 조회 928
13년 전 조회 626
13년 전 조회 1,228
13년 전 조회 855
13년 전 조회 1,594
13년 전 조회 1,017
13년 전 조회 3,494
13년 전 조회 1,559
13년 전 조회 2,148
13년 전 조회 776
13년 전 조회 427
13년 전 조회 1,109
13년 전 조회 1,901
13년 전 조회 797
13년 전 조회 2,035
13년 전 조회 736
13년 전 조회 1,086
13년 전 조회 1,793
13년 전 조회 1,116
13년 전 조회 773
13년 전 조회 1,473
13년 전 조회 3,783
13년 전 조회 501
13년 전 조회 574
13년 전 조회 757
13년 전 조회 3,902
13년 전 조회 1,243
13년 전 조회 1,417
13년 전 조회 1,432
13년 전 조회 732
13년 전 조회 606
13년 전 조회 752
13년 전 조회 1,569
13년 전 조회 930
13년 전 조회 1,267
13년 전 조회 2,466
13년 전 조회 926
13년 전 조회 1,250
13년 전 조회 1,358
13년 전 조회 705
13년 전 조회 3,461
13년 전 조회 1,221
13년 전 조회 2,734
🐛 버그신고