lib/ 아래에 latest1.lib.php 파일을 생성하세요. 정보
lib/ 아래에 latest1.lib.php 파일을 생성하세요.첨부파일
본문
lib/ 아래에 lib/latest1.lib.php 파일을 생성하세요.
<!-- 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");?>
이렇게 넣어주시면 제대로 노출됩니다.
<!-- 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");?>
이렇게 넣어주시면 제대로 노출됩니다.
댓글 전체