From 3ca2779a486d50b4dd0f40c8659e756de7186052 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 3 Mar 2018 18:24:00 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A0=84=EC=BD=98=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=ED=99=95=EC=9E=A5=EC=9E=90=20=EC=95=88=EB=82=B4=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i_entrance/manage/Frame.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i_entrance/manage/Frame.php b/i_entrance/manage/Frame.php index 70529d7..f259bb2 100644 --- a/i_entrance/manage/Frame.php +++ b/i_entrance/manage/Frame.php @@ -44,7 +44,7 @@ require_once('_common.php');
도움말
-
jpg파일 64 x 64 크기만 가능합니다.
+
jpg, gif, png 파일 64 x 64 크기만 가능합니다.
 서버최적화를 위해 신규에서 기존으로 약 월1회 저장됩니다.
 브라우저의 임시파일을 삭제하셔야 제대로 나옵니다.
 새로 캐릭터를 생성할때부터 적용됩니다.

From e8387d240d85ed192984ef30636dc74659a8b69c Mon Sep 17 00:00:00 2001
From: hide_d 
Date: Sat, 3 Mar 2018 19:28:42 +0900
Subject: [PATCH 2/2] =?UTF-8?q?=EC=A0=84=EC=BD=98=20=EA=B0=B1=EC=8B=A0?=
 =?UTF-8?q?=EC=8B=9C=20=EC=9E=90=EB=8F=99=20=EC=82=AD=EC=A0=9C=20=EA=B8=B0?=
 =?UTF-8?q?=EB=8A=A5=EC=9D=84=20=EC=A0=9C=EA=B1=B0=ED=95=98=EA=B3=A0,=20?=
 =?UTF-8?q?=EC=9A=B4=EC=98=81=EC=9E=90=20=EB=AA=A8=EB=93=9C=EC=97=90?=
 =?UTF-8?q?=EC=84=9C=20=EC=A0=84=EC=BD=98=20=EC=A0=95=EB=A6=AC=20=EA=B8=B0?=
 =?UTF-8?q?=EB=8A=A5=EC=9C=BC=EB=A1=9C=20=EB=8C=80=EC=B2=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 i_entrance/adminAction.js        | 22 ++++++++++++++
 i_entrance/adminInc.php          |  1 +
 i_entrance/adminStyle.css        | 13 ++++++---
 i_entrance/iconScrub.php         | 50 ++++++++++++++++++++++++++++++++
 i_entrance/manage/deletePost.php |  3 --
 i_entrance/manage/iconPost.php   |  3 --
 6 files changed, 82 insertions(+), 10 deletions(-)
 create mode 100644 i_entrance/iconScrub.php

diff --git a/i_entrance/adminAction.js b/i_entrance/adminAction.js
index 254de0f..5fe0f79 100644
--- a/i_entrance/adminAction.js
+++ b/i_entrance/adminAction.js
@@ -5,11 +5,33 @@ function Entrance_AdminInit() {
     $("#Entrance_000201").click(Entrance_Donation);
     $("#Entrance_000202").click(Entrance_Member);
     $("#Entrance_000204").click(Entrance_AdminChangeNotice);
+    $("#Entrance_000205").click(Entrance_IconScrub);
 }
 
 function Entrance_AdminUpdate() {
 }
 
+function Entrance_IconScrub(){
+    Popup_Confirm('사용하지 않는 전콘 중 등록된지 2개월이 지난 것들을 삭제합니다.', function() {
+        Popup_Wait(function() {
+            PostJSON(
+                HOME+I+ENTRANCE+W+'iconScrub.php', {
+                    action: 0,
+                    notice: notice
+                },
+                function(response, textStatus) {
+                    if(response.result == "SUCCESS") {
+                        Popup_WaitHide();
+                        Replace(ENTRANCE+PHP);
+                    } else {
+                        Popup_WaitShow(response.msg);
+                    }
+                }
+            )
+        })
+    });
+}
+
 function Entrance_Donation() {
     $("#Entrance_00").hide();
     $("#EntranceDonation_00").show();
diff --git a/i_entrance/adminInc.php b/i_entrance/adminInc.php
index 3f0163c..5994943 100644
--- a/i_entrance/adminInc.php
+++ b/i_entrance/adminInc.php
@@ -17,6 +17,7 @@ Entrance_AdminUpdate();
         
회 원 관 리
+
diff --git a/i_entrance/adminStyle.css b/i_entrance/adminStyle.css index 0e12fc3..a0a1fe2 100644 --- a/i_entrance/adminStyle.css +++ b/i_entrance/adminStyle.css @@ -12,13 +12,18 @@ } #Entrance_000201 { - width: 200px; height: 50px; - position: absolute; top: 65px; left: 150px; + width: 160px; height: 50px; + position: absolute; top: 65px; left: 120px; } #Entrance_000202 { - width: 200px; height: 50px; - position: absolute; top: 65px; left: 450px; + width: 160px; height: 50px; + position: absolute; top: 65px; left: 320px; +} + +#Entrance_000205 { + width: 160px; height: 50px; + position: absolute; top: 65px; left: 520px; } #Entrance_000203 { diff --git a/i_entrance/iconScrub.php b/i_entrance/iconScrub.php new file mode 100644 index 0000000..01624e8 --- /dev/null +++ b/i_entrance/iconScrub.php @@ -0,0 +1,50 @@ +Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'"); +$member = $DB->Get($rs); +if($member['GRADE'] < 6) { + $response['result'] = 'FAIL'; + $response['msg'] = '운영자 권한이 없습니다.'; + sleep(1); + echo json_encode($response); +} + + +$targetTime = strtotime("-1 month"); + +$picDir = ROOT.W.D.'pic'; + +$usedImg = []; + +$imgResult = $DB->Select('PICTURE', 'MEMBER', 'IMGSVR=1'); +foreach($DB->GetAll($imgResult) as $row){ + $imgname = $row['PICTURE']; + if(strlen($imgname)<(1+1+3+2+8)){ //*.jpg?=YYYYMMDD + continue; + } + $imgname = substr($imgname, 0, strlen($imgname)-10); + $usedImg[$imgname] = true; +} + +foreach(glob($picDir."/*.{jpg,png,gif}", GLOB_BRACE) as $filepath){ + $filename = basename($filepath); + + if (array_key_exists($filename, $usedImg)) { + continue; + } + + $mtime = filemtime($filepath); + if($mtime > $targetTime){ + continue; + } + + @unlink($filepath); +} + +sleep(1); +echo json_encode(['result'=>'SUCCESS']); diff --git a/i_entrance/manage/deletePost.php b/i_entrance/manage/deletePost.php index 89d342a..dfad9b8 100644 --- a/i_entrance/manage/deletePost.php +++ b/i_entrance/manage/deletePost.php @@ -34,9 +34,6 @@ if($dt == $rf) { $response['result'] = 'FAIL'; } else { $DB->Update('MEMBER', "PICTURE='', IMGSVR=0", "NO='{$SESSION->NoMember()}'"); - if(file_exists($dest)){ - @unlink($dest); - } for($i=0; $i < $_serverCount; $i++) { if($SETTINGS[$i]->IsExist()) { diff --git a/i_entrance/manage/iconPost.php b/i_entrance/manage/iconPost.php index 0da2250..8bde810 100644 --- a/i_entrance/manage/iconPost.php +++ b/i_entrance/manage/iconPost.php @@ -74,9 +74,6 @@ if(!is_uploaded_file($image['tmp_name'])) { $response['msg'] = '업로드에 실패했습니다!'; $response['result'] = 'FAIL'; } else { - if(file_exists($old_path)){ - @unlink($old_path); - } $pic = "{$newPicName}?={$rf}"; $DB->Update('MEMBER', "PICTURE='{$pic}', IMGSVR=1", "NO='{$SESSION->NoMember()}'");