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

· 13년 전 · 1654
목록에 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,318
13년 전 조회 3,917
13년 전 조회 4,152
13년 전 조회 1,633
13년 전 조회 2,129
13년 전 조회 1,640
13년 전 조회 2,226
13년 전 조회 1,978
13년 전 조회 1,873
13년 전 조회 2,164
13년 전 조회 1,449
13년 전 조회 2,846
13년 전 조회 2,625
13년 전 조회 2,302
13년 전 조회 1,764
13년 전 조회 2,272
13년 전 조회 2,461
13년 전 조회 2,059
13년 전 조회 3,263
13년 전 조회 1,928
13년 전 조회 1,634
13년 전 조회 1,820
13년 전 조회 4,618
13년 전 조회 3,500
13년 전 조회 2,048
13년 전 조회 2,225
13년 전 조회 3,638
13년 전 조회 2,629
13년 전 조회 1,767
13년 전 조회 1,894
13년 전 조회 3,236
13년 전 조회 1,749
13년 전 조회 2,008
13년 전 조회 1,462
13년 전 조회 1,638
13년 전 조회 2,378
13년 전 조회 3,920
13년 전 조회 1,685
13년 전 조회 1,912
13년 전 조회 2,364
13년 전 조회 1,748
13년 전 조회 3,353
13년 전 조회 1,959
13년 전 조회 2,639
13년 전 조회 2,856
13년 전 조회 2,680
13년 전 조회 2,006
13년 전 조회 2,298
13년 전 조회 1,812
13년 전 조회 1,655
13년 전 조회 2,330
13년 전 조회 2,010
13년 전 조회 1,869
13년 전 조회 1,774
13년 전 조회 1,970
13년 전 조회 1,741
13년 전 조회 2,322
13년 전 조회 1,958
13년 전 조회 1,625
13년 전 조회 2,256
13년 전 조회 1,913
13년 전 조회 2,607
13년 전 조회 2,099
13년 전 조회 4,507
13년 전 조회 2,590
13년 전 조회 3,143
13년 전 조회 1,798
13년 전 조회 1,447
13년 전 조회 2,138
13년 전 조회 2,929
13년 전 조회 1,818
13년 전 조회 3,042
13년 전 조회 1,745
13년 전 조회 2,118
13년 전 조회 2,799
13년 전 조회 2,136
13년 전 조회 1,796
13년 전 조회 2,506
13년 전 조회 4,796
13년 전 조회 1,520
13년 전 조회 1,609
13년 전 조회 1,774
13년 전 조회 4,858
13년 전 조회 2,224
13년 전 조회 2,435
13년 전 조회 2,443
13년 전 조회 1,731
13년 전 조회 1,599
13년 전 조회 1,758
13년 전 조회 2,569
13년 전 조회 1,905
13년 전 조회 2,237
13년 전 조회 3,405
13년 전 조회 1,889
13년 전 조회 2,196
13년 전 조회 2,300
13년 전 조회 1,678
13년 전 조회 4,402
13년 전 조회 2,183
13년 전 조회 3,717