리스트에 내가 코멘트 단거 표시하기 정보
리스트에 내가 코멘트 단거 표시하기
본문
안녕하세요 제가 검색능력이 부족한건지 없는건지...;;
리스트에서 게시물중에 내가 코멘트를 단 게시물이 있을시 아이콘등으로 표시되어 쉽게 확인했으면 하는데요
답변부탁드립니다
편안밤되세요
리스트에서 게시물중에 내가 코멘트를 단 게시물이 있을시 아이콘등으로 표시되어 쉽게 확인했으면 하는데요
답변부탁드립니다
편안밤되세요
댓글 전체
list.skin.php 에서 수정하시려면,
for 문안에서
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent={$list[$i][wr_id]} and wr_is_comment=1 and mb_id=$member[mb_id] ";
$cnt = sql_fetch($sql);
if($cnt['cnt']>0) {
// 이 경우가 자신의 코멘트가 있는 경우이니, 필요한 일을 하시면 됩니다.
}
테스트 해보지는 않았습니다.
for 문안에서
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent={$list[$i][wr_id]} and wr_is_comment=1 and mb_id=$member[mb_id] ";
$cnt = sql_fetch($sql);
if($cnt['cnt']>0) {
// 이 경우가 자신의 코멘트가 있는 경우이니, 필요한 일을 하시면 됩니다.
}
테스트 해보지는 않았습니다.
<?
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent={$list[$i][wr_id]} and wr_is_comment=1 and mb_id=$member[mb_id] ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>
이렇게 넣엇는데
select count(wr_id) cnt from g4_write_free where wr_parent=11 and wr_is_comment=1 and mb_id=아이디
1054 : Unknown 칼럼 '아이디' in 'where clause'
error file : /bbs/board.php
이렇게 오류가 출력되네요. 위 '아이디'라고 제가 적은 부분에는 정상적으로 아이디가 나오긴해요 ^^;;;;
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent={$list[$i][wr_id]} and wr_is_comment=1 and mb_id=$member[mb_id] ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>
이렇게 넣엇는데
select count(wr_id) cnt from g4_write_free where wr_parent=11 and wr_is_comment=1 and mb_id=아이디
1054 : Unknown 칼럼 '아이디' in 'where clause'
error file : /bbs/board.php
이렇게 오류가 출력되네요. 위 '아이디'라고 제가 적은 부분에는 정상적으로 아이디가 나오긴해요 ^^;;;;
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent={$list[$i][wr_id]} and wr_is_comment=1 and mb_id='$member[mb_id]'";
아이디 같은 경우는 string이므로 "" 이거나 '' 이걸로 싸셔야 해요.
안 그러면 sql에서 mb_id = testid 이렇게 했을 경우 mb_id 칼럼과 testid 칼럼과 같다라고 해석을 해서 testid라는 칼럼을 막 찾아요.
그리고 위처럼 모르는 칼럼이라는 말만 반복하구요.
아이디 같은 경우는 string이므로 "" 이거나 '' 이걸로 싸셔야 해요.
안 그러면 sql에서 mb_id = testid 이렇게 했을 경우 mb_id 칼럼과 testid 칼럼과 같다라고 해석을 해서 testid라는 칼럼을 막 찾아요.
그리고 위처럼 모르는 칼럼이라는 말만 반복하구요.
<?
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment=1 and mb_id='$member[mb_id]' ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>
그럼 이렇게 쓰는게 맞나요?
$sql = "select count(wr_id) cnt from $g4[write_prefix]$bo_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment=1 and mb_id='$member[mb_id]' ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>
그럼 이렇게 쓰는게 맞나요?
확인해보니 위 내용으로 테스트해보니 정상적으로 나오네요.......
혹시 최근추출 소스에는 어떻게 변경을 해야할까요?
혹시 최근추출 소스에는 어떻게 변경을 해야할까요?
위에 따옴표 빼먹은 것 죄송.. ^^;
new.skin.php 에서 달라지는 점은, $bo_table이 일정하지 않으므로 그부분만 고치시면 될듯..
<?
$sql = "select count(wr_id) cnt from $g4[write_prefix]{$list[$i][bo_table]} where wr_parent='{$list[$i][wr_id]}' and wr_is_comment=1 and mb_id='$member[mb_id]' ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>
new.skin.php 에서 달라지는 점은, $bo_table이 일정하지 않으므로 그부분만 고치시면 될듯..
<?
$sql = "select count(wr_id) cnt from $g4[write_prefix]{$list[$i][bo_table]} where wr_parent='{$list[$i][wr_id]}' and wr_is_comment=1 and mb_id='$member[mb_id]' ";
$cnt = sql_fetch($sql);
if ($cnt['cnt']>0) {
echo "[My]";
}
?>