나의 최근게시물 스킨을 설치하는데 에러가 나는군요
아래 스킨을 내려받아 사용법대로 설치하고 실행시키니 다음과 같은 에러가 나는군요
에러
select count(*) as cnt from g4_board_new a, g4_board b, g4_group c where a.bo_table = b.bo_table and b.gr_id = c.gr_id and a.bn_datetime >= '2007-08-19 18:26:16' and b.bo_table <> 'han5' and a.mb_id = 'wk256kw'
1054 : Unknown column 'a.mb_id' in 'where clause'
error file : index.html
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 12개
4.07.00에서 해당 테이블에 회원아이디 필드가 추가 되었습니다.
아래구문을 관리자 upgrade.php에 넣으시고 업그레이드를 한번 실행해 주세요.
// 4.07.00
// 최근게시물에 회원아이디 필드 및 인덱스 추가
sql_query(" ALTER TABLE `{$g4['board_new_table']}` ADD `mb_id` VARCHAR( 20 ) NOT NULL ", false);
sql_query(" ALTER TABLE `{$g4['board_new_table']}` ADD INDEX `mb_id` ( `mb_id` ) ", false);
그래서 그런 것이었군요. TOGETHER님께서 알려주신 소스를 넣고 실행하니 바로 해결되더군요.
감사합니다.
필드를 추가하여도 기존 내용에는 아이디가 들어가 있지 않습니다. 회원아이디로 기존글이 소트되지 않는다는 것이지요.
또한 이 부분뿐만 아니라 write_update.php와 write_comment_update.php에서 최신글 입력부분을 아이디가 입력되도록 수정해 주셔야 합니다....ㅠ.ㅠ
// 새글 INSERT
//sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]' ) ");
sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");
bbs/write_comment_update.php의 169줄 부근을
// 새글 INSERT
//sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$comment_id', '$wr_id', '$g4[time_ymdhis]' ) ");
sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");
로 바꾸어 주세요.
그런데 바로 답을 주시는군요.
지금 소스를 적용시켜 제대로 작동합니다.
감사합니다.
<?php
$g4_path = "."; //경로는 맞게 설정
include_once("$g4_path/common.php");
if($is_admin == "super") {
$sql = " select * from {$g4['board_new_table']} where mb_id = '' order by bn_id desc ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$post = get_write($row[bo_table], $row[wr_id]);
sql_query(" update {$g4['board_new_table']} set mb_id = '{$post['mb_id']}' where bn_id = '{$row['bn_id']}' ");
}
echo "기존게시물도 적용하였사와용~~~! 이 화일은 없애시와용~~!";
}
?>
또 위에서 부터 차례대로 적용을 시켜 삽입까지 시켰으면 자신이 지금까지 쓴 글은 모두 나타나나요?
include_once("$g4_path/common.php");
두줄을
//$g4_path = "."; //경로는 맞게 설정
include_once("./_common.php");
로 바꾸시면 그누보드 인덱스 폴더나 bbs폴더 adm 폴더등에 넣고 실행하시면 됩니다...^^
기존게시물도 적용하였사와용~~~! 이 화일은 없애시와용~~!
그러면 이것은 오늘 쓴 글 뿐이 아니라 어제의 게시물도 나타나는 것인지요?
오늘 쓴글의 갯수가 적고 나타내어야 할 글수가 많다면 어제의 게시물이 나타날수도...^^
관심을 갖고 답변해 주셔서 감사합니다.