그누보드 [G5] 좋아요(추천) / 싫어요(비추천) 보이기
페이지 정보
본문
게시글에 좋아요(추천)과 싫어요(비추천)을 누른 회원정보 보는 방법입니다.
그누보드5 / skin / board / basic / view.skin.php 적당한 위치에 아래 내용을 추가합니다.
<?php
// 추천 조회
$good_qry = " select count(distinct `bg_id`) as `cnt` from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='good' ";
$good_row = sql_fetch($good_qry);
$good_cnt = $good_row['cnt'];
if ($good_href && $good_cnt>0) {
?>
<div style="background:#f5f5f5; padding:10px 15px;">
<h4 style="padding:0 0 15px 0; font-size:1.2em;"> 추천리스트</h4>
<p class="list-group-item-text">
<?php
// 추천 있으면 표시
$good_qry = sql_query(" select * from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='good' order by bg_id desc ");
for ($good_i=0; $good_row=sql_fetch_array($good_qry); $good_i++) {
$good_qry2 = sql_query(" select * from {$g5['member_table']} where mb_id='{$good_row['mb_id']}' ");
$good_row2 = sql_fetch_array($good_qry2);
echo "<span>";
$field_query = "SHOW COLUMNS FROM {$g5['config_table']} WHERE `Field` = 'as_thema';";
$field_row = sql_fetch( $field_query );
if($field_row['Field']) { // 아미나빌더가 있으면
if ($good_row2['as_level']) {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/{$good_row2['as_level']}.gif'> ";
} else {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/guest.gif'> ";
}
}
if ($good_row2['mb_nick']) {
echo $good_row2['mb_nick'];
} else {
echo "<span style='color:#a1a1a1;'>회원탈퇴</span>";
}
echo "</span> ";
}
?>
</p>
</div>
<?php
} // 추천 조회 끝
// 비추천 조회
$nogood_qry = " select count(distinct `bg_id`) as `cnt` from ".$g5['board_good_table']." where bo_table='".$bo_table."' and wr_id='".$wr_id."' and bg_flag='nogood' ";
$nogood_row = sql_fetch($nogood_qry);
$nogood_cnt = $nogood_row['cnt'];
if ($nogood_href && $nogood_cnt>0) {
?>
<div style="background:#f5f5f5; padding:10px 15px;">
<h4 style="padding:0 0 5px 0; font-size:1.2em;"> 비추천리스트</h4>
<p class="list-group-item-text">
<?php
// 비추천 있으면 표시
$nogood_qry = sql_query(" select * from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='nogood' ");
for ($nogood_i=0; $nogood_row=sql_fetch_array($nogood_qry); $nogood_i++) {
$nogood_qry2 = sql_query(" select * from {$g5['member_table']} where mb_id='{$nogood_row['mb_id']}' ");
$row_nogood2=sql_fetch_array($nogood_qry2);
echo "<span>";
$field_query = "SHOW COLUMNS FROM {$g5['config_table']} WHERE `Field` = 'as_thema';";
$field_row = sql_fetch( $field_query );
if($field_row['Field']) { // 아미나빌더가 있으면
if ($nogood_row2['as_level']) {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/{$nogood_row2['as_level']}.gif'> ";
} else {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/guest.gif'> ";
}
}
if ($good_row2['mb_nick']) {
echo $nogood_row2['mb_nick'];
} else {
echo "<span style='color:#a1a1a1;'>회원탈퇴</span>";
}
echo "</span> ";
}
?>
</p>
</div>
<?php
} // 비추천 조회 끝
?>
추가 작업예정인 내용 ~~~~
댓글 ajax 로 이용하기
https://sir.kr/bbs/board.php?bo_table=g4_skin&wr_id=88131
그누보드5 / skin / board / basic / view.skin.php 적당한 위치에 아래 내용을 추가합니다.
<?php
// 추천 조회
$good_qry = " select count(distinct `bg_id`) as `cnt` from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='good' ";
$good_row = sql_fetch($good_qry);
$good_cnt = $good_row['cnt'];
if ($good_href && $good_cnt>0) {
?>
<div style="background:#f5f5f5; padding:10px 15px;">
<h4 style="padding:0 0 15px 0; font-size:1.2em;"> 추천리스트</h4>
<p class="list-group-item-text">
<?php
// 추천 있으면 표시
$good_qry = sql_query(" select * from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='good' order by bg_id desc ");
for ($good_i=0; $good_row=sql_fetch_array($good_qry); $good_i++) {
$good_qry2 = sql_query(" select * from {$g5['member_table']} where mb_id='{$good_row['mb_id']}' ");
$good_row2 = sql_fetch_array($good_qry2);
echo "<span>";
$field_query = "SHOW COLUMNS FROM {$g5['config_table']} WHERE `Field` = 'as_thema';";
$field_row = sql_fetch( $field_query );
if($field_row['Field']) { // 아미나빌더가 있으면
if ($good_row2['as_level']) {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/{$good_row2['as_level']}.gif'> ";
} else {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/guest.gif'> ";
}
}
if ($good_row2['mb_nick']) {
echo $good_row2['mb_nick'];
} else {
echo "<span style='color:#a1a1a1;'>회원탈퇴</span>";
}
echo "</span> ";
}
?>
</p>
</div>
<?php
} // 추천 조회 끝
// 비추천 조회
$nogood_qry = " select count(distinct `bg_id`) as `cnt` from ".$g5['board_good_table']." where bo_table='".$bo_table."' and wr_id='".$wr_id."' and bg_flag='nogood' ";
$nogood_row = sql_fetch($nogood_qry);
$nogood_cnt = $nogood_row['cnt'];
if ($nogood_href && $nogood_cnt>0) {
?>
<div style="background:#f5f5f5; padding:10px 15px;">
<h4 style="padding:0 0 5px 0; font-size:1.2em;"> 비추천리스트</h4>
<p class="list-group-item-text">
<?php
// 비추천 있으면 표시
$nogood_qry = sql_query(" select * from {$g5['board_good_table']} where bo_table='{$bo_table}' and wr_id='{$wr_id}' and bg_flag='nogood' ");
for ($nogood_i=0; $nogood_row=sql_fetch_array($nogood_qry); $nogood_i++) {
$nogood_qry2 = sql_query(" select * from {$g5['member_table']} where mb_id='{$nogood_row['mb_id']}' ");
$row_nogood2=sql_fetch_array($nogood_qry2);
echo "<span>";
$field_query = "SHOW COLUMNS FROM {$g5['config_table']} WHERE `Field` = 'as_thema';";
$field_row = sql_fetch( $field_query );
if($field_row['Field']) { // 아미나빌더가 있으면
if ($nogood_row2['as_level']) {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/{$nogood_row2['as_level']}.gif'> ";
} else {
echo "<img src='".G5_IMG_URL."/level/{$xp['xp_icon_skin']}/guest.gif'> ";
}
}
if ($good_row2['mb_nick']) {
echo $nogood_row2['mb_nick'];
} else {
echo "<span style='color:#a1a1a1;'>회원탈퇴</span>";
}
echo "</span> ";
}
?>
</p>
</div>
<?php
} // 비추천 조회 끝
?>
추가 작업예정인 내용 ~~~~
댓글 ajax 로 이용하기
https://sir.kr/bbs/board.php?bo_table=g4_skin&wr_id=88131
댓글목록
등록된 댓글이 없습니다.