http://sir.kr/g5_skin/9873?sca=갤러리&sfl=wr_subject%7C%7Cwr_content&stx=슬라이드
안녕하세요. 위 스킨을 이용해서 슬라이드 이미지를 게시판 view페이지에서 보려고 하는데
그래서 리스트에 갤러리 슬라이드 이미지를 출력하는 코드를 view페이지에 넣어서
슬라이드이미지가 출력이 되지 않네요. 어디를 손봐야할까요 아래는 소스입니다.
Copy
<?phpif (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가include_once(G5_LIB_PATH.'/thumbnail.lib.php');// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨$img_width = "600";$img_height = "600";// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);?><link rel="stylesheet" href="<?=$board_skin_url?>/style.css"><link rel="stylesheet" href="<?=$board_skin_url?>/css/lightslider.css"/><script src="<?=$board_skin_url?>/js/lightslider.js"></script> <script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script> <style> ul{ list-style: none outside none; padding-left: 0; margin: 0; } .demo .item{ margin-bottom: 60px; } .content-slider li{ background-color: #ed3020; text-align: center; color: #FFF; } .content-slider h3 { margin: 0; padding: 70px 0; } .demo{ width:600px; margin:0 auto; }</style><script> $(document).ready(function() { $("#content-slider").lightSlider({ loop:true, keyPress:true }); $('#image-gallery').lightSlider({ gallery:true, item:1, thumbItem:9, slideMargin: 0, speed:3000, auto:true, loop:true, onSliderLoad: function() { $('#image-gallery').removeClass('cS-hidden'); } }); });</script> <div style="width:750px; height:100%; float:left; display:true; margin-top:10px; padding-left:10px"> <!-- 슬라이더 시작 { --> <div class="demo"> <div class="item"> <div class="clearfix"> <ul id="image-gallery" class="gallery list-unstyled cS-hidden"><?php for ($i=0; $i<count($list); $i++) { if($i>0 && ($i % $bo_gallery_cols == 0)) $style = 'clear:both;'; else $style = ''; if ($i == 0) $k = 0; $k += 1; if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;"; $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);?> <li data-thumb="<?=$thumb['src']?>" class="gall_li <?php if ($wr_id == $list[$i]['wr_id']) { ?>gall_now<?php } ?>" > <? $image = get_editor_image($list[$i]['wr_content'],true); preg_match_all("<img [^<>]*>", $image[0][0], $output); eregi("[:space:]*(src)[:space:]*=[:space:]*([^ >;]+)",$image[0][0],$regs); $regs[2] = str_replace(Array("'",'"'),"",$regs[2]); $buff[] = $regs[2]; if(!$image[0][0]){ $sql = " select bf_file from g5_board_file where bo_table = '".$bo_table."' and wr_id = '".$list[$i]["wr_id"]."' order by bf_no "; $result = sql_query($sql); $img_url = mysql_result($result,0,0); } if($img_url){ $thumb[0]['path'] = G5_DATA_URL.'/file/'.$bo_table; $thumb[0]['file'] = $img_url; $big_img_url = $thumb[0]['path']."/".$thumb[0]['file']; }else{ $thumb[0]['file'] = $buff[$i]; $big_img_url = $thumb[0]['file']; }?> <img src="<?=$big_img_url?>" width="<?php echo $board['bo_gallery_width'] ?>" height="<?=$board['bo_gallery_height']?>"/> </li><? }?> </ul> </div> </div> </div> <!-- 게시물 읽기 시작 { --> <article id="bo_v" style="width:<?php echo $width; ?>"> <header> <h1 id="bo_v_title"> <?php if ($category_name) echo $view['ca_name'].' | '; // 분류 출력 끝 echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력 ?> </h1> </header> <div id="bo_v_if"> <section id="bo_v_info"> <h2>페이지 정보</h2> 작성자 <strong><?php echo $view['name'] ?><?php if ($is_ip_view) { echo " ($ip)"; } ?></strong> <span class="sound_only">작성일</span><strong><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong> 조회<strong><?php echo number_format($view['wr_hit']) ?>회</strong> 댓글<strong><?php echo number_format($view['wr_comment']) ?>건</strong> </section> <?php if ($view['file']['count']) { $cnt = 0; for ($i=0; $i<count($view['file']); $i++) { if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) $cnt++; } } ?> <?php if($cnt) { ?> <!-- 첨부파일 시작 { --> <section id="bo_v_file"> <h2>첨부파일</h2> <ul> <?php // 가변 파일 for ($i=0; $i<count($view['file']); $i++) { if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) { ?> <li> <a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download"> <img src="<?php echo $board_skin_url ?>/img/icon_file.gif" alt="첨부"> <strong><?php echo $view['file'][$i]['source'] ?></strong> <?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>) </a> <span class="bo_v_file_cnt"><?php echo $view['file'][$i]['download'] ?>회 다운로드</span> <span>DATE : <?php echo $view['file'][$i]['datetime'] ?></span> </li> <?php } } ?> </ul> </section> <!-- } 첨부파일 끝 --> <?php } ?> <?php if ($view['link']) { ?> <!-- 관련링크 시작 { --> <section id="bo_v_link"> <h2>관련링크</h2> <ul> <?php // 링크 $cnt = 0; for ($i=1; $i<=count($view['link']); $i++) { if ($view['link'][$i]) { $cnt++; $link = cut_str($view['link'][$i], 70); ?> <li> <a href="<?php echo $view['link_href'][$i] ?>" target="_blank"> <img src="<?php echo $board_skin_url ?>/img/icon_link.gif" alt="관련링크"> <strong><?php echo $link ?></strong> </a> <span class="bo_v_link_cnt"><?php echo $view['link_hit'][$i] ?>회 연결</span> </li> <?php } } ?> </ul> </section> <!-- } 관련링크 끝 --> <?php } ?> </div> <!-- 게시물 상단 버튼 시작 { --> <div id="bo_v_top"> <?php ob_start(); ?> <?php if ($prev_href || $next_href) { ?> <ul class="bo_v_nb"> <?php if ($prev_href) { ?><li><a href="<?php echo $prev_href ?>" class="btn_b01">이전글</a></li><?php } ?> <?php if ($next_href) { ?><li><a href="<?php echo $next_href ?>" class="btn_b01">다음글</a></li><?php } ?> </ul> <?php } ?> <ul class="bo_v_com"> <?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn_b01">수정</a></li><?php } ?> <?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" class="btn_b01" onclick="del(this.href); return false;">삭제</a></li><?php } ?> <?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" class="btn_admin" onclick="board_move(this.href); return false;">복사</a></li><?php } ?> <?php if ($move_href) { ?><li><a href="<?php echo $move_href ?>" class="btn_admin" onclick="board_move(this.href); return false;">이동</a></li><?php } ?> <?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>" class="btn_b01">검색</a></li><?php } ?> <li><a href="<?php echo $list_href ?>" class="btn_b01">목록</a></li> <?php if ($reply_href) { ?><li><a href="<?php echo $reply_href ?>" class="btn_b01">답변</a></li><?php } ?> <?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?> </ul> <?php $link_buttons = ob_get_contents(); ob_end_flush(); ?> </div> <!-- } 게시물 상단 버튼 끝 --> <section id="bo_v_atc"> <h2 id="bo_v_atc_title">본문</h2> <?php // 파일 출력 $v_img_count = count($view['file']); if($v_img_count) { echo "<div id=\"bo_v_img\">\n"; for ($i=0; $i<=count($view['file']); $i++) { if ($view['file'][$i]['view']) { //echo $view['file'][$i]['view']; echo get_view_thumbnail($view['file'][$i]['view']); } } echo "</div>\n"; } ?> <!-- 본문 내용 시작 { --> <div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div> <?php//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?> <!-- } 본문 내용 끝 --> <?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?> <!-- 스크랩 추천 비추천 시작 { --> <?php if ($scrap_href || $good_href || $nogood_href) { ?> <div id="bo_v_act"> <?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn_b01" onclick="win_scrap(this.href); return false;">스크랩</a><?php } ?> <?php if ($good_href) { ?> <span class="bo_v_act_gng"> <a href="<?php echo $good_href.'&'.$qstr ?>" id="good_button">추천 <strong><?php echo number_format($view['wr_good']) ?></strong></a> <b id="bo_v_act_good"></b> </span> <?php } ?> <?php if ($nogood_href) { ?> <span class="bo_v_act_gng"> <a href="<?php echo $nogood_href.'&'.$qstr ?>" id="nogood_button" >비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></a> <b id="bo_v_act_nogood"></b> </span> <?php } ?> </div> <?php } else { if($board['bo_use_good'] || $board['bo_use_nogood']) { ?> <div id="bo_v_act"> <?php if($board['bo_use_good']) { ?><span>추천 <strong><?php echo number_format($view['wr_good']) ?></strong></span><?php } ?> <?php if($board['bo_use_nogood']) { ?><span>비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></span><?php } ?> </div> <?php } } ?> <!-- } 스크랩 추천 비추천 끝 --> </section> <?php include_once(G5_SNS_PATH."/view.sns.skin.php"); ?> <?php // 코멘트 입출력 include_once(G5_BBS_PATH.'/view_comment.php'); ?> <!-- 링크 버튼 시작 { --> <div id="bo_v_bot"> <?php echo $link_buttons ?> </div> <!-- } 링크 버튼 끝 -->1 </article><!-- } 게시판 읽기 끝 --> <script><?php if ($board['bo_download_point'] < 0) { ?>$(function() { $("a.view_file_download").click(function() { if(!g5_is_member) { alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오."); return false; } var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"; if(confirm(msg)) { var href = $(this).attr("href")+"&js=on"; $(this).attr("href", href); return true; } else { return false; } });});<?php } ?> function board_move(href){ window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");}</script> <script>$(function() { $("a.view_image").click(function() { window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); return false; }); // 추천, 비추천 $("#good_button, #nogood_button").click(function() { var $tx; if(this.id == "good_button") $tx = $("#bo_v_act_good"); else $tx = $("#bo_v_act_nogood"); excute_good(this.href, $(this), $tx); return false; }); // 이미지 리사이즈 $("#bo_v_atc").viewimageresize();}); function excute_good(href, $el, $tx){ $.post( href, { js: "on" }, function(data) { if(data.error) { alert(data.error); return false; } if(data.count) { $el.find("strong").text(number_format(String(data.count))); if($tx.attr("id").search("nogood") > -1) { $tx.text("이 글을 비추천하셨습니다."); $tx.fadeIn(200).delay(2500).fadeOut(200); } else { $tx.text("이 글을 추천하셨습니다."); $tx.fadeIn(200).delay(2500).fadeOut(200); } } }, "json" );}</script><!-- } 게시글 읽기 끝 --></div> <!-- 사이드바 --> <div style="width:230px; height:100%; float:right; display:true; margin-top:10px; padding-left:10px"> <!-- 공지사항 최신글 --> <div style="width:200px; height:150px; float:right; display:true; margin-top:10px; padding-left:10px"> <?php // 이 함수가 바로 최신글을 추출하는 역할을 합니다. // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수); // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정 echo latest('theme/basic2', 'official', 4, 18); ?> </div> <!-- 최신 게시물 --><div style="width:200px; height:200px; float:right; display:true; margin-top:10px; padding-left:10px"><?php // 이 함수가 바로 최신글을 추출하는 역할을 합니다. // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수); // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정 echo latest('theme/basic2', 'gallery', 10, 18); ?> </div> <!-- 최신 덧글 --><div style="width:200px; height:200px; float:right; display:true; margin-top:10px; padding-left:10px"><?php// new_latest('스킨', '출력라인', '글자수', 'is_comment', cache_minute)echo new_latest('theme/new_latest', 10, 30, true, 5);?> </div> </div><!-- 사이드바끝 -->
답변 1개
채택된 답변
+20 포인트
돼지코구뇽
2016-02-21 (일) 21:33:10
게시판성격에 형태가 아닌 페이지형태로 최신글을 출력해보시는게 좋을듯합니다.
답변을 작성하려면 로그인이 필요합니다.