최신글 가져올때 제목만 가져오는 법 정보
최신글 가져올때 제목만 가져오는 법본문
최소한의 내용만 가져오기 위해 제목만 딱 가져오려면 어떻게 해야하져?
검색해보니까 rolo님이
select wr_id, substring( wr_subject, 1, 20) from g4_write_bbs ....
해서 가져오라는데 초보라서 무슨 뜻인지 잘 모르겠네요.
<?
$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++) {
echo latest("scroll", $row['bo_table'], 12, 70, "4,25");
echo "<p>\n";
}
?>
$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++) {
echo latest("scroll", $row['bo_table'], 12, 70, "4,25");
echo "<p>\n";
}
?>
이 부분을 수정하는 것 같은데... 정확하게 어떻게 수정해야하는지 자세히 좀
알려주세요. 부탁드리겠습니다. ^^
댓글 전체
수정할 곳은 scroll 이라는 스킨이 되어야 합니다..
위 코드는 최신글을 뿌려주는 것입니다.
스킨에서 원하시는 부분만 출력하시면 되지요.
위 코드는 최신글을 뿌려주는 것입니다.
스킨에서 원하시는 부분만 출력하시면 되지요.
그러니까 전 그걸 잘 모르겠는데.. 조그만 더 자세히 알려주실 수 없을까요?
g4/skin/latest/basic_v0 폴더 하나 만드신 후
그 안에 latest.skin.php라는 이름으로 아래의 내용을 넣어서 파일 하나 만드세요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td height=10>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td height=10>
<?
echo "<a href='{$list[$i]['href']}'>";
echo "<font style='font-family:굴림,Tahoma; font-size:9pt; color:#000000;'>{$list[$i]['subject']}</font>";
echo "</a>";
?>
</td>
</tr>
</table>
</td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr>
<td align=center height=10><font color=#6A6A6A>게시물이 없습니다.</a>
</td>
</tr>
<? } ?>
그런다음...
최신글을 뿌려줄 자리에...
<?=latest('basic_v1','게시판이름',5,25) ?> // 5는 불러올 갯수 25는 길이입니다.
그 안에 latest.skin.php라는 이름으로 아래의 내용을 넣어서 파일 하나 만드세요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td height=10>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td height=10>
<?
echo "<a href='{$list[$i]['href']}'>";
echo "<font style='font-family:굴림,Tahoma; font-size:9pt; color:#000000;'>{$list[$i]['subject']}</font>";
echo "</a>";
?>
</td>
</tr>
</table>
</td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr>
<td align=center height=10><font color=#6A6A6A>게시물이 없습니다.</a>
</td>
</tr>
<? } ?>
그런다음...
최신글을 뿌려줄 자리에...
<?=latest('basic_v1','게시판이름',5,25) ?> // 5는 불러올 갯수 25는 길이입니다.
캄사합니다 ^^..
와...자세한 설명.!!