[최신글 다중 추출] 재문의 드립니다
본문
이전 질문 : http://sir.co.kr/qa/?wr_id=5220&page=1&sfl=&stx=&sst=&page=1&unanswered=0&s_tag=&cwin=&vsst=old&vpage=1#c_5251
참고한 그누보드4 버전 소스 : http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=29434&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EC%B5%9C%EC%8B%A0%EA%B8%80
오류가 출력되는 사이트 : http://test.withlcc.com/
select wr_content from g5_write_ where wr_id = '1'
1146 : Table 'lovedb2.g5_write_' doesn't exist
error file : /index.php
lib 소스
function xe_latest_multi($skin_dir='', $bo_table1, $bo_table2, $bo_table3, $rows=10, $subject_len=40)
{
global $g5, $xe;
static $css = array();
if (!$skin_dir) $skin_dir = 'xe_basic';
$latest_skin_path = XE_SKIN_PATH.'/latest/'.$skin_dir;
$latest_skin_url = XE_SKIN_URL.'/latest/'.$skin_dir;
$cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";
if (!G5_USE_CACHE || !file_exists($cache_file)) {
$list = array();
$sql = " select * from $g5[board_new_table] a, $g5[board_table] b where a.bo_table = b.bo_table and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3') and a.wr_id = a.wr_parent order by a.bn_id desc limit $rows ";
$result = sql_query($sql);
for ($i=0; $board = sql_fetch_array($result); $i++) {
$tmp_write_table = $g5['write_prefix'] . $board[bo_table]; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_id = '$board[wr_id]' ";
$result2 = sql_query($sql);
$row2 = sql_fetch_array($result2);
$list[$i] = get_list($row2, $board, $latest_skin_url, $subject_len);
$list[$i][bo_table] = $board[bo_table];
$bo_table = $list[$i][bo_table];
}
$handle = fopen($cache_file, 'w');
$cache_content = "<?php\nif (!defined('_GNUBOARD_')) exit;\n\$bo_subject=\"".get_text($board['bo_subject'])."\";\n\$list=".var_export($list, true)."?>";
fwrite($handle, $cache_content);
fclose($handle);
}
include_once($cache_file);
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
스킨
<div class="xe_latest_04">
<div class="title"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject; ?></a></div>
<ul>
부라우저에서 HTML 소스보기를 해보니
하단에 스킨부분에 /board.php?bo_table=<?php echo $bo_table ?> 여기에 우선 $bo_table 값에 관리자페이지에서 캐쉬삭제를 하면 한번은 넘어 오는데, 다시 리푸레쉬하면 또 오류가 발생하고 값이 안넘어 오네요 ;;
요가 가지고 몇일째 ;;
답변을 작성하시기 전에 로그인 해주세요.