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

· 13년 전 · 636
목록에 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,274
13년 전 조회 2,880
13년 전 조회 3,086
13년 전 조회 601
13년 전 조회 1,106
13년 전 조회 583
13년 전 조회 1,164
13년 전 조회 946
13년 전 조회 831
13년 전 조회 1,156
13년 전 조회 422
13년 전 조회 1,811
13년 전 조회 1,555
13년 전 조회 1,286
13년 전 조회 720
13년 전 조회 1,207
13년 전 조회 1,421
13년 전 조회 1,024
13년 전 조회 2,202
13년 전 조회 862
13년 전 조회 593
13년 전 조회 777
13년 전 조회 3,566
13년 전 조회 2,452
13년 전 조회 1,009
13년 전 조회 1,180
13년 전 조회 2,575
13년 전 조회 1,568
13년 전 조회 741
13년 전 조회 805
13년 전 조회 2,204
13년 전 조회 694
13년 전 조회 942
13년 전 조회 438
13년 전 조회 591
13년 전 조회 1,321
13년 전 조회 2,870
13년 전 조회 632
13년 전 조회 892
13년 전 조회 1,278
13년 전 조회 696
13년 전 조회 2,314
13년 전 조회 914
13년 전 조회 1,589
13년 전 조회 1,830
13년 전 조회 1,648
13년 전 조회 964
13년 전 조회 1,259
13년 전 조회 766
13년 전 조회 637
13년 전 조회 1,289
13년 전 조회 977
13년 전 조회 828
13년 전 조회 747
13년 전 조회 913
13년 전 조회 699
13년 전 조회 1,218
13년 전 조회 928
13년 전 조회 627
13년 전 조회 1,228
13년 전 조회 856
13년 전 조회 1,594
13년 전 조회 1,018
13년 전 조회 3,494
13년 전 조회 1,559
13년 전 조회 2,149
13년 전 조회 777
13년 전 조회 428
13년 전 조회 1,110
13년 전 조회 1,901
13년 전 조회 797
13년 전 조회 2,035
13년 전 조회 736
13년 전 조회 1,087
13년 전 조회 1,793
13년 전 조회 1,116
13년 전 조회 773
13년 전 조회 1,474
13년 전 조회 3,784
13년 전 조회 501
13년 전 조회 575
13년 전 조회 757
13년 전 조회 3,903
13년 전 조회 1,243
13년 전 조회 1,419
13년 전 조회 1,433
13년 전 조회 734
13년 전 조회 607
13년 전 조회 753
13년 전 조회 1,569
13년 전 조회 931
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
🐛 버그신고