Skip to content

Commit

Permalink
관리자 글현황 추가 및 기타 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Aug 28, 2015
1 parent 82c12f6 commit 84009dc
Show file tree
Hide file tree
Showing 84 changed files with 29,584 additions and 16 deletions.
1 change: 1 addition & 0 deletions adm/admin.menu300.php
Expand Up @@ -8,5 +8,6 @@
array('300500', '1:1문의설정', ''.G5_ADMIN_URL.'/qa_config.php', 'qa'),
array('300600', '내용관리', G5_ADMIN_URL.'/contentlist.php', 'scf_contents', 1),
array('300700', 'FAQ관리', G5_ADMIN_URL.'/faqmasterlist.php', 'scf_faq', 1),
array('300820', '글,댓글 현황', G5_ADMIN_URL.'/write_count.php', 'scf_write_count'),
);
?>
2 changes: 1 addition & 1 deletion adm/config_form.php
Expand Up @@ -209,7 +209,7 @@
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';

if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
}
?>
Expand Down
13 changes: 12 additions & 1 deletion adm/css/admin.css
Expand Up @@ -747,4 +747,15 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
#theme_detail table{border-collapse:collapse;margin:5px 0 10px}
#theme_detail table th{padding: 5px 0; border: 1px solid #d1dee2; background: #e5ecef;width:50px;padding:10px;text-align:left}
#theme_detail table td{ border: 1px solid #ececec;padding:10px}
.no_theme{text-align:center;padding:100px 0;color:#555}
.no_theme{text-align:center;padding:100px 0;color:#555}

/*글,댓글현황*/
#wr_cont{position:relative;margin:10px 20px}
#wr_cont input[type="submit"]{background:#ff3061;border:none;color:#fff;padding: 0 5px;height: 24px;}
#wr_cont select{height: 24px;}
#grp_color{border:2px solid #ddd;position:absolute;top:0;right:0;list-style:none;padding: 5px 5px; margin:0;}
#grp_color li{padding:5px 10px;}
#grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;}
#grp_color li.color2 span{background:rgb(234, 162, 40);}
#chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0}
#chart_wr{margin:20px }
2 changes: 1 addition & 1 deletion adm/sms_admin/config.php
Expand Up @@ -9,7 +9,7 @@
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';

if ($config['cf_icode_id'] && $config['cf_icode_pw'])
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw'])
{
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
}
Expand Down
210 changes: 210 additions & 0 deletions adm/write_count.php
@@ -0,0 +1,210 @@
<?php
$sub_menu = '300820';
include_once('./_common.php');

check_demo();

auth_check($auth[$sub_menu], 'r');

// http://www.jqplot.com/
add_stylesheet('<link rel="stylesheet" href="'.G5_PLUGIN_URL.'/jqplot/jquery.jqplot.css">', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jquery.jqplot.js"></script>', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.pointLabels.min.js"></script>', 0);
add_javascript('<!--[if lt IE 9]><script src="'.G5_PLUGIN_URL.'/jqplot/excanvas.js"></script><![endif]-->', 0);

if (!($graph == 'line' || $graph == 'bar'))
$graph = 'line';

if ($graph == 'bar') {
// 바 타입으로 사용하는 코드입니다.
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.barRenderer.min.js"></script>', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.categoryAxisRenderer.min.js"></script>', 0);
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.pointLabels.min.js"></script>', 0);
}

$g5['title'] = '글,댓글 현황';
include_once ('./admin.head.php');

$period_array = array(
'오늘'=>array('시간', 0),
'어제'=>array('시간', 0),
'7일전'=>array('일', 7),
'14일전'=>array('일', 14),
'30일전'=>array('일', 30),
'3개월전'=>array('주', 90),
'6개월전'=>array('주', 180),
'1년전'=>array('월', 365),
'2년전'=>array('월', 365*2),
'3년전'=>array('월', 365*3),
'5년전'=>array('년', 365*5),
'10년전'=>array('년', 365*10),
);

$is_period = false;
foreach($period_array as $key=>$value) {
if ($key == $period) {
$is_period = true;
break;
}
}
if (!$is_period)
$period = '오늘';

$day = $period_array[$period][0];

$today = date('Y-m-d', G5_SERVER_TIME);
$yesterday = date('Y-m-d', G5_SERVER_TIME - 86400);

if ($period == '오늘') {
$from = $today;
$to = $from;
} else if ($period == '어제') {
$from = $yesterday;
$to = $from;
} else if ($period == '내일') {
$from = date('Y-m-d', G5_SERVER_TIME + (86400 * 2));
$to = $from;
} else {
$from = date('Y-m-d', G5_SERVER_TIME - (86400 * $period_array[$period][1]));
$to = $yesterday;
}

$sql_bo_table = '';
if ($bo_table)
$sql_bo_table = "and bo_table = '$bo_table'";

switch ($day) {
case '시간' :
$sql = " select substr(bn_datetime,6,8) as hours, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by hours order by bn_datetime ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 월-일 시간
$line1[] = "['".substr($row['hours'],0,8)."',".$row['wcount'].']';
$line2[] = "['".substr($row['hours'],0,8)."',".$row['ccount'].']';
}
break;
case '일' :
$sql = " select substr(bn_datetime,1,10) as days, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by days order by bn_datetime ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 월-일
$line1[] = "['".substr($row['days'],5,5)."',".$row['wcount'].']';
$line2[] = "['".substr($row['days'],5,5)."',".$row['ccount'].']';
}
break;
case '주' :
$sql = " select concat(substr(bn_datetime,1,4), '-', weekofyear(bn_datetime)) as weeks, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by weeks order by bn_datetime ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 올해의 몇주로 보여주면 바로 확인이 안되므로 주를 날짜로 바꾼다.
// 년-월-일
list($lyear, $lweek) = explode('-', $row['weeks']);
$date = date('y-m-d', strtotime($lyear.'W'.str_pad($lweek, 2, '0', STR_PAD_LEFT)));
$line1[] = "['".$date."',".$row['wcount'].']';
$line2[] = "['".$date."',".$row['ccount'].']';
}
break;
case '월' :
$sql = " select substr(bn_datetime,1,7) as months, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by months order by bn_datetime ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 년-월
$line1[] = "['".substr($row['months'],2,5)."',".$row['wcount'].']';
$line2[] = "['".substr($row['months'],2,5)."',".$row['ccount'].']';
}
break;
case '년' :
$sql = " select substr(bn_datetime,1,4) as years, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by years order by bn_datetime ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 년(4자리)
$line1[] = "['".substr($row['years'],0,4)."',".$row['wcount'].']';
$line2[] = "['".substr($row['years'],0,4)."',".$row['ccount'].']';
}
break;
}
?>
<div id="wr_cont">
<form>
<select name="bo_table">
<option value="">전체게시판</a>
<?php
$sql = " select bo_table, bo_subject from {$g5['board_table']} order by bo_count_write desc ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
echo "<option value=\"{$row['bo_table']}\"";
if ($bo_table == $row['bo_table'])
echo ' selected="selected"';
echo ">{$row['bo_subject']}</option>\n";
}
?>
</select>

<select name="period">
<?php
foreach($period_array as $key=>$value) {
echo "<option value=\"{$key}\"";
if ($key == $period)
echo " selected=\"selected\"";
echo ">{$key}</option>\n";
}
?>
</select>

<select name="graph">
<option value="line" <?php echo ($graph == 'line' ? 'selected="selected"' : ''); ?>>선그래프</option>
<option value="bar" <?php echo ($graph == 'bar' ? 'selected="selected"' : ''); ?>>막대그래프</option>
</select>

<input type="submit" class="btn_submit" value="확인">
</form>
<ul id="grp_color">
<li><span></span>글 수</li>
<li class="color2"><span></span>댓글 수</li>
</ul>
</div>
<br>
<div id="chart_wr">
<?php
if (empty($line1) || empty($line2)) {
echo "<h5>그래프를 만들 데이터가 없습니다.</h5>\n";
} else {
?>
<div id="chart1" style="height:500px; width:100%;"></div>
<div>
<script>
$(document).ready(function(){
var line1 = [<?php echo implode($line1, ','); ?>];
var line2 = [<?php echo implode($line2, ','); ?>];
var plot1 = $.jqplot ('chart1', [line1, line2], {
seriesDefaults: {
<?php if ($graph == 'bar') { ?>
renderer:$.jqplot.BarRenderer,
<?php } ?>
pointLabels: { show: true }
},
axes:{
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
label: '<?php echo $day; ?>',
pad:0,
max:23
},
yaxis: {
label: '글수',
min: 0

}
}
});
});
</script>
<?php
}
?>

<?
include_once ('./admin.tail.php');
?>
6 changes: 3 additions & 3 deletions bbs/logout.php
Expand Up @@ -2,16 +2,16 @@
include_once('./_common.php');

// 이호경님 제안 코드
session_unset(); // 모든 세션변수를 언레지스터 시켜줌
session_destroy(); // 세션해제함
session_unset(); // 모든 세션변수를 언레지스터 시켜줌
session_destroy(); // 세션해제함

// 자동로그인 해제 --------------------------------
set_cookie('ck_mb_id', '', 0);
set_cookie('ck_auto', '', 0);
// 자동로그인 해제 end --------------------------------

if ($url) {
$p = parse_url($url);
$p = @parse_url($url);
if ($p['scheme'] || $p['host']) {
alert('url에 도메인을 지정할 수 없습니다.');
}
Expand Down
2 changes: 1 addition & 1 deletion common.php
Expand Up @@ -319,7 +319,7 @@ function sql_escape_string($str)
$url = '';
$urlencode = urlencode($_SERVER['REQUEST_URI']);
if (G5_DOMAIN) {
$p = parse_url(G5_DOMAIN);
$p = @parse_url(G5_DOMAIN);
$urlencode = G5_DOMAIN.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode));
}
}
Expand Down
2 changes: 1 addition & 1 deletion config.php
Expand Up @@ -5,7 +5,7 @@
********************/

define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.1.0');
define('G5_GNUBOARD_VER', '5.1.1');

// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true);
Expand Down
4 changes: 3 additions & 1 deletion install/install_db.php
Expand Up @@ -53,10 +53,12 @@

$mysql_set_mode = 'false';
@mysql_query('set names utf8');
if(version_compare(mysql_get_server_info(), '5.6.6', '>=') == 1) {
$row = mysql_fetch_assoc(mysql_query(" SELECT @@sql_mode as mode "));
if($row['mode']) {
@mysql_query("SET SESSION sql_mode = ''");
$mysql_set_mode = 'true';
}
unset($row);
?>

<div class="ins_inner">
Expand Down
6 changes: 3 additions & 3 deletions lib/common.lib.php
Expand Up @@ -2066,7 +2066,7 @@ function delete_editor_thumbnail($contents)

for($i=0; $i<count($matchs[1]); $i++) {
// 이미지 path 구함
$imgurl = parse_url($matchs[1][$i]);
$imgurl = @parse_url($matchs[1][$i]);
$srcfile = $_SERVER['DOCUMENT_ROOT'].$imgurl['path'];

$filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile));
Expand Down Expand Up @@ -2857,7 +2857,7 @@ function check_url_host($url, $msg='', $return_url=G5_URL)
if(!$msg)
$msg = 'url에 타 도메인을 지정할 수 없습니다.';

$p = parse_url($url);
$p = @parse_url($url);
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);

if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host'])) {
Expand Down Expand Up @@ -2962,7 +2962,7 @@ function clean_query_string($query, $amp=true)

function get_device_change_url()
{
$p = parse_url(G5_URL);
$p = @parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'];
if(isset($p['port']) && $p['port'])
$href .= ':'.$p['port'];
Expand Down
6 changes: 5 additions & 1 deletion lib/thumbnail.lib.php
Expand Up @@ -59,15 +59,19 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_

if($tname) {
if($edt) {
// 오리지날 이미지
$ori = G5_URL.$data_path;
// 썸네일 이미지
$src = G5_URL.str_replace($filename, $tname, $data_path);
} else {
$ori = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
$src = G5_DATA_URL.'/file/'.$bo_table.'/'.$tname;
}
} else {
return false;
}

$thumb = array("src"=>$src, "alt"=>$alt);
$thumb = array("src"=>$src, "ori"=>$ori, "alt"=>$alt);

return $thumb;
}
Expand Down
2 changes: 1 addition & 1 deletion mobile/skin/member/basic/memo.skin.php
Expand Up @@ -21,7 +21,7 @@
<ul id="memo_list_ul">
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<a href="<?php echo $list[$i]['view_href'] ?>" class="memo_link"><?php echo $list[$i]['send_datetime'] ?>받은 쪽지</a>
<a href="<?php echo $list[$i]['view_href'] ?>" class="memo_link"><?php echo $list[$i]['send_datetime'] ?><?php echo ($kind == "recv") ? "받은" : "보낸"; ?> 쪽지</a>
<span class="memo_read"><?php echo $list[$i]['read_datetime'] ?></span>
<span class="memo_send"><?php echo $list[$i]['name'] ?></span>
<a href="<?php echo $list[$i]['del_href'] ?>" onclick="del(this.href); return false;" class="memo_del">삭제</a>
Expand Down
21 changes: 21 additions & 0 deletions plugin/jqplot/MIT-LICENSE.txt
@@ -0,0 +1,21 @@
Title: MIT License

Copyright (c) 2009-2013 Chris Leonello

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.

0 comments on commit 84009dc

Please sign in to comment.