new.php에서 내용이 보이게 할려면 어떻해야 합니까? 정보
new.php에서 내용이 보이게 할려면 어떻해야 합니까?본문
제 홈페이지 메인을 new.php로 할려고 합니다.
관리자 페이지에서 최신글이 한개만 나오도록 설정을 했는데
내용도 없이 제목만 한개 덜렁 나오니 이상합니다.
질문1. 블로그처럼 내용이 나오게 하고 싶습니다.
어떤 소스를 집어 넣으면 될까요?
질문2. 위의 질문연속입니다. 이미지나 편집내용도 그대로 나오게 하려면 어떻게 합니까?
블로그처럼 첫페이지에 가장 최신글의 내용이 나오게 하고 싶은 겁니다.
아래는 기본으로 포함되어 있는 new의 스킨소스입니다.
<?
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>
<? if ($is_admin) { ?>
<script language="JavaScript">
function all_checked(sw) { //ssh
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function select_new_batch(sw){////ssh06-04-12
var f = document.fboardlist;
str = "승인 or 취소";
f.sw.value = sw;
//f.target = "hiddenframe";
f.action = "<?=$g4[admin_path]?>/ssh_delete_spam.php";
f.submit();
}
</script>
<? } ?>
<!-- 분류 시작 -->
<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='검색'>
<? if ($is_admin) { ?>
<INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox>전체선택
<a href="javascript:select_new_batch('d');">선택삭제</a>
<? } ?>
<script language="JavaScript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="sw" value="">
<input type="hidden" name="gr_id" value="<?=$gr_id?>">
<input type="hidden" name="view" value="<?=$view?>">
<input type="hidden" name="mb_id" value="<?=$mb_id?>">
<!-- 제목 시작 -->
<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="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], 80));
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="">
HEREDOC;
if ($is_admin) {
if ($list[$i][comment])
echo "<input type=checkbox name=chk_wr_id[] value='{$list[$i][comment_id]}|{$list[$i][bo_table]}'>";
else
echo "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}|{$list[$i][bo_table]}'>";
}
echo <<<HEREDOC2
<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>
<!-- <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>
HEREDOC2;
}
?>
<? 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>
</form>
관리자 페이지에서 최신글이 한개만 나오도록 설정을 했는데
내용도 없이 제목만 한개 덜렁 나오니 이상합니다.
질문1. 블로그처럼 내용이 나오게 하고 싶습니다.
어떤 소스를 집어 넣으면 될까요?
질문2. 위의 질문연속입니다. 이미지나 편집내용도 그대로 나오게 하려면 어떻게 합니까?
블로그처럼 첫페이지에 가장 최신글의 내용이 나오게 하고 싶은 겁니다.
아래는 기본으로 포함되어 있는 new의 스킨소스입니다.
<?
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>
<? if ($is_admin) { ?>
<script language="JavaScript">
function all_checked(sw) { //ssh
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function select_new_batch(sw){////ssh06-04-12
var f = document.fboardlist;
str = "승인 or 취소";
f.sw.value = sw;
//f.target = "hiddenframe";
f.action = "<?=$g4[admin_path]?>/ssh_delete_spam.php";
f.submit();
}
</script>
<? } ?>
<!-- 분류 시작 -->
<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='검색'>
<? if ($is_admin) { ?>
<INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox>전체선택
<a href="javascript:select_new_batch('d');">선택삭제</a>
<? } ?>
<script language="JavaScript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="sw" value="">
<input type="hidden" name="gr_id" value="<?=$gr_id?>">
<input type="hidden" name="view" value="<?=$view?>">
<input type="hidden" name="mb_id" value="<?=$mb_id?>">
<!-- 제목 시작 -->
<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="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], 80));
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="">
HEREDOC;
if ($is_admin) {
if ($list[$i][comment])
echo "<input type=checkbox name=chk_wr_id[] value='{$list[$i][comment_id]}|{$list[$i][bo_table]}'>";
else
echo "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}|{$list[$i][bo_table]}'>";
}
echo <<<HEREDOC2
<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>
<!-- <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>
HEREDOC2;
}
?>
<? 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>
</form>
댓글 전체
1. bbs/new.php 의 데이타 조회 쿼리에 본문내용을 가져오는 것이 빠져있습니다.
데이타 조회 쿼리에 wr_content 필드를 추가하고, list[$i] 에도 내용을 넣어줘야합니다.
2. 스킨폴더/new.skin.php 에서 위의 1에서 조회한 본문을 보이도록 처리해야합니다.
데이타 조회 쿼리에 wr_content 필드를 추가하고, list[$i] 에도 내용을 넣어줘야합니다.
2. 스킨폴더/new.skin.php 에서 위의 1에서 조회한 본문을 보이도록 처리해야합니다.
다음 팁을 참고하세요.
그누보드4 > 그누4 팁 > 최근게시물(new.php)에 본문 내용 보여주기
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=23633
그누보드4 > 그누4 팁 > 최근게시물(new.php)에 본문 내용 보여주기
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=23633