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

· 13년 전 · 643
목록에 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,280
13년 전 조회 2,886
13년 전 조회 3,093
13년 전 조회 607
13년 전 조회 1,111
13년 전 조회 589
13년 전 조회 1,168
13년 전 조회 952
13년 전 조회 837
13년 전 조회 1,158
13년 전 조회 426
13년 전 조회 1,814
13년 전 조회 1,559
13년 전 조회 1,291
13년 전 조회 725
13년 전 조회 1,211
13년 전 조회 1,427
13년 전 조회 1,029
13년 전 조회 2,206
13년 전 조회 871
13년 전 조회 599
13년 전 조회 782
13년 전 조회 3,571
13년 전 조회 2,457
13년 전 조회 1,017
13년 전 조회 1,185
13년 전 조회 2,581
13년 전 조회 1,576
13년 전 조회 750
13년 전 조회 813
13년 전 조회 2,209
13년 전 조회 703
13년 전 조회 949
13년 전 조회 445
13년 전 조회 598
13년 전 조회 1,330
13년 전 조회 2,878
13년 전 조회 640
13년 전 조회 900
13년 전 조회 1,291
13년 전 조회 702
13년 전 조회 2,320
13년 전 조회 921
13년 전 조회 1,598
13년 전 조회 1,834
13년 전 조회 1,655
13년 전 조회 971
13년 전 조회 1,266
13년 전 조회 772
13년 전 조회 644
13년 전 조회 1,295
13년 전 조회 985
13년 전 조회 835
13년 전 조회 753
13년 전 조회 918
13년 전 조회 705
13년 전 조회 1,225
13년 전 조회 938
13년 전 조회 636
13년 전 조회 1,236
13년 전 조회 866
13년 전 조회 1,602
13년 전 조회 1,025
13년 전 조회 3,500
13년 전 조회 1,564
13년 전 조회 2,153
13년 전 조회 780
13년 전 조회 435
13년 전 조회 1,116
13년 전 조회 1,908
13년 전 조회 805
13년 전 조회 2,042
13년 전 조회 745
13년 전 조회 1,094
13년 전 조회 1,801
13년 전 조회 1,122
13년 전 조회 779
13년 전 조회 1,481
13년 전 조회 3,790
13년 전 조회 511
13년 전 조회 582
13년 전 조회 769
13년 전 조회 3,906
13년 전 조회 1,254
13년 전 조회 1,424
13년 전 조회 1,442
13년 전 조회 740
13년 전 조회 615
13년 전 조회 762
13년 전 조회 1,575
13년 전 조회 938
13년 전 조회 1,273
13년 전 조회 2,470
13년 전 조회 932
13년 전 조회 1,254
13년 전 조회 1,364
13년 전 조회 714
13년 전 조회 3,466
13년 전 조회 1,226
13년 전 조회 2,739
🐛 버그신고