다시 올립니다 채택완료
여기에 보면 QnA에 글올리면 waiting 글을 확인하면 Checking 글에 답변을 달면 Checked라고 뜨게 되있는데 Checking 까지는 뜨는데 왜 Checked는 안뜨나요?
if($member[mb_level] > "2" && !$view['wr_1'])
sql_fetch(" update $write_table set wr_1='상담중' where wr_id='{$view['wr_id']}' ");
if ($member[mb_level] < "2") {
$site_msg = "Thank you(谢谢)";
alert($site_msg, G5_URL);
exit;
}
<?php if ($good_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $good_href.'&'.$qstr ?>" id="good_button" class="btn_b01">접수완료</a>
<b id="bo_v_act_good"></b>
</span>
<?php }elseif ($list[$i]['wr_good']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF3061;color:#fff;font-weight:bold;">Checked</div><?php }
elseif($list[$i]['wr_1']){ ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#5AD103;color:#fff;font-weight:bold;">Checking</div><?php }
else{ ?>
<div style="padding:4px 0 0 0;width:60px;height:20px;background:#878ED3;color:#fff;font-weight:bold;">Wating</div><?php } ?></td>
<View.skin.php>파일입니다
$("#good_button, #nogood_button").click(function() {
var $tx;
if(this.id == "good_button")
$tx = $("#bo_v_act_good");
else
$tx = $("#bo_v_act_nogood");
excute_good(this.href, $(this), $tx);
return false;
});
// 이미지 리사이즈
$("#bo_v_atc").viewimageresize();
});
function excute_good(href, $el, $tx)
{
$.post(
href,
{ js: "on" },
function(data) {
if(data.error) {
alert(data.error);
return false;
}
if(data.count) {
$el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 가입실패처리하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
} else {
$tx.text("이 글을 접수완료처리하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
}
}
}, "json"
);
}
답변 3개
덕분에 삽질 잘 했습니다.
전에 한번 봤던 소스라 답변이 아니라 댓글로 해야 된다고 했다가
원래부터 답변으로 기능이 되던것처럼 말씀하셔서 내 실수인가 해서 미안한 마음에 답을 찾아 드리려 했는데...
내가 뭔가에 홀린건지.... 원....
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
이미지 보니 더 확실한듯... 님 글보기에 답글 버튼 눌러서 답변 달지 마시고 글보기 아래 댓글 달아 보세요.
답변에 대한 댓글 11개
추천기능을 변형해서 만든 게시판이네요...
view.skin.php 소스 좀 올려 주실수 있으신가요?
부분적으로 올라와 있어서요.
이게 값이 없어서 원하시는 결과가 안 나오는 겁니다.
말씀하신 피드백으로 저 값을 변경해 주는 부분에 문제가 있나 봅니다.
그래서 피드백이 있는 view.skin.php를 먼저 살펴 봐야 할거 같습니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
if($member[mb_level] > "2" && !$view['wr_1'])
sql_fetch(" update $write_table set wr_1='상담중' where wr_id='{$view['wr_id']}' ");
if ($member[mb_level] < "2") {
$site_msg = "Thank you(谢谢)";
alert($site_msg, G5_URL);
exit;
}
if ($write['mb_id'] && $write['mb_id'] != $member['mb_id'] && !$is_admin){
if ($write['wr_reply'] && $member['mb_id'])
{
$sql = " select mb_id from {$write_table}
where wr_num = '{$write['wr_num']}'
and wr_reply = ''
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
if ($row['mb_id'] != $member['mb_id'])
alert('You can only check your QnA(本人的提问和回答才可以).', G5_URL);
}else{
alert('You can only check your QnA(本人的提问和回答才可以).', G5_URL);
}
}
?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<!-- 게시물 읽기 시작 { -->
<article id="bo_v" style="width:<?php echo $width; ?>">
<header>
<h1 id="bo_v_title">
<?php
if ($category_name) echo $view['ca_name'].' | '; // 분류 출력 끝
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
?>
</h1>
</header>
<div class="tbl_frm01 tbl_wrap">
<table>
<tbody>
<tr>
<th scope="row">Name(名字)<strong class="sound_only">필수</strong></th>
<td class="wr_content"><?php echo $view['name'] ?></td>
</tr>
<tr>
<th scope="row"><label for="wr_content">Phone(手机)<strong class="sound_only">필수</strong></label></th>
<td class="wr_content">
<?php echo $view['wr_7'] ?>-<?php echo $view['wr_8'] ?>-<?php echo $view['wr_9'] ?>-<?php echo $view['wr_10'] ?>
<!-- } 본문 내용 끝 -->
</td>
</tr>
<tr>
<th>Memo(便条)</th>
<td><?php echo get_view_thumbnail($view['content']); ?></td>
</tr>
<?php for ($i=1; $i<=G5_LINK_COUNT; $i++) { ?>
<?php
// 링크
$cnt = 0;
for ($i=1; $i<=count($view['link']); $i++) {
if ($view['link'][$i]) {
$cnt++;
$link = cut_str($view['link'][$i], 70);
?>
<tr>
<th scope="row">참조사이트 <?php echo $i ?></th>
<td>
<a href="<?php echo $view['link_href'][$i] ?>" target="_blank">
<img src="<?php echo $board_skin_url ?>/img/icon_link.gif" alt="참조사이트">
<strong><?php echo $link ?></strong>
</a>
<span class="bo_v_link_cnt"><?php echo $view['link_hit'][$i] ?>회 연결</span>
<?php
}
}
?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- 게시물 상단 버튼 시작 { -->
<div id="bo_v_top">
<?php
ob_start();
?>
<?php if ($prev_href || $next_href) { ?>
<ul class="bo_v_nb">
<?php if ($prev_href) { ?><li><a href="<?php echo $prev_href ?>" class="btn_b02">Prev.</a></li><?php } ?>
<?php if ($next_href) { ?><li><a href="<?php echo $next_href ?>" class="btn_b02">Next</a></li><?php } ?>
</ul>
<?php } ?>
<ul class="bo_v_com">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn_b01">Edit(编辑)</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" class="btn_b01" onclick="del(this.href); return false;">Delete(删除)</a></li><?php } ?>
<?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>" class="btn_b01">Search(索搜)</a></li><?php } ?>
<li><a href="<?php echo $list_href ?>" class="btn_b01">List(目录)</a></li><br>
<?php if ($reply_href) { ?><li><a href="<?php echo $reply_href ?>" class="btn_b01">Feedback(反馈)</a></li><?php } ?>
</ul>
<?php
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>
<!-- } 게시물 상단 버튼 끝 -->
<section id="bo_v_atc">
<h2 id="bo_v_atc_title">본문</h2>
<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) {
if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view'];
echo get_view_thumbnail($view['file'][$i]['view']);
}
}
echo "</div>\n";
}
?>
<?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>
일단은 피드백 버튼을 보니 "답변" 버튼이 맞습니다...
이걸 누르면 글쓰기 페이지로 가지 않는지요?
제일 위에 이미지를 보면 최고♥♥♥ 처럼 답변줄이 하나 더 생기는거 아니가요?
근데 원하시는 checked 는 "추천" 기능으로 처리가 됩니다.
원래 되던 기능인가요? 만들고자 하시는 기능인가요?
원래 되던 기능이라면 아마도 /bbs/write_update.php를 수정한거 같고
만들고자 하시는 기능이라면 방향이 서로 다르게 개발이 된겁니다.
혹시모르니(소스가 다 안올라온 관계로...) 게시판관리에서 수정을 누르시면 게시판 기능설정에 추천 사용이란 항목에 체크가 되어 있나 보세요. 아마도 추천버튼이 checked 되도록 하는 버튼일거라
생각되는데... 한번 해 보시고 답변 부탁드려요.
제가 첨에 오해하고 말씀드린것도 이 소스를 알기 때문이고요...
일단은 이 소스를 변형 하신건 맞는데...
일부만 변형 하신거 같습니다...
list.skin.php에서
[code]
<?php }elseif ($list[$i]['wr_good']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF3061;color:#fff;font-weight:bold;">Checked</div><?php }
[/code]
이 부분에서 wr_good 를 comment_cnt 로 변경해 보시는 것도 방법이긴 하지만
이 방법은 그림처럼 아래로 답변이 달리는 방식입니다...
<td class="td_num" style="width:60px"><?php if ($list[$i]['wr_nogood']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF0000;color:#fff;font-weight:bold;">가입실패</div><?php }elseif ($list[$i]['comment_cnt']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF3061;color:#fff;font-weight:bold;">Checked</div>
그리고 제가 할려고하는건 추천눌렀을때 Checked가 뜨는게아니고 답변을 달면 Checked가 나오게할려고하는게 맞습니다
[code]
<?php for ($i=0; $i<count($list); $i++) {
[/code]
이부분 찾으시겠어요. 리스트 데이블 시작하는 부분입니다.
이줄 바로 아래에
[code]
<?php for ($i=0; $i<count($list); $i++) {
$sql = " select count(*) as cnt from $write_table
where wr_reply <> ''
and wr_id <> '{$list[$i]['wr_id']}'
and wr_num = '{$list[$i]['wr_num']}'
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
[/code]
이런식으로 답변 카운터 가져오는 쿼리를 넣어주세요.
따로 만들어진 값은 없어 delete.php에서 빼 왔어요.
그런 다음 아까 수정한 부분에
[code]
<?php }elseif ($list[$i]['wr_good']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF3061;color:#fff;font-weight:bold;">Checked</div><?php }
[/code]
여기서 $list[$i]['wr_good'] 대신에 $row['cnt'] 를 넣어 주세요.
[code]
<?php }elseif ($row['cnt']) { ?><div style="padding:4px 0 0 0;width:60px;height:20px;background:#FF3061;color:#fff;font-weight:bold;">Checked</div><?php }
[/code]
이렇게요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
그럼 repiled라고 뜨면서 옆에 화살표가 나오는건데... 옆에는 안바꿔서요
view.skin.php쪽으로 들어가면 수정,삭제,글쓰기,피드백이라는게 있는데 피드백 눌러서 하거든요
근데 안바꿔요^^