추천, 비추천 수정 및 머지 충돌 커밋

This commit is contained in:
chicpro
2013-03-08 12:00:19 +09:00
parent dc3d5e5380
commit 7fe1b31a76
27 changed files with 219 additions and 180 deletions

View File

@ -144,8 +144,16 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
<? if ($scrap_href || $good_href || $nogood_href) { ?>
<div id="bo_v_act">
<? if ($scrap_href) { ?><a href="<?=$scrap_href; ?>" target="_blank" class="btn_b01" onclick="win_scrap(this.href); return false;">스크랩</a><? } ?>
<? if ($good_href) {?><a href="<?=$good_href.'&amp;'.$qstr?>" id="good_button" class="btn_b01">추천 <strong><?=number_format($view['wr_good'])?></strong></a><? } ?>
<? if ($nogood_href) {?><a href="<?=$nogood_href.'&amp;'.$qstr?>" id="nogood_button" class="btn_b01">비추천 <strong><?=number_format($view['wr_nogood'])?></strong></a><? } ?>
<? if ($good_href) {?>
<a href="<?=$good_href.'&amp;'.$qstr?>" id="good_button" class="btn_b01">추천 <strong><?=number_format($view['wr_good'])?></strong></a>
<span id="bo_v_act_good"></span>
<? } ?>
<? if ($nogood_href) {?>
<a href="<?=$nogood_href.'&amp;'.$qstr?>" id="nogood_button" class="btn_b01">비추천 <strong><?=number_format($view['wr_nogood'])?></strong></a>
<span id="bo_v_act_nogood"></span>
<? } ?>
</div>
<? } else {
if($board['bo_use_good'] || $board['bo_use_nogood']) {
@ -202,15 +210,15 @@ $(function() {
return false;
});
// 추천
$("#good_button").click(function() {
excute_good(this.href, this.id);
return false;
});
// 추천, 비추천
$("#good_button, #nogood_button").click(function() {
var $tx;
if(this.id == "good_button")
$tx = $("#bo_v_act_good");
else
$tx = $("#bo_v_act_nogood");
// 비추천
$("#nogood_button").click(function() {
excute_good(this.href, this.id);
excute_good(this.href, $(this), $tx);
return false;
});
});
@ -231,7 +239,7 @@ function view_image_resize()
});
}
function excute_good(href, id)
function excute_good(href, $el, $tx)
{
$.post(
href,
@ -243,7 +251,12 @@ function excute_good(href, id)
}
if(data.count) {
$("#"+id).find("strong").text(number_format(String(data.count)));
$el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다.").css("display", "inline");
} else {
$tx.text("이 글을 추천하셨습니다.").css("display", "inline");
}
}
}, "json"
);

View File

@ -128,7 +128,7 @@ var char_max = parseInt(<?=$comment_max?>); // 최대
</table>
<div class="btn_confirm">
<input type="submit" class="btn_submit" value="댓글입력">
<input type="submit" class="btn_submit" value="댓글등록">
</div>
</form>