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

· 13년 전 · 1458
목록에 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,149
13년 전 조회 3,732
13년 전 조회 3,972
13년 전 조회 1,446
13년 전 조회 1,934
13년 전 조회 1,423
13년 전 조회 2,053
13년 전 조회 1,797
13년 전 조회 1,684
13년 전 조회 1,999
13년 전 조회 1,250
13년 전 조회 2,643
13년 전 조회 2,416
13년 전 조회 2,114
13년 전 조회 1,574
13년 전 조회 2,075
13년 전 조회 2,272
13년 전 조회 1,873
13년 전 조회 3,083
13년 전 조회 1,719
13년 전 조회 1,439
13년 전 조회 1,640
13년 전 조회 4,433
13년 전 조회 3,299
13년 전 조회 1,877
13년 전 조회 2,036
13년 전 조회 3,440
13년 전 조회 2,447
13년 전 조회 1,591
13년 전 조회 1,713
13년 전 조회 3,035
13년 전 조회 1,550
13년 전 조회 1,841
13년 전 조회 1,271
13년 전 조회 1,432
13년 전 조회 2,189
13년 전 조회 3,737
13년 전 조회 1,503
13년 전 조회 1,743
13년 전 조회 2,167
13년 전 조회 1,563
13년 전 조회 3,183
13년 전 조회 1,753
13년 전 조회 2,453
13년 전 조회 2,685
13년 전 조회 2,514
13년 전 조회 1,827
13년 전 조회 2,081
13년 전 조회 1,606
13년 전 조회 1,459
13년 전 조회 2,125
13년 전 조회 1,813
13년 전 조회 1,675
13년 전 조회 1,573
13년 전 조회 1,786
13년 전 조회 1,551
13년 전 조회 2,143
13년 전 조회 1,779
13년 전 조회 1,456
13년 전 조회 2,061
13년 전 조회 1,724
13년 전 조회 2,444
13년 전 조회 1,913
13년 전 조회 4,320
13년 전 조회 2,392
13년 전 조회 2,962
13년 전 조회 1,620
13년 전 조회 1,240
13년 전 조회 1,973
13년 전 조회 2,741
13년 전 조회 1,622
13년 전 조회 2,856
13년 전 조회 1,583
13년 전 조회 1,945
13년 전 조회 2,621
13년 전 조회 1,973
13년 전 조회 1,611
13년 전 조회 2,328
13년 전 조회 4,608
13년 전 조회 1,325
13년 전 조회 1,416
13년 전 조회 1,558
13년 전 조회 4,681
13년 전 조회 2,024
13년 전 조회 2,232
13년 전 조회 2,254
13년 전 조회 1,532
13년 전 조회 1,412
13년 전 조회 1,574
13년 전 조회 2,388
13년 전 조회 1,735
13년 전 조회 2,038
13년 전 조회 3,224
13년 전 조회 1,724
13년 전 조회 2,027
13년 전 조회 2,096
13년 전 조회 1,508
13년 전 조회 4,207
13년 전 조회 1,976
13년 전 조회 3,543