테스트 사이트 - 개발 중인 베타 버전입니다

mb_id 어떻게 사용해야 하나요...?;

· 14년 전 · 922
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

if (!$board[bo_9]) alert("여유필드 9번 : 글쓰기 남길말");
if (!$board[bo_10]) alert("여유필드 10번 : 댓글쓰기 남길말");

$noLoginValue = $board[bo_9];
$noContentValue = $board[bo_10];

?>

<style>
.bbs_form { margin:0; }
.bbs_linei { background-color:#D6D2C7; height:1px; } //게시판 줄 색깔 바꾸기
.bbs_lineo { background-color:#FFFFFF; height:10px; } //게시판 줄 색깔 바꾸기
.bbs_no { background-color:blue; height:30px; } //게시판 내용 글씨
.bbs_fs { color:gray; font-size:11px; } //게시판 날짜

.bbs_ft {font-size: 9pt; width:100%; font-family: "돋움", "굴림","seoul", "verdana", "arial"; background-color:#FFFFFF;color:#000000;border:1 solid cccccc;color:#000000;overflow: auto}
.bbs_tt { CURSOR:pointer; }

.num { color:333333; margin-right:10; font-family:tahoma; font-size:7pt; }

.name { color:#000000;text-decoration:none font-size:8pt; }
.date { color:#aaaaaa; font-family:tahoma; font-size:7pt; }
.c_name { color:#aaaaaa; text-decoration:none font-size:8pt; }
.c_date { color:#aaaaaa; font-family:tahoma; font-size:7pt; }


a.bbs:link, a.bbs:visited, a.bbs:active { text-decoration:none;}
a.bbs:hover { text-decoration:none; color:#3366cc; }

textarea {font-size: 9pt; width:100%; font-family: "돋움", "굴림","seoul", "verdana", "arial"; background-color:#FFFFFF;color:#000000;border:1 solid cccccc;color:#000000;overflow: auto}

</style>

<script language="JavaScript">

// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>

<?
if ($w == "") {
$is_name = false;
$is_password = false;

if (!$member[mb_id] || ($is_admin && $w == 'u' && $member[mb_id] != $write[mb_id])) {
$is_name = true;
$is_password = true;
}

$password_required = "required";
$content = $board[bo_insert_content];

// 글자수 제한 설정값
if ($is_admin)
{
$write_min = $write_max = 0;
}
else
{
$write_min = (int)$board[bo_write_min];
$write_max = (int)$board[bo_write_max];
}
include_once("./norobot.inc.php");
}

if (!$subject) $subject = 1;
?>

<form name="ffwrite" method="post" action="javascript:fwrite_check(document.ffwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w value="">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=wr_id value="">
<input type=hidden name=page value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password" value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key" value="<?=$norobot_key?>"><? } ?>

<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#f6f6f6">
<tr></tr>
<tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<? if ($is_name) { ?>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td>
<input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)"> ※ 손님은 등록만 가능하며 <span style="color:red">수정</span> 및 <span style="color:red">삭제</span>를 할 수 없습니다.
</td>

<td align="right" class=write_head><img id='kcaptcha_image' border='0' width=120 height=20 onclick="imageClick();" style="cursor:pointer;" title="글자가 잘안보이는 경우 클릭하시면 새로운 글자가 나옵니다."></td>
<td align="right"><input class='ed' type=input size=10 name=wr_key itemname="자동등록방지" required></td>

</table>
</td>
</tr>
<? } ?>



<td>
<textarea class="bbs_ft" name="wr_content" itemname="내용" required style="width:100%;height:60; padding:4;" onFocus="clearText(this)"><?= $noLoginValue ?></textarea>
</td>

</tr>
<tr>
<td align="right" style="padding-top:5px; ">
<input type="image" id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border="0" align="absmiddle">
</td>

</tr>
</table>
</td></tr></table>
</form>

<br>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- 게시판 리스트 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<?

$wr_num = 0;
$tempArr= null;

for ($i=0; $i<count($list); $i++) {
$list_id = $list[$i][wr_id];

if($i == 0) $tempArr .= "\"$list_id\"";
else $tempArr .= ",\"$list_id\"";

?>
<a name="c_<?=$list_id?>"></a>

<?

// 부모글
if($wr_num != $list[$i][wr_num]){

?>
<tr><td colspan="6" class="bbs_lineo">&nbsp;</td></tr>
<tr><td colspan="6" class="bbs_linei"></td></tr>
<tr bgColor="#f1f1f1">
<td height="25" colspan="5" style="padding-left : 5px;">

<span class=num>NO.<b><?= abs($list[$i][wr_num]) ?></b></span>
<?=$list[$i][name]?>
<span class=date>(<?=$list[$i][wr_datetime]?>)</span>&nbsp;
</td>
<td align="right" style="padding-right:5px;">
<a href="javascript:list_box('<?=$list_id?>', 'r');" title="댓글">댓글</a>
<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
|
<a href="javascript:list_box('<?=$list_id?>', 'u');">수정</a> |
<a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}">삭제</a>
<? } ?>
</td>
</tr>
<tr style="cursor:hand; " title="클릭하시면 답변을 쓸 수 있습니다." onClick="javascript:list_box('<?=$list_id?>', 'r');">
<td colspan="6" style="padding-left : 5px; height:100px; ">

<span id="content_<?= $list_id?>">
<a href="javascript:list_box('<?=$list_id?>', 'r');" title="답변" class="bbs">
<?= nl2br($list[$i][wr_content])?>
</a>
</span>


</td>
</tr>

<?
$Display = "none";
?>
<tr bgColor="#ffffff">
<td colspan="6" class="bbs_pp">
<textarea class="bbs_ft" id='save_content_<?=$list_id?>' type=text style='display:<?= $Display ?>;width:100%;height:40; padding:4;' required><?= $list[$i][wr_content]?></textarea>

<span id='reply_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 답변 -->
<span id='edit_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 수정 -->
</td>
</tr>

<?

// 코멘트(댓글)
}else{
$totalCount++;

?>
<tr bgColor="#f8f8f8">
<td colspan="6" style="padding-left : 5px;">

<span id="comment_<?= $list_id?>">
<?
if(strlen($list[$i][wr_reply]) > 1){
echo $list[$i][reply];
echo $list[$i][icon_reply];
}

?>
<span class="c_name"><NOBR><?=$list[$i][name]?></NOBR></span>&nbsp;:&nbsp;

<?= ($list[$i][wr_content])?>&nbsp;<span class="c_date">(<?=$list[$i][datetime]?>)</span>&nbsp;

<a href="javascript:list_box('<?=$list_id?>', 'r');" title="이 댓글에 댓글달기" class="bbs">
<img src="<?=$board_skin_path?>/img/btn_reply.gif" title="이 댓글에 댓글달기" border="0" align="absmiddle">
</a>
<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
<a href="javascript:list_box('<?=$list_id?>', 'u');" style="padding-right:2px; ">
<img src="<?=$board_skin_path?>/img/btn_edit.gif" title="수정" border="0" align="absmiddle">
</a>
<a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}">
<img src="<?=$board_skin_path?>/img/btn_del.gif" title="삭제" border="0" align="absmiddle">
</a>

</span>

<? } ?>
</td>
</tr>


<?
$Display = "none";
?>
<tr bgColor="#f8f8f8">
<td colspan="6" class="bbs_pp">
<img id='save_emoticon_<?=$list_id?>' style='display:<?= $Display ?>;' border="0" src="<?=$board_skin_path?>/emoticons/<?=$list[$i][subject]?>.gif">
<textarea class="bbs_ft" id='save_content_<?=$list_id?>' type=text style='display:<?= $Display ?>;width:100%;height:40; padding:4;'><?= $list[$i][wr_content]?></textarea>

<span id='reply_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 답변 -->
<span id='edit_<?=$list_id?>' style='display:<?= $Display ?>; width:100%; padding:5;'></span><!-- 수정 -->
</td>
</tr>

<? } ?>

<?
$wr_num = $list[$i][wr_num];

}
?>
<? if (count($list) == 0) { ?>
<tr><td height="100" align="center">게시물이 없습니다.</td></tr>

<? } ?>
</table>


<!-- 페이지 표시 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($write_pages || $prev_part_href || $next_part_href ) { ?>
<tr>
<td height="25" align="center" class="bbs_no">
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_first.gif' border='0' align='absmiddle' title='처음' width='38' height='15'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전' width='17' height='15'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음' width='17' height='15'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝' width='38' height='15'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
<? } ?>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

</table>
</td></tr></table>

<span id=list_write style='display:inline; width:100%; padding:10;'>
<form name="fwrite" method="post" action="javascript:fwrite_check(document.fwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w value="" id="list_w">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=wr_id value="<?=$list[$i][wr_id]?>" id="list_id">
<input type=hidden name=page value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password" value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key" value="<?=$norobot_key?>"><? } ?>


<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#f8f8f8"><tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($is_name) { ?>
<tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td>
<input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)"> ※ 손님은 등록만 가능하며 <span style="color:red">수정</span> 및 <span style="color:red">삭제</span>를 할 수 없습니다.
</td>

<td align="right" class=write_head><img id='kcaptcha_image_copy' border='0' width=120 height=20 onclick="imageClick();" style="cursor:pointer;" title="글자가 잘안보이는 경우 클릭하시면 새로운 글자가 나옵니다."></td>
<td align="right"><input class='ed' type=input size=10 name=wr_key itemname="자동등록방지" required></td>

</table>
</td>
</tr>
</table>

</td>
</tr>
<? } ?>

<tr>

<td width="100%" style="padding-right:3px; ">
<textarea class="bbs_ft" id="list_content" name="wr_content" itemname="내용" required style="height:33; padding:4;" onFocus="clearText(this)"><?= $noContentValue ?></textarea>
</td>

<td align="right">
<input type="image" id="btn_submit" src="<?=$board_skin_path?>/img/btn_write_comment.gif" border="0" align="absmiddle">
</td>


</tr>
</table>
</td></tr></table>
</form>
</span>



</td>
</tr>
</table>

<script type="text/javascript"> var md5_norobot_key = ''; </script>
<script type="text/javascript" src="<?="$g4[path]/js/prototype.js"?>"></script>
<script type="text/javascript">
function imageClick() {
var url = "<?=$g4[bbs_path]?>/kcaptcha_session.php";
var para = "";
var myAjax = new Ajax.Request(
url,
{
method: 'post',
asynchronous: true,
parameters: para,
onComplete: imageClickResult
});
}

function imageClickResult(req) {
var result = req.responseText;
var img = document.createElement("IMG");
img.setAttribute("src", "<?=$g4[bbs_path]?>/kcaptcha_image.php?t=" + (new Date).getTime());
document.getElementById('kcaptcha_image').src = img.getAttribute('src');
document.getElementById('kcaptcha_image_copy').src = img.getAttribute('src');

md5_norobot_key = result;
}

<? if (!$is_member) { ?>Event.observe(window, "load", imageClick);<? } ?>

function clearText(thefield){
if (thefield.defaultValue==thefield.value) thefield.value = "";
}

function fwrite_check(f)
{
var s = "";
<?if($is_guest){ ?>
if (f.wr_name.value == "손님" ||
false){

f.wr_name.focus();


alert("닉네임을 적어주세요.")
return;
}
<? } ?>
if (f.wr_content.value == "<?= $noLoginValue ?>" ||
f.wr_content.value == "<?= $noContentValue ?>" ||
false){

f.wr_content.focus();


alert("내용을 입력해 주세요...")
return;
}

if (s = word_filter_check(f.wr_content.value)) {
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
return;
}


<?if($is_guest){ ?>
if (typeof(f.wr_key) != "undefined") {
if (hex_md5(f.wr_key.value) != md5_norobot_key) {
alert("자동등록방지용 빨간글자가 순서대로 입력되지 않았습니다.");
f.wr_key.focus();
return;
}
}
<? } ?>
f.action = "./write_update.php";
f.submit();
}

var old_id, new_id;
var save_html = document.getElementById('list_write').innerHTML;

function commentTotalClose(){

var tempArr = Array(<?= $tempArr ?>);



for($i = 0 ; $i < tempArr.length ; $i++){
var commentObj = eval("document.getElementById('comment_" + tempArr[$i] + "')");

if(commentObj != null) commentObj.style.display = 'inline';
}

}

function list_box(list_id, work)
{

commentTotalClose();

imageClick();
// 답변, 수정
if (list_id)
{
if (work == 'r')
new_id = 'reply_' + list_id;
else
new_id = 'edit_' + list_id;
}
else
new_id = 'list_write';

if (old_id == new_id) {
var mode = document.getElementById(new_id).style.display;
if (mode == 'inline') {
document.getElementById(new_id).style.display = 'none';
}

else {
document.getElementById(new_id).style.display = 'inline';
}

}
else
{
if (old_id)
{
document.getElementById(old_id).style.display = 'none';
document.getElementById(old_id).innerHTML = '';

}

document.getElementById(new_id).style.display = 'inline';
document.getElementById(new_id).innerHTML = save_html;

// 수정
if (work == 'u')
{
document.getElementById('list_content').value = document.getElementById('save_content_' + list_id).value;

var commentObj = eval("document.getElementById('comment_" + list_id + "')");

if(commentObj != null)
if(commentObj.style.display == 'none') commentObj.style.display = 'inline';
else commentObj.style.display = 'none';

}

document.getElementById('list_id').value = list_id;
document.getElementById('list_w').value = work;
old_id = new_id;
}
}

list_box('', '');
new_id = 'list_write';
document.getElementById(new_id).style.display = 'none';
</script>

<?
if ($w == "") {
if (!$member[mb_id])
echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";

// 필터
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter],&nbsp'; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
}
?>

---------------------------------------------------------------------------------------

skin/board/memo 스킨의 list.skin.php 소스입니다.
각 회원마다 1개의 방명록을 따로 제공하고 싶은데... mb_id를 사용해서...
bbs/board.php?bo_table=myperson&sca=[회원아이디] 이런식으로 나왔으면 하는데요...
초보라서 모르겠네요...; 어디를 어떻게 수정하면 될까요...?

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
284348
284336
284333
284332
284320
284318
284316
284313
284307
284306
284303
284298
284296
284290
284286
284280
284277
284272
284261
284259