코멘트는 글을 적은 회원에게 보이게 어떻게 하나요? 정보
코멘트는 글을 적은 회원에게 보이게 어떻게 하나요?본문
이게시판에다가 적용할려고 하는데요..
코멘트는 다른사람을 못확인하게 할려고요..
글을 적은사람만확인할수 있게요..
어떻게 해야하나요?
제작의뢰에 있는것처럼 코멘트만 글적은 회원이 확인 할수 있게 하고 싶어요..
댓글 전체
헐랭이님 무지 감사 합니다..
저 죄송한데 한가지만 더 알려주심 안되나요?
전화번호 나 주소를 코멘트 단분만 확인 하게 하고 싶어요.
코멘트 단분이 전화번호/주소 확인눌렀을때 나오겠끔요..
어떻게 해야되나요?
저 죄송한데 한가지만 더 알려주심 안되나요?
전화번호 나 주소를 코멘트 단분만 확인 하게 하고 싶어요.
코멘트 단분이 전화번호/주소 확인눌렀을때 나오겠끔요..
어떻게 해야되나요?
특정한 형식의 단어를 치환하기를 하셔야 하는데 제 기억엔 팁게시판에 관리자님이 올리신 자료가 있었는데 지금은 없어졌는지 찾을수가 없네요.
특정형식의 치환이란 이메일 주소와 전화번호 의 패턴을 말하며 치환하는 방법은
preg_replace() 함수를 사용 합니다.
http://kr.php.net/manual/kr/function.preg-replace.php
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=5393&sca=&sfl=mb_id%2C1&stx=dalsoo&page=1
특정형식의 치환이란 이메일 주소와 전화번호 의 패턴을 말하며 치환하는 방법은
preg_replace() 함수를 사용 합니다.
http://kr.php.net/manual/kr/function.preg-replace.php
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=5393&sca=&sfl=mb_id%2C1&stx=dalsoo&page=1
----------db 호출 원리-----------------------------------
$g4_write[bo_table] = "g4_write_$bo_table";
$mct = " wr_parent = '$wr_id' "; // 해당글의 부모값 관련 목록
$coment_sql = "select mb_id from $g4_write[bo_table] where $mct ";
$coment_result = sql_query($coment_sql);
$coment_mb_id = "";
while ($coment_row = sql_fetch_array($coment_result))
{
$coment_mb_id .= $coment_row[mb_id];
}
---------------------------------------------------------------
view.skin.php 에서 적용할 부분
if($coment_mb_id == $member[mb_id]){
코멘트 단분이 전화번호/주소 확인눌렀을때 나오겠끔요
}
$g4_write[bo_table] = "g4_write_$bo_table";
$mct = " wr_parent = '$wr_id' "; // 해당글의 부모값 관련 목록
$coment_sql = "select mb_id from $g4_write[bo_table] where $mct ";
$coment_result = sql_query($coment_sql);
$coment_mb_id = "";
while ($coment_row = sql_fetch_array($coment_result))
{
$coment_mb_id .= $coment_row[mb_id];
}
---------------------------------------------------------------
view.skin.php 에서 적용할 부분
if($coment_mb_id == $member[mb_id]){
코멘트 단분이 전화번호/주소 확인눌렀을때 나오겠끔요
}
view.skin.php 소스가 이건데요.. 어떻게 해야되는지요?
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
$ex2_filed = explode("|",$write[wr_1]);
$ext2_00 = $ex2_filed[0];
$ext2_01 = $ex2_filed[1];
$ext2_02 = $ex2_filed[2];
$ext2_03 = $ex2_filed[3];
$ext2_04 = $ex2_filed[4];
$ext2_05 = $ex2_filed[5];
$ext2_06 = $ex2_filed[6];
$ext2_07 = $ex2_filed[7];
$ext2_08 = $ex2_filed[8];
$ext2_09 = $ex2_filed[9];
$ex3_filed = explode("|",$write[wr_2]);
$ext3_00 = $ex3_filed[0];
$ext3_01 = $ex3_filed[1];
$ext3_02 = $ex3_filed[2];
$ext3_03 = $ex3_filed[3];
$ext3_04 = $ex3_filed[4];
$ext3_05 = $ex3_filed[5];
$ext3_06 = $ex3_filed[6];
$ext3_07 = $ex3_filed[7];
$ext3_08 = $ex3_filed[8];
$ext3_09 = $ex3_filed[9];
?>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
<td width=75%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height=2 bgcolor=#B0ADF5></td>
</tr>
<tr>
<td height=1 bgcolor=#E7E7E7></td>
</tr>
<? if ($trackback_url) { ?>
<tr>
<td height=30>
<div align="left"><font color="#FF6600">아래의 상품정보는 진실이 아닐수 있습니다.책음은
글 작성자가 집니다. </font></div></td>
</tr>
<?}?>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
if ($view[file][$i][source] && !$view[file][$i][view])
{
$cnt++;
//echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></td></tr>";
}
}
?>
<tr>
<td height=1 bgcolor=#E7E7E7></td>
</tr>
<tr>
<td height="150" border:1px solid #BBBBBB;'>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="18%" height="30" bgcolor="#F2F2F4"><strong>+판매자정보</strong></td>
<td bgcolor="#FFFFFF"> <font color="#7A8FDB"> 이름:</font>
<?=$view[name]?>
<? if ($is_ip_view) { echo " ($ip)"; } ?>
<font color="#7A8FDB">날짜:</font>
<?=substr($view[wr_datetime],2,14)?>
<font color=#7A8FDB>조회</font> :
<?=$view[wr_hit]?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+제목글</strong></td>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="352"><font color="#FF9900">
<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
</font>
<?=$view[subject]?>
</td>
<td width="68" align="center" bgcolor="#99CC00"><strong><font color="#FFFFFF">
<?=$ext2_06?>
</font></strong></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+전화번호/핸드폰</strong></td>
<td bgcolor="#FFFFFF"><strong> TEL:</strong>
<?=$ext2_00?>
<?=$ext2_01?>
<?=$ext2_02?>
<strong>HP:</strong>
<?=$ext2_03?>
<?=$ext2_04?>
<?=$ext2_05?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+거래지역</strong></td>
<td bgcolor="#FFFFFF">
<?=$ext2_07?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+희망거래가</strong></td>
<td bgcolor="#FFFFFF"> <font color="#990000"><strong>
<?=$ext2_08?>
원</strong></font><strong> (
<?=$ext2_09?>
) </strong></td>
</tr>
</table>
<br>
<strong>+ 추가정보및 소개</strong><br>
<hr>
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?>
<span class="ct lh">
<?=$view[content];?>
</span>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp>
<a href=""></a><a href=''></a>
<? if ($is_signature) { echo "<br>$signature<br><br>"; } // 서명 출력 ?>
</td>
</tr>
</table>
<br>
<?
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td></tr></table><br>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++)
{
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width)
{
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
// 스타일에 적용된 이미지의 폭과 높이를 삭제한다
target[i].style.width = '';
target[i].style.height = '';
}
target[i].style.borderWidth = '1px';
target[i].style.borderStyle = 'solid';
target[i].style.borderColor = '#000000';
}
}
window.onload = resize_image;
function file_download(link, file)
{
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href = link;
}
</script>
<!-- 게시글 보기 끝 -->
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
$ex2_filed = explode("|",$write[wr_1]);
$ext2_00 = $ex2_filed[0];
$ext2_01 = $ex2_filed[1];
$ext2_02 = $ex2_filed[2];
$ext2_03 = $ex2_filed[3];
$ext2_04 = $ex2_filed[4];
$ext2_05 = $ex2_filed[5];
$ext2_06 = $ex2_filed[6];
$ext2_07 = $ex2_filed[7];
$ext2_08 = $ex2_filed[8];
$ext2_09 = $ex2_filed[9];
$ex3_filed = explode("|",$write[wr_2]);
$ext3_00 = $ex3_filed[0];
$ext3_01 = $ex3_filed[1];
$ext3_02 = $ex3_filed[2];
$ext3_03 = $ex3_filed[3];
$ext3_04 = $ex3_filed[4];
$ext3_05 = $ex3_filed[5];
$ext3_06 = $ex3_filed[6];
$ext3_07 = $ex3_filed[7];
$ext3_08 = $ex3_filed[8];
$ext3_09 = $ex3_filed[9];
?>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
<td width=75%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height=2 bgcolor=#B0ADF5></td>
</tr>
<tr>
<td height=1 bgcolor=#E7E7E7></td>
</tr>
<? if ($trackback_url) { ?>
<tr>
<td height=30>
<div align="left"><font color="#FF6600">아래의 상품정보는 진실이 아닐수 있습니다.책음은
글 작성자가 집니다. </font></div></td>
</tr>
<?}?>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
if ($view[file][$i][source] && !$view[file][$i][view])
{
$cnt++;
//echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></td></tr>";
}
}
?>
<tr>
<td height=1 bgcolor=#E7E7E7></td>
</tr>
<tr>
<td height="150" border:1px solid #BBBBBB;'>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="18%" height="30" bgcolor="#F2F2F4"><strong>+판매자정보</strong></td>
<td bgcolor="#FFFFFF"> <font color="#7A8FDB"> 이름:</font>
<?=$view[name]?>
<? if ($is_ip_view) { echo " ($ip)"; } ?>
<font color="#7A8FDB">날짜:</font>
<?=substr($view[wr_datetime],2,14)?>
<font color=#7A8FDB>조회</font> :
<?=$view[wr_hit]?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+제목글</strong></td>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="352"><font color="#FF9900">
<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
</font>
<?=$view[subject]?>
</td>
<td width="68" align="center" bgcolor="#99CC00"><strong><font color="#FFFFFF">
<?=$ext2_06?>
</font></strong></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+전화번호/핸드폰</strong></td>
<td bgcolor="#FFFFFF"><strong> TEL:</strong>
<?=$ext2_00?>
<?=$ext2_01?>
<?=$ext2_02?>
<strong>HP:</strong>
<?=$ext2_03?>
<?=$ext2_04?>
<?=$ext2_05?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+거래지역</strong></td>
<td bgcolor="#FFFFFF">
<?=$ext2_07?>
</td>
</tr>
<tr>
<td height="30" bgcolor="#F2F2F4"><strong>+희망거래가</strong></td>
<td bgcolor="#FFFFFF"> <font color="#990000"><strong>
<?=$ext2_08?>
원</strong></font><strong> (
<?=$ext2_09?>
) </strong></td>
</tr>
</table>
<br>
<strong>+ 추가정보및 소개</strong><br>
<hr>
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?>
<span class="ct lh">
<?=$view[content];?>
</span>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp>
<a href=""></a><a href=''></a>
<? if ($is_signature) { echo "<br>$signature<br><br>"; } // 서명 출력 ?>
</td>
</tr>
</table>
<br>
<?
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td></tr></table><br>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++)
{
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width)
{
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
// 스타일에 적용된 이미지의 폭과 높이를 삭제한다
target[i].style.width = '';
target[i].style.height = '';
}
target[i].style.borderWidth = '1px';
target[i].style.borderStyle = 'solid';
target[i].style.borderColor = '#000000';
}
}
window.onload = resize_image;
function file_download(link, file)
{
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href = link;
}
</script>
<!-- 게시글 보기 끝 -->