모바일: 게시판스킨 목록 관리자용 버튼 스타일, 추천비추천 기능 작업 중

This commit is contained in:
whitedot
2013-03-08 17:06:02 +09:00
parent ffefa1812b
commit 16e0519aa6
3 changed files with 92 additions and 10 deletions

View File

@ -460,7 +460,7 @@ input.required:focus {border:0;background:#21272e !important;color:#fff;line-hei
.btn_bo_user li {float:left;margin-left:0.3em}
.btn_bo_adm {float:left}
.btn_bo_adm li {float:left;margin-right:0.3em}
.btn_bo_adm input {padding:0 1em;height:25px;border:1px solid #e8180c !important;background:#e8180c;color:#fff;text-decoration:none;vertical-align:middle;cursor:pointer}
.btn_bo_adm input {padding:0 1em;height:2em;border:1px solid #e8180c !important;background:#e8180c;color:#fff;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-appearance:none}
.bo_notice td {background:#f7f7f7}
.bo_notice td a {font-weight:bold}
.td_num strong {color:#000}

View File

@ -143,9 +143,15 @@ 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" onclick="win_scrap(this.href); return false;" class="btn_b01">스크랩</a><? } ?>
<? if ($good_href) {?><a href="<?=$good_href?>" class="btn_b01" target="hiddenframe">추천 <strong><?=number_format($view['wr_good'])?></strong></a><? } ?>
<? if ($nogood_href) {?><a href="<?=$nogood_href?>" class="btn_b01" target="hiddenframe">비추천 <strong><?=number_format($view['wr_nogood'])?></strong></a><? } ?>
<? 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>
<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']) {
@ -201,6 +207,18 @@ $(function() {
window.open(this.href, "large_image", "top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
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");
excute_good(this.href, $(this), $tx);
return false;
});
});
function view_image_resize()
@ -218,4 +236,27 @@ function view_image_resize()
}
});
}
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("이 글을 비추천하셨습니다.").css("display", "inline");
} else {
$tx.text("이 글을 추천하셨습니다.").css("display", "inline");
}
}
}, "json"
);
}
</script>

View File

@ -14,10 +14,10 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
<section id="bo_v_info">
<h2>게시물 정보</h2>
작성자 <strong><?=$view['name']?><? if ($is_ip_view) { echo "&nbsp;($ip)"; } ?></strong>
<span class="sound_only">작성일</span><strong><?=date("y-m-d H:i", strtotime($view['wr_datetime']))?></strong>
조회<strong><?=number_format($view['wr_hit'])?>회</strong>
댓글<strong><?=number_format($view['wr_comment'])?>건</strong>
작성자 <strong><?=$view['wr_name']?><? if ($is_ip_view) { echo "&nbsp;($ip)"; } ?></strong><br>
작성일 <strong><?=date("y-m-d H:i", strtotime($view['wr_datetime']))?></strong><br>
조회 <strong><?=number_format($view['wr_hit'])?>회</strong><br>
댓글 <strong><?=number_format($view['wr_comment'])?>건</strong>
</section>
<?
@ -144,8 +144,14 @@ 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?>" target="hiddenframe" class="btn_b01">추천 <strong><?=number_format($view['wr_good'])?></strong></a><? } ?>
<? if ($nogood_href) {?><a href="<?=$nogood_href?>" target="hiddenframe" 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']) {
@ -201,6 +207,18 @@ $(function() {
window.open(this.href, "large_image", "top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
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");
excute_good(this.href, $(this), $tx);
return false;
});
});
function view_image_resize()
@ -218,4 +236,27 @@ function view_image_resize()
}
});
}
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("이 글을 비추천하셨습니다.").css("display", "inline");
} else {
$tx.text("이 글을 추천하셨습니다.").css("display", "inline");
}
}
}, "json"
);
}
</script>