우산님 전체최신글 팁자료실에 있는 내용을 latest_lib.php 아래부분에 넣어서
최신글을 불러오게 되면 전체내용은 자세히 잘나오지만
이상하게도 ico_new.gif의 경우에는 사진없으므로 나오네요
1) 팁자료의 소스를 latest_lip.php 아래에다가 저렇게 넣는게 맞는지요?
적용후에 이미지 위치를 확인해보니
보통 다른 latest 적용시에는
<img src="도메인주소/skin/latest/basic/img/icon_new.gif" alt="새글" title="">이렇게 위치가
나오면서 사진이 잘나오는데요 !
전체최신글 적용시에는 엑박이 뜨면서
<img src="/host/home2/홈페이지폴더/html/skin/latest/basic/img/icon_new.gif" alt="새글" title="">
이런식으로 경로가 이상하게 적용되는데요
스킨은 둘다 동일한 스킨을 적용하여도 이렇게 엑박이 나오네요 ..!
2)전체 최신글 적용시 기본basic 최신글로 썸네일적용시에도 따로 설정해줘야할게있나요?
'부디 초보를 위한 자세한 설명 부탁드릴게요..!
<?phpif (!defined('_GNUBOARD_')) exit; /* 다중게시판 최신글 추출 Latest *//* 제작 : SIR 내컴퓨터 *//* 버전 : 1.0.2 *//* 마스타님께서 if (!G5_USE_CACHE || !file_exists($cache_file)) { 부분 이상 검출 */ function latest($skin_dir='basic', $bo_table=false, $rows=10, $subject_len=40,$bo_title=false){ global $g5; static $css = array(); $bo_table = explode(';' , $bo_table); /* 모바일 스킨 디렉토리 */ if(G5_IS_MOBILE) { $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir; $latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir; } /* 데스크탑 스킨 디렉토리 */ else { $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir; $latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir; } /* Latest 케시파일 생성 */ $cache_botable = ""; $cache_time = date("Ymdhi"); for($y=0;$y<count($bo_table);$y++){ $cache_botable .= $bo_table[$y]; } $cache_botable = md5($cache_botable); $cache_newfile = G5_DATA_PATH."/cache/latest-{$cache_botable}-{$skin_dir}-{$rows}-{$subject_len}-{$cache_time}.php"; /* 최근 1분간 새로 등록된 케시가 없을경우 DB에서 데이터 추출후 신규 케시 생성 */ if (!G5_USE_CACHE || !file_exists($cache_newfile)) { /* 다중 게시판 게시물 추출 */ $sql = "select a.* from "; for($y=0;$y<count($bo_table);$y++){ if($y!=0) $sql .= "union all "; else $sql .= "( "; $tmp_write_table = $g5['write_prefix'] . $bo_table[$y]; // 게시판 테이블 전체이름 $sql .= "select *,'{$bo_table[$y]}' as `bo_table` from {$tmp_write_table} "; // if($y+1==count($bo_table)) $sql .= ") "; } $sql .= "a where `wr_is_comment` = 0 order by `wr_datetime` DESC limit ".$rows." "; $result = sql_query($sql); /* 다중 게시판 게시물 리스트 추출 */ $list = array(); for ($i=0; $row = sql_fetch_array($result); $i++) { /* 추출된 게시물이 등록된 게시판 매칭 */ for($y=0;$y<count($bo_table);$y++){ if ($bo_table[$y]==$row['bo_table']){ $sql = "select * from `{$g5['board_table']}` where `bo_table` = '{$bo_table[$y]}' "; $board = sql_fetch($sql); } } $list[$i] = get_list($row, $board, $latest_skin_url, $subject_len); } /* 기존에 등록된 케시파일을 삭제 */ $files = glob(G5_DATA_PATH."/cache/latest-{$cache_botable}-{$skin_dir}-{$rows}-{$subject_len}-*"); if (is_array($files)) { $cnt=0; foreach ($files as $cache_oldfile) { $cnt++; unlink($cache_oldfile); } } /* 케시파일 신규 생성 */ $handle = fopen($cache_newfile, '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_newfile); /* List에서 사용할 Board 데이터 추출 */ $bo_table = $bo_table[0]; if($bo_title) $bo_subject = $bo_title; /* 스킨연결 */ ob_start(); include $latest_skin_path.'/latest.skin.php'; $content = ob_get_contents(); ob_end_clean(); return $content;} ?> <?phpfunction latest_all($skin_dir="", $rows=10, $subject_len=40, $contents_len=200, $category="", $orderby="") { global $config; global $g5; $list = array(); $limitrows = $rows; $sqlgroup = " select bo_table, bo_subject from $g5[board_table] where bo_use_search=1 order by bo_use_search"; $rsgroup = sql_query($sqlgroup); //echo $sqlgroup; if ($skin_dir) $latest_skin_path = G5_PATH."/skin/latest/$skin_dir"; else $latest_skin_path = G5_PATH."/skin/latest/$config[cf_latest_skin]"; for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) { $bo_table = $rowgroup[bo_table]; // 테이블 이름구함 $sql = " select * from {$g5[board_table]} where bo_table = '$bo_table'"; $board = sql_fetch($sql); $tmp_write_table = $g5[write_prefix] . $bo_table; // 게시판 테이블 실제이름 // 옵션에 따라 정렬 $sql = "select * from $tmp_write_table where wr_is_comment = 0 "; $sql .= (!$category) ? "" : " and ca_name = '$category' "; $sql .= (!$orderby) ? " order by wr_id desc " : " order by $orderby desc, wr_id desc "; $sql .= " limit $limitrows"; //echo $sql; $result = sql_query($sql); for ($i=0; $row = sql_fetch_array($result); $i++, $k++) { if(!$orderby) $op_list[$k] = $row[wr_datetime]; else { $op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]); $op_list[$k] .= $row[wr_datetime]; $op_list[$k] .= $row[wr_name]; $op_list[$k] .= $row[wr_10]; } $list[$k] = get_list($row, $board, $latest_skin_path, $subject_len, $wr_name, $wr_10); $list[$k][bo_table] = $board[bo_table]; $list[$k][bo_subject] = $board[bo_subject]; $list[$k][wr_name] = $board[wr_name]; $list[$k][wr_10] = $board[wr_10]; $list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len, $wr_name, $wr_10); } } if($k>0) array_multisort($op_list, SORT_DESC, $list); if($k>$rows) array_splice($list, $rows); ob_start(); include $latest_skin_path.'/latest.skin.php'; $content = ob_get_contents(); ob_end_clean(); return $content; } ?>
답변 1개 / 댓글 1개
경로상수 문제입니다.
<?php echo G5_URL ?>
= 도메인/(루트)
<?php echo G5_PATH ?>
= 도메인/host/home2/홈페이지폴더/html
즉 URL 의 경우 현재 도메인의 루트폴더 이후부터 나오지만
PATH의 경우 전체경로가 모두 출력됩니다.
latest 스킨 안의 img 불러오는곳을 확인해보세요.
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.
정말 힘이되네요^^
오늘하루도 즐거운 주말되세요:0