diff --git a/README.md b/README.md index ebd7e77f..b84dc81d 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,10 @@ * mpm_event 권장 * PHP 7.2 이상 * php-fpm 권장 - * php에서 curl을 실행가능해야 합니다. -* MySQL 5.6 이상, 또는 MariaDB 10.0 이상 + * php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원) + * mysqlnd가 지원되어야합니다. (기본값: 지원) +* MariaDB 10.2.1 이상 + * MySQL 5.6 이상도 가능하도록 할 예정입니다. * git * curl @@ -47,7 +49,7 @@ Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의 현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다. -f_install/templates/KakaoKey.orig.phpd_setting/KakaoKey.php로 복사한 후 API 키를 입력하여야 합니다. +설치 후 d_setting/KakaoKey.php에서 API키를 입력해야 합니다. ## 라이선스 diff --git a/e_lib/summernote/plugin/image-sammo/summernote-image-flip.js b/e_lib/summernote/plugin/image-sammo/summernote-image-flip.js new file mode 100644 index 00000000..65754746 --- /dev/null +++ b/e_lib/summernote/plugin/image-sammo/summernote-image-flip.js @@ -0,0 +1,153 @@ +/* Forked from https://github.com/asiffermann/summernote-image-title */ + +(function (factory) { + /* Global define */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && module.exports) { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(window.jQuery); + } +}(function ($) { + $.extend(true, $.summernote.lang, { + 'en-US': { + imageFlip: { + edit: 'Flip image', + flipLabel: 'Alternative Image' + } + }, + 'ko-KR': { + imageFlip: { + edit: '이미지 전환', + flipLabel: '대체 이미지( , 로 구분)' + } + }, + }); + $.extend($.summernote.options, { + imageFlip: { + icon: '', + tooltip: 'Image Flip' + } + }); + $.extend($.summernote.plugins, { + 'imageFlip': function (context) { + var self = this; + + var ui = $.summernote.ui; + var $note = context.layoutInfo.note; + var $editor = context.layoutInfo.editor; + var $editable = context.layoutInfo.editable; + var $toolbar = context.layoutInfo.toolbar; + + if (typeof context.options.imageFlip === 'undefined') { + context.options.imageFlip = {}; + } + + var options = context.options; + var lang = options.langInfo; + + context.memo('button.imageFlip', function () { + var button = ui.button({ + contents: ui.icon(options.icons.pencil), + container: false, + tooltip: lang.imageFlip.edit, + click: function (e) { + context.invoke('imageFlip.show'); + } + }); + + return button.render(); + }); + + this.initialize = function () { + var $container = options.dialogsInBody ? $(document.body) : $editor; + + var body = '
' + + '' + + '' + + '
'; + + var footer = ''; + + this.$dialog = ui.dialog({ + title: lang.imageFlip.edit, + body: body, + footer: footer + }).render().appendTo($container); + }; + + this.destroy = function () { + ui.hideDialog(this.$dialog); + this.$dialog.remove(); + }; + + this.bindEnterKey = function ($input, $btn) { + $input.on('keypress', function (event) { + if (event.keyCode === 13) { + $btn.trigger('click'); + } + }); + }; + + this.show = function () { + var $img = $($editable.data('target')); + + var imgInfo = { + imgDom: $img, + flip: $img.data('flip'), + }; + this.showLinkDialog(imgInfo).then(function (imgInfo) { + ui.hideDialog(self.$dialog); + var $img = imgInfo.imgDom; + + if (imgInfo.flip) { + $img.attr('data-flip', imgInfo.flip); + } + else { + $img.removeData('flip'); + } + + $note.val(context.invoke('code')); + $note.change(); + }); + }; + + this.showLinkDialog = function (imgInfo) { + return $.Deferred(function (deferred) { + var $imageFlip = self.$dialog.find('.note-image-flip-text'); + var $editBtn = self.$dialog.find('.note-image-flip-btn'); + + ui.onDialogShown(self.$dialog, function () { + context.triggerEvent('dialog.shown'); + + $editBtn.click(function (event) { + event.preventDefault(); + deferred.resolve({ + imgDom: imgInfo.imgDom, + flip: $imageFlip.val(), + }); + }); + + $imageFlip.val(imgInfo.flip).trigger('focus'); + self.bindEnterKey($imageFlip, $editBtn); + + }); + + ui.onDialogHidden(self.$dialog, function () { + $editBtn.off('click'); + + if (deferred.state() === 'pending') { + deferred.reject(); + } + }); + + ui.showDialog(self.$dialog); + }); + }; + } + }); +})); \ No newline at end of file diff --git a/f_install/j_setup_db.php b/f_install/j_setup_db.php index 403c27b4..ef69b1e1 100644 --- a/f_install/j_setup_db.php +++ b/f_install/j_setup_db.php @@ -263,6 +263,14 @@ $result = Util::generateFileUsingSimpleTemplate( ] ); +Util::generateFileUsingSimpleTemplate( + __dir__.'/templates/KakaoKey.orig.php', + ROOT.'/d_setting/KakaoKey.php', + [ + ], + true +); + if ($result !== true) { Json::die([ 'result'=>false, diff --git a/hwe/a_emperior_detail.php b/hwe/a_emperior_detail.php index b5a1b414..08b5ebc6 100644 --- a/hwe/a_emperior_detail.php +++ b/hwe/a_emperior_detail.php @@ -179,7 +179,7 @@ if($showServers){ if($nation['generals']){ $generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']); - if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){ + if(count($generals) != count($nation['generals']) && $serverID == UniqueConst::$serverID){ $liveGenerals = $nation['generals']; foreach($generals as $general){ if(in_array($general['general_no'], $nation['generals'])){ diff --git a/hwe/a_traffic.php b/hwe/a_traffic.php index 29b977c9..4386954a 100644 --- a/hwe/a_traffic.php +++ b/hwe/a_traffic.php @@ -170,7 +170,7 @@ $max_refresh['name'] = '접속자 총합'; $refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5')); foreach ($refresh_result as $i=>$user) { - $w = round($user['refresh'] / $max_refresh['refresh'] * 100, 1); + $w = round($user['refresh'] / max(1, $max_refresh['refresh']) * 100, 1); $w2 = round(100 - $w, 1); $color = getTrafficColor($w); ?> diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index a49a3491..c85fb1c1 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -55,6 +55,7 @@ var editable = =5?'true':'false')?>; + diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index de96758b..f0c9ef36 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -177,7 +177,7 @@ for($i=0; $i < $nationcount; $i++) { "; } ?> - align=center>불가침 : @, 통합 : , 합병 : , 통상 : ㆍ, 선포 : , 교전 : + align=center>불가침 : @, 합병 : , 통상 : ㆍ, 선포 : , 교전 : diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php index 2847a2bb..c8eb0638 100644 --- a/hwe/b_myBossInfo.php +++ b/hwe/b_myBossInfo.php @@ -150,12 +150,15 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) { echo "