리스트에 출력되는 게시글 갯수 지정하려면 어떻게 할까요 ? (관리자 모드 제외) 정보
리스트에 출력되는 게시글 갯수 지정하려면 어떻게 할까요 ? (관리자 모드 제외)
본문
댓글 전체
onchange해서 개수값을 넘기고 그개수값을 리스트 뿌려주는쿼리를 찾아서 끝에 order by no desc limit 개수값 이런식으로 지정하면 간단하게 해결되죠

음 좋은글 이지만, 이해가 가지 않네여 ㅠ

급조.. 참조하세요..
$qstr 이 끈어지는 부분이 있으니 쿠키나 세션을 활용해도 좋을듯합니다.
/common.php
if ($pdx) $board[bo_page_rows] = $pdx; 을 추가해 주어야합니다.
수정전
if (isset($bo_table)) {
$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
}
수정후
if (isset($bo_table)) {
$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
if ($pdx) $board[bo_page_rows] = $pdx;
}
수정전
if (isset($sca)) {
$sca = mysql_real_escape_string($sca);
$qstr .= '&sca=' . urlencode($sca);
}
수정후
if (isset($sca)) {
$sca = mysql_real_escape_string($sca);
$qstr .= '&sca=' . urlencode($sca);
}
if (isset($pdx)) { // 셀렉트유지
$pdx = mysql_real_escape_string($pdx);
$qstr .= '&pdx=' . urlencode($pdx);
}
스킨의 list.skin.php 에 아래와같이 수정하시면됄듯..
// 선택 SELECT 형식으로 얻음
function get_row_select($name, $start_id=0, $end_id=10, $selected='', $event='')
{
global $g4;
$str = "<select name='$name' $event>";
for ($i=$start_id; $i<=$end_id; $i++)
{
$str .= "<option value='$i'";
if ($i == $selected)
$str .= " selected";
$str .= ">$i</option>";
}
$str .= "</select>";
return $str;
}
if (!$pdx) $pdx=$board[bo_page_rows];
원하는위치
<?=get_row_select("pdx", 1, 30, $pdx, "onchange="location='{$_SERVER[PHP_SELF]}?bo_table={$bo_table}&{$qstr}&pdx='+this.value;"")?>
$qstr 이 끈어지는 부분이 있으니 쿠키나 세션을 활용해도 좋을듯합니다.
/common.php
if ($pdx) $board[bo_page_rows] = $pdx; 을 추가해 주어야합니다.
수정전
if (isset($bo_table)) {
$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
}
수정후
if (isset($bo_table)) {
$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
if ($pdx) $board[bo_page_rows] = $pdx;
}
수정전
if (isset($sca)) {
$sca = mysql_real_escape_string($sca);
$qstr .= '&sca=' . urlencode($sca);
}
수정후
if (isset($sca)) {
$sca = mysql_real_escape_string($sca);
$qstr .= '&sca=' . urlencode($sca);
}
if (isset($pdx)) { // 셀렉트유지
$pdx = mysql_real_escape_string($pdx);
$qstr .= '&pdx=' . urlencode($pdx);
}
스킨의 list.skin.php 에 아래와같이 수정하시면됄듯..
// 선택 SELECT 형식으로 얻음
function get_row_select($name, $start_id=0, $end_id=10, $selected='', $event='')
{
global $g4;
$str = "<select name='$name' $event>";
for ($i=$start_id; $i<=$end_id; $i++)
{
$str .= "<option value='$i'";
if ($i == $selected)
$str .= " selected";
$str .= ">$i</option>";
}
$str .= "</select>";
return $str;
}
if (!$pdx) $pdx=$board[bo_page_rows];
원하는위치
<?=get_row_select("pdx", 1, 30, $pdx, "onchange="location='{$_SERVER[PHP_SELF]}?bo_table={$bo_table}&{$qstr}&pdx='+this.value;"")?>

그럼 죄송하지만 10, 30개를 적는 위치는 어디즘이 될까요 ?

원하는위치
<?=get_row_select("pdx", 1, 30, $pdx, "onchange="location='{$_SERVER[PHP_SELF]}?bo_table={$bo_table}&{$qstr}&pdx='+this.value;"")?>
1, 30, <-- 1~30 까지..
<?=get_row_select("pdx", 1, 30, $pdx, "onchange="location='{$_SERVER[PHP_SELF]}?bo_table={$bo_table}&{$qstr}&pdx='+this.value;"")?>
1, 30, <-- 1~30 까지..