이거좀 봐주세요.. 정보
이거좀 봐주세요..
본문
시키는대로 해봤습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//랜덤 게시물 추출하기
function r_latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $mem)
{
global $g4;
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";
$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);
$board = sql_fetch($sql);
$today = $g4[time_ymd];
if(!$mem) $mem="1";
else $mem="0";
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();
$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
라고 뜹니다.
어떤게 잘못된걸까요?
해결법좀 알려주세요.
댓글 전체
위 내용을 /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");
extend 폴더 안에 developer.lib.php 파일을 열어 아래의 소스를 맨 아래 ?> 위에 붙여 넣으세요.
라고 되어 있습니다만 developer.lib.php가 존재하지 않는다면..
위코드를 내용으로 하는 라이브러리파일 developer.lib.php를 생성하여 ...
$g4[path]/extend폴더에 업로드
최신글을 불러오는 페이지(index.php 또는 임의생성페이지) 상단에 생성한 라이브러리파일을 불러옴...
include_once("$g4[path]/extend/developer.lib.php");