메인페이지 게시판 제목과 내용출력 정보
메인페이지 게시판 제목과 내용출력본문
php에 p자도 모르는 생초보라서 질문을 올립니다 ㅠㅠ
제가 지금
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("emp", "news", 3, 23);
?>
라는 태그를 이용해서 메인페이지에 제목을 출력을 해놨는데
그 제목아래에 내용 두줄을 추가 하고 싶은데 아는게 없어서 질문을 올립니다.. ㅠㅠ
latest.lib.php소스 파일 내용입니다.
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
이곳에 뭘 추가 해야할까요?? 그리고
스킨에는
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #999999;
text-decoration: none;
}
a:active {
color: #000000;
text-decoration: none;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<body style="background-color:transparent">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<!-- 최신글 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=100% border="0">
<tr>
<td height=15><img src='<?=$latest_skin_path?>/img/box02_bullet.gif' align=absmiddle>
<?
//날짜표시
$date1 = substr($list[$i][datetime],0,10); //날짜표시형식변경
$date = explode("-", $date1);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$latest_date = $month."/".$day."";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target='_top'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'>[{$latest_date}] <strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$latest_date}] {$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td></tr>
<!-- <tr><td height="1" background="<?=$latest_skin_path?>/img/box01_dot.gif"></td></tr> -->
<!--<tr><td bgcolor=#EBEBEB height=1></td></tr> -->
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=66><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
이렇게 되어있는데 내용 두줄이 추가 되려면 어디에 무슨 태그를 넣어야하는지좀 알려주세요 ㅠㅠ
검색을 하려해도 정확하게 어떤걸 넣어야할지 몰라가지고 몇일째 헤매다가
이제서야 질문을 올리게 되버렸습니다 ㅠㅠ
도무지 모르겠습니다..
도와주세요 그누님들 !! ㅠㅠ
제가 지금
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("emp", "news", 3, 23);
?>
라는 태그를 이용해서 메인페이지에 제목을 출력을 해놨는데
그 제목아래에 내용 두줄을 추가 하고 싶은데 아는게 없어서 질문을 올립니다.. ㅠㅠ
latest.lib.php소스 파일 내용입니다.
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
이곳에 뭘 추가 해야할까요?? 그리고
스킨에는
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style type="text/css">
<!--
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #999999;
text-decoration: none;
}
a:active {
color: #000000;
text-decoration: none;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<body style="background-color:transparent">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<!-- 최신글 목록 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=100% border="0">
<tr>
<td height=15><img src='<?=$latest_skin_path?>/img/box02_bullet.gif' align=absmiddle>
<?
//날짜표시
$date1 = substr($list[$i][datetime],0,10); //날짜표시형식변경
$date = explode("-", $date1);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$latest_date = $month."/".$day."";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target='_top'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'>[{$latest_date}] <strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>[{$latest_date}] {$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td></tr>
<!-- <tr><td height="1" background="<?=$latest_skin_path?>/img/box01_dot.gif"></td></tr> -->
<!--<tr><td bgcolor=#EBEBEB height=1></td></tr> -->
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=66><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
이렇게 되어있는데 내용 두줄이 추가 되려면 어디에 무슨 태그를 넣어야하는지좀 알려주세요 ㅠㅠ
검색을 하려해도 정확하게 어떤걸 넣어야할지 몰라가지고 몇일째 헤매다가
이제서야 질문을 올리게 되버렸습니다 ㅠㅠ
도무지 모르겠습니다..
도와주세요 그누님들 !! ㅠㅠ
댓글 전체
저가 잘못이해하였는지 모르지만 최근게시물 불러오는 구조부터 이해하시는 것이 필요할 것 같습니다.
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("emp", "news", 3, 23);
?>
위 소스를 보면 최근게시물스킨이 emp이고 메인 화면으로 불러 오고자 하는 게시판이 news 같고 게시글은 세개를 불러오되 글짜는 23자까지가 아닌가 생각됩니다.
제목이 불러와 진 것을 보면 제대로 하신 것으로 생각됩니다.
그렇다면 news 게시판에 글을 올려 보십시요.
아마 세개까지 불러와지지 않을까 생각되구요.
만약 맞는다면 위에 3을 2로 고치면 게시물 2개 불러와 질 것 같습니다...
가끔 불러오는 방식이 다른 경우도 있지만 아마 맞지 않을까 생각합니다...
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.
echo latest("emp", "news", 3, 23);
?>
위 소스를 보면 최근게시물스킨이 emp이고 메인 화면으로 불러 오고자 하는 게시판이 news 같고 게시글은 세개를 불러오되 글짜는 23자까지가 아닌가 생각됩니다.
제목이 불러와 진 것을 보면 제대로 하신 것으로 생각됩니다.
그렇다면 news 게시판에 글을 올려 보십시요.
아마 세개까지 불러와지지 않을까 생각되구요.
만약 맞는다면 위에 3을 2로 고치면 게시물 2개 불러와 질 것 같습니다...
가끔 불러오는 방식이 다른 경우도 있지만 아마 맞지 않을까 생각합니다...
네 그건 이미 이해를 해서 3개와 23자만 불러들이게 했구요
제목말고도 제목과 함께 밑에 그 해당 글의 내용을 불러들이는 방법을 원하고 있는데 ..
그누보드 팁에서 찾아봤는데도 찾아보기가 힘들더라구요 ㅠㅠ
제목말고도 제목과 함께 밑에 그 해당 글의 내용을 불러들이는 방법을 원하고 있는데 ..
그누보드 팁에서 찾아봤는데도 찾아보기가 힘들더라구요 ㅠㅠ
<?=$list[$i]['wr_content']?>
글자수 조절하시려면
<?=cut_str(strip_tags($list[$i]['wr_content']),180)?>
180을 알아서 조절 하시길...
글자수 조절하시려면
<?=cut_str(strip_tags($list[$i]['wr_content']),180)?>
180을 알아서 조절 하시길...