|
|
|
20년 전
|
조회 1,522
|
|
|
|
20년 전
|
조회 2,811
|
|
|
|
20년 전
|
조회 2,184
|
|
|
|
20년 전
|
조회 1,537
|
|
|
|
20년 전
|
조회 1,436
|
|
|
|
20년 전
|
조회 2,087
|
|
|
|
20년 전
|
조회 1,518
|
|
|
|
20년 전
|
조회 1,766
|
|
|
|
20년 전
|
조회 1,557
|
|
|
|
20년 전
|
조회 1,781
|
|
|
|
20년 전
|
조회 1,515
|
|
|
|
20년 전
|
조회 1,526
|
|
|
|
20년 전
|
조회 1,518
|
|
|
|
20년 전
|
조회 1,547
|
|
|
|
20년 전
|
조회 1,608
|
|
|
|
20년 전
|
조회 1,591
|
|
|
|
20년 전
|
조회 1,518
|
|
|
|
20년 전
|
조회 1,575
|
|
|
|
20년 전
|
조회 1,512
|
|
|
|
20년 전
|
조회 1,709
|
댓글 5개
bo_table 테이블명과 bo_notice (text type)가 있습니다.
이 레코드에 줄바꿈+글번호만 추가됩니다.
bbs/list.php 의
.
.
if (!$sca && !$stx)
{
$arr_notice = split("\n", trim($board[bo_notice]));
for ($k=0; $k<count($arr_notice); $k++)
{
$row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");
if (!$row[wr_id])
continue;
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
$list[$i][is_notice] = true;
$i++;
}
}
split으로 공지글이 몇번이다를 배열에 넣습니다.
<!-- latest1.lib.php 파일에 아래내용을 넣고 저장-->
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest1($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$sql = " select * from {$g4[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$arr_notice = split("\n", trim($board[bo_notice]));
if($board[bo_notice] ) // 이렇게 고치니 되네요..참고하세요..
$in_str= implode( ",", $arr_notice);
else $in_str='null';
$tmp_write_table = $g4['write_prefix'] . $bo_table;
$sql = "select * from $tmp_write_table where wr_id in ( $in_str) order by wr_id desc limit 0,$rows";
$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;
}
?>
적용은 넣으려는 페이지의 php파일 상단에
<?
$g4_path = "./board";
include_once("_common.php");
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
include_once("$g4[path]/lib/latest1.lib.php"); //이걸넣으세요
include_once("$g4[path]/lib/outlogin.lib.php");
?>
이처럼 넣어주시고
적용할 부분에 다가 아래처럼
<?=latest1("basic","notice","6","33","wr_id","notice");?>
이렇게 넣어주시면 제대로 노출됩니다.