힘

이거좀 봐주세요..

 
 
시키는대로 해봤습니다.
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//랜덤 게시물 추출하기
function r_latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $mem)
{
    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);
$today = $g4[time_ymd];
if(!$mem) $mem="1";
else $mem="0";
    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
    $sql = " select * from $tmp_write_table where wr_is_comment='0' and wr_1>='$today' and wr_3 >= '$mem' order by rand() 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;
}
?>
 
 
로그인하면
 
Fatal error: Cannot redeclare r_latest() (previously declared in /home/sok/bbs/extend/r_latest.lib.php:3) in /home/sok/bbs/extend/developer.lib.php on line 5
 
라고 뜹니다.
어떤게 잘못된걸까요?
 
해결법좀 알려주세요.

댓글 3개

위 내용을 /lib/latest.lib.php 에 삽입해보세요...
latest.lib.php 제일 상단에 복사해 넣어봤는데 사이트자체를 못들어가고 에러가 나옵니다.
어떤식으로 해야하는지 자세히좀 알려주세요.
<설치방법>
extend 폴더 안에 developer.lib.php 파일을 열어 아래의 소스를 맨 아래 ?> 위에 붙여 넣으세요.

라고 되어 있습니다만 developer.lib.php가 존재하지 않는다면..
위코드를 내용으로 하는 라이브러리파일 developer.lib.php를 생성하여 ...
$g4[path]/extend폴더에 업로드

최신글을 불러오는 페이지(index.php 또는 임의생성페이지) 상단에 생성한 라이브러리파일을 불러옴...
include_once("$g4[path]/extend/developer.lib.php");
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
06-11-23 조회 1,590
06-11-23 조회 1,683
06-11-23 조회 1,607
06-11-23 조회 1,669
06-11-23 조회 1,564
06-11-23 조회 1,760
06-11-23 조회 1,755
06-11-23 조회 1,599
06-11-23 조회 2,000
06-11-23 조회 2,838
06-11-22 조회 1,747
06-11-22 조회 2,146
06-11-22 조회 1,871
06-11-22 조회 2,060
06-11-22 조회 1,826
06-11-22 조회 1,589
06-11-22 조회 1,816
06-11-22 조회 1,907
06-11-22 조회 1,701
06-11-22 조회 1,585