5.4 버전 내용 적용
This commit is contained in:
@ -3,25 +3,68 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$popular_skin_url.'/style.css">', 0);
|
||||
add_javascript('<script src="'.G5_JS_URL.'/owlcarousel/owl.carousel.min.js"></script>', 10);
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/owlcarousel/owl.carousel.min.css">', 10);
|
||||
?>
|
||||
|
||||
<!-- 인기검색어 시작 { -->
|
||||
<section id="popular">
|
||||
<div>
|
||||
<h2>인기검색어</h2>
|
||||
<div class="popular_inner">
|
||||
<ul>
|
||||
<?php
|
||||
if( isset($list) && is_array($list) ){
|
||||
for ($i=0; $i<count($list); $i++) {
|
||||
?>
|
||||
<li><a href="<?php echo G5_BBS_URL ?>/search.php?sfl=wr_subject&sop=and&stx=<?php echo urlencode($list[$i]['pp_word']) ?>"><?php echo get_text($list[$i]['pp_word']); ?></a></li>
|
||||
<?php
|
||||
} //end for
|
||||
} //end if
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>인기검색어</h2>
|
||||
<div class="popular_inner">
|
||||
<ul>
|
||||
<?php
|
||||
if( isset($list) && is_array($list) ){
|
||||
for ($i=0; $i<count($list); $i++) {
|
||||
?>
|
||||
<li class="item"><a href="<?php echo G5_BBS_URL ?>/search.php?sfl=wr_subject&sop=and&stx=<?php echo urlencode($list[$i]['pp_word']) ?>"><?php echo get_text($list[$i]['pp_word']); ?></a></li>
|
||||
<?php
|
||||
} //end for
|
||||
} //end if
|
||||
?>
|
||||
</ul>
|
||||
<span class="popular_btns">
|
||||
<a href="#" class="pp-next"><i class="fa fa-angle-right" aria-hidden="true"></i></a>
|
||||
<a href="#" class="pp-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if ($list && is_array($list)) { //게시물이 있다면 ?>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
|
||||
var popular_el = ".popular_inner ul",
|
||||
p_width = $(popular_el).width(),
|
||||
c_width = 0;
|
||||
|
||||
$(popular_el).children().each(function() {
|
||||
c_width += $(this).outerWidth( true );
|
||||
});
|
||||
|
||||
if( c_width > p_width ){
|
||||
var $popular_btns = $(".popular_inner .popular_btns");
|
||||
$popular_btns.show();
|
||||
|
||||
var p_carousel = $(popular_el).addClass("owl-carousel").owlCarousel({
|
||||
items:5,
|
||||
loop:true,
|
||||
nav:false,
|
||||
dots:false,
|
||||
autoWidth:true,
|
||||
mouseDrag:false,
|
||||
});
|
||||
|
||||
$popular_btns.on("click", ".pp-next", function(e) {
|
||||
e.preventDefault();
|
||||
p_carousel.trigger('next.owl.carousel');
|
||||
})
|
||||
.on("click", ".pp-prev", function(e) {
|
||||
e.preventDefault();
|
||||
p_carousel.trigger('prev.owl.carousel');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<!-- } 인기검색어 끝 -->
|
||||
@ -1,10 +1,16 @@
|
||||
@charset "utf-8";
|
||||
|
||||
/* 인기검색어 */
|
||||
#popular {margin:8px 0 0;position:relative}
|
||||
#popular h2{display:inline-block;font-size:0.92em;color:#4b8bff;background:#fff;line-height:20px;padding:0 5px;border:1px solid #dcdcde;vertical-align:top}
|
||||
#popular .popular_inner{position:absolute;left:70px;top:2px;height:18px;overflow:hidden}
|
||||
#popular ul{display:inline-block}
|
||||
#popular {position:relative;margin:15px 0 0}
|
||||
#popular h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
|
||||
#popular .popular_inner {width:400px;height:20px;overflow:hidden}
|
||||
#popular ul {padding:0;margin:0}
|
||||
#popular ul:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#popular li{height:18px;line-height:18px;border-left:1px solid #c3c3c3;padding:0 10px;float:left}
|
||||
#popular li:first-child{border-left:0}
|
||||
#popular li a:hover{color:#a22121;text-decoration:underline}
|
||||
#popular li {float:left;width:auto !important;height:18px;line-height:18px;padding-right:20px}
|
||||
#popular li a {color:#8d8c8c}
|
||||
#popular li:first-child {border-left:0}
|
||||
#popular li a:hover {text-decoration:underline}
|
||||
|
||||
.popular_inner .popular_btns{display:none}
|
||||
.popular_btns .pp-next {position:absolute;top:68%;right:0px;width:18px;height:18px;line-height:15px;text-align:center;border:1px solid #53555a;margin-top:-12px;color:#d3d2d2}
|
||||
.popular_btns .pp-prev {position:absolute;top:68%;right:17px;width:18px;height:18px;line-height:15px;text-align:center;border:1px solid #53555a;margin-top:-12px;color:#d3d2d2}
|
||||
|
||||
Reference in New Issue
Block a user