extend 폴더에 최신글 관련 파일 질문 드립니다. 정보
extend 폴더에 최신글 관련 파일 질문 드립니다.본문
bbs/extend 에 최신글 관련 파일이 다른것이 2가지가 있으면
오류가 나는데요(한개만 사용가능한건가요?) , 오류가 안나게 하려면 어떻게 해주어야 하나요 ?
latest_1.lib.php
latest_2.lib.php
최근게시물 뽑기
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8713
오류가 나는데요(한개만 사용가능한건가요?) , 오류가 안나게 하려면 어떻게 해주어야 하나요 ?
latest_1.lib.php
latest_2.lib.php
최근게시물 뽑기
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8713
댓글 전체
오류 메시지를 적어주시는게...
오류내용 입니다.
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home2/zonehom/public_html/bbs/extend/latest_2.lib.php:42) in /home2/zonehom/public_html/bbs/head.sub.php on line 38
최근게시물 뽑기
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8713
위에것 하나와 아래것 해서 두개 사용할려고 하는데요 두개를 업하고 나니 오류가 납니다.
<?
if (!defined('_GNUBOARD_')) exit;
function latest_s($skin_dir="", $bo_table, $rows=10, $subject_len=40, $brch="")
{
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);
$tmp_write_table = $g4['write_prefix'] . $bo_table;
if ($brch == "H")
$brch = "wr_hit";
elseif ($brch == "C")
$brch ="wr_comment";
elseif ($brch == "R")
$brch = "rand()";
elseif ($brch == "G")
$brch = "wr_good";
else
$brch = "wr_id";
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $brch 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;
}
?>
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8713
위에것 하나와 아래것 해서 두개 사용할려고 하는데요 두개를 업하고 나니 오류가 납니다.
<?
if (!defined('_GNUBOARD_')) exit;
function latest_s($skin_dir="", $bo_table, $rows=10, $subject_len=40, $brch="")
{
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);
$tmp_write_table = $g4['write_prefix'] . $bo_table;
if ($brch == "H")
$brch = "wr_hit";
elseif ($brch == "C")
$brch ="wr_comment";
elseif ($brch == "R")
$brch = "rand()";
elseif ($brch == "G")
$brch = "wr_good";
else
$brch = "wr_id";
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $brch 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;
}
?>
헤더는 한번 보내고 나면 수정할 수 없습니다. 또한 헤더를 보내기 이전에 어떠한 값이 출력되면 오류가 납니다. 이런 문제를 해결하기 위해 쓰는 것이 ob_start(); 이것인데, 이를 중복사용하면 오류가 발생할수 있습니다.
미라지 님 늦은시간에 이렇게 답변을 주셔서 감사드립니다. ^^*
편안한밤 되세요 ~
편안한밤 되세요 ~