최근게시물 추출 숫자 조정이 안돼네요.. 정보
최근게시물 추출 숫자 조정이 안돼네요..본문
최근게시물을 1개 추출하게끔 해놓아 잘 나왔었는데
아무것도 안만졌는데 (안만진거 같은데) 갑자기 어느날부터 최근개시물이 2개씩 나오네요
1번, 2번 이렇게 두개 나오는게 아니고 1번, 1번 이렇게 두개씩 나오네요
index.php 에 최신글 뽑는데는 이렇게 돼있습니다.
<?
// 최신글
$sql = " select bo_table, bo_subject from $g4[board_table] order by gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
// 최신글
$sql = " select bo_table, bo_subject from $g4[board_table] order by gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("moong", "test", 1, 20);
echo "\n";
}
?>
</td>
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("moong", "test", 1, 20);
echo "\n";
}
?>
</td>
스킨도 바꿔가며 적용해봣는데도 같은 현상이 일어나네요...
뭐가 문제인지 혹시 아시는분 계신지요?? 그누보드 다시 깔아야 하나요?
최근게시물 스킨
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="20" colspan="3"><img src="<?=$latest_skin_path?>/img/top.gif" width="500" height="20"></td>
</tr>
<? for ($j=0; $j<1; $j++) { ?>
<tr>
<td width="15"><img src="<?=$latest_skin_path?>/img/bg_left.gif" width="15" height="150"></td>
<td width="470">
<table width="470" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="15"></td>
<td><font style="font-family:굴림;font-size=11pt;font-color=#004B8F"><b><a href='<?=$list[$j][href]?>'><?=$list[$j][wr_subject]?></a></b></font></td>
<td width="15"></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
<tr>
<td width="15"></td>
<td width="470"><font style="font-family:돋움;font-size:9pt;line-height:12pt"><?=nl2br(cut_str($list[$j][wr_content],250,"..."))?></font></td>
<td width="15"></td>
</tr>
<tr>
<td height="6" colspan="3"></td>
<tr>
<tr>
<td width="15"></td>
<td width="470"><font style="font-family:verdana;font-size=8pt;font-color=grey">on <?=$list[$j][datetime]?> by </font><font style="font-family:verdana;font-size=8pt;font-color=#004B8F"><?=$list[$j][name]?></font></td>
<td width="15"></td>
</tr>
</table>
</td>
<td width="15"><img src="<?=$latest_skin_path?>/img/bg_right.gif" width="15" height="150"></td>
</tr>
<tr>
<td width="500" height="20" colspan="3"><img src="<?=$latest_skin_path?>/img/bottom.gif" width="500" height="20"></td>
</tr>
</table>
<? } ?>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width="500" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="20" colspan="3"><img src="<?=$latest_skin_path?>/img/top.gif" width="500" height="20"></td>
</tr>
<? for ($j=0; $j<1; $j++) { ?>
<tr>
<td width="15"><img src="<?=$latest_skin_path?>/img/bg_left.gif" width="15" height="150"></td>
<td width="470">
<table width="470" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="15"></td>
<td><font style="font-family:굴림;font-size=11pt;font-color=#004B8F"><b><a href='<?=$list[$j][href]?>'><?=$list[$j][wr_subject]?></a></b></font></td>
<td width="15"></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
<tr>
<td width="15"></td>
<td width="470"><font style="font-family:돋움;font-size:9pt;line-height:12pt"><?=nl2br(cut_str($list[$j][wr_content],250,"..."))?></font></td>
<td width="15"></td>
</tr>
<tr>
<td height="6" colspan="3"></td>
<tr>
<tr>
<td width="15"></td>
<td width="470"><font style="font-family:verdana;font-size=8pt;font-color=grey">on <?=$list[$j][datetime]?> by </font><font style="font-family:verdana;font-size=8pt;font-color=#004B8F"><?=$list[$j][name]?></font></td>
<td width="15"></td>
</tr>
</table>
</td>
<td width="15"><img src="<?=$latest_skin_path?>/img/bg_right.gif" width="15" height="150"></td>
</tr>
<tr>
<td width="500" height="20" colspan="3"><img src="<?=$latest_skin_path?>/img/bottom.gif" width="500" height="20"></td>
</tr>
</table>
<? } ?>
댓글 전체

index.php
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$g4[title] = "제목";
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
?>
<?=latest("스킨명", "게시판명", 갯수, 글자수);?>
<?
include_once("$g4[path]/tail.sub.php");
?>
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$g4[title] = "제목";
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/latest.lib.php");
?>
<?=latest("스킨명", "게시판명", 갯수, 글자수);?>
<?
include_once("$g4[path]/tail.sub.php");
?>

위에서 적어주신 내용은 전체 게시판의 숫자만큼 moong스킨을 이용한 test 게시판의 최신글을 뽑아옵니다.

즉 생성된 게시판이 5개면... 아래와 같이 되겠죵. ㅡ ㅡㅋ
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);
echo latest("moong", "test", 1, 20);

위 부분에서 아래처럼 바꿔주시면 되겠죠~
혹은 맨 첫번째 코멘트처럼 하거나...
echo latest("moong", "$row[bo_table]", 1, 20);
혹은 맨 첫번째 코멘트처럼 하거나...
echo latest("moong", "$row[bo_table]", 1, 20);
아... 감사합니다... 원인은 개시판 하나를 더 만들어서 그랬군요... 음... 게시판 하나 지우니까 한개가 나오네요-_-
게시판이 여러개지만 test게시판의 최신글 (1개)만 moong스킨을 이용해서 보이게 하려면 어떡하나요?
echo latest("moong", "$row[bo_table]", 1, 20); 이렇게 했더니 각 게시판에서 1개씩 나오게 되는거 같던데요..
게시판이 여러개지만 test게시판의 최신글 (1개)만 moong스킨을 이용해서 보이게 하려면 어떡하나요?
echo latest("moong", "$row[bo_table]", 1, 20); 이렇게 했더니 각 게시판에서 1개씩 나오게 되는거 같던데요..
아... 됐군요.. 해결했습니다^^ 위에 잡다한거 지우고 그냥 <?=latest("moong", "test", 1, 50);?> 요렇게 넣으니까 돼네요~~ 감사합니다~~ ^^

좋은하루 되세요~*