first
This commit is contained in:
4
modules/tag/README.md
Normal file
4
modules/tag/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## Copyright and license
|
||||
Copyright 2020 Redblock, Inc.
|
||||
|
||||
Licensed under the [RBL](https://kimsq.com/p/rbl) License
|
||||
23
modules/tag/action/a.searchtag.php
Normal file
23
modules/tag/action/a.searchtag.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
$data = array();
|
||||
|
||||
$p = $p ? $p : 1;
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
$sort = $sort ? $sort : 'hit';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$query = 'site='.$s.' and ';
|
||||
$_WHERE1= $query.'keyword like "%'.$q.'%"';
|
||||
$_WHERE2= 'keyword,sum(hit) as hit';
|
||||
$Tags = getDbSelect($table['s_tag'],$_WHERE1.' group by keyword order by '.$sort.' '.$orderby.' limit 0,'.$recnum,$_WHERE2);
|
||||
|
||||
$tagData = '';
|
||||
while($R=db_fetch_array($Tags)){
|
||||
$tagData .= $R['keyword'].'|'.$R['hit'].',';
|
||||
}
|
||||
$data['taglist'] = $tagData;
|
||||
|
||||
echo json_encode($data);
|
||||
exit;
|
||||
?>
|
||||
4
modules/tag/admin.php
Normal file
4
modules/tag/admin.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
include $g['path_module'].$module.'/admin/'.$front.'.php';
|
||||
?>
|
||||
29
modules/tag/admin/_info.php
Normal file
29
modules/tag/admin/_info.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$license_local = $g['path_module'].$module.'/LICENSE';
|
||||
$license_global = $g['path_root'].'LICENSE';
|
||||
|
||||
if (file_exists($license_local)) $license = $license_local;
|
||||
else $license = $license_global;
|
||||
?>
|
||||
|
||||
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
|
||||
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
|
||||
|
||||
<?php @include $g['path_module'].$module.'/var/var.moduleinfo.php' ?>
|
||||
|
||||
<article class="rb-docs markdown-body px-5 pt-3">
|
||||
<h1><?php echo sprintf('%s 모듈정보',ucfirst($MD['name']))?></h1>
|
||||
|
||||
<div class="pb-5 readme">
|
||||
<?php readfile($g['path_module'].$module.'/README.md')?>
|
||||
</div>
|
||||
|
||||
<div class="pb-5">
|
||||
<h2>라이센스</h2>
|
||||
<textarea class="form-control" rows="10"><?php readfile($license)?></textarea>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".markdown-body .readme").markdown();
|
||||
</script>
|
||||
0
modules/tag/admin/main.css
Normal file
0
modules/tag/admin/main.css
Normal file
110
modules/tag/admin/main.php
Normal file
110
modules/tag/admin/main.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
|
||||
$year1 = $year1 ? $year1 : substr($date['today'],0,4);
|
||||
$month1 = $month1 ? $month1 : substr($date['today'],4,2);
|
||||
$day1 = $day1 ? $day1 : 1;
|
||||
$year2 = $year2 ? $year2 : substr($date['today'],0,4);
|
||||
$month2 = $month2 ? $month2 : substr($date['today'],4,2);
|
||||
$day2 = $day2 ? $day2 : substr($date['today'],6,2);
|
||||
|
||||
$p = $p ? $p : 1;
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
$sort = $sort ? $sort : 'hit';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$account = $SD['uid'];
|
||||
$accountQue = $account ? 'site='.$account.' and ':'';
|
||||
|
||||
$_WHERE1= $accountQue.'date >= '.$year1.sprintf('%02d',$month1).sprintf('%02d',$day1).' and date <= '.$year2.sprintf('%02d',$month2).sprintf('%02d',$day2);
|
||||
$_WHERE2= 'keyword,sum(hit) as hit';
|
||||
$RCD = getDbSelect($table['s_tag'],$_WHERE1.' group by keyword order by '.$sort.' '.$orderby.' limit 0,'.$recnum,$_WHERE2);
|
||||
?>
|
||||
|
||||
<section class="p-4">
|
||||
|
||||
<form name="procForm" class="form-inline" action="<?php echo $g['s']?>/" method="get">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $m?>" />
|
||||
<input type="hidden" name="module" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="front" value="<?php echo $front?>" />
|
||||
|
||||
<div class="sbox">
|
||||
|
||||
<div>
|
||||
<select name="year1" class="form-control custom-select">
|
||||
<?php for($i=$date['year'];$i>2009;$i--):?><option value="<?php echo $i?>"<?php if($year1==$i):?> selected="selected"<?php endif?>><?php echo $i?>년</option><?php endfor?>
|
||||
</select>
|
||||
<select name="month1" class="form-control custom-select">
|
||||
<?php for($i=1;$i<13;$i++):?><option value="<?php echo sprintf('%02d',$i)?>"<?php if($month1==$i):?> selected="selected"<?php endif?>><?php echo sprintf('%02d',$i)?>월</option><?php endfor?>
|
||||
</select>
|
||||
<select name="day1" class="form-control custom-select">
|
||||
<?php for($i=1;$i<32;$i++):?><option value="<?php echo sprintf('%02d',$i)?>"<?php if($day1==$i):?> selected="selected"<?php endif?>><?php echo sprintf('%02d',$i)?>일(<?php echo getWeekday(date('w',mktime(0,0,0,$month1,$i,$year1)))?>)</option><?php endfor?>
|
||||
</select> ~
|
||||
<select name="year2" class="form-control custom-select">
|
||||
<?php for($i=$date['year'];$i>2009;$i--):?><option value="<?php echo $i?>"<?php if($year2==$i):?> selected="selected"<?php endif?>><?php echo $i?>년</option><?php endfor?>
|
||||
</select>
|
||||
<select name="month2" class="form-control custom-select">
|
||||
<?php for($i=1;$i<13;$i++):?><option value="<?php echo sprintf('%02d',$i)?>"<?php if($month2==$i):?> selected="selected"<?php endif?>><?php echo sprintf('%02d',$i)?>월</option><?php endfor?>
|
||||
</select>
|
||||
<select name="day2" class="form-control custom-select">
|
||||
<?php for($i=1;$i<32;$i++):?><option value="<?php echo sprintf('%02d',$i)?>"<?php if($day2==$i):?> selected="selected"<?php endif?>><?php echo sprintf('%02d',$i)?>일(<?php echo getWeekday(date('w',mktime(0,0,0,$month2,$i,$year2)))?>)</option><?php endfor?>
|
||||
</select>
|
||||
|
||||
<input type="button" class="btn btn-light" value="기간적용" onclick="this.form.submit();" />
|
||||
<input type="button" class="btn btn-light" value="어제" onclick="dropDate('<?php echo date('Ymd',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Ymd',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');" />
|
||||
<input type="button" class="btn btn-light" value="오늘" onclick="dropDate('<?php echo $date['today']?>','<?php echo $date['today']?>');" />
|
||||
<input type="button" class="btn btn-light" value="일주" onclick="dropDate('<?php echo date('Ymd',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo $date['today']?>');" />
|
||||
<input type="button" class="btn btn-light" value="한달" onclick="dropDate('<?php echo date('Ymd',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo $date['today']?>');" />
|
||||
<input type="button" class="btn btn-light" value="당월" onclick="dropDate('<?php echo substr($date['today'],0,6)?>01','<?php echo $date['today']?>');" />
|
||||
<input type="button" class="btn btn-light" value="전월" onclick="dropDate('<?php echo date('Ym',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Ym',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');" />
|
||||
<input type="button" class="btn btn-light" value="전체" onclick="dropDate('20090101','<?php echo $date['today']?>');" />
|
||||
</div>
|
||||
<div>
|
||||
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
|
||||
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50개</option>
|
||||
<option value="100"<?php if($recnum==100):?> selected="selected"<?php endif?>>100개</option>
|
||||
<option value="150"<?php if($recnum==150):?> selected="selected"<?php endif?>>150개</option>
|
||||
<option value="200"<?php if($recnum==200):?> selected="selected"<?php endif?>>200개</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
<div class="mt-4">
|
||||
<?php $j=0;while($G=db_fetch_array($RCD)):$j++?>
|
||||
|
||||
<a class="btn btn-outline-primary" href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=search&q=<?php echo urlencode($G['keyword'])?>" target="_blank" title="<?php echo $G['keyword']?>">
|
||||
<span class="num"><?php echo $j?>.</span>
|
||||
<?php echo getStrCut($G['keyword'],6,'..')?>
|
||||
<span class="badge badge-dark"><?php echo $G['hit']?>건</span>
|
||||
</a>
|
||||
|
||||
<?php endwhile?>
|
||||
<?php if(!$j):?>
|
||||
<div class="nodata">지정된 기간내에 기록된 키워드가 없습니다.</div>
|
||||
<?php endif?>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
//사이트 셀렉터 출력
|
||||
$('[data-role="siteSelector"]').removeClass('d-none')
|
||||
|
||||
function dropDate(date1,date2)
|
||||
{
|
||||
var f = document.procForm;
|
||||
f.year1.value = date1.substring(0,4);
|
||||
f.month1.value = date1.substring(4,6);
|
||||
f.day1.value = date1.substring(6,8);
|
||||
|
||||
f.year2.value = date2.substring(0,4);
|
||||
f.month2.value = date2.substring(4,6);
|
||||
f.day2.value = date2.substring(6,8);
|
||||
|
||||
f.submit();
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
3
modules/tag/admin/var/var.menu.php
Normal file
3
modules/tag/admin/var/var.menu.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$d['amenu']['main'] = '태그분석';
|
||||
?>
|
||||
3
modules/tag/main.php
Normal file
3
modules/tag/main.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
?>
|
||||
1
modules/tag/name.txt
Normal file
1
modules/tag/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
태그
|
||||
Reference in New Issue
Block a user