first
This commit is contained in:
21
modules/search/themes/_desktop/bs4-default/LICENSE
Normal file
21
modules/search/themes/_desktop/bs4-default/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The RBL License
|
||||
|
||||
Copyright (c) 2011-2018 Redblock, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
6
modules/search/themes/_desktop/bs4-default/README.md
Normal file
6
modules/search/themes/_desktop/bs4-default/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
# 부스트트랩 4 기본형
|
||||
|
||||
테스크탑 전용 통합검색모듈 테마 입니다.
|
||||
|
||||
## 주요 기능
|
||||
116
modules/search/themes/_desktop/bs4-default/main.css
Normal file
116
modules/search/themes/_desktop/bs4-default/main.css
Normal file
@@ -0,0 +1,116 @@
|
||||
#rb-search-body .container {
|
||||
max-width: 1100px !important;
|
||||
}
|
||||
|
||||
#rb-search-body .logo {
|
||||
display: inline-block;
|
||||
padding-top: .3125rem;
|
||||
padding-bottom: .3125rem;
|
||||
font-size: 1.8rem;
|
||||
line-height: inherit;
|
||||
white-space: nowrap;
|
||||
color: rgba(0,0,0,.8);
|
||||
}
|
||||
#rb-search-body .logo:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
[data-role="searchform"] .input-group {
|
||||
border: 1px solid #007bff;
|
||||
}
|
||||
|
||||
[data-role="searchform"] .form-control {
|
||||
font-weight: 600;
|
||||
color: #000
|
||||
}
|
||||
|
||||
[data-role="searchform"] .form-control:focus {
|
||||
outline: 0;
|
||||
box-shadow: none
|
||||
}
|
||||
|
||||
[data-role="lnb"] {
|
||||
padding: 0 1rem
|
||||
}
|
||||
|
||||
[data-role="lnb"] .nav-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
[data-role="lnb"] .nav-item .nav-link {
|
||||
padding: .7rem 1rem;
|
||||
color: #333;
|
||||
font-size: 1.05rem;
|
||||
letter-spacing: -.5px;
|
||||
}
|
||||
[data-role="lnb"] .nav-item:first-child .nav-link {
|
||||
padding-left: 0
|
||||
}
|
||||
|
||||
[data-role="lnb"] .nav-item.active .nav-link {
|
||||
color: #007bff
|
||||
}
|
||||
|
||||
[data-role="lnb"] .nav-item.active::after {
|
||||
position: absolute;
|
||||
bottom:-1px;
|
||||
left: 1rem;
|
||||
right:1rem;
|
||||
top: auto;
|
||||
height: 2px;
|
||||
background-color: #007bff;
|
||||
content: ''
|
||||
}
|
||||
[data-role="lnb"] .nav-item:first-child.active::after {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
[data-role="section-list"] [data-role="section-item"] {
|
||||
margin-top: 2.5rem;
|
||||
padding-top: 1.5rem;
|
||||
border-top: 0.0625rem solid #dee2e6
|
||||
}
|
||||
|
||||
[data-role="section-list"] [data-role="section-item"]:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
border-top: none
|
||||
}
|
||||
|
||||
[data-role="section-item"] .media-body h5 a {
|
||||
font-size: 14px;
|
||||
color: #1a0dab;
|
||||
text-decoration: underline;
|
||||
}
|
||||
[data-role="section-item"] .media-body h5 a:visited {
|
||||
color: #8c0198;
|
||||
}
|
||||
|
||||
[data-role="section-item"] .media-body {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
[data-role="section-item"] .media-body time {
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
|
||||
.footer_comm .link_info {
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
}
|
||||
.footer_comm .txt_bar {
|
||||
font-size: 12px;
|
||||
padding: 0 4px;
|
||||
color: #ededed;
|
||||
}
|
||||
|
||||
.mark, mark {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
color: inherit;
|
||||
}
|
||||
328
modules/search/themes/_desktop/bs4-default/main.php
Normal file
328
modules/search/themes/_desktop/bs4-default/main.php
Normal file
@@ -0,0 +1,328 @@
|
||||
|
||||
|
||||
<div id="rb-search-body" class="mb-4">
|
||||
|
||||
<header class="header">
|
||||
<form name="RbSearchForm" action="<?php echo $_HS['rewrite']? RW('m=search'):$g['s'].'/'?>" class="py-4" role="form" data-role="searchform">
|
||||
|
||||
<?php if (!$_HS['rewrite']): ?>
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $m?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="where" value="<?php echo $where?>">
|
||||
<input type="hidden" name="swhere" value="<?php echo $swhere?>">
|
||||
<input type="hidden" name="sort" value="<?php echo $sort?>">
|
||||
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
|
||||
|
||||
<div class="<?php echo $d['layout']['header_container'] ?>">
|
||||
<div class="row align-items-center">
|
||||
|
||||
<div class="col-8 pr-0">
|
||||
|
||||
<div class="media align-items-center">
|
||||
<h1 class="h2 mb-0 mr-4">
|
||||
<a class="navbar-brand" href="<?php echo RW(0) ?>"
|
||||
style="background-image:url(<?php echo $d['layout']['header_logo']?$g['url_var_site'].'/'.$d['layout']['header_logo'].$g['wcache']:''?>);background-size:<?php echo $d['layout']['header_logo_size'] ?>%">
|
||||
<?php echo !$d['layout']['header_logo']?$d['layout']['header_title'] :'' ?>
|
||||
</a>
|
||||
</h1>
|
||||
<div class="media-body">
|
||||
<div class="input-group input-group-lg shadow-sm dropdown">
|
||||
<input type="search" name="q" class="form-control bg-white border-0 rounded-0" value="<?php echo $q?>" data-plugin="autocomplete" autocomplete="off" required>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary border-0 rounded-0" type="submit"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div><!-- /.input-group -->
|
||||
</div><!-- /.media-body -->
|
||||
</div>
|
||||
</div><!-- /.col-8 -->
|
||||
|
||||
<div class="col-4">
|
||||
|
||||
|
||||
</div><!-- /.col-4 -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container -->
|
||||
</form>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white border-top border-bottom" data-role="lnb">
|
||||
<div class="container">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item <?php if($swhere=='all'):?> active<?php endif?>">
|
||||
<a class="nav-link" href="<?php echo $g['url_where']?>all">통합검색</a>
|
||||
</li>
|
||||
<?php $_ResultArray['spage']=0;foreach($d['search_order'] as $_key => $_val):if(!strstr($_val[1],'['.$r.']'))continue?>
|
||||
<li class="nav-item<?php if($swhere==$_key):?> active<?php endif?>" id="nav_<?php echo $_key?>" data-num="">
|
||||
<a class="nav-link" href="<?php echo $g['url_where'].$_key?>" id=nav_<?php echo $_key?>>
|
||||
<?php echo $_val[0]?>
|
||||
</a>
|
||||
</li>
|
||||
<?php $_ResultArray['spage']++;endforeach?>
|
||||
</ul>
|
||||
<?php if($q):?>
|
||||
<span class="navbar-text f13">
|
||||
총 <strong id="rb_sresult_num_all">0</strong> 건이 검색 되었습니다.
|
||||
</span>
|
||||
<?php endif?>
|
||||
<div class="ml-3">
|
||||
<select class="form-control custom-select custom-select-sm" data-header="정열방식" onchange="searchSortChange(this);">
|
||||
<option value="desc"<?php if($orderby=='desc'):?> selected<?php endif?>>최신순</option>
|
||||
<option value="asc"<?php if($orderby=='asc'):?> selected<?php endif?>>과거순</option>
|
||||
</select>
|
||||
</div>
|
||||
</div><!-- /.container -->
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="<?php echo $d['layout']['home_container'] ?>">
|
||||
|
||||
<div class="row">
|
||||
<main class="col-8 border-right py-4" data-plugin="markjs">
|
||||
|
||||
<div data-role="section-list">
|
||||
<?php $_ResultArray['num']=array()?>
|
||||
<?php if($q):?>
|
||||
<?php foreach($d['search_order'] as $_key => $_val):if(!strstr($_val[1],'['.$r.']'))continue?>
|
||||
<?php $_iscallpage=($swhere == 'all' || $swhere == $_key)?>
|
||||
<?php if($_iscallpage):?>
|
||||
<?php if(is_file($_val[2].'.css')) echo '<link href="'.$_val[2].'.css" rel="stylesheet">'?>
|
||||
<section id="rb_search_panel_<?php echo $_key?>" class="d-none" data-role="section-item">
|
||||
<header class="mb-3">
|
||||
<strong><?php echo $_val[0]?></strong>
|
||||
<small><span class="text-muted" data-role="sresult_num_tt_<?php echo $_key?>"></span> 건</small>
|
||||
</header>
|
||||
<?php endif?>
|
||||
|
||||
<!-- 검색결과 -->
|
||||
<?php include $_val[2].'.php' ?>
|
||||
<!-- @검색결과 -->
|
||||
|
||||
<?php if($_iscallpage):?>
|
||||
<?php if($swhere==$_key):?>
|
||||
<footer>
|
||||
<ul class="pagination justify-content-center mb-0">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo getTotalPage($_ResultArray['num'][$_key],$d['search']['num2'])?>,'');</script>
|
||||
</ul>
|
||||
</footer>
|
||||
<?php else:?>
|
||||
<?php if($_ResultArray['num'][$_key] > $d['search']['num1']):?>
|
||||
<footer>
|
||||
<div class="rb-more-search">
|
||||
<a href="<?php echo $g['url_where'].$_key?>">더보기 <i class="fa fa-angle-right"></i></a>
|
||||
</div>
|
||||
</footer>
|
||||
<?php endif?>
|
||||
<?php endif?>
|
||||
</section>
|
||||
<?php endif?>
|
||||
<?php endforeach?>
|
||||
</div>
|
||||
|
||||
<section id="search_no_result" class="d-none my-5">
|
||||
<h5 class="mb-4"><strong>'<?php echo $q ?>'</strong> 에 대한 검색결과가 없습니다.</h5>
|
||||
<ul class="list-unstyled text-muted f13">
|
||||
<li>ㆍ검색어의 단어 수를 줄이거나, 보다 일반적인 단어로 검색해 보세요.</li>
|
||||
<li>ㆍ두 단어 이상의 키워드로 검색 하신 경우, 정확하게 띄어쓰기를 한 후 검색해 보세요.</li>
|
||||
<li>ㆍ키워드에 있는 특수문자를 뺀 후에 검색해 보세요.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<?php else:?>
|
||||
|
||||
<section id="rb-searchresult-none">
|
||||
<div class="text-center p-5 text-muted">
|
||||
검색어를 입력해 주세요.
|
||||
</div>
|
||||
</section>
|
||||
<?php endif?>
|
||||
<section id="rb-searchpage-none" class="d-none">
|
||||
<h3>검색 페이지가 설정되어 있지 않습니다.</h3>
|
||||
</section>
|
||||
</main>
|
||||
<aside class="col-4 py-4">
|
||||
|
||||
<?php
|
||||
$recnum = 10;
|
||||
$sort = $sort ? $sort : 'hit';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$query = 'site='.$s.' and ';
|
||||
$_WHERE1= $query.'date >= '.date('Ymd', strtotime('-1 month'));
|
||||
$_WHERE2= 'keyword,sum(hit) as hit';
|
||||
$RCD = getDbSelect($table['s_tag'],$_WHERE1.' group by keyword order by '.$sort.' '.$orderby.' limit 0,'.$recnum,$_WHERE2);
|
||||
?>
|
||||
|
||||
<section data-role="section-item">
|
||||
<header class="d-flex justify-content-between">
|
||||
<strong>기간별 주요 키워드 </strong>
|
||||
<small class="text-muted"><?php echo date("m/d", strtotime("-1 month")).'~'. date("m/d", strtotime("now"))?></small>
|
||||
</header>
|
||||
|
||||
<div class="mt-2">
|
||||
<div class="row mx-0">
|
||||
<?php $j=0;while($G=db_fetch_array($RCD)):$j++?>
|
||||
|
||||
<div class="col-6 bg-light py-1 mb-1">
|
||||
<a class="text-reset d-block f13" href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=search&q=<?php echo urlencode($G['keyword'])?>" title="<?php echo $G['keyword']?>">
|
||||
<span class="badge badge-light mr-2"><?php echo $j?>.</span>
|
||||
<?php echo getStrCut($G['keyword'],6,'..')?>
|
||||
<small class="text-muted"><?php echo $G['hit']?>건</small>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php endwhile?>
|
||||
<?php if(!$j):?>
|
||||
<div class="nodata">지정된 기간내에 기록된 키워드가 없습니다.</div>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</aside>
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container -->
|
||||
</main>
|
||||
|
||||
<footer class="border-top">
|
||||
|
||||
<div class="pt-5 text-center">
|
||||
<form name="RbSearchForm2" action="<?php echo $_HS['rewrite']? RW('m=search'):$g['s'].'/'?>" class="mx-auto" role="form" data-role="searchform" style="width :460px">
|
||||
|
||||
<?php if (!$_HS['rewrite']): ?>
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $m?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="where" value="<?php echo $where?>">
|
||||
<input type="hidden" name="swhere" value="<?php echo $swhere?>">
|
||||
<input type="hidden" name="sort" value="<?php echo $sort?>">
|
||||
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
|
||||
|
||||
<div class="input-group input-group-lg shadow-sm">
|
||||
<input type="text" name="q" class="form-control bg-white border-0 rounded-0" value="<?php echo $q?>" autocomplete="off" required>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary border-0 rounded-0" type="submit"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="footer_comm mt-4 mb-5">
|
||||
<a href="<?php echo RW('mod=policy')?>" class="link_info">개인정보취급방침</a>
|
||||
<span class="txt_bar">|</span>
|
||||
<a href="<?php echo RW('mod=privacy')?>" class="link_info">이용약관</a>
|
||||
<span class="txt_bar">|</span>
|
||||
<span class="link_info">© <?php echo $d['layout']['company_name'] ?> <?php echo $date['year']?></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- markjs js : https://github.com/julmot/mark.js -->
|
||||
<?php getImport('markjs','jquery.mark.min','8.11.1','js')?>
|
||||
|
||||
<!-- jQuery-Autocomplete : https://github.com/devbridge/jQuery-Autocomplete -->
|
||||
<?php getImport('jQuery-Autocomplete','jquery.autocomplete.min','1.3.0','js') ?>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
document.title = '<?php echo $q?$q.'-':''?> 검색 | <?php echo $g['browtitle']?>';
|
||||
|
||||
function searchSortChange(obj)
|
||||
{
|
||||
var f = document.RbSearchForm;
|
||||
f.orderby.value = obj.value;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// Textarea 또는 Input의 끝으로 커서 이동
|
||||
jQuery.fn.putCursorAtEnd = function() {
|
||||
return this.each(function() {
|
||||
var $el = $(this),
|
||||
el = this;
|
||||
if (!$el.is(":focus")) {
|
||||
$el.focus();
|
||||
}
|
||||
if (el.setSelectionRange) {
|
||||
var len = $el.val().length * 2;
|
||||
setTimeout(function() {
|
||||
el.setSelectionRange(len, len);
|
||||
}, 1);
|
||||
} else {
|
||||
$el.val($el.val());
|
||||
}
|
||||
this.scrollTop = 999999;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
<?php $total = 0?>
|
||||
|
||||
$(function () {
|
||||
|
||||
<?php foreach($_ResultArray['num'] as $_key => $_val):$total+=$_val?>
|
||||
|
||||
if ($('[data-role="sresult_num_tt_<?php echo $_key?>"]')) {
|
||||
$('[data-role="sresult_num_tt_<?php echo $_key?>"]').text('<?php echo $_val?>')
|
||||
}
|
||||
|
||||
<?php if($_val):?>
|
||||
$('#rb_search_panel_<?php echo $_key?>').removeClass('d-none').addClass('active')
|
||||
$('#nav_<?php echo $_key?>').attr('data-num',<?php echo $_val?>);
|
||||
<?php else: ?>
|
||||
$('#rb_search_panel_<?php echo $_key?>').remove()
|
||||
<?php endif?>
|
||||
|
||||
<?php endforeach?>
|
||||
|
||||
var search_result_total = <?php echo $swhere=='all'?$total:$_ResultArray['num'][$swhere]?>;
|
||||
if(search_result_total==0){
|
||||
$("#search_no_result").removeClass("d-none");
|
||||
}
|
||||
$('#rb_sresult_num_all').text(search_result_total)
|
||||
$('[name="RbSearchForm"]').find('[name="q"]').focus().putCursorAtEnd()
|
||||
|
||||
<?php if(!$_ResultArray['spage']):?>
|
||||
if(getId('rb-sortbar')) getId('rb-sortbar').className = 'd-none';
|
||||
<?php endif?>
|
||||
|
||||
// marks.js
|
||||
$('[data-plugin="markjs"]').mark("<?php echo $q ?>");
|
||||
|
||||
$('[data-plugin="autocomplete"]').autocomplete({
|
||||
width : 467,
|
||||
lookup: function (query, done) {
|
||||
|
||||
$.getJSON(rooturl+"/?m=tag&a=searchtag", {q: query}, function(res){
|
||||
var sg_tag = [];
|
||||
var data_arr = res.taglist.split(',');//console.log(data.usernames);
|
||||
$.each(data_arr,function(key,tag){
|
||||
var tagData = tag.split('|');
|
||||
var keyword = tagData[0];
|
||||
var hit = tagData[1];
|
||||
sg_tag.push({"value":keyword,"data":hit});
|
||||
});
|
||||
var result = {
|
||||
suggestions: sg_tag
|
||||
};
|
||||
done(result);
|
||||
});
|
||||
},
|
||||
onSelect: function (suggestion) {
|
||||
if ($('[data-plugin="autocomplete"]').val().length >= 1) {
|
||||
$('[name="RbSearchForm"]').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
1
modules/search/themes/_desktop/bs4-default/name.txt
Normal file
1
modules/search/themes/_desktop/bs4-default/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
부스트트랩 4 기본형
|
||||
21
modules/search/themes/_mobile/rc-default/LICENSE
Normal file
21
modules/search/themes/_mobile/rc-default/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The RBL License
|
||||
|
||||
Copyright (c) 2011-2018 Redblock, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
6
modules/search/themes/_mobile/rc-default/README.md
Normal file
6
modules/search/themes/_mobile/rc-default/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
# 알씨 기본형
|
||||
|
||||
모바일 전용 통합검색 테마 입니다.
|
||||
|
||||
## 주요 기능
|
||||
172
modules/search/themes/_mobile/rc-default/component.js
Normal file
172
modules/search/themes/_mobile/rc-default/component.js
Normal file
@@ -0,0 +1,172 @@
|
||||
var modal_search = $('#modal-search');
|
||||
var modal_search_none = '<div class="p-5 text-xs-center text-muted" data-role="none">검색된 자료가 없습니다.</div>';
|
||||
|
||||
function getSearchResult(settings) {
|
||||
var wrapper = settings.wrapper;
|
||||
var start = settings.start;
|
||||
var keyword = settings.keyword;
|
||||
var sort = settings.sort;
|
||||
var recnum = settings.recnum;
|
||||
var markup_file = settings.markup_file;
|
||||
var none = settings.none;
|
||||
|
||||
var totalPage = settings.totalPage;
|
||||
var totalNUM = settings.totalNUM;
|
||||
var currentPage =1; // 처음엔 무조건 1, 아래 더보기 진행되면서 +1 증가
|
||||
var prevNUM = currentPage * recnum;
|
||||
var moreNUM = totalNUM - prevNUM ;
|
||||
|
||||
wrapper.find('[data-role="list-post"]').loader({ position: 'inside' });
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_postSearch',{
|
||||
start: start,
|
||||
keyword : keyword,
|
||||
sort : sort,
|
||||
recnum : recnum,
|
||||
p : currentPage,
|
||||
markup_file : markup_file
|
||||
},function(response,status){
|
||||
if(status=='success'){
|
||||
var result = $.parseJSON(response);
|
||||
var list=result.list;
|
||||
var num=result.num;
|
||||
|
||||
if (list) wrapper.find('[data-role="list-post"]').html(list)
|
||||
else wrapper.find('[data-role="list-post"]').html(none)
|
||||
|
||||
wrapper.find('[data-role="keyword-reset"]').removeClass("hidden");
|
||||
wrapper.find('[data-plugin="timeago"]').timeago();
|
||||
|
||||
$('[data-role="search"]').find('[name="keyword"]').blur();
|
||||
|
||||
//무한 스크롤
|
||||
wrapper.closest('.content').infinitescroll({
|
||||
dataSource: function(helpers, callback){
|
||||
var nextPage = parseInt(currentPage)+1;
|
||||
if (totalPage>currentPage) {
|
||||
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_postSearch',{
|
||||
start: start,
|
||||
sort: sort,
|
||||
recnum : recnum,
|
||||
markup_file : markup_file,
|
||||
p : nextPage
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
var list=result.list;
|
||||
if(error) alert(result.error);
|
||||
callback({ content: list });
|
||||
|
||||
currentPage++; // 현재 페이지 +1
|
||||
console.log(currentPage+'페이지 불러옴')
|
||||
wrapper.find('[data-plugin="timeago"]').timeago();
|
||||
//wrapper.find('[data-plugin="markjs"]').mark(keyword); // marks.js
|
||||
});
|
||||
} else {
|
||||
callback({ end: true });
|
||||
console.log('더이상 불러올 페이지가 없습니다.')
|
||||
}
|
||||
},
|
||||
appendToEle : wrapper,
|
||||
percentage : 95, // 95% 아래로 스크롤할때 다움페이지 호출
|
||||
hybrid : false // true: 버튼형, false: 자동
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
alert(status);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} // getSearchResult
|
||||
|
||||
//검색 모달이 열렸을때
|
||||
modal_search.on('shown.rc.modal', function () {
|
||||
var modal = $(this);
|
||||
setTimeout(function() {
|
||||
modal_search.find('[name="keyword"]').val('').focus();
|
||||
}, 100);
|
||||
|
||||
$('#modal-post-view').find('[data-act="pauseVideo"]').click(); //유튜브 미니플레이어 재생정지
|
||||
|
||||
modal_search.find('[name="keyword"]').autocomplete({
|
||||
lookup: function (query, done) {
|
||||
|
||||
$.getJSON(rooturl+"/?m=tag&a=searchtag", {q: query}, function(res){
|
||||
var sg_tag = [];
|
||||
var data_arr = res.taglist.split(',');//console.log(data.usernames);
|
||||
$.each(data_arr,function(key,tag){
|
||||
var tagData = tag.split('|');
|
||||
var keyword = tagData[0];
|
||||
var hit = tagData[1];
|
||||
sg_tag.push({"value":keyword,"data":hit});
|
||||
});
|
||||
var result = {
|
||||
suggestions: sg_tag
|
||||
};
|
||||
done(result);
|
||||
});
|
||||
},
|
||||
onSelect: function (suggestion) {
|
||||
if (modal_search.find('[name="keyword"]').val().length >= 1) {
|
||||
modal_search.find('form').submit();
|
||||
console.log('검색')
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//검색실행
|
||||
modal_search.find('form').submit( function(e){
|
||||
var modal = modal_search;
|
||||
var keyword = modal_search.find('[name="keyword"]').val();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
getSearchResult({
|
||||
wrapper : modal,
|
||||
keyword : keyword,
|
||||
totalNUM : '',
|
||||
totalPage : '',
|
||||
recnum : '5',
|
||||
totalPage : '',
|
||||
sort : 'gid',
|
||||
markup_file : 'search-row',
|
||||
none : modal_search_none
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 검색버튼과 검색어 초기화 버튼 동적 출력
|
||||
modal_search.find('[name="keyword"]').on('keyup', function(event) {
|
||||
var modal = modal_search
|
||||
modal.find('[data-role="keyword-reset"]').addClass("hidden"); // 검색어 초기화 버튼 숨김
|
||||
modal.find("#drawer-search-footer").addClass('hidden') //검색풋터(검색버튼 포함) 숨김
|
||||
modal.find('[data-role="none"]').addClass('d-none');
|
||||
if ($(this).val().length >= 2) {
|
||||
modal.find('[data-role="keyword-reset"]').removeClass("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
// 검색어 입력필드 초기화
|
||||
$(document).on('tap click','[data-act="keyword-reset"]',function(){
|
||||
var modal = modal_search
|
||||
modal.find('[name="keyword"]').val('').autocomplete('clear'); // 입력필드 초기화
|
||||
setTimeout(function(){
|
||||
modal.find('[name="keyword"]').focus(); // 입력필드 포커싱
|
||||
modal.find('[data-role="keyword-reset"]').addClass("hidden"); // 검색어 초기화 버튼 숨김
|
||||
modal.find('[data-role="none"]').addClass('d-none');
|
||||
modal.find('[data-role="list-post"]').empty();
|
||||
}, 10);
|
||||
});
|
||||
|
||||
// 검색모달이 닫혔을때
|
||||
modal_search.on('hidden.rc.modal', function () {
|
||||
var modal = $(this)
|
||||
modal.find('[name="keyword"]').autocomplete('clear');
|
||||
$('.autocomplete-suggestions').remove();
|
||||
modal.find('[name="keyword"]').val('');
|
||||
modal.find('[data-role="list-post"]').html('');
|
||||
modal.find('[data-role="keyword-reset"]').addClass("hidden"); // 검색어 초기화 버튼 숨김'
|
||||
})
|
||||
23
modules/search/themes/_mobile/rc-default/component.php
Normal file
23
modules/search/themes/_mobile/rc-default/component.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- 통합검색 -->
|
||||
<div id="modal-search" class="modal fast" data-role="search">
|
||||
<header class="bar bar-nav px-0 bg-white">
|
||||
<a class="icon material-icons pull-left pl-3 pr-2 text-muted" role="button" data-history="back">arrow_back</a>
|
||||
<form class="input-group">
|
||||
<input type="search" name="keyword" class="form-control bg-faded" placeholder="검색어 입력" required autocomplete="off">
|
||||
<span class="input-group-btn hidden" data-role="keyword-reset" >
|
||||
<button class="btn btn-link btn-nav" type="button" data-act="keyword-reset" tabindex="-1">
|
||||
<i class="icon material-icons" aria-hidden="true">close</i>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
</header>
|
||||
<main class="content bg-white">
|
||||
|
||||
<ul class="table-view table-view-sm mt-2 border-top-0 border-bottom-0" data-role="list-list"></ul>
|
||||
|
||||
<ul class="table-view table-view-sm mt-2 border-top-0 border-bottom-0" data-role="list-post"></ul>
|
||||
|
||||
</main>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script src="/modules/search/themes/_mobile/rc-default/component.js<?php echo $g['wcache']?>" ></script>
|
||||
7
modules/search/themes/_mobile/rc-default/main.css
Normal file
7
modules/search/themes/_mobile/rc-default/main.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.bar input[type="search"] {
|
||||
height: 2.35rem;
|
||||
margin: .2rem 0;
|
||||
}
|
||||
.rb-main {
|
||||
margin-top: -1px
|
||||
}
|
||||
190
modules/search/themes/_mobile/rc-default/main.php
Normal file
190
modules/search/themes/_mobile/rc-default/main.php
Normal file
@@ -0,0 +1,190 @@
|
||||
<!-- markjs js : https://github.com/julmot/mark.js -->
|
||||
<?php getImport('markjs','jquery.mark.min','8.11.1','js')?>
|
||||
|
||||
<header class="bar bar-nav bar-dark bg-primary pl-0 pr-1">
|
||||
<form name="RbSearchForm" action="<?php echo $g['s']?>/" class="input-group" role="form" id="search-form" style="top: 0;">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $m?>">
|
||||
<input type="hidden" name="where" value="<?php echo $where?>">
|
||||
<input type="hidden" name="swhere" value="all">
|
||||
<input type="hidden" name="term" value="<?php echo $term?>">
|
||||
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
|
||||
<span class="input-group-btn" data-role="return-result">
|
||||
<a class="icon icon-left-nav pull-left px-2" role="button" href="<?php echo RW(0) ?>"></a>
|
||||
</span>
|
||||
<input type="search" class="form-control border-0" placeholder="검색어를 입력하세요." value="<?php echo $_keyword?>" id="search-input-page" name="keyword" autocomplete="off">
|
||||
<span class="input-group-btn hidden" data-role="reset-keyword">
|
||||
<button class="btn btn-secondary px-3" type="button" data-act="keyword-reset" tabindex="-1">
|
||||
<i class="fa fa-times-circle fa-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
</header>
|
||||
|
||||
<!-- Block button in standard bar fixed below top bar -->
|
||||
<div class="bar bar-standard bar-header-secondary bar-light bg-white">
|
||||
<nav class="nav nav-inline">
|
||||
<a id="nav_search_all" class="nav-link<?php if($swhere=='all'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>all" data-control="push" data-transition="fade" data-act="moreResult">전체</a>
|
||||
<a id="nav_site_page" class="nav-link<?php if($swhere=='site_page'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>site_page" data-control="push" data-transition="fade" data-act="moreResult">페이지</a>
|
||||
<a id="nav_bbs_post" class="nav-link<?php if($swhere=='bbs_post'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>bbs_post" data-control="push" data-transition="fade" data-act="moreResult">게시물</a>
|
||||
<a id="nav_mediaset_photo" class="nav-link<?php if($swhere=='mediaset_photo'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>mediaset_photo" data-control="push" data-transition="fade" data-act="moreResult">사진</a>
|
||||
<a id="nav_mediaset_youtube" class="nav-link<?php if($swhere=='mediaset_youtube'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>mediaset_youtube" data-control="push" data-transition="fade" data-act="moreResult">동영상</a>
|
||||
<a id="nav_mediaset_file" class="nav-link<?php if($swhere=='mediaset_file'):?> active<?php endif?>" href="<?php echo $g['url_where'] ?>mediaset_file" data-control="push" data-transition="fade" data-act="moreResult">파일</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="bar bar-standard bar-footer bar-light bg-faded hidden" id="search-footer">
|
||||
<button class="btn btn-secondary btn-block" id="search-form-submit">검색</button>
|
||||
</div>
|
||||
|
||||
<div class="content bg-faded" data-role="panal-result">
|
||||
<main class="rb-main" data-plugin="markjs">
|
||||
|
||||
<?php if($keyword && $swhere == 'all'):?>
|
||||
<div id="rb-sortbar" class="card p-a-1 bg-white">
|
||||
총 <span id="rb_sresult_num_all" class="badge badge-primary badge-outline">0</span> 건이 검색 되었습니다.
|
||||
</div>
|
||||
|
||||
<div id="search_no_result" class="d-none content-padded">
|
||||
<div class="alert alert-info text-xs-center"><strong>‘<span><?php echo $keyword;?></span>’에 대한 검색결과가 없습니다.</strong></div>
|
||||
<ul class="list-unstyled text-muted">
|
||||
<li>검색어의 철자를 정확하게 입력했는지 확인해 보세요.</li>
|
||||
<li>연관된 다른 검색어나 비슷한 의미의 일반적인 단어를 입력하여 찾아 보세요.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a href="<?php echo RW(0) ?>" class="btn btn-secondary btn-block">홈으로</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php endif?>
|
||||
|
||||
|
||||
<?php $_ResultArray['num']=array()?>
|
||||
<?php if($keyword):?>
|
||||
<?php foreach($d['search_order'] as $_key => $_val):if(!strstr($_val[1],'['.$r.']'))continue?>
|
||||
<?php $_iscallpage=($swhere == 'all' || $swhere == $_key)?>
|
||||
<?php if($_iscallpage):?>
|
||||
<?php if(is_file($_val[2].'.css')) echo '<link href="'.$_val[2].'.css" rel="stylesheet">'?>
|
||||
<section id="rb_search_panel_<?php echo $_key?>" class="widget mb-2">
|
||||
<header>
|
||||
<div class="content-padded">
|
||||
<?php echo $_val[0]?>
|
||||
<small class="ml-2"><span id="rb_sresult_num_tt_<?php echo $_key?>" class="text-danger">0</span> 건</small>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
<?php endif?>
|
||||
|
||||
<!-- 검색결과 -->
|
||||
<div class="">
|
||||
<?php include $_val[2].'.php' ?>
|
||||
</div>
|
||||
<!-- @검색결과 -->
|
||||
<?php if($_iscallpage): ?>
|
||||
<?php if($swhere==$_key): ?>
|
||||
<footer>
|
||||
<div class="p-x-0">
|
||||
<?php echo getPageLink_RC(3,$p,getTotalPage($_ResultArray['num'][$_key],$d['search']['num2']),'1')?>
|
||||
</div>
|
||||
</footer>
|
||||
<?php else:?>
|
||||
<?php if($_ResultArray['num'][$_key] > $d['search']['num1']):?>
|
||||
<footer class="p-2 text-xs-right">
|
||||
<a href="<?php echo $g['url_where'].$_key ?>" class="btn btn-link text-muted" data-control="push" data-transition="fade" data-act="moreResult">
|
||||
<?php echo $_val[0]?> 더보기 <i class="fa fa-arrow-circle-o-right fa-lg" aria-hidden="true"></i>
|
||||
</a>
|
||||
</footer>
|
||||
<?php endif ?>
|
||||
<?php endif?>
|
||||
</section>
|
||||
|
||||
<?php endif?>
|
||||
|
||||
<?php endforeach?>
|
||||
|
||||
<?php else:?>
|
||||
<div id="rb-searchresult-none" class="content-padded">
|
||||
<p>검색어를 입력해 주세요.</p>
|
||||
</div>
|
||||
<?php endif?>
|
||||
</main>
|
||||
</div><!-- /.content -->
|
||||
|
||||
<script>
|
||||
|
||||
// 통합검색 입력창
|
||||
var doSearchInput = function(){
|
||||
|
||||
$('#search-input-page').focus(function(){
|
||||
var keyword = $(this).val()
|
||||
var modal = $('#modal-search')
|
||||
$('.loader-overlay').remove()
|
||||
modal.modal('show')
|
||||
setTimeout(function(){
|
||||
$('#search-input').val(keyword).focus()
|
||||
modal.find('[data-role="keyword-reset"]').removeClass('hidden')
|
||||
}, 310);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var doSearchResult = function(){
|
||||
|
||||
function searchSortChange(obj)
|
||||
{
|
||||
var f = document.RbSearchForm;
|
||||
f.orderby.value = obj.value;
|
||||
f.submit();
|
||||
}
|
||||
function searchTermChange(obj)
|
||||
{
|
||||
var f = document.RbSearchForm;
|
||||
f.term.value = obj.value;
|
||||
f.submit();
|
||||
}
|
||||
function searchWhereChange(obj)
|
||||
{
|
||||
var f = document.RbSearchForm;
|
||||
f.where.value = obj.value;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// marks.js
|
||||
$('[data-plugin="markjs"]').mark("<?php echo $keyword ?>");
|
||||
|
||||
<?php $total = 0?>
|
||||
|
||||
<?php foreach($_ResultArray['num'] as $_key => $_val):$total+=$_val?>
|
||||
|
||||
if ($('#rb_sresult_num_tt_<?php echo $_key?>')) {
|
||||
$('#rb_sresult_num_tt_<?php echo $_key?>').text('<?php echo $_val?>')
|
||||
}
|
||||
|
||||
<?php if(!$_val):?>
|
||||
$('#rb_search_panel_<?php echo $_key?>').addClass('d-none')
|
||||
$('#nav_<?php echo $_key?>').addClass('d-none')
|
||||
<?php endif?>
|
||||
|
||||
<?php endforeach?>
|
||||
|
||||
var search_result_total = <?php echo $swhere=='all'?$total:$_ResultArray['num'][$swhere]?>;
|
||||
if(search_result_total==0){
|
||||
$("#search_no_result").removeClass("d-none");
|
||||
$('.bar-header-secondary').remove()
|
||||
}
|
||||
$('#rb_sresult_num_all').text(search_result_total)
|
||||
|
||||
<?php if(!$_ResultArray['spage']):?>
|
||||
if(getId('rb-sortbar')) getId('rb-sortbar').className = 'd-none';
|
||||
<?php endif?>
|
||||
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
// 검색관련 스크립트 실행
|
||||
doSearchInput();
|
||||
doSearchResult();
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
1
modules/search/themes/_mobile/rc-default/name.txt
Normal file
1
modules/search/themes/_mobile/rc-default/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
알씨 기본형
|
||||
Reference in New Issue
Block a user