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

· 13년 전 · 1553
목록에 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,227
13년 전 조회 3,837
13년 전 조회 4,075
13년 전 조회 1,537
13년 전 조회 2,028
13년 전 조회 1,532
13년 전 조회 2,133
13년 전 조회 1,891
13년 전 조회 1,789
13년 전 조회 2,102
13년 전 조회 1,356
13년 전 조회 2,756
13년 전 조회 2,525
13년 전 조회 2,219
13년 전 조회 1,672
13년 전 조회 2,179
13년 전 조회 2,371
13년 전 조회 1,979
13년 전 조회 3,189
13년 전 조회 1,826
13년 전 조회 1,546
13년 전 조회 1,728
13년 전 조회 4,536
13년 전 조회 3,404
13년 전 조회 1,972
13년 전 조회 2,135
13년 전 조회 3,555
13년 전 조회 2,545
13년 전 조회 1,699
13년 전 조회 1,807
13년 전 조회 3,153
13년 전 조회 1,659
13년 전 조회 1,930
13년 전 조회 1,380
13년 전 조회 1,554
13년 전 조회 2,290
13년 전 조회 3,851
13년 전 조회 1,606
13년 전 조회 1,842
13년 전 조회 2,263
13년 전 조회 1,668
13년 전 조회 3,279
13년 전 조회 1,866
13년 전 조회 2,551
13년 전 조회 2,782
13년 전 조회 2,601
13년 전 조회 1,924
13년 전 조회 2,210
13년 전 조회 1,703
13년 전 조회 1,554
13년 전 조회 2,231
13년 전 조회 1,907
13년 전 조회 1,760
13년 전 조회 1,687
13년 전 조회 1,887
13년 전 조회 1,652
13년 전 조회 2,237
13년 전 조회 1,864
13년 전 조회 1,540
13년 전 조회 2,176
13년 전 조회 1,836
13년 전 조회 2,516
13년 전 조회 2,009
13년 전 조회 4,421
13년 전 조회 2,496
13년 전 조회 3,061
13년 전 조회 1,729
13년 전 조회 1,358
13년 전 조회 2,066
13년 전 조회 2,840
13년 전 조회 1,738
13년 전 조회 2,967
13년 전 조회 1,666
13년 전 조회 2,037
13년 전 조회 2,716
13년 전 조회 2,056
13년 전 조회 1,703
13년 전 조회 2,421
13년 전 조회 4,704
13년 전 조회 1,439
13년 전 조회 1,522
13년 전 조회 1,673
13년 전 조회 4,779
13년 전 조회 2,133
13년 전 조회 2,349
13년 전 조회 2,362
13년 전 조회 1,640
13년 전 조회 1,516
13년 전 조회 1,670
13년 전 조회 2,489
13년 전 조회 1,808
13년 전 조회 2,137
13년 전 조회 3,310
13년 전 조회 1,812
13년 전 조회 2,110
13년 전 조회 2,210
13년 전 조회 1,596
13년 전 조회 4,307
13년 전 조회 2,090
13년 전 조회 3,627