그누보드 최신글(new.php) 에서 회원 여분필드 불러오기 좀! 정보
그누보드 최신글(new.php) 에서 회원 여분필드 불러오기 좀!본문
읽어주셔서 감사합니다.
그누보드 최신글 new.php 파일에 회원가입 시 받은 여분필드(mb_1)의
내용을 불러오려고 합니다.
***~~[mb_1] 이런 문구는 전혀 안먹히고,
소스 구문을 보니 sql 에서 불러오는 정의를 내린 후,
정의된 문을 적어야 표시되는 것 같은데 어렵네요.
혹시 사용하시는 분 계시면 답변 좀 부탁드립니다.
그누보드 최신글 new.php 파일에 회원가입 시 받은 여분필드(mb_1)의
내용을 불러오려고 합니다.
***~~[mb_1] 이런 문구는 전혀 안먹히고,
소스 구문을 보니 sql 에서 불러오는 정의를 내린 후,
정의된 문을 적어야 표시되는 것 같은데 어렵네요.
혹시 사용하시는 분 계시면 답변 좀 부탁드립니다.
댓글 전체
$mb_id=$row3[mb_id]; //최신글에서 먼저 회원아이디를 얻고
$mb_info = get_member($mb_id,mb_1); //해당 회원 정보를 불러와서-빠른 검색을 위해 mb_1만 가져옴
echo $mb_info[mb_1]; //mb_1 정보만 출력시키면 됩니다.
$mb_info = get_member($mb_id,mb_1); //해당 회원 정보를 불러와서-빠른 검색을 위해 mb_1만 가져옴
echo $mb_info[mb_1]; //mb_1 정보만 출력시키면 됩니다.
dochi님 답변 감사합니다. 그런데 위에 구문을 어디에다가 넣어야 할까요? 삽질 하고 있습니다.
new.skin.php 파일 일부 내용입니다.
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i][gr_subject], 14);
$bo_subject = cut_str($list[$i][bo_subject], 14);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 74));
echo <<<HEREDOC
<tr>
<td align="center" height="30" colspan=3><font class=n_title3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><font class=n_title3><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <font class=n_title3><a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
<td align="center"><font class=n_title3>{$list[$i][name]}</td>
<td align="center" colspan=2><font class=n_title3>{$list[$i][datetime2]}</font></td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
?>
<? if ($i == 0) { ?>
<tr><td colspan="9" height=50 align=center><font class=n_title3>게시물이 없습니다.</td></tr>
<? } ?>
어디다가?
new.skin.php 파일 일부 내용입니다.
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i][gr_subject], 14);
$bo_subject = cut_str($list[$i][bo_subject], 14);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 74));
echo <<<HEREDOC
<tr>
<td align="center" height="30" colspan=3><font class=n_title3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><font class=n_title3><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <font class=n_title3><a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
<td align="center"><font class=n_title3>{$list[$i][name]}</td>
<td align="center" colspan=2><font class=n_title3>{$list[$i][datetime2]}</font></td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
?>
<? if ($i == 0) { ?>
<tr><td colspan="9" height=50 align=center><font class=n_title3>게시물이 없습니다.</td></tr>
<? } ?>
어디다가?
basic스킨 전체입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
.n_title1 { font-family:돋움; font-size:9pt; color:#FFFFFF; }
.n_title2 { font-family:돋움; font-size:9pt; color:#5E5E5E; }
</style>
</style>
<!-- 분류 시작 -->
<form name=fnew method=get style="margin:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height=30>
<?=$group_select?>
<select id=view name=view onchange="select_change()">
<option value=''>전체게시물
<option value='w'>원글만
<option value='c'>코멘트만
</select>
<b>회원아이디 : </b>
<input type=text class=ed id='mb_id' name='mb_id' value='<?=$mb_id?>'>
<input type=submit value='검색'>
<script type="text/javascript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<!-- 제목 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4" height="33" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_01.gif" width="4" height="33"></td>
<td width="100" align="center" bgcolor="#7BB2D6" height="30"><font class=n_title1><strong>그룹</strong></font></td>
<td width="5" align="center" valign="middle" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_02.gif" width="5" height="33"></td>
<td width="5" align="center" valign="middle" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_03.gif" width="5" height="33"></td>
<td width="100" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>게시판</strong></font></td>
<td width="" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>제목</strong></font></td>
<td width="120" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>이름</strong></font></td>
<td width="60" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>일시</strong></font></td>
<td width="" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>mb_1</strong></font></td> <!--//추가된 부분-->
<td width="4" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_04.gif" width="4" height="33"></td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i][gr_subject], 10);
$bo_subject = cut_str($list[$i][bo_subject], 10);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
$mb_id=$list[$i][mb_id]; //최신글에서 먼저 회원아이디를 얻고
$mb_info = get_member($mb_id,mb_1); //해당 회원 정보를 불러와서-빠른 검색을 위해 mb_1만 가져옴
//echo $mb_info[mb_1]; //mb_1 정보만 출력시키면 됩니다.
echo <<<HEREDOC
<tr>
<td align="center" height="30" colspan=3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
<td align="center">{$list[$i][name]}</td>
<td align="center" colspan=2>{$list[$i][datetime2]}</td>
<td align="center">{$mb_info[mb_1]}</td> <!--//추가된 부분-->
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
?>
<? if ($i == 0) { ?>
<tr><td colspan="9" height=50 align=center>게시물이 없습니다.</td></tr>
<? } ?>
<tr>
<td colspan="9" height="30" align="center"><?=$write_pages?></td>
</tr>
</table>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
.n_title1 { font-family:돋움; font-size:9pt; color:#FFFFFF; }
.n_title2 { font-family:돋움; font-size:9pt; color:#5E5E5E; }
</style>
</style>
<!-- 분류 시작 -->
<form name=fnew method=get style="margin:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height=30>
<?=$group_select?>
<select id=view name=view onchange="select_change()">
<option value=''>전체게시물
<option value='w'>원글만
<option value='c'>코멘트만
</select>
<b>회원아이디 : </b>
<input type=text class=ed id='mb_id' name='mb_id' value='<?=$mb_id?>'>
<input type=submit value='검색'>
<script type="text/javascript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<!-- 제목 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4" height="33" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_01.gif" width="4" height="33"></td>
<td width="100" align="center" bgcolor="#7BB2D6" height="30"><font class=n_title1><strong>그룹</strong></font></td>
<td width="5" align="center" valign="middle" bgcolor="#7BB2D6"><img src="<?=$new_skin_path?>/img/list_top_02.gif" width="5" height="33"></td>
<td width="5" align="center" valign="middle" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_03.gif" width="5" height="33"></td>
<td width="100" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>게시판</strong></font></td>
<td width="" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>제목</strong></font></td>
<td width="120" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>이름</strong></font></td>
<td width="60" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>일시</strong></font></td>
<td width="" align="center" bgcolor="#EEEEEE"><font class=n_title2><strong>mb_1</strong></font></td> <!--//추가된 부분-->
<td width="4" bgcolor="#EEEEEE"><img src="<?=$new_skin_path?>/img/list_top_04.gif" width="4" height="33"></td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i][gr_subject], 10);
$bo_subject = cut_str($list[$i][bo_subject], 10);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
$mb_id=$list[$i][mb_id]; //최신글에서 먼저 회원아이디를 얻고
$mb_info = get_member($mb_id,mb_1); //해당 회원 정보를 불러와서-빠른 검색을 위해 mb_1만 가져옴
//echo $mb_info[mb_1]; //mb_1 정보만 출력시키면 됩니다.
echo <<<HEREDOC
<tr>
<td align="center" height="30" colspan=3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
<td align="center">{$list[$i][name]}</td>
<td align="center" colspan=2>{$list[$i][datetime2]}</td>
<td align="center">{$mb_info[mb_1]}</td> <!--//추가된 부분-->
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
?>
<? if ($i == 0) { ?>
<tr><td colspan="9" height=50 align=center>게시물이 없습니다.</td></tr>
<? } ?>
<tr>
<td colspan="9" height="30" align="center"><?=$write_pages?></td>
</tr>
</table>
답변 감사합니다^^ ㅎㅎ 대단 하세요~