질문드립니다.파씽문제!@ 정보
질문드립니다.파씽문제!@
본문
http://superface.cafe24.com/read.php 이페이지의소스가아래소스입니다~!!
왜 파싱을못할까요 ?어디가문제일까요 ?
<?
$_gnu_path = ""; //그누보드가 설치되어 있는 경로
$g4_path = "$_SERVER[DOCUMENT_ROOT]"; //그누보드가 설치되어 있는 경로
include_once("$g4_path/common.php");
$bo_table = "test";// 불러올 게시판 id (원본과 동일한 게시판 id)
$rows=10; // 몇개를 불러올것인지
$subject_len=30; //제목 길이 /* $subject= cut_str($subject1,30); // 제목자르기 <--이 라인 참조 */
$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; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num 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);
$str .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \n
<main>\n
";
for($i=0; $i<count($list); $i++){ // 반복 시작
for($j=0; $j<$list[$i][file][count]; $j++){
if($list[$i][file][$j][view]){
$subject = iconv("EUC-KR", "UTF-8", stripslashes($list[$i][subject])); // 제목, 한글처리
$file = "$_gnu_path/data/file/$bo_table/{$list[$i][file][$j][file]}";
$memo= iconv("EUC-KR", "UTF-8", cut_str(strip_tags($list[$i][wr_content]),300));
$url = "$_gnu_path/bbs/board.php?bo_table=".$bo_table."&wr_id={$list[$i][wr_id]}";
$date = $list[$i][datetime2]; // 날짜
break;
}
}
$str .="<message > \r\n
<no>".$subject."</no>\r\n
<name>".$thumb."</name> \r\n
<title>".$subject."</title>\r\n
<comment>".$memo."</comment> \r\n
<wdate>".$url."</wdate>\r\n
</message>\r\n
";
} // 반복 끝
$str .= "</main>\n";
echo($str);
?>
댓글 전체
common.php에 BOM 이 들어가 있는 것 같습니다.
에디트플러스 사용하시면 아래의 url을 참고하셔서 설정을 변경하신 후 common.php을 다시 저장해 보시기 바랍니다.
http://0010.tistory.com/26
허나 말씀하신데로 해보니 여전히 데이타를못가져오고있습니다 ㅜㅜ
test 게시판을 확인해보니 첨부파일이 없습니다.
파일 첨부해서 글쓰고 나서 돌리시면 데이터를 가져올 거라고 보입니다.
========================================
for($i=0; $i<count($list); $i++){ // 반복 시작
for($j=0; $j<$list[$i][file][count]; $j++){
========================================
파일첨부없이 글이 보이게 하려면 어떤식으로하면될까요..
제거할 for문 => for($j=0; $j<$list[$i][file][count]; $j++){