m

기본 베이직 스킨에 갱신기능만..

· 2012-12-12 (수) 19:46:56 · 4092 · 5
1.gif
2.gif
급조.. 참조하세요..
$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;"")?>



원본
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=21961


갱신 팁을 12시간내에 한번만 갱신 가능하게 할려면 ^^;;

<?
// 현재 글을 최근에 등록한것으로 만들어 사람들이 많이 클릭하게 만듬
if ($is_admin) {

if ( time() >= strtotime($view[wr_datetime].' + 12 hours') ) {

echo "<a href='$_SERVER[REQUEST_URI]&cmd=make_new' title='이글을 최신글로 만들기' onclick=\"return confirm('이글을 최신글로 만들까요?');\">▲</a>";

if ($_GET[cmd]=='make_new') {

$wr_num = get_next_num($write_table);

//원글 최신글로 날짜도 현재시간으로
sql_fetch("update $write_table set wr_num='$wr_num',wr_datetime='$g4[time_ymdhis]' where wr_id='$view[wr_id]'");

//해당 답글(댓글)도 최신글로
sql_fetch("update $write_table set wr_num='$wr_num',wr_datetime='$g4[time_ymdhis]' where wr_num='$view[wr_num]'");

}

} else {

echo "<a href=\"javascript:alert('갱신또는 글등록이후 12시간이 넘어야 사용이 가능합니다.')\">▲</a>";

}

}
?>

첨부파일

1.gif (12.7 KB)
0회 2012-12-12 19:46
2.gif (103.8 KB)
0회 2012-12-12 19:46
pdx.zip (50.2 KB) 45회 2012-12-12 19:46
|

댓글 5개

2012-12-12 (수) 20:14:54
음...
아하...이렇게까지...고마울수가...ㅠ
2012-12-13 (목) 17:39:40
감사합니다
2012-12-13 (목) 22:43:13
감사합니다~
감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 스킨

5,847건

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y 그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

+
분류 제목 글쓴이 날짜 조회
갤러리 12-12-14 조회 9,925
게시판 12-12-14 조회 3,593
게시판 12-12-13 조회 7,788
게시판 12-12-12 조회 4,093
최신글 12-12-12 조회 9,339
게시판 12-12-12 조회 3,795
게시판 12-12-11 조회 5,839
게시판 12-12-11 조회 5,346
최신글 12-12-11 조회 8,239