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

· 13년 전 · 1374
목록에 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,060
13년 전 조회 3,659
13년 전 조회 3,886
13년 전 조회 1,360
13년 전 조회 1,840
13년 전 조회 1,330
13년 전 조회 1,947
13년 전 조회 1,719
13년 전 조회 1,598
13년 전 조회 1,913
13년 전 조회 1,166
13년 전 조회 2,573
13년 전 조회 2,342
13년 전 조회 2,042
13년 전 조회 1,487
13년 전 조회 1,999
13년 전 조회 2,186
13년 전 조회 1,793
13년 전 조회 2,995
13년 전 조회 1,618
13년 전 조회 1,366
13년 전 조회 1,567
13년 전 조회 4,345
13년 전 조회 3,232
13년 전 조회 1,774
13년 전 조회 1,966
13년 전 조회 3,347
13년 전 조회 2,347
13년 전 조회 1,491
13년 전 조회 1,593
13년 전 조회 2,951
13년 전 조회 1,462
13년 전 조회 1,767
13년 전 조회 1,188
13년 전 조회 1,340
13년 전 조회 2,100
13년 전 조회 3,646
13년 전 조회 1,404
13년 전 조회 1,670
13년 전 조회 2,082
13년 전 조회 1,470
13년 전 조회 3,091
13년 전 조회 1,666
13년 전 조회 2,355
13년 전 조회 2,591
13년 전 조회 2,426
13년 전 조회 1,724
13년 전 조회 2,009
13년 전 조회 1,522
13년 전 조회 1,375
13년 전 조회 2,049
13년 전 조회 1,736
13년 전 조회 1,569
13년 전 조회 1,481
13년 전 조회 1,701
13년 전 조회 1,459
13년 전 조회 2,065
13년 전 조회 1,688
13년 전 조회 1,363
13년 전 조회 1,985
13년 전 조회 1,635
13년 전 조회 2,372
13년 전 조회 1,840
13년 전 조회 4,241
13년 전 조회 2,306
13년 전 조회 2,880
13년 전 조회 1,528
13년 전 조회 1,157
13년 전 조회 1,876
13년 전 조회 2,659
13년 전 조회 1,553
13년 전 조회 2,760
13년 전 조회 1,511
13년 전 조회 1,859
13년 전 조회 2,536
13년 전 조회 1,883
13년 전 조회 1,521
13년 전 조회 2,240
13년 전 조회 4,517
13년 전 조회 1,240
13년 전 조회 1,328
13년 전 조회 1,466
13년 전 조회 4,593
13년 전 조회 1,937
13년 전 조회 2,147
13년 전 조회 2,156
13년 전 조회 1,446
13년 전 조회 1,325
13년 전 조회 1,482
13년 전 조회 2,281
13년 전 조회 1,639
13년 전 조회 1,964
13년 전 조회 3,147
13년 전 조회 1,613
13년 전 조회 1,942
13년 전 조회 2,018
13년 전 조회 1,408
13년 전 조회 4,128
13년 전 조회 1,905
13년 전 조회 3,451