lib/ 아래에 latest1.lib.php 파일을 생성하세요. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

lib/ 아래에 latest1.lib.php 파일을 생성하세요. 정보

lib/ 아래에 latest1.lib.php 파일을 생성하세요.

첨부파일

latest1.lib.php (1.1K) 15회 다운로드 2012-02-28 22:10:07

본문

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");?>

이렇게 넣어주시면 제대로 노출됩니다.

댓글 전체

전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT