first
5
modules/comment/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# 댓글 모듈
|
||||
## Copyright and license
|
||||
Copyright 2020 Redblock, Inc.
|
||||
|
||||
Licensed under the [RBL](https://kimsq.com/p/rbl) License
|
||||
583
modules/comment/_main.js
Normal file
@@ -0,0 +1,583 @@
|
||||
|
||||
(function (factory) {
|
||||
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 = function( root, jQuery ) {
|
||||
if ( jQuery === undefined ) {
|
||||
// require('jQuery') returns a factory that requires window to
|
||||
// build a jQuery instance, we normalize how we use modules
|
||||
// that require this pattern but the window provided is a noop
|
||||
// if it's defined (how jquery works)
|
||||
if ( typeof window !== 'undefined' ) {
|
||||
jQuery = require('jquery');
|
||||
}
|
||||
else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function($) {
|
||||
|
||||
var Comments = {
|
||||
|
||||
// Instance variables
|
||||
// ==================
|
||||
|
||||
$el: null,
|
||||
$el_id: null,
|
||||
module: null,
|
||||
parent : null,
|
||||
parent_table : null,
|
||||
theme_name: null,
|
||||
theme_path: null,
|
||||
userLevel: 0,
|
||||
userGroup: 0,
|
||||
currentPage: 1,
|
||||
totalPage: null,
|
||||
totalRow: null,
|
||||
perm_write: null, // 작성 권한
|
||||
is_admin: is_admin==1?true:false,
|
||||
uploadInputEle : null,
|
||||
emoticonPath : null,
|
||||
options: {},
|
||||
events: {
|
||||
'keydown [data-role="comments-inputEle"]' : 'enterClientComment',
|
||||
'keyup [data-role="comments-inputEle"]' : 'showStatusComment',
|
||||
'mouseover [data-role="comment-row"]' : 'showCommentMenu', // 댓글 row 메뉴 노출 이벤트(desktop)
|
||||
'mouseout [data-role="comment-row"]' : 'hideCommentMenu', // 댓글 row 메뉴 숨김 이벤트(desktop)
|
||||
'keypress [data-role="comment-row"]' : 'showCommentMenu', // 댓글 row 메뉴 노출 이벤트(mobile)
|
||||
'tap [data-role="comment-row"]' : 'hideCommentMenu', // 댓글 row 메뉴 숨김 이벤트(mobile)
|
||||
'click [data-act]' : 'doUserAct', // 사용자 액션
|
||||
'tap [data-act]' : 'doUserAct', // 사용자 액션
|
||||
'scroll [data-role="comments-logContainer"]' : 'checkScrollTop', // 스크롤 이벤트 (댓글내역 더 가져오기)
|
||||
'change [data-role="upload-inputFile"]' : 'fileInputChanged', // 파일업로드 input change
|
||||
'click [data-role="open-emoticon"]' : 'showEmoticonBox', // 이모티콘 박스 보여주기
|
||||
'click [data-role="insert-emoticon"]' : 'insertEmoticon' // 이모티콘 입력
|
||||
|
||||
},
|
||||
|
||||
// Default options
|
||||
getDefaultOptions: function() {
|
||||
return {
|
||||
userInputEle : '[data-role="comments-inputEle"]',
|
||||
commentLogContainer : '[data-role="comments-logContainer"]',
|
||||
statusBox : '[data-role="comments-status"]',
|
||||
nowText : '현재',
|
||||
userNameText : memberid?memberid:'손님',
|
||||
meText : '나',
|
||||
menuEle : '[data-role="comment-menuEle"]',
|
||||
uploadBtnWrapper : '[data-role="uploadBtn-wrapper"]',
|
||||
enableAttachments: true, // 업로드 가능 여부
|
||||
uploadInputDataRoleName : 'upload-inputFile',
|
||||
emoticonBox: '[data-role="emoticon-box"]',
|
||||
blockListWrapper: '[data-role="blockList-wrapper"]',
|
||||
showTotalRowEle : '[data-role="show-totalRow"]'
|
||||
}
|
||||
},
|
||||
|
||||
// Initialization
|
||||
init: function(options, el) {
|
||||
var self = this;
|
||||
this.$el = $(el);
|
||||
this.$el_id = '#'+this.$el.attr('id');
|
||||
|
||||
// Detect mobile devices
|
||||
(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
|
||||
if($.browser.mobile) this.$el.addClass('mobile');
|
||||
|
||||
// Init options
|
||||
this.options = $.extend(true, {}, this.getDefaultOptions(), options);
|
||||
this.$el.addClass(this.options.containerClass); // 댓글박스 출력 container 에 class 추가
|
||||
this.module = this.options.moduleName; // module name 값 세팅
|
||||
this.parent = this.options.parent; // 위젯에서 세팅
|
||||
this.parent_table = this.options.parent_table; // 위젯에서 세팅
|
||||
this.theme_name = this.options.theme_name; // 위젯에서 세팅
|
||||
this.initCommentBox(); // load 챗박스
|
||||
},
|
||||
|
||||
// comments box 로딩 및 접속자 권한/관련 데이타 세팅
|
||||
initCommentBox : function(){
|
||||
var self = this;
|
||||
var container = this.$el;
|
||||
var commentBox = this.options.commentLogContainer; // 댓글 출력 박스
|
||||
$.post(
|
||||
rooturl+'/?r='+raccount+'&m='+this.module+'&a=get_Comments_Box',
|
||||
{
|
||||
parent : this.parent,
|
||||
parent_table : this.parent_table,
|
||||
theme_name : this.theme_name
|
||||
},
|
||||
function(response){
|
||||
var result = $.parseJSON(response);
|
||||
self.totalPage = result.totalPage; // 전체 페이지 값
|
||||
self.totalRow = result.totalRow; // 전체 row 갯수 값 (대화 내력받기 시 체크)
|
||||
self.userLevel = result.userLevel; // 접속자 level
|
||||
self.userGroup = result.userGroup; // 접속자 group
|
||||
self.theme_path = result.theme_path;
|
||||
self.emoticonPath = result.theme_path+'/images/emoticon/';
|
||||
$(container).append(result.comment_box);
|
||||
self.AfterInitCommentBox();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// CommentBox 로딩 후 초기화 함수들 호출
|
||||
AfterInitCommentBox : function(){
|
||||
this.undelegateEvents(); // comment box 엘리먼트들 이벤트 바인딩 off
|
||||
this.delegateEvents(); // comment box 엘리먼트들 이벤트 바인딩 on
|
||||
this.initUploadInput(); // 업로드 input 세팅
|
||||
this.initWritePerm(); // 글쓰기 권한 체크 적용
|
||||
},
|
||||
|
||||
// 댓글 메뉴 보이기 이벤트
|
||||
showCommentMenu : function(e){
|
||||
var row = e.currentTarget;
|
||||
var menu = $(row).find(this.options.menuEle);
|
||||
$(menu).css("visibility", "visible");
|
||||
},
|
||||
|
||||
// 댓글 메뉴 보이기 이벤트
|
||||
hideCommentMenu : function(e){
|
||||
var row = e.currentTarget;
|
||||
var menu = $(row).find(this.options.menuEle);
|
||||
$(menu).css("visibility", "hidden");
|
||||
},
|
||||
|
||||
// 콤마 추가 함수
|
||||
addComma: function(string){
|
||||
var commaString=string.toLocaleString().split(".")[0];
|
||||
return commaString;
|
||||
},
|
||||
|
||||
// 콤마 삭제
|
||||
delComma: function(commaString){
|
||||
var string=commaString.replace(/,/gi,'');
|
||||
return string;
|
||||
},
|
||||
|
||||
// 전체 row 수량 업데이트
|
||||
updateTotal: function(num,type){
|
||||
var totalRow = this.totalRow; // 최초 합계
|
||||
var total_row_wrap = this.options.showTotalRowEle;
|
||||
var total_row_text=$(total_row_wrap).text();
|
||||
total_row_text=this.delComma(total_row_text);
|
||||
var total_row;
|
||||
|
||||
if(type=='add'){
|
||||
total_row=parseInt(total_row_text)+parseInt(num);
|
||||
this.totalRow = totalRow+num;
|
||||
}
|
||||
else if(type=='del'){
|
||||
total_row=parseInt(total_row_text)-parseInt(num);
|
||||
this.totalRow = totalRow-num;
|
||||
}
|
||||
|
||||
// 최종 합계에 콤마 추가
|
||||
total_row_comma=this.addComma(total_row);
|
||||
|
||||
// 취소버튼 클릭시 초기화
|
||||
if(type=='init'){
|
||||
total_checked_num=0;
|
||||
$(total_row_wrap).text(0);
|
||||
}
|
||||
else $(total_row_wrap).text(total_row_comma);
|
||||
},
|
||||
|
||||
// 글쓰기 권한 적용
|
||||
initWritePerm : function(){
|
||||
if(!this.perm_write || !this.room_open || this.room_closed){
|
||||
$(this.options.userInputEle).attr("placeholder","운영시간이 아니거나 작성권한이 없습니다.")
|
||||
$(this.options.userInputEle).attr("disabled","disabled");
|
||||
$('[data-role="'+this.options.uploadInputDataRoleName+'"]').attr("disabled","disabled");
|
||||
$(this.options.emoticonBox).remove();
|
||||
}
|
||||
},
|
||||
|
||||
// 댓글 더 가져오기 이벤트
|
||||
checkScrollTop : function(e){
|
||||
var comment_box = e.currentTarget;
|
||||
var scrollTop = $(comment_box).scrollTop();
|
||||
var comment_row = $(comment_box).find('[data-role="comment-row"]:first');
|
||||
//var _currentPage = $(comment_row).data('page');
|
||||
var totalPage = this.totalPage;
|
||||
if((scrollTop<50) && (this.currentPage<totalPage)){
|
||||
this.getMoreComment(this.currentPage);
|
||||
this.currentPage++;
|
||||
}
|
||||
},
|
||||
|
||||
// 댓글내역 더 가져오기
|
||||
getMoreComment : function(currentPage){
|
||||
var comment_box = this.options.commentLogContainer;
|
||||
$.get(rooturl+'/?r='+raccount+'&m='+this.module+'&a=do_userAct',{
|
||||
act : 'getMoreComment',
|
||||
currentPage : currentPage,
|
||||
bid : this.room
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
if(error){
|
||||
var error_comment = result.error_comment;
|
||||
self.showNotify(error_comment);
|
||||
}else{
|
||||
$(comment_box).prepend(result.content);
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
delegateEvents: function() {
|
||||
this.bindEvents(false);
|
||||
},
|
||||
|
||||
undelegateEvents: function() {
|
||||
this.bindEvents(true);
|
||||
},
|
||||
|
||||
bindEvents: function(unbind) {
|
||||
var bindFunction = unbind ? 'off' : 'on';
|
||||
for (var key in this.events) {
|
||||
var eventName = key.split(' ')[0];
|
||||
var selector = key.split(' ').slice(1).join(' ');
|
||||
var methodNames = this.events[key].split(' ');
|
||||
for(var index in methodNames) {
|
||||
if(methodNames.hasOwnProperty(index)) {
|
||||
var method = this[methodNames[index]];
|
||||
// Keep the context
|
||||
method = $.proxy(method, this);
|
||||
|
||||
if (selector == '') {
|
||||
this.$el[bindFunction](eventName, method);
|
||||
} else {
|
||||
// scroll 이벤트는 해당 엘리먼트에 직접 바인딩 해야한다.
|
||||
if(eventName=='scroll') $(selector)[bindFunction](eventName,method);
|
||||
else this.$el[bindFunction](eventName, selector, method);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 사용자 액션 실행
|
||||
doUserAct : function(e){
|
||||
e.preventDefault();
|
||||
var self = this;
|
||||
var target = e.currentTarget;
|
||||
var act = $(target).data('act');
|
||||
var token = $(target).data('token');
|
||||
var user = $(target).data('user');
|
||||
var totalRow = this.totalRow;
|
||||
if(act=='dump-xls'){
|
||||
if(totalRow==0){
|
||||
alert('데이타가 존재하지 않습니다');
|
||||
return false;
|
||||
}
|
||||
var input_array ='<input name="r" value="'+raccount+'" />';
|
||||
input_array +='<input name="m" value="'+this.module+'"/>';
|
||||
input_array +='<input name="a" value="do_userAct"/>';
|
||||
input_array +='<input name="act" value="'+act+'"/>';
|
||||
input_array +='<input name="bid" value="'+this.room+'"/>';
|
||||
var form = $('<form/>', { name: 'tmpForm', method: 'post', action: '/',html: input_array})
|
||||
.css("display","none")
|
||||
.appendTo(this.$el)
|
||||
setTimeout(function(){
|
||||
var f = document.tmpForm;
|
||||
f.submit();
|
||||
$(form).remove();
|
||||
//getIframeForAction(f);
|
||||
},10);
|
||||
}else{
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+this.module+'&a=do_userAct',{
|
||||
act : act,
|
||||
token : token,
|
||||
bid : this.room,
|
||||
user: user
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
if(error){
|
||||
var error_comment = result.error_comment;
|
||||
self.showNotify(error_comment);
|
||||
}else{
|
||||
// 해당 row 삭제
|
||||
if(act=='delete'){
|
||||
self.updateTotal(1,'del');
|
||||
$(self.$el_id).find('[data-row-token="'+token+'"]').remove();
|
||||
|
||||
}else if(act=='report'||act=='block'||act=='unblock'){
|
||||
if(act=='unblock') $('[data-role="block-row-'+user+'"]').remove();
|
||||
self.showNotify(result.success_comment);
|
||||
}
|
||||
else if(act=='owner-delete'){
|
||||
if(self.totalRow==0){
|
||||
self.showNotify('데이타가 존재하지 않습니다');
|
||||
return false;
|
||||
}
|
||||
// token 으로 엘리먼트 삭제
|
||||
$.each(result.token_array,function(key,token){
|
||||
$(self.$el_id).find('[data-row-token="'+token+'"]').remove();
|
||||
});
|
||||
self.updateTotal(result.delete_qty,'del');
|
||||
self.showNotify(result.success_comment);
|
||||
|
||||
}else if(act=='getBlockUser'){
|
||||
var block_list = result.content;
|
||||
$(self.options.blockListWrapper).html(block_list);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 댓글 저장 : token 을 저장하고 삭제시 이용한다.
|
||||
saveComment : function(data){
|
||||
var self = this;
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+this.module+'&a=save_comment',{
|
||||
bid : this.room,
|
||||
notice : data.notice,
|
||||
user : self.options.userNameText,
|
||||
content : data.comment,
|
||||
token : data.token,
|
||||
upload : data.upload
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
if(error){
|
||||
var error_comment = result.error_comment;
|
||||
self.showNotify(error_comment);
|
||||
}else{
|
||||
var emit_data = {"comment": data.comment,"notice": data.notice,"upload": data.upload,"token": data.token,};
|
||||
self.updateTotal(1,'add');
|
||||
self.emitClientComment(emit_data);
|
||||
}
|
||||
|
||||
//$("#result").html(result.content);
|
||||
});
|
||||
},
|
||||
|
||||
// 댓글 출력 함수
|
||||
emitClientComment : function(data){
|
||||
socket.emit("clientComment", {
|
||||
"room" : this.room,
|
||||
"notice" : data.notice,
|
||||
"name": this.options.userNameText,
|
||||
"avatar" : this.options.userAvatarName,
|
||||
"comment": data.comment,
|
||||
"token": data.token
|
||||
});
|
||||
},
|
||||
|
||||
// 댓글 전송 함수
|
||||
enterClientComment : function(e){
|
||||
if (e.which == 13) {
|
||||
var userInputEle = e.currentTarget;
|
||||
var user_comment = userInputEle.value;
|
||||
var comment = $.trim(user_comment);
|
||||
var comment_type='text';
|
||||
if(comment){
|
||||
var token = this.getCommentToken();
|
||||
var comment_data = {"comment":this.linkify(comment),"notice":0,"token": token};
|
||||
this.saveComment(comment_data);
|
||||
//this.emitClientComment(this.linkify(comment),token); // nodejs 에게 댓글 전송
|
||||
$(userInputEle).val('');
|
||||
}else{
|
||||
alert('댓글를 입력해주세요. ');
|
||||
return false;
|
||||
this.focusInput(userInputEle);
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Start of upload setting *****************************************************************************************************
|
||||
initUploadInput: function(){
|
||||
var sesscode = this.getCommentToken;
|
||||
var uploadButton = $('<span/>', {
|
||||
'class': 'comments-attach'
|
||||
});
|
||||
var uploadIcon = $('<i/>', {
|
||||
'class': 'fa fa-picture-o fa-lg'
|
||||
});
|
||||
var fileInput = $('<input/>', {
|
||||
type: 'file',
|
||||
name: 'upfiles[]',
|
||||
'data-role': this.options.uploadInputDataRoleName,
|
||||
'data-sesscode' : sesscode
|
||||
});
|
||||
// Multi file upload might not work with backend as the the file names
|
||||
// may be the same causing duplicates
|
||||
if(!$.browser.mobile) fileInput.attr('multiple', 'multiple');
|
||||
if(!this.options.enableAttachments) fileInput.attr('disabled', 'disabled');
|
||||
|
||||
uploadButton.append(uploadIcon).append(fileInput);
|
||||
$(this.options.uploadBtnWrapper).append(uploadButton);
|
||||
},
|
||||
|
||||
// 업로드 input change 이벤트
|
||||
fileInputChanged: function(e) {
|
||||
var files = e.currentTarget.files;
|
||||
var uploadInputFileEle = $('[data-role="'+this.options.uploadInputDataRoleName+'"]');
|
||||
var sesscode = $(uploadInputFileEle).data('sesscode');
|
||||
var uploadOptions = {
|
||||
uploadDir : this.options.uploadDir,
|
||||
sesscode : sesscode
|
||||
};
|
||||
if (sesscode === undefined){
|
||||
alert('파일 업로드를 위한 셋팅에 문제가 있습니다.');
|
||||
return false;
|
||||
}else if(files.length>0) this.uploadAttachments(files,uploadOptions);
|
||||
},
|
||||
|
||||
// 업로드 실행 함수
|
||||
uploadAttachments: function(files,uploadOptions){
|
||||
var self = this;
|
||||
var data = new FormData();
|
||||
|
||||
$.each(files, function(key, value) {data.append(key, value);});
|
||||
$.each(uploadOptions, function(key, value) {data.append(key, value);});
|
||||
|
||||
$.ajax({
|
||||
url: rooturl+'/?r='+raccount+'&m='+this.module+'&a=upload_Attachments',
|
||||
type: 'post',
|
||||
data: data,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
var result=$.parseJSON(response);
|
||||
var fileList = result.fileList;
|
||||
var comment_content = '';
|
||||
var upload = '';
|
||||
var files=fileList.split(',');
|
||||
$.each(files,function(key,list){
|
||||
var list_arr = list.split('^^');
|
||||
var src = list_arr[0];
|
||||
var uid = list_arr[1];
|
||||
var type = list_arr[2];
|
||||
upload +='['+uid+']';
|
||||
if(type==2){
|
||||
var photo_data = {"type":"photo","photo_src":src};
|
||||
comment_content += self.getCommentTpl(photo_data);
|
||||
}
|
||||
});
|
||||
self.uploadClientComment(comment_content,upload);
|
||||
},
|
||||
xhr: function() {
|
||||
var myXhr = $.ajaxSettings.xhr();
|
||||
if(myXhr.upload) {
|
||||
myXhr.upload.addEventListener('progress', function(e) {
|
||||
if(e.lengthComputable){
|
||||
var max = e.total;
|
||||
var current = e.loaded;
|
||||
var Percentage = (current * 100)/max;
|
||||
console.log(Percentage);
|
||||
// progressBar.css({width: Percentage + '%'});
|
||||
// percent.html(parseInt(Percentage));
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return myXhr;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// End of upload setting ********************************************************************************************************
|
||||
|
||||
// 업로드 전송 함수 :
|
||||
uploadClientComment : function(comment_content,upload_value){
|
||||
var token = this.getCommentToken();
|
||||
var data = {"comment":comment_content,"notice":0,"upload":upload_value,"token": token};
|
||||
this.saveComment(data);
|
||||
},
|
||||
|
||||
// emoticon 박스 보여주기
|
||||
showEmoticonBox: function(){
|
||||
$(this.options.emoticonBox).slideToggle('fast');
|
||||
},
|
||||
|
||||
// emoticon 입력
|
||||
insertEmoticon: function(e){
|
||||
var ele = e.currentTarget;
|
||||
var emoticon_comment = $(ele).data('emotion');
|
||||
var emoticon_src = this.emoticonPath+'/emo_'+emoticon_comment+'.png';
|
||||
var emoticon_data = {"type":"emoticon","emoticon_src":emoticon_src};
|
||||
var comment = this.getCommentTpl(emoticon_data);
|
||||
var token = this.getCommentToken();
|
||||
var comment_data = {"comment":comment,"notice":0,"token": token};
|
||||
this.saveComment(comment_data);
|
||||
$(this.options.emoticonBox).slideToggle('fast');
|
||||
},
|
||||
|
||||
// comment toekn 생성
|
||||
getCommentToken : function(){
|
||||
function chr4(){
|
||||
return Math.random().toString(16).slice(-4);
|
||||
}
|
||||
return chr4() + chr4() + '.' + chr4() + chr4() + chr4();
|
||||
},
|
||||
|
||||
// 입력창 포커스 이벤트
|
||||
focusInput : function(userInputEle){
|
||||
setTimeout(function(){
|
||||
$(userInputEle).focus();
|
||||
},10);
|
||||
},
|
||||
|
||||
// 입력내용 중 a 요소 자동으로 링크 만들기
|
||||
linkify: function(inputText) {
|
||||
var replacedText, replacePattern1, replacePattern2, replacePattern3;
|
||||
|
||||
// URLs starting with http://, https://, file:// or ftp://
|
||||
replacePattern1 = /(^|\s)((https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
|
||||
replacedText = inputText.replace(replacePattern1, '$1<a href="$2" target="_blank">$2</a>');
|
||||
|
||||
// URLs starting with "www." (without // before it, or it'd re-link the ones done above).
|
||||
replacePattern2 = /(^|\s)(www\.[\S]+(\b|$))/gim;
|
||||
replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
|
||||
|
||||
// Change email addresses to mailto:: links.
|
||||
replacePattern3 = /(^|\s)(([a-zA-Z0-9\-\_\.]+)@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
|
||||
replacedText = replacedText.replace(replacePattern3, '$1<a href="mailto:$2">$2</a>');
|
||||
|
||||
// If there are hrefs in the original text, let's split
|
||||
// the text up and only work on the parts that don't have urls yet.
|
||||
var count = inputText.match(/<a href/g) || [];
|
||||
|
||||
if(count.length > 0){
|
||||
// Keep delimiter when splitting
|
||||
var splitInput = inputText.split(/(<\/a>)/g);
|
||||
for (var i = 0 ; i < splitInput.length ; i++){
|
||||
if(splitInput[i].match(/<a href/g) == null){
|
||||
splitInput[i] = splitInput[i].replace(replacePattern1, '<a href="$1" target="_blank">$1</a>').replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>').replace(replacePattern3, '<a href="mailto:$1">$1</a>');
|
||||
}
|
||||
}
|
||||
var combinedReplacedText = splitInput.join('');
|
||||
return combinedReplacedText;
|
||||
} else {
|
||||
return replacedText;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
$.fn.comments = function(options) {
|
||||
return this.each(function() {
|
||||
var comments = Object.create(Comments);
|
||||
$.data(this, 'comments', comments);
|
||||
comments.init(options || {}, this);
|
||||
});
|
||||
};
|
||||
}));
|
||||
15
modules/comment/action/a.bbs_file_delete.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
|
||||
if ($R['img'.$dtype])
|
||||
{
|
||||
getDbUpdate($table[$m.'list'],"img".$dtype."=''",'uid='.$R['uid']);
|
||||
unlink($g['dir_module'].'var/files/'.$R['img'.$dtype]);
|
||||
}
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
10
modules/comment/action/a.bbsorder_update.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$i=0;
|
||||
foreach($bbsmembers as $val) getDbUpdate($table[$m.'list'],'gid='.($i++),'uid='.$val);
|
||||
|
||||
getLink('','','','');
|
||||
?>
|
||||
95
modules/comment/action/a.comment_delete.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
$R = getUidData($table['s_comment'],$uid);
|
||||
if (!$R['uid']) echo '[RESULT:존재하지 않는 댓글입니다.:RESULT]';//getLink('','','존재하지 않는 댓글입니다.','');
|
||||
|
||||
if ($my['uid'] != $R['mbruid'] && !$my['admin'])
|
||||
{
|
||||
if ($pw)
|
||||
{
|
||||
if (md5($pw) != $R['pw']) echo '[RESULT:비밀번호가 일치하지 않습니다.:RESULT]';//getLink('','','비밀번호가 일치하지 않습니다.','');
|
||||
}
|
||||
else {
|
||||
echo '[RESULT:비밀번호를 입력해 주세요.:RESULT]';// getLink('','','비밀번호를 입력해 주세요.','');
|
||||
}
|
||||
}
|
||||
|
||||
include $g['path_module'].'comment/var/var.php';
|
||||
|
||||
if ($d['comment']['onelinedel'])
|
||||
{
|
||||
if($R['oneline'])
|
||||
{
|
||||
echo '[RESULT:한줄의견이 있는 댓글은 삭제할 수 없습니다.:RESULT]';//getLink('','','한줄의견이 있는 댓글은 삭제할 수 없습니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
//동기화
|
||||
$cyncArr = getArrayString($R['cync']);
|
||||
$fdexp = explode(',',$cyncArr['data'][2]);
|
||||
if ($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
//include $g['path_module'].'upload/var/var.php';
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table[$m.'upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table[$m.'upload'],'uid='.$U['uid']);
|
||||
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) echo '[RESULT:FTP서버 연결에 문제가 발생했습니다.:RESULT]';//getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) echo '[RESULT:FTP서버 아이디나 패스워드가 일치하지 않습니다.:RESULT]';//getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
//unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
//if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//한줄의견삭제
|
||||
if ($R['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
|
||||
}
|
||||
|
||||
getDbDelete($table['s_comment'],'uid='.$R['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
echo '[RESULT:ok:RESULT]';
|
||||
?>
|
||||
78
modules/comment/action/a.comment_multi_delete.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
foreach($comment_members as $val)
|
||||
{
|
||||
$R = getUidData($table['s_comment'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
|
||||
//동기화
|
||||
$syncArr = getArrayString($R['sync']);
|
||||
$fdexp = explode(',',$syncArr['data'][2]);
|
||||
if ($fdexp[0]&&$fdexp[1]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$syncArr['data'][1]);
|
||||
if ($fdexp[0]&&$fdexp[2]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$syncArr['data'][1]);
|
||||
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
include_once $g['path_module'].'mediaset/var/var.php';
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['bbsupload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['bbsupload'],'uid='.$U['uid']);
|
||||
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//한줄의견삭제
|
||||
if ($R['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
|
||||
}
|
||||
|
||||
getDbDelete($table['s_comment'],'uid='.$R['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
}
|
||||
setrawcookie('comment_post_result', rawurlencode('댓글이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
106
modules/comment/action/a.comment_report.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) echo '[RESULT:로그인을 먼저 해주세요.:RESULT]';
|
||||
|
||||
$R = getUidData($table['s_comment'],$uid);
|
||||
if (!$R['uid']) echo '[RESULT:존재하지 않는 댓글입니다.:RESULT]';
|
||||
|
||||
include $g['path_module'].'comment/var/var.php';
|
||||
|
||||
if ($d['comment']['singo_del'] && $d['comment']['singo_del_num'] <= $R['singo'])
|
||||
{
|
||||
|
||||
if ($d['comment']['singo_del_act'] == 1)
|
||||
{
|
||||
|
||||
//동기화
|
||||
$cyncArr = getArrayString($R['cync']);
|
||||
$fdexp = explode(',',$cyncArr['data'][2]);
|
||||
if ($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table[$m.'upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table[$m.'upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) echo '[RESULT:FTP서버 연결에 문제가 발생했습니다.:RESULT]';//getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) echo '[RESULT:FTP서버 아이디나 패스워드가 일치하지 않습니다.:RESULT]';//getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
|
||||
//unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
//if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
|
||||
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//한줄의견삭제
|
||||
if ($R['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
|
||||
}
|
||||
|
||||
getDbDelete($table['s_comment'],'uid='.$R['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('skin','iframe','sort','orderby','recnum','where','keyword'));
|
||||
getLink($backUrl ,'parent.' , '신고건수 누적으로 삭제처리 되었습니다.' , $history);
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table['s_comment'],'hidden=1','uid='.$R['uid']);
|
||||
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('skin','iframe','sort','orderby','recnum','where','keyword'));
|
||||
getLink($backUrl ,'parent.' , '신고건수 누적으로 게시제한처리 되었습니다.' , $history);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if (!strstr($_SESSION['module_comment_singo'],'['.$R['uid'].']'))
|
||||
{
|
||||
getDbUpdate($table['s_comment'],'singo=singo+1','uid='.$R['uid']);
|
||||
$_SESSION['module_comment_singo'] .= '['.$R['uid'].']';
|
||||
echo '[RESULT:신고처리 되었습니다.:RESULT]';//getLink('','','신고처리 되었습니다.','');
|
||||
}
|
||||
else {
|
||||
echo '[RESULT:이미 신고하신 댓글입니다.:RESULT]'; // getLink('','','이미 신고하신 댓글입니다.','');
|
||||
}
|
||||
}
|
||||
?>
|
||||
30
modules/comment/action/a.comment_score.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) echo '[RESULT:로그인을 먼저 해주세요.:RESULT]';
|
||||
|
||||
$R = getUidData($table['s_comment'],$uid);
|
||||
if (!$R['uid']) exit;
|
||||
$score_limit = 1; //점수한계치(이 점수보다 높은 갚을 임의로 보낼 경우 제한)
|
||||
$score = $score ? $score : 1;
|
||||
if ($score > $score_limit) $score = $score_limit;
|
||||
|
||||
if (!strstr($_SESSION['module_comment_score'],'['.$R['uid'].']'))
|
||||
{
|
||||
if ($value == 'good')
|
||||
{
|
||||
getDbUpdate($table['s_comment'],'score1=score1+'.$score,'uid='.$R['uid']);
|
||||
echo '<script>parent.getId("_score1_'.$uid.'").innerHTML="'.($R['score1']+$score).'";</script>';;
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table['s_comment'],'score2=score2+'.$score,'uid='.$R['uid']);
|
||||
echo '<script>parent.getId("_score2_'.$uid.'").innerHTML="'.($R['score1']+$score).'";</script>';;
|
||||
}
|
||||
$_SESSION['module_comment_score'] .= '['.$R['uid'].']';
|
||||
echo '[RESULT:ok:RESULT]';
|
||||
}
|
||||
else {
|
||||
echo '[RESULT:이미 평가하신 댓글입니다.:RESULT]';
|
||||
}
|
||||
exit;
|
||||
?>
|
||||
25
modules/comment/action/a.config.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$badword = trim($badword);
|
||||
$badword = str_replace("\r\n","",$badword);
|
||||
$badword = str_replace("\n","",$badword);
|
||||
|
||||
$fdset = array('skin_main','skin_mobile','skin_total','rss','restr','commentdel','badword','badword_action','badword_escape','report_del','report_del_num','report_del_act','recnum','newtime','give_point','give_opoint');
|
||||
$gfile= $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
|
||||
|
||||
$fp = fopen($gfile,'w');
|
||||
fwrite($fp, "<?php\n");
|
||||
foreach ($fdset as $val)
|
||||
{
|
||||
fwrite($fp, "\$d['comment']['".$val."'] = \"".trim(${$val})."\";\n");
|
||||
}
|
||||
fwrite($fp, "?>");
|
||||
fclose($fp);
|
||||
@chmod($gfile,0707);
|
||||
|
||||
setrawcookie('comment_config_result', rawurlencode('설정이 변경 되었습니다.|success')); // 처리여부 cookie 저장
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
170
modules/comment/action/a.delete.php
Normal file
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
|
||||
$B = getUidData($table[$m.'list'],$R['bbs']);
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
|
||||
|
||||
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid']))
|
||||
{
|
||||
if ($pw)
|
||||
{
|
||||
if (md5($pw) != $R['pw']) getLink('reload','parent.','비밀번호가 일치하지 않습니다.','');
|
||||
}
|
||||
else {
|
||||
getLink($backUrl.'&mod=delete&uid='.$R['uid'],'parent.','','');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($d['bbs']['commentdel'])
|
||||
{
|
||||
if($R['comment'])
|
||||
{
|
||||
getLink('','','댓글이 있는 게시물은 삭제할 수 없습니다.','');
|
||||
}
|
||||
}
|
||||
if ($d['bbs']['replydel'])
|
||||
{
|
||||
$_ngid = (int)$R['gid'];
|
||||
if(getDbRows($table[$m.'data'],'gid > '.$_ngid.' and gid < '.($_ngid+1)) && !$R['depth'])
|
||||
{
|
||||
getLink('','','답변글이 있는 게시물은 삭제할 수 없습니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
//댓글삭제
|
||||
if ($R['comment'])
|
||||
{
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
|
||||
}
|
||||
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
if ($_C['point']&&$_C['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//태그삭제
|
||||
if ($R['tag'])
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
|
||||
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
|
||||
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
|
||||
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$R['bbs'])."'",'uid='.$cuid);
|
||||
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
|
||||
|
||||
if ($R['point1']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
getLink($backUrl ,'parent.' , $alert , $history);
|
||||
?>
|
||||
164
modules/comment/action/a.deletebbs.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$R = getUidData($table[$m.'list'],$uid);
|
||||
if (!$R['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
$RCD = getDbArray($table[$m.'data'],'bbs='.$R['uid'],'*','gid','asc',0,0);
|
||||
while($_R=db_fetch_array($RCD))
|
||||
{
|
||||
//댓글삭제
|
||||
if ($_R['comment'])
|
||||
{
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$_R['uid']."'",'*','uid','asc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
|
||||
foreach($UPFILES as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
|
||||
}
|
||||
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
if ($_C['point']&&$_C['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
//첨부파일삭제
|
||||
if ($_R['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//태그삭제
|
||||
if ($_R['tag'])
|
||||
{
|
||||
$_tagdate = substr($_R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$_R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$_R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($_R['d_regis'],0,6)."' and site=".$_R['site'].' and bbs='.$_R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($_R['d_regis'],0,8)."' and site=".$_R['site'].' and bbs='.$_R['bbs']);
|
||||
getDbDelete($table['s_trackback'],"parent='".$_R['bbsid'].$_R['uid']."'");
|
||||
|
||||
if ($_R['point1']&&$_R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_R['mbruid']."','0','-".$_R['point1']."','게시물삭제(".getStrCut($_R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_R['point1'],'memberuid='.$_R['mbruid']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getDbDelete($table[$m.'idx'],'bbs='.$R['uid']);
|
||||
getDbDelete($table[$m.'data'],'bbs='.$R['uid']);
|
||||
getDbDelete($table[$m.'list'],'uid='.$R['uid']);
|
||||
getDbDelete($table[$m.'xtra'],'bbs='.$R['uid']);
|
||||
getDbDelete($table['s_seo'],'rel=3 and parent='.$R['uid']);
|
||||
|
||||
unlink($g['dir_module'].'var/var.'.$R['id'].'.php');
|
||||
|
||||
if ($R['imghead'] && is_file($g['dir_module'].'var/files/'.$R['imghead']))
|
||||
{
|
||||
unlink($g['dir_module'].'var/files/'.$R['imghead']);
|
||||
}
|
||||
if ($R['imgfoot'] && is_file($g['dir_module'].'var/files/'.$R['imgfoot']))
|
||||
{
|
||||
unlink($g['dir_module'].'var/files/'.$R['imgfoot']);
|
||||
}
|
||||
|
||||
$mfile = $g['dir_module'].'var/code/'.$R['id'];
|
||||
|
||||
if (is_file($mfile.'.header.php'))
|
||||
{
|
||||
unlink($mfile.'.header.php');
|
||||
}
|
||||
if (is_file($mfile.'.footer.php'))
|
||||
{
|
||||
unlink($mfile.'.footer.php');
|
||||
}
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
85
modules/comment/action/a.do_userAct.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
$comment = new Comment();
|
||||
$comment->parent = $_REQUEST['parent']; // post 로 넘어온 값
|
||||
$comment->parent_table = $_REQUEST['parent_table']; // post 로 넘어온 값
|
||||
$comment->theme_name = $_REQUEST['theme_name']; // post 로 넘어온 값
|
||||
$comment->sort = $_REQUEST['sort'];
|
||||
$comment->recnum = $_REQUEST['recnum'];
|
||||
$comment->orderby = $_REQUEST['orderby'];
|
||||
|
||||
// post 로 넘어오는 값
|
||||
$entry = $_REQUEST['entry']; // 해당 글 uid
|
||||
$type = $_REQUEST['type'];// comment or oneline
|
||||
$uid = $_REQUEST['uid']; // comment, oneline...PK
|
||||
$parent = $_REQUEST['parent'];
|
||||
|
||||
// 리턴값 세팅
|
||||
$result = array();
|
||||
$result['error'] = false;
|
||||
|
||||
if($act=='like'){
|
||||
|
||||
// 테이블 세팅
|
||||
if($type=='comment') $update_table = $comment->commentTable;
|
||||
else if($type=='oneline') $update_table = $comment->onelineTable;
|
||||
$opinion_table = $comment->opinionTable;
|
||||
|
||||
$mbruid = $my['uid'];
|
||||
|
||||
$check_qry = "mbruid='".$mbruid."' and module='".$type."' and entry='".$entry."' and opinion='like'";
|
||||
// 로그인한 사용자가 좋아요를 했는지 여부 체크
|
||||
$is_liked = getDbRows($opinion_table,$check_qry);
|
||||
|
||||
if($is_liked){ // 좋아요를 했던 경우
|
||||
getDbDelete($opinion_table,$check_qry);
|
||||
getDbUpdate($update_table,'likes=likes-1','uid='.$entry);
|
||||
$result['is_liked'] = 0;
|
||||
}else{ // 좋아요 안한 경우 추가
|
||||
$QKEY = "mbruid,module,entry,opinion,d_regis";
|
||||
$QVAL = "'$mbruid','$type','$entry','like','".$date['totime']."'";
|
||||
getDbInsert($opinion_table,$QKEY,$QVAL);
|
||||
getDbUpdate($update_table,'likes=likes+1','uid='.$entry);
|
||||
$result['is_liked'] = 1;
|
||||
}
|
||||
|
||||
// 현재 해당 글 likes 갯수 얻기
|
||||
$R = getDbData($update_table,'uid='.$entry,'likes');
|
||||
|
||||
$result['total_like'] = $R['likes']?$R['likes']:'';
|
||||
$result['check_qry'] = $check_qry;
|
||||
$result['update_table'] = $update_table;
|
||||
}else if($act=='delete'){
|
||||
if($type=='comment') $del_msg = $comment->deleteComment($uid);
|
||||
else if($type=='oneline') $del_msg = $comment->deleteOneline($parent,$uid);
|
||||
|
||||
if($del_msg=='OK') $result['msg'] = $del_msg;
|
||||
else {
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = $del_msg;
|
||||
}
|
||||
|
||||
}else if($act=='notice'){ // 공지글 지정
|
||||
$update_table = $comment->commentTable;
|
||||
$check_qry = "notice=1 and uid=".$uid;
|
||||
$is_notice = getDbRows($update_table,$check_qry);
|
||||
|
||||
if ($is_notice) {
|
||||
getDbUpdate($update_table,'notice=0','uid='.$uid);
|
||||
$result['is_notice'] = 0;
|
||||
} else {
|
||||
getDbUpdate($update_table,'notice=1','uid='.$uid);
|
||||
$result['is_notice'] = 1;
|
||||
}
|
||||
// $result['content'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page);
|
||||
|
||||
}else if($act=='getCommentList'){ // 댓글 더보기 & 리로드
|
||||
$result['content'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page,0);
|
||||
$result['notice'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page,1);
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
?>
|
||||
98
modules/comment/action/a.download.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
$R=getUidData($table['s_upload'],$uid);
|
||||
if (!$R['uid']) getLink('','','정상적인 요청이 아닙니다.','');
|
||||
$filename = getUTFtoKR($R['name']);
|
||||
$filetmpname = getUTFtoKR($R['tmpname']);
|
||||
if ($R['url']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$filepath = $d['upload']['ftp_urlpath'].$R['folder'].'/'.$filetmpname;
|
||||
$filesize = $R['size'];
|
||||
}
|
||||
else {
|
||||
$filepath = '.'.$R['url'].$R['folder'].'/'.$filetmpname;
|
||||
$filesize = filesize($filepath);
|
||||
}
|
||||
if (!strstr($_SERVER['HTTP_REFERER'],'module=upload'))
|
||||
{
|
||||
//동기화
|
||||
$cyncArr = getArrayString($R['cync']);
|
||||
$fdexp = explode(',',$cyncArr['data'][2]);
|
||||
if($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3])
|
||||
{
|
||||
if ($cyncArr['data'][0] == 'bbs' && $cyncArr['data'][1])
|
||||
{
|
||||
$AT = getUidData($table[$cyncArr['data'][0].'data'],$cyncArr['data'][1]);
|
||||
include_once $g['path_module'].$cyncArr['data'][0].'/var/var.'.$AT['bbsid'].'.php';
|
||||
$B['var'] = $d['bbs'];
|
||||
if (!$my['admin'] && $my['uid'] != $AT['mbruid'])
|
||||
{
|
||||
if ($B['var']['perm_l_down'] > $my['level'] || strstr($B['var']['perm_g_down'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','다운로드 권한이 없습니다.','-1');
|
||||
}
|
||||
}
|
||||
if ($B['var']['point3'])
|
||||
{
|
||||
if (!$my['uid']) getLink('','','다운로드 권한이 없습니다.','-1');
|
||||
$UT = getDbData($table[$cyncArr['data'][0].'xtra'],'parent='.$AT['uid'],'*');
|
||||
if (!strpos('_'.$UT['down'],'['.$my['uid'].']') && !strpos('_'.$_SESSION['module_'.$cyncArr['data'][0].'_dncheck'],'['.$AT['uid'].']'))
|
||||
{
|
||||
if ($confirm == 'Y' && $my['point'] >= $B['var']['point3'])
|
||||
{
|
||||
if (!$my['admin'] && $my['uid'] != $AT['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','-".$B['var']['point3']."','다운로드(".getStrCut($AT['subject'],15,'').")','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$B['var']['point3'].',usepoint=usepoint+'.$B['var']['point3'],'memberuid='.$my['uid']);
|
||||
if (!$UT['parent'])
|
||||
{
|
||||
getDbInsert($table[$cyncArr['data'][0].'xtra'],'parent,site,bbs,down',"'".$AT['uid']."','".$s."','".$AT['bbs']."','[".$my['uid']."]'");
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$cyncArr['data'][0].'xtra'],"down='".$UT['down']."[".$my['uid']."]'",'parent='.$AT['uid']);
|
||||
}
|
||||
}
|
||||
$_SESSION['module_'.$cyncArr['data'][0].'_dncheck'] = $_SESSION['module_'.$cyncArr['data'][0].'_dncheck'].'['.$AT['uid'].']';
|
||||
getLink('','','결제되었습니다. 다운로드 받으세요.','close');
|
||||
}
|
||||
else {
|
||||
getWindow($g['s'].'/?iframe=Y&r='.$r.'&m='.$cyncArr['data'][0].'&bid='.$AT['bbsid'].'&mod=down&dfile='.$uid.'&uid='.$AT['uid'],'','width=550px,height=350px,status=yes,toolbar=no,scrollbars=no',$_SERVER['HTTP_REFERER'].'#attach','');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$cyncQue = $fdexp[1].'='.$fdexp[1].'+1';
|
||||
getDbUpdate($cyncArr['data'][3],$cyncQue,$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
}
|
||||
getDbUpdate($table['s_upload'],'down=down+1','uid='.$R['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'download=download+1',"date='".$date['today']."' and site=".$s);
|
||||
}
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Length: " .$filesize);
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
header("Cache-Control: private, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
if ($R['url']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
$filepath = $g['path_tmp'].'session/'.$filetmpname;
|
||||
ftp_get($FTP_CONNECT,$filepath,$d['upload']['ftp_folder'].$R['folder'].'/'.$filetmpname,FTP_BINARY);
|
||||
ftp_close($FTP_CONNECT);
|
||||
$fp = fopen($filepath, 'rb');
|
||||
if (!fpassthru($fp)) fclose($fp);
|
||||
unlink($filepath);
|
||||
}
|
||||
else {
|
||||
$fp = fopen($filepath, 'rb');
|
||||
if (!fpassthru($fp)) fclose($fp);
|
||||
}
|
||||
exit;
|
||||
?>
|
||||
9
modules/comment/action/a.fupdate.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if(!strpos('_score1,score2',$f)) exit;
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) exit;
|
||||
getDbUpdate($table[$m.'data'],$f.'='.$f.'+1','uid='.$R['uid']);
|
||||
exit;
|
||||
?>
|
||||
56
modules/comment/action/a.get_Chatting_Box.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/* 채팅박스 초기화 */
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
|
||||
$chatting = new Chatting();
|
||||
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
|
||||
$is_owner = $chatting->is_owner(); // 채팅방장 여부
|
||||
$totalPage = $chatting->getTotalPage($chatting->id,$chatting->recnum);
|
||||
$totalRow = getDbRows($table[$m.'data'],"bbsid='".$chatting->id."'");
|
||||
$SAT = $chatting->getSettings($chatting->id); // 채팅방 설정값
|
||||
|
||||
// 이미지 폴더 패스
|
||||
$TMPL['img_module_skin'] = $chatting->getThemePath($chatting->id).'/images/';
|
||||
|
||||
// chat box html 추출
|
||||
if($is_owner) $TMPL['chat_owner_menu'] = $chatting->getHtml('chat_owner_menu');
|
||||
else $TMPL['chat_owner_menu'] = '';
|
||||
|
||||
// 차단사용자 모달 값 세팅
|
||||
$TMPL['room_name'] = $SAT['room_name'];// 채팅방명
|
||||
$TMPL['block_list'] = $chatting->getBlockUser($chatting->id,1,5); // 차단사용자 리스트
|
||||
|
||||
// 열람 권한 체크 및 chat 출력
|
||||
$UAP = $chatting->getUAP($chatting->id);
|
||||
if(!$UAP['open']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('not_open'); // 오픈전 메세지
|
||||
else if(!$UAP['view']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('no_viewPerm'); // 열람권한 없음 메세지
|
||||
else if($UAP['closed']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('closed'); // closed 메세지
|
||||
else $TMPL['chat_rows'] = $chatting->getChatLog($chatting->id,1,$chatting->recnum);
|
||||
|
||||
// 이모티콘 리스트
|
||||
$TMPL['emoticon_list'] = $chatting->getEmoticonList($chatting->id);
|
||||
|
||||
$chat_box = $chatting->getHtml('chat_box');
|
||||
|
||||
$result['chat_box'] = $chat_box;
|
||||
$result['is_owner'] = $is_owner; // 채팅방장 여부
|
||||
$result['owner_id'] = $SAT['owner_id'];
|
||||
$result['totalPage'] = $totalPage;
|
||||
$result['totalRow'] = $totalRow;
|
||||
$result['userGroup'] = $my['mygroup']?$my['mygroup']:0;
|
||||
$result['userLevel'] = $my['level']?$my['level']:0;
|
||||
$result['room_type'] = $SAT['room_type']; // 운영시작
|
||||
$result['perm_write'] = $UAP['write']; // 작성 권한
|
||||
$result['room_open'] = $UAP['open']; // 운영시작
|
||||
$result['room_closed'] = $UAP['closed']; // 운영마감
|
||||
$result['t_start'] = $UAP['t_start']; // 운영마감
|
||||
$result['t_end'] = $UAP['t_end']; // 운영마감
|
||||
$result['now_time'] = $UAP['now_time']; // 운영마감
|
||||
|
||||
|
||||
echo json_encode($result,true);
|
||||
exit;
|
||||
?>
|
||||
28
modules/comment/action/a.get_CommentList.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
// 넘어온 값 : type & data
|
||||
//data 배열화 : data=theme+'^^'+parent+'^^'+sort+'^^'+recnum+'^^'+page+'^^'+'+orderby+'^^'+last_cuid;
|
||||
$data_arr=explode('^^',$data);
|
||||
$theme=$data_arr[0];
|
||||
$parent=$data_arr[1];
|
||||
$c_sort=$data_arr[2];
|
||||
$c_recnum=$data_arr[3];
|
||||
$c_page=$data_arr[4];
|
||||
$c_orderby=$data_arr[5];
|
||||
$last_sort=$data_arr[6];
|
||||
$_where=$c_sort."<>0";
|
||||
if($type=='more')
|
||||
{
|
||||
if($c_orderby=='asc') $_where .=" and ".$c_sort.">".$last_sort;
|
||||
else $_where .=" and ".$c_sort."<".$last_sort;
|
||||
}
|
||||
|
||||
include $theme.'comment/function.php';
|
||||
?>
|
||||
[RESULT:
|
||||
<?php getCommentList($theme,$m.$parent,$_where,$c_recnum,$c_sort,$orderby1,$c_orderby,$c_page);?>
|
||||
:RESULT]
|
||||
<?php
|
||||
exit;
|
||||
?>
|
||||
43
modules/comment/action/a.get_Comment_Box.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/* 채팅박스 초기화 */
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->parent = $_POST['parent']; // post 로 넘어온 값
|
||||
$comment->parent_table = $_POST['parent_table']; // post 로 넘어온 값
|
||||
$comment->theme_name = $_POST['theme_name']; // post 로 넘어온 값
|
||||
$comment->sort = $_POST['sort'];
|
||||
$comment->recnum = $_POST['recnum'];
|
||||
$comment->orderby = $_POST['orderby'];
|
||||
|
||||
$totalPage = $comment->getTotalData($comment->parent,$comment->recnum,'comment','page',0);
|
||||
$totalRow = $comment->getTotalData($comment->parent,$comment->recnum,'comment','row',0);
|
||||
|
||||
$TMPL['comment_total'] = $totalRow==0?'':$totalRow;
|
||||
$TMPL['login_user_pic'] = $comment->getUserAvatar($my['uid'],'src');
|
||||
$TMPL['login_user_nic'] = $my['nic'];
|
||||
$TMPL['comment_parent'] = $comment->parent;
|
||||
|
||||
// comment_box.html 구성요소 세팅
|
||||
$TMPL['img_module_skin'] = $comment->getThemePath('absolute').'/images/'; // 이미지 폴더 패스
|
||||
$TMPL['theme_css_path'] = $comment->getThemePath('absolute').'/css/style.css'; // 테마 css
|
||||
$TMPL['comment_rows_notice'] = $comment->getCommentLog($comment->parent,$sort,$orderby,$recnum,1,1); // 열람 권한 체크 및 고정 comment 출력
|
||||
$TMPL['comment_rows'] = $comment->getCommentLog($comment->parent,$sort,$orderby,$recnum,1,0); // 열람 권한 체크 및 comment 출력
|
||||
$TMPL['emoticon_list'] = $comment->getEmoticonList($comment->parent); // 이모티콘 리스트
|
||||
$TMPL['comment_header'] = $comment->getHtml('comment_header'); // 헤더
|
||||
$TMPL['comment_write'] = $comment->getHtml('comment_write'); // 쓰기
|
||||
|
||||
// 최종 리턴되는 댓글 box html & 세팅값
|
||||
$result['comment_box'] = $comment->getHtml('comment_box');
|
||||
$result['totalPage'] = $totalPage;
|
||||
$result['totalRow'] = $totalRow;
|
||||
$result['perm_write'] = $my['uid']?true:false; // 작성 권한
|
||||
$result['userGroup'] = $my['mygroup']?$my['mygroup']:0;
|
||||
$result['userLevel'] = $my['level']?$my['level']:0;
|
||||
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
?>
|
||||
21
modules/comment/action/a.get_Comment_Tpl.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/* msg 템플릿 초기화 */
|
||||
if(!defined('__KIMS__')) exit;
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
|
||||
$chatting = new Chatting();
|
||||
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
|
||||
|
||||
$resutl = array();
|
||||
$result['me'] = $chatting->getHtmlOnly('my_msg');
|
||||
$result['other'] = $chatting->getHtmlOnly('other_msg');
|
||||
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
|
||||
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
|
||||
$result['photo'] = $chatting->getHtmlOnly('photo_msg');
|
||||
$result['file'] = $chatting->getHtmlOnly('file_msg');
|
||||
$result['emoticon'] = $chatting->getHtmlOnly('emoticon_msg');
|
||||
|
||||
echo json_encode($result,true);
|
||||
exit;
|
||||
?>
|
||||
21
modules/comment/action/a.get_Msg_Tpl.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/* msg 템플릿 초기화 */
|
||||
if(!defined('__KIMS__')) exit;
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
|
||||
$chatting = new Chatting();
|
||||
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
|
||||
|
||||
$resutl = array();
|
||||
$result['me'] = $chatting->getHtmlOnly('my_msg');
|
||||
$result['other'] = $chatting->getHtmlOnly('other_msg');
|
||||
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
|
||||
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
|
||||
$result['photo'] = $chatting->getHtmlOnly('photo_msg');
|
||||
$result['file'] = $chatting->getHtmlOnly('file_msg');
|
||||
$result['emoticon'] = $chatting->getHtmlOnly('emoticon_msg');
|
||||
|
||||
echo json_encode($result,true);
|
||||
exit;
|
||||
?>
|
||||
11
modules/comment/action/a.get_OnelineList.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
include $theme.'comment/function.php';
|
||||
?>
|
||||
[RESULT:
|
||||
<?php echo getOnelineList($theme,$parent)?>
|
||||
:RESULT]
|
||||
<?php
|
||||
exit;
|
||||
?>
|
||||
54
modules/comment/action/a.makebbs.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$id = $id ? trim($id) : $bid;
|
||||
$name = trim($name);
|
||||
$codhead = trim($codhead);
|
||||
$codfoot = trim($codfoot);
|
||||
$category = trim($category);
|
||||
$addinfo = trim($addinfo);
|
||||
$writecode = trim($writecode);
|
||||
|
||||
if (!$name) getLink('','','채팅방 이름을 입력해 주세요.','');
|
||||
if (!$id) getLink('','','채팅방 아이디를 입력해 주세요.','');
|
||||
|
||||
if ($bid)
|
||||
{
|
||||
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
$QVAL = "name='$name',type='$type',owner_id='$owner_id',members='$members',t_start='$t_start',t_end='$t_end',category='$category',imghead='$imghead',imgfoot='$imgfoot',puthead='$puthead',putfoot='$putfoot',addinfo='$addinfo',writecode='$writecode'";
|
||||
getDbUpdate($table[$m.'list'],$QVAL,"id='".$bid."'");
|
||||
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.$R['uid'];
|
||||
$msg = '채팅방 설정내용이 수정되었습니다.';
|
||||
}
|
||||
else {
|
||||
|
||||
if(getDbRows($table[$m.'list'],"id='".$id."'")) getLink('','','이미 같은 아이디의 채팅방이 존재합니다.','');
|
||||
|
||||
$Ugid = getDbCnt($table[$m.'list'],'max(gid)','') + 1;
|
||||
$QKEY = "gid,id,name,type,owner_id,members,t_start,t_end,category,num_r,d_last,d_regis,imghead,imgfoot,puthead,putfoot,addinfo,writecode";
|
||||
$QVAL = "'$Ugid','$id','$name','$type','$owner_id','$members','$t_start','$t_end','$category','0','','".$date['totime']."','$imghead','$imgfoot','$puthead','$putfoot','$addinfo','$writecode'";
|
||||
getDbInsert($table[$m.'list'],$QKEY,$QVAL);
|
||||
|
||||
|
||||
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.getDbCnt($table[$m.'list'],'max(uid)','');
|
||||
$msg ='새 채팅방이 만들어졌습니다. ';
|
||||
}
|
||||
|
||||
|
||||
$fdset = array('layout','skin','m_skin','perm_g_view','perm_g_write','perm_l_view','perm_l_write','admin','hitcount','recnum','sbjcut','newtime','display');
|
||||
|
||||
$gfile= $g['dir_module'].'var/var.'.$id.'.php';
|
||||
$fp = fopen($gfile,'w');
|
||||
fwrite($fp, "<?php\n");
|
||||
foreach ($fdset as $val)
|
||||
{
|
||||
fwrite($fp, "\$d['bbs']['".$val."'] = \"".trim(${$val})."\";\n");
|
||||
}
|
||||
fwrite($fp, "?>");
|
||||
fclose($fp);
|
||||
@chmod($gfile,0707);
|
||||
|
||||
getLink('reload','parent.',$msg,'');
|
||||
?>
|
||||
13
modules/comment/action/a.multi_config.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
foreach ($bbs_members as $val)
|
||||
{
|
||||
$R = getUidData($table[$m.'list'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
getDbUpdate($table[$m.'list'],"name='".trim(${'name_'.$R['uid']})."'",'uid='.$R['uid']);
|
||||
}
|
||||
getLink('reload','parent.','수정되었습니다.','');
|
||||
?>
|
||||
233
modules/comment/action/a.multi_copy.php
Normal file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
$str_month = '';
|
||||
$str_today = '';
|
||||
$B = getUidData($table[$m.'list'],$bid);
|
||||
sort($post_members);
|
||||
reset($post_members);
|
||||
|
||||
foreach ($post_members as $val)
|
||||
{
|
||||
|
||||
$R = getUidData($table[$m.'data'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
|
||||
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid-1 : 100000000.00;
|
||||
|
||||
if (!$inc_comment)
|
||||
{
|
||||
$R['comment'] = 0;
|
||||
$R['oneline'] = 0;
|
||||
}
|
||||
if (!$inc_upload)
|
||||
{
|
||||
$R['upload'] = '';
|
||||
}
|
||||
|
||||
$month = substr($R['d_regis'],0,6);
|
||||
$today = substr($R['d_regis'],0,8);
|
||||
|
||||
//게시물복사
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'".$R['site']."','$gid','".$B['uid']."','".$B['id']."','".$R['depth']."','".$R['parentmbr']."','".$R['display']."','".$R['hidden']."','".$R['notice']."',";
|
||||
$QVAL.= "'".addslashes($R['name'])."','".addslashes($R['nic'])."','".$R['mbruid']."','".$R['id']."','".$R['pw']."','".addslashes($R['category'])."','".addslashes($R['subject'])."',";
|
||||
$QVAL.= "'".addslashes($R['content'])."','".$R['html']."','".addslashes($R['tag'])."',";
|
||||
$QVAL.= "'".$R['hit']."','".$R['down']."','".$R['comment']."','".$R['oneline']."','0','".$R['score1']."','".$R['score2']."','".$R['singo']."','0','".$R['point2']."','".$R['point3']."','".$R['point4']."',";
|
||||
$QVAL.= "'".$R['d_regis']."','".$R['d_modify']."','".$R['d_comment']."','".$R['d_trackback']."','".$R['upload']."','".$R['ip']."','".$R['agent']."','".$R['sns']."','".addslashes($R['adddata'])."'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'".$R['site']."','".$R['notice']."','".$B['uid']."','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1",'uid='.$B['uid']);
|
||||
|
||||
if(!strstr($str_month,'['.$month.']') && !getDbRows($table[$m.'month'],"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']))
|
||||
{
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$month."','".$R['site']."','".$B['uid']."','1'");
|
||||
$str_month .= '['.$month.']';
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']);
|
||||
}
|
||||
|
||||
if(!strstr($str_today,'['.$today.']') && !getDbRows($table[$m.'day'],"date='".$today."' and site=".$site.' and bbs='.$bbsuid))
|
||||
{
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$today."','".$R['site']."','".$B['uid']."','1'");
|
||||
$str_today .= '['.$today.']';
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$today."' and site=".$R['site'].' and bbs='.$B['uid']);
|
||||
}
|
||||
|
||||
$NOWUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
|
||||
|
||||
//댓글복사
|
||||
if ($inc_comment && $R['comment'])
|
||||
{
|
||||
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','desc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
|
||||
$comment_minuid = getDbCnt($table['s_comment'],'min(uid)','');
|
||||
$comment_uid = $comment_minuid ? $comment_minuid-1 : 100000000;
|
||||
$comment_cync = '['.$m.']['.$NOWUID.'][uid,comment,oneline,d_comment]['.$table[$m.'data'].']['.$_C['parentmbr'].'][m:'.$m.',bid:'.$B['id'].',uid:'.$NOWUID.']';
|
||||
|
||||
|
||||
$QKEY = "uid,site,parent,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,subject,content,html,";
|
||||
$QKEY.= "hit,down,oneline,score1,score2,singo,d_regis,d_modify,d_oneline,upload,ip,agent,cync,sns,adddata";
|
||||
$QVAL = "'$comment_uid','".$_C['site']."','".$m.$NOWUID."','".$_C['parentmbr']."','".$_C['display']."','".$_C['hidden']."','".$_C['notice']."','".addslashes($_C['name'])."','".addslashes($_C['nic'])."',";
|
||||
$QVAL.= "'".$_C['mbruid']."','".$_C['id']."','".$_C['pw']."','".addslashes($_C['subject'])."','".addslashes($_C['content'])."','".$_C['html']."',";
|
||||
$QVAL.= "'".$_C['hit']."','".$_C['down']."','".$_C['oneline']."','".$_C['score1']."','".$_C['score2']."','".$_C['singo']."','".$_C['d_regis']."','".$_C['d_modify']."','".$_C['d_oneline']."',";
|
||||
$QVAL.= "'".$_C['upload']."','".$_C['ip']."','".$_C['agent']."','$comment_cync','".$_C['sns']."','".addslashes($_C['adddata'])."'";
|
||||
getDbInsert($table['s_comment'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment+1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
$oneline_maxuid = getDbCnt($table['s_oneline'],'max(uid)','');
|
||||
$oneline_uid = $oneline_maxuid ? $oneline_maxuid+1 : 1;
|
||||
|
||||
$QKEY = "uid,site,parent,parentmbr,hidden,name,nic,mbruid,id,content,html,singo,d_regis,d_modify,ip,agent,adddata";
|
||||
$QVAL = "'$oneline_uid','".$_O['site']."','$comment_uid','".$_O['parentmbr']."','".$_O['hidden']."','".addslashes($_O['name'])."','".addslashes($_O['nic'])."','".$_O['mbruid']."',";
|
||||
$QVAL.= "'".$_O['id']."','".addslashes($_O['content'])."','".$_O['html']."','".$_O['singo']."','".$_O['d_regis']."','".$_O['d_modify']."','".$_O['ip']."','".$_O['agent']."',";
|
||||
$QVAL.= "'".addslashes($_O['adddata'])."'";
|
||||
getDbInsert($table['s_oneline'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline+1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($inc_upload && $_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
$tmpupload = '';
|
||||
$_content = $_C['content'];
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
$_tmpname = md5($U['tmpname']).'.'.getExt($U['tmpname']);
|
||||
$_thumbna = md5($U['thumbname']);
|
||||
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['tmpname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname'],FTP_BINARY);
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_tmpname,$g['path_tmp'].'session/'.$U['tmpname'], FTP_BINARY);
|
||||
@unlink($g['path_tmp'].'session/'.$U['tmpname']);
|
||||
if($U['type']==2)
|
||||
{
|
||||
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['thumbname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname'],FTP_BINARY);
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_thumbna,$g['path_tmp'].'session/'.$U['thumbname'], FTP_BINARY);
|
||||
@unlink($g['path_tmp'].'session/'.$U['thumbname']);
|
||||
}
|
||||
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
copy($g['path_file'].$U['folder'].'/'.$U['tmpname'],$g['path_file'].$U['folder'].'/'.$_tmpname);
|
||||
if($U['type']==2) copy($g['path_file'].$U['folder'].'/'.$U['thumbname'],$g['path_file'].$U['folder'].'/'.$_thumbna);
|
||||
}
|
||||
|
||||
$upload_mingid = getDbCnt($table['s_upload'],'min(gid)','');
|
||||
$upload_gid = $upload_mingid ? $upload_mingid - 1 : 100000000;
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,heigth,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'".$upload_gid."','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."','".$U['folder']."',";
|
||||
$QVAL.= "'".addslashes($U['name'])."','".$_tmpname."','".$_thumbna."','".$U['size']."','".$U['width']."','".$U['height']."','".addslashes($U['caption'])."',";
|
||||
$QVAL.= "'".$U['down']."','".$U['d_regis']."','".$U['d_update']."',''";
|
||||
getDbInsert($table['s_upload'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
|
||||
$tmpupload .= '['.getDbCnt($table['s_upload'],'max(uid)','').']';
|
||||
$_content = str_replace($U['tmpname'],$_tmpname,$_content);
|
||||
|
||||
}
|
||||
}
|
||||
getDbUpdate($table['s_comment'],"content='".addslashes($_content)."',upload='".$tmpupload."'",'uid='.$comment_uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//첨부파일복사
|
||||
if ($inc_upload && $R['upload'])
|
||||
{
|
||||
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
$tmpupload = '';
|
||||
$_content1 = $R['content'];
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
$_tmpname = md5($U['tmpname']).'.'.getExt($U['tmpname']);
|
||||
$_thumbna = md5($U['thumbname']);
|
||||
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['tmpname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname'],FTP_BINARY);
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_tmpname,$g['path_tmp'].'session/'.$U['tmpname'],FTP_BINARY);
|
||||
@unlink($g['path_tmp'].'session/'.$U['tmpname']);
|
||||
if($U['type']==2)
|
||||
{
|
||||
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['thumbname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname'],FTP_BINARY);
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_thumbna,$g['path_tmp'].'session/'.$U['thumbname'],FTP_BINARY);
|
||||
@unlink($g['path_tmp'].'session/'.$U['thumbname']);
|
||||
}
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
copy($g['path_file'].$U['folder'].'/'.$U['tmpname'],$g['path_file'].$U['folder'].'/'.$_tmpname);
|
||||
if($U['type']==2) copy($g['path_file'].$U['folder'].'/'.$U['thumbname'],$g['path_file'].$U['folder'].'/'.$_thumbna);
|
||||
}
|
||||
|
||||
$upload_mingid = getDbCnt($table['s_upload'],'min(gid)','');
|
||||
$upload_gid = $upload_mingid ? $upload_mingid - 1 : 100000000;
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'$upload_gid','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."',";
|
||||
$QVAL.= "'".$U['folder']."','".addslashes($U['name'])."','".$_tmpname."','".$_thumbna."','".$U['size']."','".$U['width']."','".$U['height']."',";
|
||||
$QVAL.= "'".addslashes($U['caption'])."','".$U['down']."','".$U['d_regis']."','".$U['d_update']."',''";
|
||||
getDbInsert($table['s_upload'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
|
||||
$tmpupload .= '['.getDbCnt($table['s_upload'],'max(uid)','').']';
|
||||
$_content1 = str_replace($U['tmpname'],$_tmpname,$_content1);
|
||||
}
|
||||
}
|
||||
getDbUpdate($table[$m.'data'],"content='".addslashes($_content1)."',upload='".$tmpupload."'",'uid='.$NOWUID);
|
||||
}
|
||||
|
||||
$_SESSION['BbsPost'.$type] = str_replace('['.$R['uid'].']','',$_SESSION['BbsPost'.$type]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
|
||||
|
||||
getLink($referer,'parent.','실행되었습니다.','');
|
||||
?>
|
||||
146
modules/comment/action/a.multi_delete.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
checkAdmin(0);
|
||||
|
||||
//include_once $g['path_module'].'upload/var/var.php'; ----------> 자체 upload 폴더 사용함으로 필요 없음 2014.12.31 by 케르
|
||||
|
||||
|
||||
foreach ($post_members as $val)
|
||||
{
|
||||
$R = getUidData($table[$m.'data'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
$B = getUidData($table[$m.'list'],$R['bbs']);
|
||||
if (!$B['uid']) continue;
|
||||
|
||||
//댓글삭제
|
||||
if ($R['comment'])
|
||||
{
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table[$m.'upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table[$m.'upload'],'uid='.$U['uid']);
|
||||
|
||||
if ($U['host']==$d['mediaset']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
|
||||
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
|
||||
}
|
||||
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
if ($_C['point']&&$_C['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table[$m.'upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table[$m.'upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['mediaset']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
//getLink('','','./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname'],'');
|
||||
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//태그삭제
|
||||
if ($R['tag'])
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
|
||||
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
|
||||
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
|
||||
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
|
||||
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
|
||||
|
||||
|
||||
if ($R['point1']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
11
modules/comment/action/a.multi_empty.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
|
||||
$_SESSION['BbsPost'.$type] = '';
|
||||
|
||||
getLink($referer,'parent.','','');
|
||||
?>
|
||||
22
modules/comment/action/a.multi_hide.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
foreach ($post_members as $val)
|
||||
{
|
||||
|
||||
$R = getUidData($table[$m.'data'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
|
||||
getDbUpdate($table[$m.'data'],'display=0','uid='.$val);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
getLink('reload','parent.','선택한 게시물이 모두 숨김처리 되었습니다. ','');
|
||||
?>
|
||||
100
modules/comment/action/a.multi_move.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$str_month = '';
|
||||
$str_today = '';
|
||||
$B = getUidData($table[$m.'list'],$bid);
|
||||
sort($post_members);
|
||||
reset($post_members);
|
||||
|
||||
foreach ($post_members as $val)
|
||||
{
|
||||
$R = getUidData($table[$m.'data'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
if ($R['bbs']==$B['uid']) continue;
|
||||
|
||||
$month = substr($R['d_regis'],0,6);
|
||||
$today = substr($R['d_regis'],0,8);
|
||||
|
||||
//게시물이동
|
||||
getDbUpdate($table[$m.'data'],'bbs='.$B['uid'].",bbsid='".$B['id']."'",'uid='.$R['uid']);
|
||||
getDbUpdate($table[$m.'idx'],'bbs='.$B['uid'],'gid='.$R['gid']);
|
||||
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r-1",'uid='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1",'uid='.$B['uid']);
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".$month."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".$today."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
|
||||
if(!strstr($str_month,'['.$month.']') && !getDbRows($table[$m.'month'],"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']))
|
||||
{
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$month."','".$R['site']."','".$B['uid']."','1'");
|
||||
$str_month .= '['.$month.']';
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']);
|
||||
}
|
||||
|
||||
if(!strstr($str_today,'['.$today.']') && !getDbRows($table[$m.'day'],"date='".$today."' and site=".$site.' and bbs='.$bbsuid))
|
||||
{
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$today."','".$R['site']."','".$B['uid']."','1'");
|
||||
$str_today .= '['.$today.']';
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$today."' and site=".$R['site'].' and bbs='.$B['uid']);
|
||||
}
|
||||
|
||||
|
||||
//댓글이동
|
||||
if ($R['comment'])
|
||||
{
|
||||
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','desc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
$comment_cync = '['.$m.']['.$R['uid'].'][uid,comment,oneline,d_comment]['.$table[$m.'data'].']['.$_C['parentmbr'].'][m:'.$m.',bid:'.$B['id'].',uid:'.$R['uid'].']';
|
||||
getDbUpdate($table['s_comment'],"cync='$comment_cync'",'uid='.$_C['uid']);
|
||||
|
||||
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_upload'],"cync=''",'uid='.$U['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//첨부파일이동
|
||||
if ($R['upload'])
|
||||
{
|
||||
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_upload'],"cync=''",'uid='.$U['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['BbsPost'.$type] = str_replace('['.$R['uid'].']','',$_SESSION['BbsPost'.$type]);
|
||||
}
|
||||
|
||||
|
||||
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
|
||||
|
||||
getLink($referer,'parent.','실행되었습니다.','');
|
||||
?>
|
||||
149
modules/comment/action/a.mypost_multi_delete.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
|
||||
foreach ($post_members as $val)
|
||||
{
|
||||
|
||||
$R = getUidData($table[$m.'data'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
$B = getUidData($table[$m.'list'],$R['bbs']);
|
||||
if (!$B['uid']) continue;
|
||||
|
||||
if ($my['uid'] != $R['mbruid'])
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//댓글삭제
|
||||
if ($R['comment'])
|
||||
{
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
|
||||
}
|
||||
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
if ($_C['point']&&$_C['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//태그삭제
|
||||
if ($R['tag'])
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
|
||||
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
|
||||
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
|
||||
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
|
||||
|
||||
|
||||
if ($R['point1']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
20
modules/comment/action/a.notidoc_regis.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$fdset = array('noti_title','noti_body','noti_button');
|
||||
$gfile= $g['dir_module'].'var/noti/'.$type.'.php'; // 알림메시지 양식
|
||||
|
||||
$fp = fopen($gfile,'w');
|
||||
fwrite($fp, "<?php\n");
|
||||
fwrite($fp, "\$d['comment']['noti_title'] = \"".$noti_title."\";\n");
|
||||
fwrite($fp, "\$d['comment']['noti_body'] = \"".$noti_body."\";\n");
|
||||
fwrite($fp, "\$d['comment']['noti_button'] = \"".$noti_button."\";\n");
|
||||
fwrite($fp, "?>");
|
||||
fclose($fp);
|
||||
@chmod($gfile,0707);
|
||||
|
||||
setrawcookie('notidoc_result', rawurlencode('수정 되었습니다.|success'));
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
27
modules/comment/action/a.oneline_delete.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) echo '[RESULT:정상적인 접근이 아닙니다.:RESULT]';
|
||||
$R = getUidData($table['s_oneline'],$uid);
|
||||
if (!$R['uid']) echo '[RESULT:존재하지 않는 한줄 의견입니다.:RESULT]';
|
||||
if ($R['id']!=$my['id']&&!$my['admin']) echo '[RESULT:삭제권한이 없습니다.:RESULT]';
|
||||
|
||||
$C = getUidData($table['s_comment'],$R['parent']);
|
||||
|
||||
getDbDelete($table['s_oneline'],'uid='.$R['uid']);
|
||||
getDbUpdate($table['s_comment'],'oneline=oneline-1','uid='.$C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($R['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
//동기화
|
||||
$cyncArr = getArrayString($C['cync']);
|
||||
$fdexp = explode(',',$cyncArr['data'][2]);
|
||||
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
|
||||
echo '[RESULT:ok:RESULT]';
|
||||
exit;
|
||||
?>
|
||||
31
modules/comment/action/a.oneline_multi_delete.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
foreach ($oneline_members as $val)
|
||||
{
|
||||
$R = getUidData($table['s_oneline'],$val);
|
||||
if (!$R['uid']) continue;
|
||||
|
||||
$C = getUidData($table['s_comment'],$R['parent']);
|
||||
|
||||
getDbDelete($table['s_oneline'],'uid='.$R['uid']);
|
||||
getDbUpdate($table['s_comment'],'oneline=oneline-1','uid='.$C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($R['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
//동기화
|
||||
$syncArr = getArrayString($C['sync']);
|
||||
$fdexp = explode(',',$syncArr['data'][2]);
|
||||
if ($fdexp[0]&&$fdexp[2]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-1',$fdexp[0].'='.$syncArr['data'][1]);
|
||||
|
||||
}
|
||||
setrawcookie('comment_oneline_result', rawurlencode('의견이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
19
modules/comment/action/a.oneline_report.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) echo '[RESULT:로그인해 주세요.:RESULT]';
|
||||
|
||||
$R = getUidData($table['s_oneline'],$uid);
|
||||
if (!$R['uid']) echo '[RESULT:존재하지 않는 한줄 의견입니다.:RESULT]';
|
||||
|
||||
if (!strstr($_SESSION['module_comment_osingo'],'['.$R['uid'].']'))
|
||||
{
|
||||
getDbUpdate($table['s_oneline'],'report=report+1','uid='.$R['uid']);
|
||||
$_SESSION['module_comment_osingo'] .= '['.$R['uid'].']';
|
||||
echo '[RESULT:신고처리 되었습니다.:RESULT]';
|
||||
}
|
||||
else {
|
||||
echo '[RESULT:이미 신고하신 한줄의견입니다.:RESULT]';
|
||||
}
|
||||
exit;
|
||||
?>
|
||||
37
modules/comment/action/a.point_view.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) getLink('','','잘못된 요청입니다.','');
|
||||
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) exit;
|
||||
|
||||
if (!$my['admin'] && $my['uid'] != $R['mbruid'])
|
||||
{
|
||||
if ($my['point'] < $R['point2'])
|
||||
{
|
||||
getLink('','','회원님의 보유포인트가 열람포인트보다 적습니다.','');
|
||||
}
|
||||
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','-".$R['point2']."','게시물열람(".getStrCut($R['subject'],15,'').")','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point2'].',usepoint=usepoint+'.$R['point2'],'memberuid='.$my['uid']);
|
||||
|
||||
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
|
||||
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
|
||||
|
||||
getLink('reload','parent.','결제되었습니다.','');
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
|
||||
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
|
||||
|
||||
if ($my['uid'] == $R['mbruid'])
|
||||
{
|
||||
getLink('reload','parent.','게시물 등록회원님으로 인증되셨습니다.','');
|
||||
}
|
||||
else
|
||||
{
|
||||
getLink('reload','parent.','관리자님으로 인증되셨습니다.','');
|
||||
}
|
||||
}
|
||||
?>
|
||||
14
modules/comment/action/a.pwcheck.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$pw) getLink('','','비밀번호를 입력해 주세요.','');
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('reload','parent.','존재하지 않거나 삭제된 글입니다.','');
|
||||
|
||||
if (md5($pw) != $R['pw']) getLink('reload','parent.','비밀번호가 일치하지 않습니다.','');
|
||||
|
||||
|
||||
$_SESSION['module_'.$m.'_pwcheck'] .= '['.$R['uid'].']';
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
227
modules/comment/action/a.regis_comment.php
Normal file
@@ -0,0 +1,227 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
include $g['dir_module'].'var/var.php';
|
||||
include $g['dir_module'].'var/noti/_'.$a.'.php'; // 알림메시지 양식
|
||||
|
||||
function _getPostLink($arr)
|
||||
{
|
||||
$sync_arr=explode('|',$arr['sync']);
|
||||
$B = getUidData($sync_arr[0],$sync_arr[2]);
|
||||
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#CMT-'.$arr['uid']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->theme_name = $_POST['theme_name'];
|
||||
$comment->recnum = $_POST['recnum'];
|
||||
|
||||
$result = array();
|
||||
$result['error'] = false;
|
||||
|
||||
if (!$sess_code){
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '정상적인 접근이 아닙니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}else{
|
||||
$mbruid = $my['uid'];
|
||||
$id = $my['id'];
|
||||
$name = $my['uid'] ? $my['name'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : $name;
|
||||
$pw = $pw ? md5($pw) : '';
|
||||
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
|
||||
$content = trim($content);
|
||||
$subject = $subject ? $subject : getStrCut(str_replace('&',' ',strip_tags($content)),35,'..');
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$d_regis = $date['totime'];
|
||||
$d_modify = '';
|
||||
$d_oneline = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
//$upload = $upfiles; // upfiles 값을 배열로 받아서 풀어서 upload 에 저장한다. 아래 참조
|
||||
$adddata = trim($adddata);
|
||||
$hit = 0;
|
||||
$down = 0;
|
||||
$oneline = 0;
|
||||
$likes = 0;
|
||||
$dislikes = 0;
|
||||
$report = 0;
|
||||
$point = $d['comment']['give_point'];
|
||||
$hidden = ($hidden=='true') ? 1 : 0;
|
||||
$notice = $notice ? intval($notice) : 0;
|
||||
$display = $hidepost || $hidden ? 0 : 1;
|
||||
|
||||
// 포토, 장소, 링크 존재여부
|
||||
$is_photo=0;
|
||||
$is_link=0;
|
||||
$is_place=0;
|
||||
|
||||
if ($d['comment']['badword_action'])
|
||||
{
|
||||
$badwordarr = explode(',' , $d['comment']['badword']);
|
||||
$badwordlen = count($badwordarr);
|
||||
for($i = 0; $i < $badwordlen; $i++)
|
||||
{
|
||||
if(!$badwordarr[$i]) continue;
|
||||
if(strstr($subject,$badwordarr[$i]) || strstr($content,$badwordarr[$i]))
|
||||
{
|
||||
if ($d['comment']['badword_action'] == 1)
|
||||
{
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '등록이 제한된 단어를 사용하셨습니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$badescape = strCopy($badwordarr[$i],$d['comment']['badword_escape']);
|
||||
$content = str_replace($badwordarr[$i],$badescape,$content);
|
||||
$subject = str_replace($badwordarr[$i],$badescape,$subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 업로드 파일 세팅
|
||||
if($upfiles)
|
||||
{
|
||||
$upload='';
|
||||
foreach ($upfiles as $file) {
|
||||
$upload .=$file;
|
||||
}
|
||||
$upload=trim($upload);
|
||||
$is_photo=1;
|
||||
}
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($comment->commentTable,$uid);
|
||||
|
||||
if (!$R['uid']){
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '존재하지 않는 댓글입니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$my['uid'] || ($my['uid'] != $R['mbruid'] && !$my['admin']))
|
||||
{
|
||||
if (!$pw)
|
||||
{
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '정상적인 접근이 아닙니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
if($pw != $R['pw'])
|
||||
{
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '정상적인 접근이 아닙니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$QVAL = "display='$display',hidden='$hidden',subject='$subject',content='$content',html='$html',";
|
||||
$QVAL .="d_modify='$d_regis',upload='$upload',adddata='$adddata'";
|
||||
getDbUpdate($comment->commentTable,$QVAL,'uid='.$R['uid']);
|
||||
$result['edit_content'] = $content;
|
||||
$result['edit_uid'] = $uid;
|
||||
$result['edit_hidden'] = $hidden;
|
||||
$result['edit_time'] = getDateFormat($d_regis,'c');
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// $parent_set 가공
|
||||
$parent_arr=explode('-',$parent);
|
||||
$parent_prefix = $parent_arr[0];
|
||||
$parent_uid = $parent_arr[1];
|
||||
$parent_set=str_replace('-','', $parent);
|
||||
|
||||
$R = getUidData($parent_table,$parent_uid);
|
||||
getDbUpdate($parent_table,"comment=comment+1,d_comment='".$date['totime']."'",'uid='.$R['uid']);
|
||||
$parentmbr = $R['mbruid'];
|
||||
$sync = $parent_table.'|'.$parent_prefix.'|'.$parent_uid;
|
||||
$minuid = getDbCnt($comment->commentTable,'min(uid)','');
|
||||
$uid = $minuid ? $minuid-1 : 1000000000;
|
||||
|
||||
$QKEY = "uid,site,parent,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,subject,content,html,";
|
||||
$QKEY.= "hit,down,oneline,likes,dislikes,report,point,d_regis,d_modify,d_oneline,upload,ip,agent,sync,sns,adddata";
|
||||
$QVAL = "'$uid','$s','".$parent_set."','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$subject','$content','$html',";
|
||||
$QVAL.= "'$hit','$down','$oneline','$likes','$dislikes','$report','$point','$d_regis','$d_modify','$d_oneline','$upload','$ip','$agent','$sync','','$adddata'";
|
||||
getDbInsert($comment->commentTable,$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($uid == 1000000000) db_query("OPTIMIZE TABLE ".$table['s_comment'],$DB_CONNECT);
|
||||
if ($point&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point."','댓글(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point,'memberuid='.$my['uid']);
|
||||
}
|
||||
|
||||
$LASTUID = getDbCnt($comment->commentTable,'min(uid)','');
|
||||
$row = getUidData($comment->commentTable,$LASTUID);
|
||||
|
||||
|
||||
// 연동모듈 댓글통계 반영
|
||||
if(!getDbRows($table['s_mbrmonth'],"date='".$date['month']."' and site=".$s.' and mbruid='.$row['parentmbr'])) {
|
||||
getDbInsert($table['s_mbrmonth'],'date,site,mbruid',"'".$date['month']."','".$s."','".$row['parentmbr']."'");
|
||||
}
|
||||
|
||||
if(!getDbRows($table['s_mbrday'],"date='".$date['today']."' and site=".$s.' and mbruid='.$row['parentmbr'])) {
|
||||
getDbInsert($table['s_mbrday'],'date,site,mbruid',"'".$date['today']."','".$s."','".$row['parentmbr']."'");
|
||||
}
|
||||
|
||||
if(!getDbRows($table[$parent_prefix.'month'],"date='".$date['month']."' and site=".$s.' and data='.$parent_uid)) {
|
||||
getDbInsert($table[$parent_prefix.'month'],'date,site,data',"'".$date['month']."','".$s."','".$parent_uid."'");
|
||||
}
|
||||
|
||||
if(!getDbRows($table[$parent_prefix.'day'],"date='".$date['today']."' and site=".$s.' and data='.$parent_uid)) {
|
||||
getDbInsert($table[$parent_prefix.'day'],'date,site,data',"'".$date['today']."','".$s."','".$parent_uid."'");
|
||||
}
|
||||
|
||||
getDbUpdate($table['s_mbrmonth'],'post_comment=post_comment+1',"date='".$date['month']."' and site=".$s.' and mbruid='.$row['parentmbr']); //부모글 등록자 월별 조회수 갱신
|
||||
getDbUpdate($table['s_mbrday'],'post_comment=post_comment+1',"date='".$date['today']."' and site=".$s.' and mbruid='.$row['parentmbr']); //부모글 등록자 일별조회수 갱신
|
||||
getDbUpdate($table[$parent_prefix.'month'],'comment=comment+1',"date='".$date['month']."' and site=".$s.' and data='.$parent_uid); //연동모듈 월별 조회수 갱신
|
||||
getDbUpdate($table[$parent_prefix.'day'],'comment=comment+1',"date='".$date['today']."' and site=".$s.' and data='.$parent_uid); //연동모듈 일별 조회수 갱신
|
||||
|
||||
|
||||
// 댓글의 부모글 등록자에게 알림전송
|
||||
if ($row['parentmbr'] != $my['uid'] ) {
|
||||
|
||||
$B = getDbData($table['bbslist'],'id="'.$R['bbsid'].'"','name');
|
||||
|
||||
//알림내용에 양식 적용(/modules/comment/var/noti/regis_comment.php)
|
||||
$noti_title = $d['comment']['noti_title'];
|
||||
$noti_body = $d['comment']['noti_body'];
|
||||
$noti_referer = _getPostLink($row);
|
||||
$noti_button = $d['comment']['noti_button'];
|
||||
$noti_tag = '';
|
||||
|
||||
// 내용 치환
|
||||
$noti_title = str_replace('{NAME}',$my['name'],$noti_title); //댓글등록자 이름
|
||||
$noti_title = str_replace('{NIC}',$my['nic'],$noti_title); //댓글등록자 닉네임
|
||||
$noti_body = str_replace('{NAME}',$my['name'],$noti_body); //댓글등록자 이름
|
||||
$noti_body = str_replace('{NIC}',$my['nic'],$noti_body); //댓글등록자 닉네임
|
||||
$noti_body = str_replace('{BBS}',$B['name'],$noti_body); //게시판명
|
||||
$noti_body = str_replace('{SUBJECT}',$subject,$noti_body); //댓글내용
|
||||
|
||||
putNotice($row['parentmbr'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,'','');
|
||||
}
|
||||
|
||||
$result['last_row'] = $comment->getCommentRow($row,$p,0);
|
||||
$result['lastuid'] = $LASTUID;
|
||||
$result['parent_table'] = $parent_table;
|
||||
$result['sess_code'] = $sess_code;
|
||||
echo json_encode($result);
|
||||
|
||||
exit;
|
||||
|
||||
}
|
||||
// 신규등록
|
||||
}
|
||||
?>
|
||||
154
modules/comment/action/a.regis_oneline.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
require_once $g['dir_module'].'includes/base.class.php';
|
||||
require_once $g['dir_module'].'includes/module.class.php';
|
||||
include $g['dir_module'].'var/var.php';
|
||||
include $g['dir_module'].'var/noti/_'.$a.'.php'; // 알림메시지 양식
|
||||
|
||||
function _getPostLink($arr)
|
||||
{
|
||||
$sync_arr=explode('|',$arr['sync']);
|
||||
$B = getUidData($sync_arr[0],$sync_arr[2]);
|
||||
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#CMT-'.$arr['uid']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->theme_name = $_POST['theme_name'];
|
||||
|
||||
$result = array();
|
||||
$result['error'] = false;
|
||||
$R = getUidData($comment->commentTable,$parent);
|
||||
if (!$my['uid'] || !$R['uid']){
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '정상적인 접근이 아닙니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
|
||||
}else{
|
||||
$parentmbr = $R['mbruid'];
|
||||
$mbruid = $my['uid'];
|
||||
$id = $my['id'];
|
||||
$name = $my['uid'] ? $my['name'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : $name;
|
||||
$pw = $pw ? md5($pw) : '';
|
||||
$content = trim($content);
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$report = 0;
|
||||
$hidden = ($hidden=='true') ? 1 : 0;
|
||||
$point = $d['comment']['give_opoint'];
|
||||
$d_regis = $date['totime'];
|
||||
$d_modify = '';
|
||||
$d_oneline = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$adddata = trim($adddata);
|
||||
|
||||
|
||||
if ($d['comment']['badword_action'])
|
||||
{
|
||||
$badwordarr = explode(',' , $d['comment']['badword']);
|
||||
$badwordlen = count($badwordarr);
|
||||
for($i = 0; $i < $badwordlen; $i++)
|
||||
{
|
||||
if(!$badwordarr[$i]) continue;
|
||||
|
||||
if(strstr($content,$badwordarr[$i]))
|
||||
{
|
||||
if ($d['comment']['badword_action'] == 1)
|
||||
{
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '등록이 제한된 단어를 사용하셨습니다.';
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$badescape = strCopy($badwordarr[$i],$d['comment']['badword_escape']);
|
||||
$content = str_replace($badwordarr[$i],$badescape,$content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($comment->onelineTable,$uid);
|
||||
if((!$my['admin'] && $my['uid'] != $R['mbruid'])||!$R['uid']){
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '정상적인 접근이 아닙니다.';
|
||||
$result['mbruid'] = $R['mbruid'];
|
||||
$result['uid'] = $R['uid'];
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
$QVAL = "hidden='$hidden',content='$content',html='$html',d_modify='$d_regis',adddata='$adddata'";
|
||||
getDbUpdate($comment->onelineTable,$QVAL,'uid='.$R['uid']);
|
||||
|
||||
$result['edit_content'] = $content;
|
||||
$result['edit_uid'] = $uid;
|
||||
$result['edit_hidden'] = $hidden;
|
||||
$result['edit_time'] = getDateFormat($d_regis,'c');
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$maxuid = getDbCnt($comment->onelineTable,'max(uid)','');
|
||||
$uid = $maxuid ? $maxuid+1 : 1;
|
||||
|
||||
$QKEY = "uid,site,parent,parentmbr,hidden,name,nic,mbruid,id,content,html,report,point,d_regis,d_modify,ip,agent,adddata";
|
||||
$QVAL = "'$uid','$s','$parent','$parentmbr','$hidden','$name','$nic','$mbruid','$id','$content','$html','$report','$point','$d_regis','$d_modify','$ip','$agent','$adddata'";
|
||||
getDbInsert($comment->onelineTable,$QKEY,$QVAL);
|
||||
getDbUpdate($comment->commentTable,"oneline=oneline+1,d_oneline='".$d_regis."'",'uid='.$parent);
|
||||
getDbUpdate($grant_table,"oneline=oneline+1",'uid='.$grant); // 댓글의 parent = grant
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($uid == 1) db_query("OPTIMIZE TABLE ".$table['s_oneline'],$DB_CONNECT);
|
||||
|
||||
if ($point&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point."','한줄의견(".getStrCut(str_replace('&',' ',strip_tags($content)),15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point,'memberuid='.$my['uid']);
|
||||
}
|
||||
|
||||
$LASTUID = getDbCnt($comment->onelineTable,'max(uid)','');
|
||||
$row = getUidData($comment->onelineTable,$LASTUID);
|
||||
|
||||
|
||||
// 한줄의견의 부모댓글 등록자에게 알림전송
|
||||
if ($row['parentmbr'] != $my['uid'] ) {
|
||||
|
||||
$B = getDbData($table['bbslist'],'id="'.$R['bbsid'].'"','name');
|
||||
|
||||
//알림내용에 양식 적용(/modules/comment/var/noti/regis_oneline.php)
|
||||
$noti_title = $d['comment']['noti_title'];
|
||||
$noti_body = $d['comment']['noti_body'];
|
||||
$noti_referer = _getPostLink($row);
|
||||
$noti_button = $d['comment']['noti_button'];
|
||||
$noti_tag = '';
|
||||
|
||||
// 내용 치환
|
||||
$noti_title = str_replace('{NAME}',$my['name'],$noti_title); //댓글등록자 이름
|
||||
$noti_title = str_replace('{NIC}',$my['nic'],$noti_title); //댓글등록자 닉네임
|
||||
$noti_body = str_replace('{NAME}',$my['name'],$noti_body); //댓글등록자 이름
|
||||
$noti_body = str_replace('{NIC}',$my['nic'],$noti_body); //댓글등록자 닉네임
|
||||
$noti_body = str_replace('{BBS}',$B['name'],$noti_body); //게시판명
|
||||
$noti_body = str_replace('{COMMENT}',$R['subject'],$noti_body); //댓글제목
|
||||
$noti_body = str_replace('{SUBJECT}',$content,$noti_body); //의견내용
|
||||
|
||||
putNotice($row['parentmbr'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,'','');
|
||||
}
|
||||
|
||||
|
||||
$result['last_row'] = $comment->getOnelineRow($row,$p);
|
||||
$result['lastuid'] = $LASTUID;
|
||||
$result['grant_table'] = $grant_table;
|
||||
$result['grant'] = $grant;
|
||||
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
80
modules/comment/action/a.save_msg.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
|
||||
$result= array();
|
||||
$result['error'] = false;
|
||||
|
||||
if (!$bid){
|
||||
$result['error'] = true;
|
||||
$result['error_msg'] = '게시판 아이디가 지정되지 않았습니다.';
|
||||
echo json_encode($result,true);
|
||||
exit;
|
||||
}
|
||||
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
|
||||
|
||||
$bbsuid = $B['uid'];
|
||||
$bbsid = $B['id'];
|
||||
$mbruid = $my['uid'];
|
||||
$id = $my['id'];
|
||||
$name = $my['uid'] ? $my['name'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : $name;
|
||||
$category = trim($category);
|
||||
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
|
||||
$content = trim($content);
|
||||
$subject = $subject ? $subject : getStrCut(str_replace('&',' ',strip_tags($content)),35,'..');
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$tag = trim($tag);
|
||||
$d_regis = $date['totime'];
|
||||
$d_comment = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$adddata = trim($adddata);
|
||||
$hidden = $hidden ? intval($hidden) : 0;
|
||||
$notice = $notice ? intval($notice) : 0;
|
||||
$display = $d['bbs']['display'] || $hidepost || $hidden ? 0 : 1;
|
||||
$parentmbr = 0;
|
||||
$point1 = trim($d['bbs']['point1']);
|
||||
$point2 = trim($d['bbs']['point2']);
|
||||
$point3 = $point3 ? filterstr(trim($point3)) : 0;
|
||||
$point4 = $point4 ? filterstr(trim($point4)) : 0;
|
||||
|
||||
if (!$uid || $reply == 'Y')
|
||||
{
|
||||
if(!getDbRows($table[$m.'day'],"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$date['today']."','".$s."','".$bbsuid."','0'");
|
||||
if(!getDbRows($table[$m.'month'],"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$date['month']."','".$s."','".$bbsuid."','0'");
|
||||
}
|
||||
|
||||
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid-1 : 100000000.00;
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata,token";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata','$token'";
|
||||
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
|
||||
|
||||
if ($gid == 100000000.00)
|
||||
{
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'idx'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'month'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'day'],$DB_CONNECT);
|
||||
}
|
||||
$result = array();
|
||||
$result['uid'] = $LASTUID;
|
||||
echo json_encode($result,true);
|
||||
exit;
|
||||
?>
|
||||
48
modules/comment/action/a.score.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
$useGUEST = 0; //비회원도 접근허용할 경우 1로 변경
|
||||
$score_limit = 1; //점수한계치(이 점수보다 높은 갚을 임의로 보낼 경우 제한)
|
||||
$score = $score ? $score : 1;
|
||||
if ($score > $score_limit) $score = $score_limit;
|
||||
|
||||
if (!$useGUEST)
|
||||
{
|
||||
if (!$my['uid']) getLink('','','로그인해 주세요.','');
|
||||
$scorelog = '['.$my['uid'].']';
|
||||
}
|
||||
else {
|
||||
$scorelog = '['.$_SERVER['REMOTE_ADDR'].']';
|
||||
if ($my['uid']) $scorelog .= '['.$my['uid'].']';
|
||||
}
|
||||
|
||||
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
|
||||
|
||||
$UT = getDbData($table[$m.'xtra'],'parent='.$R['uid'],'*');
|
||||
$scoreset = array('good'=>'score1','bad'=>'score2');
|
||||
|
||||
// 공감,비공감 또는 추천,비추천 등 2개이상의 체크가 가능할 경우 둘중 하나라도 체크했을때 중복을 제한하려면 주석을 풀어주세요.
|
||||
//if (strpos('_'.$UT['score1'],'['.$my['uid'].']') || strpos('_'.$UT['score1'],'['.$_SERVER['REMOTE_ADDR'].']') || strpos('_'.$UT['score2'],'['.$my['uid'].']') || strpos('_'.$UT['score2'],'['.$_SERVER['REMOTE_ADDR'].']'))
|
||||
//{
|
||||
// getLink('','','이미 반영된 글입니다.','');
|
||||
//}
|
||||
|
||||
if (!strpos('_'.$UT[$scoreset[$value]],'['.$my['uid'].']') && !strpos('_'.$UT[$scoreset[$value]],'['.$_SERVER['REMOTE_ADDR'].']'))
|
||||
{
|
||||
getDbUpdate($table[$m.'data'],$scoreset[$value].'='.$scoreset[$value].'+'.$score,'uid='.$R['uid']);
|
||||
if (!$UT['parent'])
|
||||
{
|
||||
getDbInsert($table[$m.'xtra'],'parent,site,bbs,'.$scoreset[$value],"'".$R['uid']."','".$s."','".$R['bbs']."','".$scorelog."'");
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'xtra'],$scoreset[$value]."='".$UT[$scoreset[$value]].$scorelog."'",'parent='.$R['uid']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
getLink('','','이미 반영된 글입니다.','');
|
||||
}
|
||||
|
||||
getLink('','','반영되었습니다.','');
|
||||
?>
|
||||
28
modules/comment/action/a.scrap.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) getLink('','','정상적인 접근이 아닙니다.','');
|
||||
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
|
||||
$B = getUidData($table[$m.'list'],$R['bbs']);
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
|
||||
$mbruid = $my['uid'];
|
||||
$category = $_HM['name']?$_HM['name']:$B['name'];
|
||||
$subject = addslashes($R['subject']);
|
||||
$url = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('bid','uid','skin','iframe'));
|
||||
$d_regis = $date['totime'];
|
||||
|
||||
if (getDbRows($table['s_scrap'],"mbruid=".$mbruid." and url='".$url."'"))
|
||||
{
|
||||
getLink('','','이미 스크랩된 게시물입니다.','');
|
||||
}
|
||||
|
||||
$_QKEY = 'mbruid,category,subject,url,d_regis';
|
||||
$_QVAL = "'$mbruid','$category','$subject','$url','$d_regis'";
|
||||
getDbInsert($table['s_scrap'],$_QKEY,$_QVAL);
|
||||
|
||||
|
||||
getLink('' ,'' , '스크랩 되었습니다.' , '');
|
||||
?>
|
||||
172
modules/comment/action/a.singo.php
Normal file
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
if (!$my['uid']) getLink('','','로그인해 주세요.','');
|
||||
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
|
||||
$B = getUidData($table[$m.'list'],$R['bbs']);
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
if ($d['bbs']['singo_del'] && $d['bbs']['singo_del_num'] <= $R['singo'])
|
||||
{
|
||||
|
||||
if ($d['bbs']['singo_del_act'] == 1)
|
||||
{
|
||||
|
||||
//댓글삭제
|
||||
if ($R['comment'])
|
||||
{
|
||||
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
|
||||
|
||||
while($_C=db_fetch_array($CCD))
|
||||
{
|
||||
if ($_C['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($_C['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_C['oneline'])
|
||||
{
|
||||
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
|
||||
while($_O=db_fetch_array($_ONELINE))
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
|
||||
if ($_O['point']&&$_O['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
|
||||
}
|
||||
}
|
||||
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
|
||||
}
|
||||
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
|
||||
|
||||
if ($_C['point']&&$_C['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
//첨부파일삭제
|
||||
if ($R['upload'])
|
||||
{
|
||||
$UPFILES = getArrayString($R['upload']);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['uid'])
|
||||
{
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
|
||||
getDbDelete($table['s_upload'],'uid='.$U['uid']);
|
||||
if ($U['host']==$d['upload']['ftp_urlpath'])
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
else {
|
||||
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
|
||||
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//태그삭제
|
||||
if ($R['tag'])
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
|
||||
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
|
||||
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
|
||||
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
|
||||
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$R['bbs'])."'",'uid='.$cuid);
|
||||
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
|
||||
|
||||
if ($R['point1']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
|
||||
getLink($backUrl ,'parent.' , '신고건수 누적으로 삭제처리 되었습니다.' , $history);
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'data'],'hidden=1','uid='.$R['uid']);
|
||||
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
|
||||
getLink($backUrl ,'parent.' , '신고건수 누적으로 게시제한처리 되었습니다.' , $history);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$UT = getDbData($table[$m.'xtra'],'parent='.$R['uid'],'*');
|
||||
|
||||
if (!strpos('_'.$UT['singo'],'['.$my['uid'].']'))
|
||||
{
|
||||
getDbUpdate($table[$m.'data'],'singo=singo+1','uid='.$R['uid']);
|
||||
if (!$UT['parent'])
|
||||
{
|
||||
getDbInsert($table[$m.'xtra'],'parent,site,bbs,singo',"'".$R['uid']."','".$s."','".$R['bbs']."','[".$my['uid']."]'");
|
||||
}
|
||||
else {
|
||||
getDbUpdate($table[$m.'xtra'],"singo='[".$my['uid']."]'",'parent='.$R['uid']);
|
||||
}
|
||||
getLink('','','신고처리 되었습니다.','');
|
||||
}
|
||||
else {
|
||||
getLink('','','이미 신고하신 게시물입니다.','');
|
||||
}
|
||||
}
|
||||
?>
|
||||
13
modules/comment/action/a.theme_config.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$fp = fopen($g['dir_module'].'themes/'.$theme.'/_var.php','w');
|
||||
fwrite($fp,trim(stripslashes($theme_var)));
|
||||
fclose($fp);
|
||||
@chmod($g['dir_module'].'themes/'.$theme.'/_var.php',0707);
|
||||
|
||||
setrawcookie('result_comment_theme', rawurlencode('저장 되었습니다.|success')); // 처리여부 cookie 저장
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
12
modules/comment/action/a.theme_delete.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
if (trim($theme) && is_dir($g['dir_module'].'theme/'.$theme))
|
||||
{
|
||||
include_once $g['path_core'].'function/dir.func.php';
|
||||
DirDelete($g['dir_module'].'theme/'.$theme);
|
||||
}
|
||||
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=skin','parent.','','');
|
||||
?>
|
||||
41
modules/comment/action/a.update_like.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
// post 로 넘어오는 값
|
||||
$post = $_POST['post']; // 해당 블로그 data uid
|
||||
|
||||
// 리턴값 세팅
|
||||
$result = array();
|
||||
$result['error'] = false;
|
||||
|
||||
$mbruid = $my['uid'];
|
||||
|
||||
// 로그인한 사용자가 좋아요를 했는지 여부 체크
|
||||
$is_liked = getDbRows($table[$m.'likes'],'mbruid='.$mbruid.' and post='.$post);
|
||||
|
||||
if($is_liked){ // 좋아요를 했던 경우
|
||||
// rb_blog_likes 테이블 row 삭제
|
||||
getDbDelete($table[$m.'likes'],'mbruid='.$mbruid.' and post='.$post);
|
||||
|
||||
// rb_blog_data 테이블 해당 글의 likes 갯수 업데이트
|
||||
getDbUpdate($table[$m.'data'],'likes=likes-1','uid='.$post);
|
||||
|
||||
}else{ // 좋아요 안한 경우 추가
|
||||
// rb_blog_likes 테이블 row 추가
|
||||
$QKEY = "mbruid,post,d_regis";
|
||||
$QVAL = "'$mbruid','$post','".$date['totime']."'";
|
||||
getDbInsert($table[$m.'likes'],$QKEY,$QVAL);
|
||||
|
||||
// rb_blog_data 테이블 해당 글의 likes 갯수 업데이트
|
||||
getDbUpdate($table[$m.'data'],'likes=likes+1','uid='.$post);
|
||||
|
||||
}
|
||||
|
||||
// 현재 해당 글 likes 갯수 얻기
|
||||
$R = getDbData($table[$m.'data'],'uid='.$post,'likes');
|
||||
|
||||
$result['total_like'] = $R['likes'];
|
||||
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
?>
|
||||
106
modules/comment/action/a.upload.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
$g=array();
|
||||
$g['url_host'] = 'http'.($_SERVER['HTTPS']=='on'?'s':'').'://'.$_SERVER['HTTP_HOST'];
|
||||
$g['path_root']='../../../';
|
||||
$g['path_var']=$g['path_root'].'_var/';
|
||||
$g['path_core']=$g['path_root'].'_core/';
|
||||
$g['path_module']=$g['path_root'].'modules/';
|
||||
require $g['path_var'].'db.info.php';
|
||||
require $g['path_var'].'table.info.php';
|
||||
require $g['path_core'].'function/db.mysql.func.php';
|
||||
require $g['path_core'].'function/sys.func.php';
|
||||
require $g['path_core'].'function/thumb.func.php';
|
||||
include $g['path_module'].'mediaset/var/var.php'; // 미디어셋 설정내용
|
||||
$DB_CONNECT = isConnectedToDB($DB);
|
||||
$date['today']=date('Ymd');
|
||||
$date['totime']=date('YmdHis');
|
||||
|
||||
if ($_FILES['file']['name']) {
|
||||
if (!$_FILES['file']['error']) {
|
||||
if (!$d['mediaset']['ext_cut'] && !strstr($d['mediaset']['ext_cut'],$fileExt)){
|
||||
$tmpcode = time();
|
||||
$s=$_POST['s'];
|
||||
$mbruid=$_POST['mbruid'];
|
||||
$fserver = $d['meidaset']['use_fileserver'];
|
||||
$url = $fserver ? $d['meidaset']['ftp_urlpath'] : $g['url_host'].'/modules/bbs/upload/';
|
||||
$name = strtolower($_FILES['file']['name']);
|
||||
$size = $_FILES['file']['size'];
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
$caption = trim($caption);
|
||||
$down = 0;
|
||||
$d_regis = $date['totime'];
|
||||
$d_update = '';
|
||||
$fileExt = getExt($name);
|
||||
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
|
||||
$type = getFileType($fileExt);
|
||||
$tmpname = md5($name).substr($date['totime'],8,14);
|
||||
$tmpname = $type == 2 ? $tmpname.'.'.$fileExt : $tmpname;
|
||||
$hidden = $type == 2 ? 1 : 0;
|
||||
|
||||
$upfolder = substr($date['today'],0,8); // 년월일을 업로드 폴더 구분기준으로 설정
|
||||
$saveDir = '../upload/'; // bbs 게시판 안에 별도의 files 폴더를 둔다. 나중에 포럼모듈이 나오면 충돌을 피하기 위해
|
||||
$savePath1 = $saveDir.substr($upfolder,0,4);// 년도 폴더 지정 (없으면 아래 for 문으로 만든다)
|
||||
$savePath2 = $savePath1.'/'.substr($upfolder,4,2); // 월 폴더 지정 (없으면 아래 for 문으로 만든다)
|
||||
$savePath3 = $savePath2.'/'.substr($upfolder,6,2); // 일 폴더 지정(없으면 아래 for 문으로 만든다)
|
||||
$folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
|
||||
|
||||
// 위 폴더가 없으면 새로 만들기
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
if (!is_dir(${'savePath'.$i}))
|
||||
{
|
||||
mkdir(${'savePath'.$i},0707);
|
||||
@chmod(${'savePath'.$i},0707);
|
||||
}
|
||||
}
|
||||
$saveFile = $savePath3.'/'.$tmpname; // 생성된 폴더/파일 --> 파일의 실제 위치
|
||||
|
||||
if($Overwrite=='true' || !is_file($saveFile))
|
||||
{
|
||||
move_uploaded_file($_FILES["file"]["tmp_name"], $saveFile);
|
||||
if ($type == 2)
|
||||
{
|
||||
$thumbname = md5($tmpname).'.'.$fileExt;
|
||||
$thumbFile = $savePath3.'/'.$thumbname;
|
||||
ResizeWidth($saveFile,$thumbFile,150);
|
||||
@chmod($thumbFile,0707);
|
||||
$IM = getimagesize($saveFile);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
}
|
||||
@chmod($saveFile,0707);
|
||||
}
|
||||
|
||||
$mingid = getDbCnt($table['bbsupload'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid - 1 : 100000000;
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'$gid','$hidden','$tmpcode','$s','$mbruid','$type','$fileExt','$fserver','$url','$folder','$name','$tmpname','$thumbname','$size','$width','$height','$caption','$down','$d_regis','$d_update','$cync'";
|
||||
getDbInsert($table['bbsupload'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
$lastuid= getDbCnt($table['bbsupload'],'max(uid)','');
|
||||
$sourcePath='./modules/bbs'.str_replace('..','',$savePath3); // 소스에 보여주는 패스트 -- 상대경로를 제거한다.
|
||||
$code='100';
|
||||
$src=$sourcePath.'/'.$tmpname;
|
||||
$result=array($code,$src,$lastuid); // 이미지 path 및 이미지 uid 값
|
||||
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
|
||||
}else{
|
||||
$code='200';
|
||||
$msg = '업로드금지 확장자입니다.';
|
||||
$result=array($code,$msg);
|
||||
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
|
||||
}
|
||||
|
||||
}else{
|
||||
$code='300';
|
||||
$msg = '파일 에러입니다.: '.$_FILES['file']['error'];
|
||||
$result=array($code,$msg);
|
||||
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
|
||||
}
|
||||
|
||||
}// 파일이 넘어왔는지 체크
|
||||
?>
|
||||
|
||||
|
||||
436
modules/comment/action/a.write.php
Normal file
@@ -0,0 +1,436 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
|
||||
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
|
||||
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
|
||||
|
||||
|
||||
$bbsuid = $B['uid'];
|
||||
$bbsid = $B['id'];
|
||||
$mbruid = $my['uid'];
|
||||
$id = $my['id'];
|
||||
$name = $my['uid'] ? $my['name'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : $name;
|
||||
$category = trim($category);
|
||||
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
|
||||
$content = trim($content);
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$tag = trim($tag);
|
||||
$d_regis = $date['totime'];
|
||||
$d_comment = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$upload = $upfiles;
|
||||
$adddata = trim($adddata);
|
||||
$hidden = $hidden ? intval($hidden) : 0;
|
||||
$notice = $notice ? intval($notice) : 0;
|
||||
$display = $d['bbs']['display'] || $hidepost || $hidden ? 0 : 1;
|
||||
$parentmbr = 0;
|
||||
$point1 = trim($d['bbs']['point1']);
|
||||
$point2 = trim($d['bbs']['point2']);
|
||||
$point3 = $point3 ? filterstr(trim($point3)) : 0;
|
||||
$point4 = $point4 ? filterstr(trim($point4)) : 0;
|
||||
|
||||
if ($d['bbs']['badword_action'])
|
||||
{
|
||||
$badwordarr = explode(',' , $d['bbs']['badword']);
|
||||
$badwordlen = count($badwordarr);
|
||||
for($i = 0; $i < $badwordlen; $i++)
|
||||
{
|
||||
if(!$badwordarr[$i]) continue;
|
||||
|
||||
if(strstr($subject,$badwordarr[$i]) || strstr($content,$badwordarr[$i]))
|
||||
{
|
||||
if ($d['bbs']['badword_action'] == 1)
|
||||
{
|
||||
getLink('','','등록이 제한된 단어를 사용하셨습니다.','');
|
||||
}
|
||||
else {
|
||||
$badescape = strCopy($badwordarr[$i],$d['bbs']['badword_escape']);
|
||||
$content = str_replace($badwordarr[$i],$badescape,$content);
|
||||
$subject = str_replace($badwordarr[$i],$badescape,$subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($num_upfile || $num_photo)
|
||||
{
|
||||
|
||||
include_once $g['path_core'].'function/thumb.func.php';
|
||||
//include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
$fserver = $d['mediaset']['use_fileserver'];
|
||||
$fserverurl = $fserver ? $d['mediaset']['ftp_urlpath'] : $g['url_root'].'/files/bbs/';
|
||||
$incPhoto = '';
|
||||
$upload = $uid ? $upload : '';
|
||||
$saveDir = $g['path_file'].$m.'/';
|
||||
$savePath1 = $saveDir.substr($date['today'],0,4);
|
||||
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
|
||||
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
|
||||
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
|
||||
$up_caption = $subject;
|
||||
$up_cync = '';
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if ($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
ftp_chdir($FTP_CONNECT,$d['mediaset']['ftp_folder']);
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
ftp_mkdir($FTP_CONNECT,$d['mediaset']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
if (!is_dir(${'savePath'.$i}))
|
||||
{
|
||||
mkdir(${'savePath'.$i},0707);
|
||||
@chmod(${'savePath'.$i},0707);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
|
||||
{
|
||||
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
|
||||
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
$up_name = strtolower($_FILES['upfile']['name'][$i]);
|
||||
$up_size = $_FILES['upfile']['size'][$i];
|
||||
$up_fileExt = getExt($up_name);
|
||||
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
|
||||
$up_type = getFileType($up_fileExt);
|
||||
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
|
||||
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
|
||||
$up_mingid = getDbCnt($table['s_upload'],'min(gid)','');
|
||||
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
|
||||
$up_saveFile= $savePath3.'/'.$up_tmpname;
|
||||
$up_hidden = $up_type == 2 ? 1 : 0;
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
|
||||
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
|
||||
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
|
||||
unlink($up_thumbFile);
|
||||
}
|
||||
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
|
||||
}
|
||||
else {
|
||||
|
||||
if (!is_file($up_saveFile))
|
||||
{
|
||||
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $savePath3.'/'.$up_thumbname;
|
||||
ResizeWidth($up_saveFile,$up_thumbFile,150);
|
||||
@chmod($up_thumbFile,0707);
|
||||
$IM = getimagesize($up_saveFile);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
}
|
||||
@chmod($up_saveFile,0707);
|
||||
}
|
||||
}
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
|
||||
getDbInsert($table['s_upload'],$QKEY,$QVAL);
|
||||
$up_lastuid = getDbCnt($table['s_upload'],'max(uid)','');
|
||||
$upload .= '['.$up_lastuid.']';
|
||||
if ($up_type == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_upload'],$DB_CONNECT);
|
||||
|
||||
}
|
||||
|
||||
if ($uid && $upfiles)
|
||||
{
|
||||
$_uploadtmp = getArrayString($upfiles);
|
||||
foreach($_uploadtmp['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['type'] == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($incPhoto)
|
||||
{
|
||||
if ($insert_photo == 'top')
|
||||
{
|
||||
$content = $incPhoto.nl2br($content);
|
||||
}
|
||||
if ($insert_photo == 'bottom')
|
||||
{
|
||||
$content = nl2br($content).'<br /><br />'.$incPhoto;
|
||||
}
|
||||
$html = 'HTML';
|
||||
}
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$uid || $reply == 'Y')
|
||||
{
|
||||
if(!getDbRows($table[$m.'day'],"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$date['today']."','".$s."','".$bbsuid."','0'");
|
||||
if(!getDbRows($table[$m.'month'],"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$date['month']."','".$s."','".$bbsuid."','0'");
|
||||
}
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
|
||||
|
||||
if ($reply == 'Y')
|
||||
{
|
||||
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
$RNUM = getDbRows($table[$m.'idx'],'gid >= '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
if ($RNUM > 98) getLink('','','죄송합니다. 더이상 답글을 달 수 없습니다.','');
|
||||
|
||||
getDbUpdate($table[$m.'idx'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
getDbUpdate($table[$m.'data'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
|
||||
if ($R['hidden'] && $hidden)
|
||||
{
|
||||
if ($R['mbruid'])
|
||||
{
|
||||
$pw = $R['mbruid'];
|
||||
}
|
||||
else {
|
||||
$pw = $my['uid'] ? $R['pw'] : ($pw == $R['pw'] ? $R['pw'] : md5($pw));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$pw = $pw ? md5($pw) : '';
|
||||
}
|
||||
|
||||
$gid = $R['gid']+0.01;
|
||||
$depth = $R['depth']+1;
|
||||
$parentmbr = $R['mbruid'];
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid'])) getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
|
||||
$pw = !$R['pw'] && !$R['hidden'] && $hidden && $R['mbruid'] ? $R['mbruid'] : $R['pw'];
|
||||
|
||||
$QVAL = "display='$display',hidden='$hidden',notice='$notice',pw='$pw',category='$category',subject='$subject',content='$content',html='$html',tag='$tag',point3='$point3',point4='$point4',d_modify='$d_regis',upload='$upload',adddata='$adddata'";
|
||||
getDbUpdate($table[$m.'data'],$QVAL,'uid='.$R['uid']);
|
||||
getDbUpdate($table[$m.'idx'],'notice='.$notice,'gid='.$R['gid']);
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$R['site'].' and bbs='.$R['bbs'])."'",'uid='.$cuid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
$pw = $hidden && $my['uid'] ? $my['uid'] : ($pw ? md5($pw) : '');
|
||||
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid-1 : 100000000.00;
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
|
||||
if ($gid == 100000000.00)
|
||||
{
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'idx'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'month'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'day'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
$NOWUID = $LASTUID ? $LASTUID : $R['uid'];
|
||||
|
||||
if ($trackback)
|
||||
{
|
||||
$trackback = trim($trackback);
|
||||
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
|
||||
if ($trackback != $compaurl)
|
||||
{
|
||||
include_once $g['path_core'].'function/trackback.func.php';
|
||||
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
|
||||
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
|
||||
$trackuid = $minuid ? $minuid-1 : 100000000;
|
||||
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
|
||||
|
||||
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
|
||||
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
|
||||
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($tag || $R['tag'])
|
||||
{
|
||||
$_tagarr1 = array();
|
||||
$_tagarr2 = explode(',',$tag);
|
||||
$_tagdate = $date['today'];
|
||||
|
||||
if ($R['uid'] && $reply != 'Y')
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr2)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($_tagarr2 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr1)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],'site='.$s." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid']) getDbUpdate($table['s_tag'],'hit=hit+1','uid='.$_TAG['uid']);
|
||||
else getDbInsert($table['s_tag'],'site,date,keyword,hit',"'".$s."','".$_tagdate."','".$_t."','1'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($snsCallBack && ($sns_t||$sns_f||$sns_m||$sns_y))
|
||||
{
|
||||
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
|
||||
$orignSubject = strip_tags($subject);
|
||||
$orignContent = getStrCut($orignSubject,60,'..');
|
||||
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
|
||||
|
||||
include_once $g['path_module'].$snsCallBack;
|
||||
|
||||
if ($snsSendResult)
|
||||
{
|
||||
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$_SESSION['bbsback'] = $backtype;
|
||||
|
||||
if ($backtype == 'list')
|
||||
{
|
||||
getLink($nlist,'parent.','','');
|
||||
}
|
||||
else if ($backtype == 'view')
|
||||
{
|
||||
if ($_HS['rewrite']&&!strstr($nlist,'&'))
|
||||
{
|
||||
getLink($nlist.'/'.$NOWUID,'parent.','','');
|
||||
}
|
||||
else {
|
||||
getLink($nlist.'&mod=view&uid='.$NOWUID,'parent.','','');
|
||||
}
|
||||
}
|
||||
else {
|
||||
getLink('reload','parent.','','');
|
||||
}
|
||||
?>
|
||||
501
modules/comment/action/a.write_contactUs.php
Normal file
@@ -0,0 +1,501 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
|
||||
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
|
||||
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
|
||||
|
||||
|
||||
$bbsuid = $B['uid'];
|
||||
$bbsid = $B['id'];
|
||||
$mbruid = $my['uid'];
|
||||
$id = $my['id'];
|
||||
$name = $my['uid'] ? $my['name'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : $name;
|
||||
$category = trim($category);
|
||||
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
|
||||
$content = trim($content);
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$tag = trim($tag);
|
||||
$d_regis = $date['totime'];
|
||||
$d_comment = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$upload = $upfiles;
|
||||
$adddata = trim($adddata);
|
||||
$hidden = $hidden ? intval($hidden) : 0;
|
||||
$notice = $notice ? intval($notice) : 0;
|
||||
$display = $d['bbs']['display'] || $hidepost || $hidden ? 0 : 1;
|
||||
$parentmbr = 0;
|
||||
$point1 = trim($d['bbs']['point1']);
|
||||
$point2 = trim($d['bbs']['point2']);
|
||||
$point3 = $point3 ? filterstr(trim($point3)) : 0;
|
||||
$point4 = $point4 ? filterstr(trim($point4)) : 0;
|
||||
|
||||
if ($d['bbs']['badword_action'])
|
||||
{
|
||||
$badwordarr = explode(',' , $d['bbs']['badword']);
|
||||
$badwordlen = count($badwordarr);
|
||||
for($i = 0; $i < $badwordlen; $i++)
|
||||
{
|
||||
if(!$badwordarr[$i]) continue;
|
||||
|
||||
if(strstr($subject,$badwordarr[$i]) || strstr($content,$badwordarr[$i]))
|
||||
{
|
||||
if ($d['bbs']['badword_action'] == 1)
|
||||
{
|
||||
getLink('','','등록이 제한된 단어를 사용하셨습니다.','');
|
||||
}
|
||||
else {
|
||||
$badescape = strCopy($badwordarr[$i],$d['bbs']['badword_escape']);
|
||||
$content = str_replace($badwordarr[$i],$badescape,$content);
|
||||
$subject = str_replace($badwordarr[$i],$badescape,$subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($num_upfile || $num_photo)
|
||||
{
|
||||
|
||||
include_once $g['path_core'].'function/thumb.func.php';
|
||||
//include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
$fserver = $d['mediaset']['use_fileserver'];
|
||||
$fserverurl = $fserver ? $d['mediaset']['ftp_urlpath'] : $g['url_root'].'/files/bbs/';
|
||||
$incPhoto = '';
|
||||
$upload = $uid ? $upload : '';
|
||||
$saveDir = $g['path_file'].$m.'/';
|
||||
$savePath1 = $saveDir.substr($date['today'],0,4);
|
||||
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
|
||||
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
|
||||
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
|
||||
$up_caption = $subject;
|
||||
$up_cync = '';
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
if ($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
|
||||
ftp_chdir($FTP_CONNECT,$d['mediaset']['ftp_folder']);
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
ftp_mkdir($FTP_CONNECT,$d['mediaset']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
if (!is_dir(${'savePath'.$i}))
|
||||
{
|
||||
mkdir(${'savePath'.$i},0707);
|
||||
@chmod(${'savePath'.$i},0707);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
|
||||
{
|
||||
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
|
||||
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
$up_name = strtolower($_FILES['upfile']['name'][$i]);
|
||||
$up_size = $_FILES['upfile']['size'][$i];
|
||||
$up_fileExt = getExt($up_name);
|
||||
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
|
||||
$up_type = getFileType($up_fileExt);
|
||||
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
|
||||
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
|
||||
$up_mingid = getDbCnt($table[$m.'upload'],'min(gid)','');
|
||||
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
|
||||
$up_saveFile= $savePath3.'/'.$up_tmpname;
|
||||
$up_hidden = $up_type == 2 ? 1 : 0;
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
|
||||
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
|
||||
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
|
||||
unlink($up_thumbFile);
|
||||
}
|
||||
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
|
||||
}
|
||||
else {
|
||||
|
||||
if (!is_file($up_saveFile))
|
||||
{
|
||||
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $savePath3.'/'.$up_thumbname;
|
||||
ResizeWidth($up_saveFile,$up_thumbFile,150);
|
||||
@chmod($up_thumbFile,0707);
|
||||
$IM = getimagesize($up_saveFile);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
}
|
||||
@chmod($up_saveFile,0707);
|
||||
}
|
||||
}
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
|
||||
getDbInsert($table[$m.'upload'],$QKEY,$QVAL);
|
||||
$up_lastuid = getDbCnt($table[$m.'upload'],'max(uid)','');
|
||||
$upload .= '['.$up_lastuid.']';
|
||||
if ($up_type == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table[$m.'upload'],$DB_CONNECT);
|
||||
|
||||
}
|
||||
|
||||
if ($uid && $upfiles)
|
||||
{
|
||||
$_uploadtmp = getArrayString($upfiles);
|
||||
foreach($_uploadtmp['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table[$m.'upload'],$_val);
|
||||
if ($U['type'] == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($incPhoto)
|
||||
{
|
||||
if ($insert_photo == 'top')
|
||||
{
|
||||
$content = $incPhoto.nl2br($content);
|
||||
}
|
||||
if ($insert_photo == 'bottom')
|
||||
{
|
||||
$content = nl2br($content).'<br /><br />'.$incPhoto;
|
||||
}
|
||||
$html = 'HTML';
|
||||
}
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$uid || $reply == 'Y')
|
||||
{
|
||||
if(!getDbRows($table[$m.'day'],"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$date['today']."','".$s."','".$bbsuid."','0'");
|
||||
if(!getDbRows($table[$m.'month'],"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$date['month']."','".$s."','".$bbsuid."','0'");
|
||||
}
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
|
||||
|
||||
if ($reply == 'Y')
|
||||
{
|
||||
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
$RNUM = getDbRows($table[$m.'idx'],'gid >= '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
if ($RNUM > 98) getLink('','','죄송합니다. 더이상 답글을 달 수 없습니다.','');
|
||||
|
||||
getDbUpdate($table[$m.'idx'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
getDbUpdate($table[$m.'data'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
|
||||
if ($R['hidden'] && $hidden)
|
||||
{
|
||||
if ($R['mbruid'])
|
||||
{
|
||||
$pw = $R['mbruid'];
|
||||
}
|
||||
else {
|
||||
$pw = $my['uid'] ? $R['pw'] : ($pw == $R['pw'] ? $R['pw'] : md5($pw));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$pw = $pw ? md5($pw) : '';
|
||||
}
|
||||
|
||||
$gid = $R['gid']+0.01;
|
||||
$depth = $R['depth']+1;
|
||||
$parentmbr = $R['mbruid'];
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid'])) getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
|
||||
$pw = !$R['pw'] && !$R['hidden'] && $hidden && $R['mbruid'] ? $R['mbruid'] : $R['pw'];
|
||||
|
||||
$QVAL = "display='$display',hidden='$hidden',notice='$notice',pw='$pw',category='$category',subject='$subject',content='$content',html='$html',tag='$tag',point3='$point3',point4='$point4',d_modify='$d_regis',upload='$upload',adddata='$adddata'";
|
||||
getDbUpdate($table[$m.'data'],$QVAL,'uid='.$R['uid']);
|
||||
getDbUpdate($table[$m.'idx'],'notice='.$notice,'gid='.$R['gid']);
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$R['site'].' and bbs='.$R['bbs'])."'",'uid='.$cuid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
$pw = $hidden && $my['uid'] ? $my['uid'] : ($pw ? md5($pw) : '');
|
||||
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid-1 : 100000000.00;
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
|
||||
if ($gid == 100000000.00)
|
||||
{
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'idx'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'month'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'day'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
$NOWUID = $LASTUID ? $LASTUID : $R['uid'];
|
||||
|
||||
if ($trackback)
|
||||
{
|
||||
$trackback = trim($trackback);
|
||||
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
|
||||
if ($trackback != $compaurl)
|
||||
{
|
||||
include_once $g['path_core'].'function/trackback.func.php';
|
||||
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
|
||||
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
|
||||
$trackuid = $minuid ? $minuid-1 : 100000000;
|
||||
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
|
||||
|
||||
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
|
||||
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
|
||||
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($tag || $R['tag'])
|
||||
{
|
||||
$_tagarr1 = array();
|
||||
$_tagarr2 = explode(',',$tag);
|
||||
$_tagdate = $date['today'];
|
||||
|
||||
if ($R['uid'] && $reply != 'Y')
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr2)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($_tagarr2 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr1)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],'site='.$s." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid']) getDbUpdate($table['s_tag'],'hit=hit+1','uid='.$_TAG['uid']);
|
||||
else getDbInsert($table['s_tag'],'site,date,keyword,hit',"'".$s."','".$_tagdate."','".$_t."','1'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($snsCallBack && ($sns_t||$sns_f||$sns_m||$sns_y))
|
||||
{
|
||||
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
|
||||
$orignSubject = strip_tags($subject);
|
||||
$orignContent = getStrCut($orignSubject,60,'..');
|
||||
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
|
||||
|
||||
include_once $g['path_module'].$snsCallBack;
|
||||
|
||||
if ($snsSendResult)
|
||||
{
|
||||
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
|
||||
}
|
||||
}
|
||||
### 이메일 발송 #########################################################################
|
||||
function SendSMTP($to_email,$to_name,$from_name,$from_email,$title,$content)
|
||||
{
|
||||
global $g;
|
||||
|
||||
$smtp_mail_id = "notifications@kimsq.com"; //예)test@naver.com 혹은 test@gmail.com 등의 형식
|
||||
$smtp_mail_pw = "redred@#$";
|
||||
//$smtp_use = 'smtp.naver.com'; //네이버 메일 사용시
|
||||
$smtp_use = 'smtp.gmail.com'; //구글 메일 사용시 주석제거
|
||||
if ($smtp_use == 'smtp.naver.com') {
|
||||
$from_email = $smtp_mail_id; //네이버메일은 보내는 id로만 전송이가능함
|
||||
}else {
|
||||
$from_email = $from_email;
|
||||
}
|
||||
|
||||
//메일러 로딩
|
||||
require_once $g['dir_module']."lib/class.smtp.php";
|
||||
require_once $g['dir_module']."lib/class.phpmailer.php";
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
$mail->IsSMTP();
|
||||
try {
|
||||
$mail->Host = $smtp_use; // email 보낼때 사용할 서버를 지정
|
||||
$mail->SMTPAuth = true; // SMTP 인증을 사용함
|
||||
$mail->Port = 465; // email 보낼때 사용할 포트를 지정
|
||||
$mail->SMTPSecure = "ssl"; // SSL을 사용함
|
||||
$mail->Username = $smtp_mail_id; // 계정
|
||||
$mail->Password = $smtp_mail_pw; // 패스워드
|
||||
$mail->SetFrom($from_email, $from_name); // 보내는 사람 email 주소와 표시될 이름 (표시될 이름은 생략가능)
|
||||
$mail->AddAddress($to_email, $to_name); // 받을 사람 email 주소와 표시될 이름 (표시될 이름은 생략가능)
|
||||
$mail->Subject = $title; // 메일 제목
|
||||
$mail->MsgHTML($content); // 메일 내용 (HTML 형식도 되고 그냥 일반 텍스트도 사용 가능함)
|
||||
$mail->Send(); // 실제로 메일을 보냄
|
||||
|
||||
} catch (phpmailerException $e) {
|
||||
$e->errorMessage();
|
||||
} catch (Exception $e) {
|
||||
$e->getMessage();
|
||||
}
|
||||
return $e;
|
||||
}
|
||||
include_once $g['path_module'].'contactUs/var/var.php';
|
||||
$from_email='kkk@naver.com';
|
||||
$from_name='경기방송';
|
||||
$to_name='관리자';
|
||||
$to_email_arr =explode(',',$d['cs']['rsv_email']);
|
||||
$_title='[경기방송] 사용자의 참여/제보 및 문의메일이 접수되었습니다.';
|
||||
$title = $subject?$subject:$_title;
|
||||
foreach ($to_email_arr as $to_email) {
|
||||
SendSMTP($to_email,$to_name,$from_name,$from_email,$title,$content);
|
||||
}
|
||||
|
||||
|
||||
### 이메일 발송 #########################################################################
|
||||
|
||||
// ajax 전송과 일반전송에 따른 결과값 리턴방식 구분
|
||||
if($backtype=='ajax'){
|
||||
|
||||
$return=array();
|
||||
$return['error'] = false;
|
||||
$return['result'] ='OK';
|
||||
$return['email'] = $d['cs']['rsv_email'];
|
||||
|
||||
echo json_encode($return,true);
|
||||
exit;
|
||||
}else{
|
||||
|
||||
$_SESSION['bbsback'] = $backtype;
|
||||
|
||||
if ($backtype == 'list')
|
||||
{
|
||||
getLink($nlist,'parent.','','');
|
||||
}
|
||||
else if ($backtype == 'view')
|
||||
{
|
||||
if ($_HS['rewrite']&&!strstr($nlist,'&'))
|
||||
{
|
||||
getLink($nlist.'/'.$NOWUID,'parent.','','');
|
||||
}
|
||||
else {
|
||||
getLink($nlist.'&mod=view&uid='.$NOWUID,'parent.','','');
|
||||
}
|
||||
}
|
||||
else {
|
||||
getLink('reload','parent.','','');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
457
modules/comment/action/a.write_h.php
Normal file
@@ -0,0 +1,457 @@
|
||||
<!--
|
||||
비회원 전용 / 비밀기능 게시판 변경 내역
|
||||
|
||||
1. 아이디와 닉네임을 'guest' 로 처리
|
||||
2. 비회원인 경우 접근거부 루틴 제거 ( 아래 308 라인)
|
||||
-->
|
||||
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
|
||||
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
|
||||
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
|
||||
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
|
||||
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
|
||||
include_once $g['dir_module'].'var/var.php';
|
||||
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
|
||||
|
||||
$bbsuid = $B['uid'];
|
||||
$bbsid = $B['id'];
|
||||
$mbruid = $my['uid']? $my['uid'] :'0';
|
||||
$id = $my['uid']? $my['id'] : 'guest';
|
||||
$name = $my['uid'] ? $my['nic'] : trim($name);
|
||||
$nic = $my['uid'] ? $my['nic'] : 'guest';
|
||||
$category = trim($category);
|
||||
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
|
||||
$content = trim($content);
|
||||
$html = $html ? $html : 'TEXT';
|
||||
$tag = trim($tag);
|
||||
$d_regis = $date['totime'];
|
||||
$d_comment = '';
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$upload = $upfiles;
|
||||
$adddata = trim($adddata);
|
||||
$hidden = $hidden ? intval($hidden) : 0;
|
||||
$notice = $notice ? intval($notice) : 0;
|
||||
$display = $d['bbs']['display'] || $hidepost || $hidden ? 0 : 1;
|
||||
$parentmbr = 0;
|
||||
$point1 = trim($d['bbs']['point1']);
|
||||
$point2 = trim($d['bbs']['point2']);
|
||||
$point3 = $point3 ? filterstr(trim($point3)) : 0;
|
||||
$point4 = $point4 ? filterstr(trim($point4)) : 0;
|
||||
|
||||
if ($d['bbs']['badword_action'])
|
||||
{
|
||||
$badwordarr = explode(',' , $d['bbs']['badword']);
|
||||
$badwordlen = count($badwordarr);
|
||||
for($i = 0; $i < $badwordlen; $i++)
|
||||
{
|
||||
if(!$badwordarr[$i]) continue;
|
||||
|
||||
if(strstr($subject,$badwordarr[$i]) || strstr($content,$badwordarr[$i]))
|
||||
{
|
||||
if ($d['bbs']['badword_action'] == 1)
|
||||
{
|
||||
getLink('','','등록이 제한된 단어를 사용하셨습니다.','');
|
||||
}
|
||||
else {
|
||||
$badescape = strCopy($badwordarr[$i],$d['bbs']['badword_escape']);
|
||||
$content = str_replace($badwordarr[$i],$badescape,$content);
|
||||
$subject = str_replace($badwordarr[$i],$badescape,$subject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($num_upfile || $num_photo)
|
||||
{
|
||||
|
||||
include_once $g['path_core'].'function/thumb.func.php';
|
||||
include_once $g['path_module'].'upload/var/var.php';
|
||||
|
||||
$fserver = $d['upload']['use_fileserver'];
|
||||
$fserverurl = $fserver ? $d['upload']['ftp_urlpath'] : '/files/';
|
||||
$incPhoto = '';
|
||||
$upload = $uid ? $upload : '';
|
||||
$saveDir = $g['path_file'];
|
||||
$savePath1 = $saveDir.substr($date['today'],0,4);
|
||||
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
|
||||
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
|
||||
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
|
||||
$up_caption = $subject;
|
||||
$up_cync = '';
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
|
||||
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
|
||||
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
|
||||
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
|
||||
|
||||
ftp_chdir($FTP_CONNECT,$d['upload']['ftp_folder']);
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
ftp_mkdir($FTP_CONNECT,$d['upload']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ($i = 1; $i < 4; $i++)
|
||||
{
|
||||
if (!is_dir(${'savePath'.$i}))
|
||||
{
|
||||
mkdir(${'savePath'.$i},0707);
|
||||
@chmod(${'savePath'.$i},0707);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
|
||||
{
|
||||
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
|
||||
|
||||
$width = 0;
|
||||
$height = 0;
|
||||
$up_name = strtolower($_FILES['upfile']['name'][$i]);
|
||||
$up_size = $_FILES['upfile']['size'][$i];
|
||||
$up_fileExt = getExt($up_name);
|
||||
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
|
||||
$up_type = getFileType($up_fileExt);
|
||||
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
|
||||
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
|
||||
$up_mingid = getDbCnt($table['s_upload'],'min(gid)','');
|
||||
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
|
||||
$up_saveFile= $savePath3.'/'.$up_tmpname;
|
||||
$up_hidden = $up_type == 2 ? 1 : 0;
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
|
||||
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
|
||||
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
|
||||
unlink($up_thumbFile);
|
||||
}
|
||||
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
|
||||
}
|
||||
else {
|
||||
|
||||
if (!is_file($up_saveFile))
|
||||
{
|
||||
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
|
||||
if ($up_type == 2)
|
||||
{
|
||||
$up_thumbname = md5($up_tmpname);
|
||||
$up_thumbFile = $savePath3.'/'.$up_thumbname;
|
||||
ResizeWidth($up_saveFile,$up_thumbFile,150);
|
||||
@chmod($up_thumbFile,0707);
|
||||
$IM = getimagesize($up_saveFile);
|
||||
$width = $IM[0];
|
||||
$height= $IM[1];
|
||||
}
|
||||
@chmod($up_saveFile,0707);
|
||||
}
|
||||
}
|
||||
|
||||
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
|
||||
$QVAL = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
|
||||
getDbInsert($table['s_upload'],$QKEY,$QVAL);
|
||||
$up_lastuid = getDbCnt($table['s_upload'],'max(uid)','');
|
||||
$upload .= '['.$up_lastuid.']';
|
||||
if ($up_type == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['upload']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
|
||||
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_upload'],$DB_CONNECT);
|
||||
|
||||
}
|
||||
|
||||
if ($uid && $upfiles)
|
||||
{
|
||||
$_uploadtmp = getArrayString($upfiles);
|
||||
foreach($_uploadtmp['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($table['s_upload'],$_val);
|
||||
if ($U['type'] == 2)
|
||||
{
|
||||
if ($fserver)
|
||||
{
|
||||
$incPhoto .= '<img src="'.$d['upload']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
else {
|
||||
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($incPhoto)
|
||||
{
|
||||
if ($insert_photo == 'top')
|
||||
{
|
||||
$content = $incPhoto.nl2br($content);
|
||||
}
|
||||
if ($insert_photo == 'bottom')
|
||||
{
|
||||
$content = nl2br($content).'<br /><br />'.$incPhoto;
|
||||
}
|
||||
$html = 'HTML';
|
||||
}
|
||||
|
||||
if ($fserver)
|
||||
{
|
||||
ftp_close($FTP_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$uid || $reply == 'Y')
|
||||
{
|
||||
if(!getDbRows($table[$m.'day'],"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$date['today']."','".$s."','".$bbsuid."','0'");
|
||||
if(!getDbRows($table[$m.'month'],"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid))
|
||||
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$date['month']."','".$s."','".$bbsuid."','0'");
|
||||
}
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($table[$m.'data'],$uid);
|
||||
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
|
||||
|
||||
if ($reply == 'Y')
|
||||
{
|
||||
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
|
||||
$RNUM = getDbRows($table[$m.'idx'],'gid >= '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
if ($RNUM > 98) getLink('','','죄송합니다. 더이상 답글을 달 수 없습니다.','');
|
||||
|
||||
getDbUpdate($table[$m.'idx'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
getDbUpdate($table[$m.'data'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
|
||||
|
||||
if ($R['hidden'] && $hidden)
|
||||
{
|
||||
if ($R['mbruid'])
|
||||
{
|
||||
$pw = $R['mbruid'];
|
||||
}
|
||||
else {
|
||||
$pw = $my['uid'] ? $R['pw'] : ($pw == $R['pw'] ? $R['pw'] : md5($pw));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$pw = $pw ? md5($pw) : '';
|
||||
}
|
||||
|
||||
$gid = $R['gid']+0.01;
|
||||
$depth = $R['depth']+1;
|
||||
$parentmbr = $R['mbruid'];
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid'])) getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
|
||||
$pw = !$R['pw'] && !$R['hidden'] && $hidden && $R['mbruid'] ? $R['mbruid'] : $R['pw'];
|
||||
|
||||
$QVAL = "display='$display',hidden='$hidden',notice='$notice',pw='$pw',category='$category',subject='$subject',content='$content',html='$html',tag='$tag',point3='$point3',point4='$point4',d_modify='$d_regis',upload='$upload',adddata='$adddata'";
|
||||
getDbUpdate($table[$m.'data'],$QVAL,'uid='.$R['uid']);
|
||||
getDbUpdate($table[$m.'idx'],'notice='.$notice,'gid='.$R['gid']);
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$R['site'].' and bbs='.$R['bbs'])."'",'uid='.$cuid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
##################################################################################
|
||||
// 비회원인 경우 접근거부 루틴 제거 (2012.1.23 by 케르)
|
||||
|
||||
/* if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
|
||||
{
|
||||
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['sosok'].']'))
|
||||
{
|
||||
getLink('','','정상적인 접근이 아닙니다.','');
|
||||
}
|
||||
}
|
||||
*/
|
||||
###################################################################################
|
||||
|
||||
$pw = $hidden && $my['uid'] ? $my['uid'] : ($pw ? md5($pw) : '');
|
||||
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
|
||||
$gid = $mingid ? $mingid-1 : 100000000.00;
|
||||
|
||||
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
|
||||
$QKEY.= "hit,down,comment,oneline,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata";
|
||||
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
|
||||
$QVAL.= "'0','0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata'";
|
||||
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
|
||||
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
|
||||
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
|
||||
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
|
||||
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
|
||||
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
|
||||
if ($point1&&$my['uid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
|
||||
}
|
||||
|
||||
if ($gid == 100000000.00)
|
||||
{
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'idx'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'month'],$DB_CONNECT);
|
||||
db_query("OPTIMIZE TABLE ".$table[$m.'day'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
$NOWUID = $LASTUID ? $LASTUID : $R['uid'];
|
||||
|
||||
if ($trackback)
|
||||
{
|
||||
$trackback = trim($trackback);
|
||||
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
|
||||
if ($trackback != $compaurl)
|
||||
{
|
||||
include_once $g['path_core'].'function/trackback.func.php';
|
||||
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
|
||||
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
|
||||
$trackuid = $minuid ? $minuid-1 : 100000000;
|
||||
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
|
||||
|
||||
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
|
||||
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
|
||||
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
|
||||
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
|
||||
|
||||
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($tag || $R['tag'])
|
||||
{
|
||||
$_tagarr1 = array();
|
||||
$_tagarr2 = explode(',',$tag);
|
||||
$_tagdate = $date['today'];
|
||||
|
||||
if ($R['uid'] && $reply != 'Y')
|
||||
{
|
||||
$_tagdate = substr($R['d_regis'],0,8);
|
||||
$_tagarr1 = explode(',',$R['tag']);
|
||||
foreach($_tagarr1 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr2)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid'])
|
||||
{
|
||||
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
|
||||
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($_tagarr2 as $_t)
|
||||
{
|
||||
if(!$_t || in_array($_t,$_tagarr1)) continue;
|
||||
$_TAG = getDbData($table['s_tag'],'site='.$s." and date='".$_tagdate."' and keyword='".$_t."'",'*');
|
||||
if($_TAG['uid']) getDbUpdate($table['s_tag'],'hit=hit+1','uid='.$_TAG['uid']);
|
||||
else getDbInsert($table['s_tag'],'site,date,keyword,hit',"'".$s."','".$_tagdate."','".$_t."','1'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((!$uid||$reply=='Y') && $snsCallBack && is_file($g['path_module'].$snsCallBack))
|
||||
{
|
||||
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
|
||||
$orignSubject = strip_tags($subject);
|
||||
$orignContent = getStrCut($orignSubject,60,'..');
|
||||
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
|
||||
|
||||
include_once $g['path_module'].$snsCallBack;
|
||||
|
||||
if ($snsSendResult)
|
||||
{
|
||||
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
|
||||
}
|
||||
}
|
||||
include_once $g['dir_module'].'theme/_pc/'.$bid.'/_var.php';
|
||||
// 메일 발송
|
||||
if($d['theme']['email_send'] && !$my['admin'])
|
||||
{
|
||||
$AD = getDbData($table['s_mbrdata'],"nic='관리자'",'*');
|
||||
$email=$AD['email'];
|
||||
$to=$AD['name'];
|
||||
|
||||
include_once $g['path_core'].'function/email.func.php';
|
||||
include_once $g['path_module'].'member/var/var.join.php';
|
||||
|
||||
getSendMail($email.'|'. $to, $d['member']['join_email'].'|'.$_HS['name'], '['.$_HS['name'].']의 ['.$B['name'].']게시판에 ['.$name.']님께서 아래와 같은 내용의 글을 등록하셨습니다. ', $content, 'HTML');
|
||||
}
|
||||
|
||||
$_SESSION['bbsback'] = $backtype;
|
||||
|
||||
if ($backtype == 'list')
|
||||
{
|
||||
getLink($nlist,'parent.','','');
|
||||
}
|
||||
else if ($backtype == 'view')
|
||||
{
|
||||
if ($_HS['rewrite']&&!strstr($nlist,'&'))
|
||||
{
|
||||
getLink($nlist.'/'.$NOWUID,'parent.','','');
|
||||
}
|
||||
else {
|
||||
getLink($nlist.'&mod=view&uid='.$NOWUID,'parent.','','');
|
||||
}
|
||||
}
|
||||
else {
|
||||
getLink('reload','parent.','','');
|
||||
}
|
||||
?>
|
||||
4
modules/comment/admin.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
include $g['path_module'].$module.'/admin/'.$front.'.php';
|
||||
?>
|
||||
198
modules/comment/admin/_add_fgroup.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<!--
|
||||
// makebbs.php 의 추가설정 부분
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">최근글 제외</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="display" value="1" <?php if($d['bbs']['display']):?> checked<?php endif?> class="form-control">
|
||||
<i></i>최근글 추출에서 제외합니다.
|
||||
</label>
|
||||
</div>
|
||||
<div class="help-text">
|
||||
<small class="text-muted">
|
||||
<a data-toggle="collapse" href="#bbs_display-guide"><i class="fa fa-question-circle fa-fw"></i>도움말</a>
|
||||
</small>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="bbs_display-guide">
|
||||
<small>
|
||||
최근글 추출제외는 게시물등록시에 이 설정값을 따르므로<br />
|
||||
설정값을 중간에 변경하면 이전 게시물에 대해서는 적용되지 않습니다.<br />
|
||||
최근글 제외설정은 게시판 서비스전에 확정하여 주세요.<br />
|
||||
최근글에서 제외하면 통합검색에서도 제외됩니다.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">쿼리 생략</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="hidelist" value="1" <?php if($d['bbs']['hidelist']):?> checked<?php endif?> class="form-control">
|
||||
<i></i>게시물가공 기본쿼리를 생략합니다.
|
||||
</label>
|
||||
</div>
|
||||
<div class="help-text">
|
||||
<small class="text-muted">
|
||||
<a data-toggle="collapse" href="#bbs_hidelist-guide"><i class="fa fa-question-circle fa-fw"></i>도움말</a>
|
||||
</small>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="bbs_hidelist-guide">
|
||||
<small>
|
||||
종종 기본쿼리가 아닌 테마자체에서 데이터를 가공해야 하는 경우가 있습니다.<br />
|
||||
1:1상담게시판,일정관리 등 특수한 테마의 경우 쿼리생략이 요구되기도 합니다.<br />
|
||||
쿼리생략이 요구되는 테마를 사용할 경우 체크해 주세요.<br />
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">RSS 발행</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="rss" value="1" <?php if($d['bbs']['rss']):?> checked<?php endif?> class="form-control">
|
||||
<i></i>RSS발행을 허용합니다. <br /><small class="text-muted">(개별게시판별 RSS발행은 개별게시판 설정을 따름) </small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">조회수 증가</label>
|
||||
<div class="col-sm-10">
|
||||
<label class="radio-inline" >
|
||||
<input type="radio" name="hitcount" value="1" <?php if($d['bbs']['hitcount']):?> checked<?php endif?> />
|
||||
무조건 증가
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="hitcount" value="0"<?php if(!$d['bbs']['hitcount']):?> checked<?php endif?> />
|
||||
1회만 증가
|
||||
</label>
|
||||
</div><!-- .col-sm-10 -->
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">게시물 출력</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="recnum" value="<?php echo $d['bbs']['recnum']?$d['bbs']['recnum']:20?>" class="form-control">
|
||||
<span class="input-group-addon">개</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 form-control-static text-muted">
|
||||
<small>한페이지에 출력할 게시물의 수</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">제목 끊기</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="sbjcut" value="<?php echo $d['bbs']['sbjcut']?$d['bbs']['sbjcut']:40?>" class="form-control">
|
||||
<span class="input-group-addon">자</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 form-control-static text-muted">
|
||||
<small>제목이 길 경우 보여줄 글자 수 </small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">새글 유지시간</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="newtime" value="<?php echo $d['bbs']['newtime']?$d['bbs']['newtime']:24?>" class="form-control">
|
||||
<span class="input-group-addon">시간</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 text-muted form-control-static">
|
||||
<small> 새글로 인식되는 시간 </small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">등록 포인트</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="point1" value="<?php echo $d['bbs']['point1']?$d['bbs']['point1']:0?>" class="form-control">
|
||||
<span class="input-group-addon">포인트 지급</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 text-muted form-control-static">
|
||||
<small> 게시물 삭제시 환원됩니다. </small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">열람 포인트</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="point2" value="<?php echo $d['bbs']['point2']?$d['bbs']['point2']:0?>" class="form-control">
|
||||
<span class="input-group-addon">포인트 차감</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 text-muted form-control-static">
|
||||
<small> </small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">다운 포인트</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="point3" value="<?php echo $d['bbs']['point3']?$d['bbs']['point3']:0?>" class="form-control">
|
||||
<span class="input-group-addon">포인트 차감</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 text-muted form-control-static">
|
||||
<small> </small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">추가 관리자</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input class="form-control" placeholder="" type="text" name="admin" value="<?php echo $d['bbs']['admin']?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default rb-help-btn" type="button" data-toggle="collapse" data-target="#bbs_admin-guide" data-tooltip="tooltip" title="도움말"><i class="fa fa-question-circle fa-lg"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="bbs_admin-guide">
|
||||
<small>
|
||||
이 게시판에 대해서 관리자권한을 별도로 부여할 회원이 있을경우<br />
|
||||
회원아이디를 콤마(,)로 구분해서 등록해 주세요.<br />
|
||||
관리자로 지정될 경우 열람/수정/삭제등의 모든권한을 얻게 됩니다.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">부가필드</label>
|
||||
<div class="col-md-10">
|
||||
<textarea name="adddata" class="form-control" rows="3"><?php echo htmlspecialchars($R['adddata'])?></textarea>
|
||||
<span class="help-block">
|
||||
이 게시판에 대해서 추가적인 정보가 필요할 경우 사용합니다.<br />
|
||||
필드명은 <code>[adddata]</code> 입니다.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
49
modules/comment/admin/_footer_fgroup.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<!--
|
||||
// makebbs.php 의 픗터삽입 부분
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">픗터 파일</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="imgfoot">
|
||||
<?php if($R['imgfoot']):?>
|
||||
<p class="form-control-static">
|
||||
<a class="btn bnt-link" href="<?php echo $g['r']?>/?m=<?php echo $module?>&a=bbs_file_delete&bid=<?php echo $R['id']?>&dtype=foot" target="_action_frame_<?php echo $m?>" onclick="return hrefCheck(this,true,'정말로 삭제하시겠습니까?');">삭제</a>
|
||||
<a class="btn btn-link" href="<?php echo $g['s']?>/modules/<?php echo $module?>/var/files/<?php echo $R['imgfoot']?>" target="_blank">등록파일 보기</a>
|
||||
</p>
|
||||
<?php else:?>
|
||||
<small class="help-block">(gif/jpg/png/swf 가능)</small>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">
|
||||
픗터 코드
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<p>
|
||||
<textarea name="codfoot" id="codfootArea" class="form-control" rows="5"><?php if(is_file($g['path_module'].$module.'/var/code/'.$R['id'].'.footer.php')) echo htmlspecialchars(implode('',file($g['path_module'].$module.'/var/code/'.$R['id'].'.footer.php')))?></textarea>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">
|
||||
노출 위치
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_foot_list" value="[l]"<?php if(strstr($R['putfoot'],'[l]')):?> checked <?php endif?> class="form-control"> <i></i>목록
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_foot_view" value="[v]"<?php if(strstr($R['putfoot'],'[v]')):?> checked <?php endif?> class="form-control"><i></i>본문
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_foot_write" value="[w]"<?php if(strstr($R['putfoot'],'[w]')):?> checked <?php endif?> class="form-control"><i></i>쓰기
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
49
modules/comment/admin/_header_fgroup.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<!--
|
||||
// makebbs.php 의 헤더삽입 부분
|
||||
-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" >헤더 파일</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="imghead">
|
||||
<?php if($R['imghead']):?>
|
||||
<p class="form-control-static">
|
||||
<a class="btn bnt-link" href="<?php echo $g['r']?>/?m=<?php echo $module?>&a=bbs_file_delete&bid=<?php echo $R['id']?>&dtype=head" target="_action_frame_<?php echo $m?>" onclick="return hrefCheck(this,true,'정말로 삭제하시겠습니까?');">삭제</a>
|
||||
<a class="btn btn-link" href="<?php echo $g['s']?>/modules/<?php echo $module?>/var/files/<?php echo $R['imghead']?>" target="_blank">등록파일 보기</a>
|
||||
</p>
|
||||
<?php else:?>
|
||||
<small class="help-block">(gif/jpg/png/swf 가능)</small>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">
|
||||
헤더 코드
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<p>
|
||||
<textarea name="codhead" id="codheadArea" class="form-control" rows="5"><?php if(is_file($g['path_module'].$module.'/var/code/'.$R['id'].'.header.php')) echo htmlspecialchars(implode('',file($g['path_module'].$module.'/var/code/'.$R['id'].'.header.php')))?></textarea>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">
|
||||
노출 위치
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_head_list" value="[l]"<?php if(strstr($R['puthead'],'[l]')):?> checked <?php endif?> class="form-control"> <i></i>목록
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_head_view" value="[v]"<?php if(strstr($R['puthead'],'[v]')):?> checked <?php endif?> class="form-control"><i></i>본문
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="inc_head_write" value="[w]"<?php if(strstr($R['puthead'],'[w]')):?> checked <?php endif?> class="form-control"><i></i>쓰기
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
29
modules/comment/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>
|
||||
70
modules/comment/admin/_right_fgroup.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<!--
|
||||
// makebbs.php 의 권한설정 부분
|
||||
-->
|
||||
<div class="well well-lg">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-10">
|
||||
<h3><span class="label label-default">채팅 열람</label></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">허용등급</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="perm_l_view" class="form-control">
|
||||
<option value="0"> + 전체허용</option>
|
||||
<option value="0">--------------------------------</option>
|
||||
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
|
||||
<?php while($_L=db_fetch_array($_LEVEL)):?>
|
||||
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_view']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
|
||||
<?php if($_L['gid'])break; endwhile?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">차단그룹</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="_perm_g_view" class="form-control" multiple size="5">
|
||||
<option value=""<?php if(!$d['bbs']['perm_g_view']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
|
||||
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
|
||||
<?php while($_S=db_fetch_array($_SOSOK)):?>
|
||||
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_view'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
|
||||
<?php endwhile?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .well-->
|
||||
|
||||
<div class="well well-lg">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-10">
|
||||
<h3><span class="label label-default">채팅 참여(글쓰기)</label></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">허용등급</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="perm_l_write" class="form-control">
|
||||
<option value="0"> + 전체허용</option>
|
||||
<option value="0">--------------------------------</option>
|
||||
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
|
||||
<?php while($_L=db_fetch_array($_LEVEL)):?>
|
||||
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_write']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
|
||||
<?php if($_L['gid'])break; endwhile?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">차단그룹</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="_perm_g_write" class="form-control" multiple size="5">
|
||||
<option value=""<?php if(!$d['bbs']['perm_g_write']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
|
||||
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
|
||||
<?php while($_S=db_fetch_array($_SOSOK)):?>
|
||||
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_write'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
|
||||
<?php endwhile?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .well-->
|
||||
380
modules/comment/admin/comment.php
Normal file
@@ -0,0 +1,380 @@
|
||||
<?php
|
||||
//동기화URL
|
||||
function getCyncUrl($cync)
|
||||
{
|
||||
if (!$cync) return $GLOBALS['g']['r'];
|
||||
$_r = getArrayString($cync);
|
||||
$_r = $_r['data'][5];
|
||||
if ($GLOBALS['_HS']['rewrite']&&strpos('_'.$_r,'m:bbs,bid:'))
|
||||
{
|
||||
$_r = str_replace('m:bbs','b',$_r);
|
||||
$_r = str_replace(',bid:','/',$_r);
|
||||
$_r = str_replace(',uid:','/',$_r);
|
||||
$_r = str_replace(',CMT:','/',$_r);
|
||||
$_r = str_replace(',s:','/s',$_r);
|
||||
return $GLOBALS['g']['r'].'/'.$_r;
|
||||
}
|
||||
else return $GLOBALS['g']['s'].'/?'.($GLOBALS['_HS']['usescode']?'r='.$GLOBALS['_HS']['id'].'&':'').str_replace(':','=',str_replace(',','&',$_r));
|
||||
}
|
||||
|
||||
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
|
||||
$sort = $sort ? $sort : 'uid';
|
||||
$orderby= $orderby ? $orderby : 'asc';
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
$_WHERE='uid>0';
|
||||
if($account) $_WHERE .=' and site='.$account;
|
||||
if ($d_start) $_WHERE .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
|
||||
if ($d_finish) $_WHERE .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
|
||||
if ($bid) $_WHERE .= ' and bbs='.$bid;
|
||||
if ($category) $_WHERE .= " and category ='".$category."'";
|
||||
if ($notice) $_WHERE .= ' and notice=1';
|
||||
if ($hidden) $_WHERE .= ' and hidden=1';
|
||||
if ($where && $keyw)
|
||||
{
|
||||
if (strstr('[name][nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyw."'";
|
||||
else $_WHERE .= getSearchSql($where,$keyw,$ikeyword,'or');
|
||||
}
|
||||
$RCD = getDbArray($table['s_comment'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table['s_comment'],$_WHERE);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
|
||||
|
||||
?>
|
||||
<div class="page-header">
|
||||
<h4>댓글 리스트 </h4>
|
||||
</div>
|
||||
<form name="procForm" action="<?php echo $g['s']?>/" method="get" class="form-horizontal rb-form">
|
||||
<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="rb-heading well well-sm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label">필터 </label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<select name="account" class="form-control input-sm" onchange="this.form.submit();">
|
||||
<option value="">+ 전체사이트</option>
|
||||
<option value="">--------------------</option>
|
||||
<?php while($S = db_fetch_array($SITES)):?>
|
||||
<option value="<?php echo $S['uid']?>"<?php if($account==$S['uid']):?> selected="selected"<?php endif?>>ㆍ<?php echo $S['name']?></option>
|
||||
<?php endwhile?>
|
||||
<?php if(!db_num_rows($SITES)):?>
|
||||
<option value="">등록된 사이트가 없습니다.</option>
|
||||
<?php endif?>
|
||||
</select>
|
||||
</div>
|
||||
</div> <!-- .row -->
|
||||
</div> <!-- .col-sm-10 -->
|
||||
</div> <!-- .form-group -->
|
||||
<!-- 고급검색 시작 -->
|
||||
<div id="search-more" class="collapse<?php if($_SESSION['sh_bbspost']):?> in<?php endif?>">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label">옵션 </label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<label class="checkbox" style="margin-top:0">
|
||||
<input type="checkbox" name="notice" value="Y"<?php if($notice=='Y'):?> checked<?php endif?> onclick="this.form.submit();" class="form-control"> <i></i>공지글
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<label class="checkbox" style="margin-top:0">
|
||||
<input type="checkbox" name="hidden" value="Y"<?php if($hidden=='Y'):?> checked<?php endif?> onclick="this.form.submit();" class="form-control"><i></i>비밀글
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label">기간</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<div class="input-daterange input-group input-group-sm" id="datepicker">
|
||||
<input type="text" class="form-control" name="d_start" placeholder="시작일 선택" value="<?php echo $d_start?>">
|
||||
<span class="input-group-addon">~</span>
|
||||
<input type="text" class="form-control" name="d_finish" placeholder="종료일 선택" value="<?php echo $d_finish?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">기간적용</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');">어제</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo getDateFormat($date['today'],'Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">오늘</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">일주</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">한달</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo getDateFormat(substr($date['today'],0,6).'01','Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">당월</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');">전월</button>
|
||||
<button class="btn btn-default" type="button" onclick="dropDate('','');">전체</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hidden-xs">
|
||||
<label class="col-sm-1 control-label">정렬</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group btn-group-sm" data-toggle="buttons">
|
||||
<label class="btn btn-default<?php if($sort=='gid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="uid" name="sort"<?php if($sort=='uid'):?> checked<?php endif?>> 등록일
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='hit'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="hit" name="sort"<?php if($sort=='hit'):?> checked<?php endif?>> 조회
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='down'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="down" name="sort"<?php if($sort=='down'):?> checked<?php endif?>> 다운
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='oneline'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="oneline" name="sort"<?php if($sort=='oneline'):?> checked<?php endif?>> 한줄의견
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='score1'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="score1" name="sort"<?php if($sort=='score1'):?> checked<?php endif?>> 점수1
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='score2'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="score2" name="sort"<?php if($sort=='score2'):?> checked<?php endif?>> 점수2
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($sort=='report'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="report" name="sort"<?php if($sort=='report'):?> checked<?php endif?>> 신고
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm" data-toggle="buttons">
|
||||
<label class="btn btn-default<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i>역순
|
||||
</label>
|
||||
<label class="btn btn-default<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i>정순
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label">검색</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-btn hidden-xs" style="width:165px">
|
||||
<select name="where" class="form-control btn btn-default">
|
||||
<option value="subject"<?php if($where=='subject'):?> selected="selected"<?php endif?>>제목</option>
|
||||
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
|
||||
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
|
||||
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
|
||||
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
|
||||
<option value="ip"<?php if($where=='ip'):?> selected="selected"<?php endif?>>아이피</option>
|
||||
</select>
|
||||
</span>
|
||||
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">검색</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-1 control-label">출력</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<select name="recnum" onchange="this.form.submit();" class="form-control input-sm">
|
||||
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20</option>
|
||||
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35</option>
|
||||
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50</option>
|
||||
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75</option>
|
||||
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-10">
|
||||
<button type="button" class="btn btn-link rb-advance<?php if(!$_SESSION['sh_bbspost']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#search-more" onclick="sessionSetting('sh_bbspost','1','','1');">고급검색<small></small></button>
|
||||
<a href="<?php echo $g['adm_href']?>" class="btn btn-link">초기화</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="page-header">
|
||||
<h4>
|
||||
<small><?php echo number_format($NUM)?> 개 ( <?php echo $p?>/<?php echo $TPG.($TPG>1?'pages':'page')?> )</small>
|
||||
</h4>
|
||||
</div>
|
||||
<form name="listForm" action="<?php echo $g['s']?>/" method="post">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module?>">
|
||||
<input type="hidden" name="a" value="">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-post-user"></label></th>
|
||||
<th>번호</th>
|
||||
<th>제목</th>
|
||||
<th>이름</th>
|
||||
<th>조회</th>
|
||||
<th>다운</th>
|
||||
<th>점수1</th>
|
||||
<th>점수2</th>
|
||||
<th>신고</th>
|
||||
<th>날짜</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while($R=db_fetch_array($RCD)):?>
|
||||
<?php $R['mobile']=isMobileConnect($R['agent'])?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="comment_members[]" value="<?php echo $R['uid']?>" class="rb-post-user" onclick="checkboxCheck();"/></td>
|
||||
<td>
|
||||
<?php echo $NUM-((($p-1)*$recnum)+$_rec++)?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($R['notice']):?><i class="fa fa-volume-up"></i><?php endif?>
|
||||
<?php if($R['mobile']):?><i class="fa fa-mobile f-lg"></i><?php endif?>
|
||||
<a href="<?php echo getCyncUrl($R['cync'].',CMT:'.$R['uid'].',s:'.$R['site'])?>#CMT" target="_blank"><?php echo $R['subject']?></a>
|
||||
<?php if(strstr($R['content'],'.jpg')):?><i class="fa fa-picture-o"></i><?php endif?>
|
||||
<?php if($R['upload']):?><i class="glyphicon glyphicon-floppy-disk"></i><?php endif?>
|
||||
<?php if($R['hidden']):?><i class="fa fa-lock fa-lg"></i><?php endif?>
|
||||
<?php if($R['oneline']):?><span class="comment">[<?php echo $R['oneline']?>]</span><?php endif?>
|
||||
<?php if(getNew($R['d_regis'],24)):?><small class="label label-danger">new</small><?php endif?>
|
||||
</td>
|
||||
<?php if($R['id']):?>
|
||||
<td><a href="javascript:OpenWindow('<?php echo $g['s']?>/?r=<?php echo $r?>&iframe=Y&m=member&front=manager&page=post&mbruid=<?php echo $R['mbruid']?>');" title="게시정보"><?php echo $R[$_HS['nametype']]?></a></td>
|
||||
<?php else:?>
|
||||
<td><?php echo $R[$_HS['nametype']]?></td>
|
||||
<?php endif?>
|
||||
<td><strong><?php echo $R['hit']?></strong></td>
|
||||
<td><?php echo $R['down']?></td>
|
||||
<td><?php echo $R['score1']?></td>
|
||||
<td><?php echo $R['score2']?></td>
|
||||
<td><?php echo $R['report']?></td>
|
||||
<td><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></td>
|
||||
</tr>
|
||||
<?php endwhile?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if(!$NUM):?>
|
||||
<div class="rb-none">게시물이 없습니다.</div>
|
||||
<?php endif?>
|
||||
<div class="rb-footer clearfix">
|
||||
<div class="pull-right">
|
||||
<ul class="pagination">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
|
||||
<?php //echo getPageLink(5,$p,$TPG,'')?>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" onclick="chkFlag('comment_members[]');checkboxCheck();" class="btn btn-default btn-sm">선택/해제 </button>
|
||||
<button type="button" onclick="actCheck('comment_multi_delete');" class="btn btn-default btn-sm rb-action-btn" disabled>삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="MoveCopy" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
...
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<!-- bootstrap-datepicker, http://eternicode.github.io/bootstrap-datepicker/ -->
|
||||
<?php getImport('bootstrap-datepicker','css/datepicker3',false,'css')?>
|
||||
<?php getImport('bootstrap-datepicker','js/bootstrap-datepicker',false,'js')?>
|
||||
<?php getImport('bootstrap-datepicker','js/locales/bootstrap-datepicker.kr',false,'js')?>
|
||||
<style type="text/css">
|
||||
.datepicker {z-index: 1151 !important;}
|
||||
</style>
|
||||
<script>
|
||||
|
||||
$('.input-daterange').datepicker({
|
||||
format: "yyyy/mm/dd",
|
||||
todayBtn: "linked",
|
||||
language: "kr",
|
||||
calendarWeeks: true,
|
||||
todayHighlight: true,
|
||||
autoclose: true
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
// 선택박스 체크 이벤트 핸들러
|
||||
$(".checkAll-post-user").click(function(){
|
||||
$(".rb-post-user").prop("checked",$(".checkAll-post-user").prop("checked"));
|
||||
checkboxCheck();
|
||||
});
|
||||
// 선택박스 체크시 액션버튼 활성화 함수
|
||||
function checkboxCheck()
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('comment_members[]');
|
||||
var n = l.length;
|
||||
var i;
|
||||
var j=0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (l[i].checked == true) j++;
|
||||
}
|
||||
if (j) $('.rb-action-btn').prop("disabled",false);
|
||||
else $('.rb-action-btn').prop("disabled",true);
|
||||
}
|
||||
// 기간 검색 적용 함수
|
||||
function dropDate(date1,date2)
|
||||
{
|
||||
var f = document.procForm;
|
||||
f.d_start.value = date1;
|
||||
f.d_finish.value = date2;
|
||||
f.submit();
|
||||
}
|
||||
function actCheck(act)
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('comment_members[]');
|
||||
var n = l.length;
|
||||
var j = 0;
|
||||
var i;
|
||||
var s = '';
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if(l[i].checked == true)
|
||||
{
|
||||
j++;
|
||||
s += '['+l[i].value+']';
|
||||
}
|
||||
}
|
||||
if (!j)
|
||||
{
|
||||
alert('선택된 게시물이 없습니다. ');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (act == 'comment_multi_delete')
|
||||
{
|
||||
if(confirm('정말로 삭제하시겠습니까? '))
|
||||
{
|
||||
getIframeForAction(f);
|
||||
f.a.value = act;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
251
modules/comment/admin/config.php
Normal file
@@ -0,0 +1,251 @@
|
||||
|
||||
<form class="p-4" role="form" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="a" value="config" />
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">댓글 대표 테마</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<select name="skin_main" class="form-control custom-select">
|
||||
<option value=""> + 선택하세요</option>
|
||||
<option value="" disabled>--------------------------------</option>
|
||||
|
||||
<optgroup label="데스크탑">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
<optgroup label="모바일">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
</select>
|
||||
<small class="form-text text-muted">
|
||||
지정된 대표테마는 댓글목록 설정시 별도의 테마지정없이 자동으로 적용됩니다.
|
||||
가장 많이 사용하는 테마를 지정해 주세요.
|
||||
</small>
|
||||
</div> <!-- .col-md-10 col-xl-9 -->
|
||||
</div> <!-- .form-group -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right"><span class="badge badge-dark">댓글 모바일 대표테마</span></label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<select name="skin_mobile" class="form-control custom-select">
|
||||
<option value="">모바일 테마 사용안함</option>
|
||||
<option value="" disabled>--------------------------------</option>
|
||||
|
||||
<optgroup label="모바일">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_mobile']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
<optgroup label="데스크탑">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_mobile']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
</select>
|
||||
<small class="form-text text-muted">
|
||||
선택하지 않으면 데스크탑 대표테마로 설정됩니다.
|
||||
</small>
|
||||
</div> <!-- .col-md-10 col-xl-9 -->
|
||||
</div> <!-- .form-group -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">통합 댓글테마</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<select name="skin_total" class="form-control custom-select">
|
||||
<option value="">통합보드 사용안함</option>
|
||||
<option value="" disabled>--------------------------------</option>
|
||||
|
||||
<optgroup label="데스크탑">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_total']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
<optgroup label="모바일">
|
||||
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['comment']['skin_total']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</optgroup>
|
||||
|
||||
</select>
|
||||
<small class="form-text text-muted">
|
||||
통합보드란 모든 댓글목록 전체 게시물을 하나의 댓글목록으로 출력해 주는 서비스입니다.<br>
|
||||
사용하시려면 통합댓글목록용 테마를 지정해 주세요.
|
||||
통합댓글목록의 호출은 <code><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>" target="_blank"><?php echo $g['r']?>/?m=<?php echo $module?></a></code> 입니다.
|
||||
</small>
|
||||
</div> <!-- .col-md-10 col-xl-9 -->
|
||||
</div> <!-- .form-group -->
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">게시물 출력</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<div class="input-group w-25">
|
||||
<input type="text" name="recnum" value="<?php echo $d['comment']['recnum']?$d['comment']['recnum']:20?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">개</span>
|
||||
</div>
|
||||
</div>
|
||||
<small class="form-text text-muted">한페이지에 출력할 게시물의 수</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">불량글 처리</label>
|
||||
<div class="col-md-10 col-xl-9 form-inline">
|
||||
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="report_del" name="report_del" value="1" <?php if($d['comment']['report_del']):?> checked<?php endif?> >
|
||||
<label class="custom-control-label" for="report_del">신고건 수가</label>
|
||||
</div>
|
||||
|
||||
<div class="input-group ml-4">
|
||||
<input type="text" name="report_del_num" value="<?php echo $d['comment']['report_del_num']?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">건 이상인 경우</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select name="report_del_act" class="form-control custom-select ml-4">
|
||||
<option value="1"<?php if($d['comment']['report_del_act']==1):?> selected="selected"<?php endif?>>자동삭제</option>
|
||||
<option value="2"<?php if($d['comment']['report_del_act']==2):?> selected="selected"<?php endif?>>비밀처리</option>
|
||||
</select>
|
||||
</div> <!-- .col-md-10 col-xl-9 -->
|
||||
</div> <!-- .form-group -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">제한단어</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<textarea name="badword" rows="5" class="form-control"><?php echo $d['comment']['badword']?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">제한단어 처리</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="badword_action_0" class="custom-control-input" name="badword_action" value="0" <?php if($d['comment']['badword_action']==0):?> checked<?php endif?>>
|
||||
<label class="custom-control-label" for="badword_action_0">제한단어 체크하지 않음</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="badword_action_1" class="custom-control-input" name="badword_action" value="1"<?php if($d['comment']['badword_action']==1):?> checked<?php endif?>>
|
||||
<label class="custom-control-label" for="badword_action_1">등록을 차단함</label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="badword_action_2" class="custom-control-input" name="badword_action" value="2"<?php if($d['comment']['badword_action']==2):?> checked<?php endif?>>
|
||||
<label class="custom-control-label" for="badword_action_2">제한단어를 다음의 문자로 치환하여 등록함</label>
|
||||
<input class="form-control w-25" type="text" name="badword_escape" value="<?php echo $d['comment']['badword_escape']?>" maxlength="1">
|
||||
</div>
|
||||
|
||||
</div><!-- .col-md-10 col-xl-9 -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">삭제 제한</label>
|
||||
<div class="col-md-10 col-xl-9">
|
||||
<div class="custom-control custom-checkbox mt-1">
|
||||
<input type="checkbox" class="custom-control-input" id="commentdel" name="commentdel" value="1" <?php if($d['comment']['commentdel']):?> checked<?php endif?>>
|
||||
<label class="custom-control-label" for="commentdel">한줄의견 있는 댓글의 삭제를 제한합니다.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">새글 유지시간</label>
|
||||
<div class="col-md-10">
|
||||
<div class="form-inline">
|
||||
<div class="input-group">
|
||||
<input type="text" name="newtime" value="<?php echo $d['comment']['newtime']?$d['comment']['newtime']:24?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">시간</span>
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-muted ml-2">새글로 인식되는 시간</small>
|
||||
</div><!-- /.form-inline -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">댓글 포인트</label>
|
||||
<div class="col-md-10">
|
||||
<div class="form-inline">
|
||||
<div class="input-group">
|
||||
<input type="text" name="give_point" value="<?php echo $d['comment']['give_point']?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">포인트 지급</span>
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-muted ml-2">등록한 댓글을 삭제시 환원됩니다</small>
|
||||
</div><!-- /.form-inline -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 col-form-label text-md-right">한줄의견 포인트</label>
|
||||
<div class="col-md-10">
|
||||
<div class="form-inline">
|
||||
<div class="input-group">
|
||||
<input type="text" name="give_opoint" value="<?php echo $d['comment']['give_opoint']?>" class="form-control">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">포인트 지급</span>
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-muted ml-2">등록한 한줄의견을 삭제시 환원됩니다</small>
|
||||
</div><!-- /.form-inline -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="offset-md-2 col-md-10 col-xl-9">
|
||||
<button type="submit" class="btn btn-outline-primary btn-block my-4">저장하기</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
putCookieAlert('comment_config_result') // 실행결과 알림 메시지 출력
|
||||
|
||||
function saveCheck(f)
|
||||
{
|
||||
if (f.skin_main.value == '')
|
||||
{
|
||||
alert('대표테마를 선택해 주세요. ');
|
||||
f.skin_main.focus();
|
||||
return false;
|
||||
}
|
||||
// if (f.skin_mobile.value == '')
|
||||
// {
|
||||
// alert('모바일테마를 선택해 주세요. ');
|
||||
// f.skin_mobile.focus();
|
||||
// return false;
|
||||
// }
|
||||
if (confirm('정말로 실행하시겠습니까? '))
|
||||
{
|
||||
getIframeForAction(f);
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
1
modules/comment/admin/main.css
Normal file
@@ -0,0 +1 @@
|
||||
h6 {text-align: left;width: auto;line-height: 160%}
|
||||
382
modules/comment/admin/main.php
Normal file
@@ -0,0 +1,382 @@
|
||||
<?php
|
||||
//댓글링크
|
||||
function _getPostLink($arr)
|
||||
{
|
||||
$sync_arr=explode('|',$arr['sync']);
|
||||
$B = getUidData($sync_arr[0],$sync_arr[2]);
|
||||
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#CMT-'.$arr['uid']));
|
||||
}
|
||||
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
|
||||
$sort = $sort ? $sort : 'uid';
|
||||
$orderby= $orderby ? $orderby : 'asc';
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
$_WHERE='uid>0';
|
||||
$account = $SD['uid'];
|
||||
if($account) $_WHERE .=' and site='.$account;
|
||||
if($d_start) $_WHERE .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
|
||||
if($d_finish) $_WHERE .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
|
||||
if($bid) $_WHERE .= ' and bbs='.$bid;
|
||||
if($category) $_WHERE .= " and category ='".$category."'";
|
||||
if($notice) $_WHERE .= ' and notice=1';
|
||||
if($hidden) $_WHERE .= ' and hidden=1';
|
||||
if($where && $keyw)
|
||||
{
|
||||
if (strstr('[name][nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyw."'";
|
||||
else $_WHERE .= getSearchSql($where,$keyw,$ikeyword,'or');
|
||||
}
|
||||
$RCD = getDbArray($table['s_comment'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table['s_comment'],$_WHERE);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
?>
|
||||
|
||||
<div class="row no-gutters">
|
||||
|
||||
<div class="col-sm-4 col-md-4 col-xl-3 d-none d-sm-block sidebar sidebar-right">
|
||||
|
||||
<form name="procForm" 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 id="accordion" role="tablist">
|
||||
<div class="card border-0">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_main_collapse']!='filter'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-filter" role="button" aria-expanded="true" aria-controls="collapseOne" onclick="sessionSetting('comment_main_collapse','filter','','');">
|
||||
필터
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="collapse-filter" class="collapse<?php if($_SESSION['comment_main_collapse']=='filter'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="mb-2">
|
||||
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="notice" name="notice" value="Y"<?php if($notice=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
|
||||
<label class="custom-control-label" for="notice">공지글</label>
|
||||
</div>
|
||||
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="hidden" name="hidden" value="Y"<?php if($hidden=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
|
||||
<label class="custom-control-label" for="hidden">비밀글</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-daterange input-group input-group-sm mb-2" id="datepicker">
|
||||
<input type="text" class="form-control" name="d_start" placeholder="시작일 선택" value="<?php echo $d_start?>">
|
||||
<input type="text" class="form-control" name="d_finish" placeholder="종료일 선택" value="<?php echo $d_finish?>">
|
||||
<span class="input-group-append">
|
||||
<button class="btn btn-light" type="submit">기간적용</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<span class="btn-group btn-group-toggle">
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');">어제</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat($date['today'],'Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">오늘</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">일주</button>
|
||||
</span>
|
||||
|
||||
<span class="btn-group btn-group-toggle">
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">한달</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat(substr($date['today'],0,6).'01','Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">당월</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');">전월</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('','');">전체</button>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_main_collapse']!='sort'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-sort" role="button" aria-expanded="false" aria-controls="collapseTwo" onclick="sessionSetting('comment_main_collapse','sort','','');">
|
||||
정렬
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-sort" class="collapse<?php if($_SESSION['comment_main_collapse']=='sort'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($sort=='d_regis'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="d_regis" name="sort"<?php if($sort=='d_regis'):?> checked<?php endif?>> 등록일
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='hit'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="hit" name="sort"<?php if($sort=='hit'):?> checked<?php endif?>> 조회
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='down'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="down" name="sort"<?php if($sort=='down'):?> checked<?php endif?>> 다운
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='oneline'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="oneline" name="sort"<?php if($sort=='oneline'):?> checked<?php endif?>> 한줄의견
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($sort=='likes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="likes" name="sort"<?php if($sort=='likes'):?> checked<?php endif?>> 추천
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='dislikes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="dislikes" name="sort"<?php if($sort=='dislikes'):?> checked<?php endif?>> 비추천
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='report'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="report" name="sort"<?php if($sort=='report'):?> checked<?php endif?>> 신고
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i>역순
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i>정순
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_main_collapse']!='search'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-search" role="button" aria-expanded="false" aria-controls="collapseThree" onclick="sessionSetting('comment_main_collapse','search','','');">
|
||||
검색
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-search" class="collapse<?php if($_SESSION['comment_main_collapse']=='search'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<select name="where" class="form-control custom-select mb-2">
|
||||
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
|
||||
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
|
||||
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
|
||||
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
|
||||
<option value="ip"<?php if($where=='ip'):?> selected="selected"<?php endif?>>아이피</option>
|
||||
</select>
|
||||
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control mb-2">
|
||||
<button class="btn btn-light btn-block" type="submit">검색</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-3">
|
||||
<div class="input-group input-group-sm mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text">출력수</label>
|
||||
</div>
|
||||
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
|
||||
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20개</option>
|
||||
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35개</option>
|
||||
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50개</option>
|
||||
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75개</option>
|
||||
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90개</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php if($NUM):?>
|
||||
<a href="<?php echo $g['adm_href']?>" class="btn btn-block btn-light<?php echo $keyw?' active':'' ?>">검색조건 초기화</a>
|
||||
<?php endif?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div><!-- /.sidebar -->
|
||||
<div class="col-sm-8 col-md-8 mr-sm-auto col-xl-9">
|
||||
|
||||
<?php if ($NUM): ?>
|
||||
|
||||
<form class="card rounded-0 border-0" name="listForm" action="<?php echo $g['s']?>/" method="post">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module?>">
|
||||
<input type="hidden" name="a" value="">
|
||||
|
||||
<div class="card-header border-0 page-body-header">
|
||||
<small><?php echo number_format($NUM)?> 개</small>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $p?>/<?php echo $TPG?> 페이지</span>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped text-center mb-0 f13">
|
||||
<thead class="small text-muted">
|
||||
<tr>
|
||||
<th><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-post-user"></label></th>
|
||||
<th>번호</th>
|
||||
<th>제목</th>
|
||||
<th>이름</th>
|
||||
<th>좋아요</th>
|
||||
<th>싫어요</th>
|
||||
<th>신고</th>
|
||||
<th>날짜</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while($R=db_fetch_array($RCD)):?>
|
||||
<?php $R['mobile']=isMobileConnect($R['agent'])?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="comment_members[]" value="<?php echo $R['uid']?>" class="rb-post-user" onclick="checkboxCheck();"/></td>
|
||||
<td>
|
||||
<?php echo $NUM-((($p-1)*$recnum)+$_rec++)?>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<?php if($R['notice']):?><i class="fa fa-volume-up"></i><?php endif?>
|
||||
<?php if($R['mobile']):?><i class="fa fa-mobile f-lg"></i><?php endif?>
|
||||
<a href="<?php echo _getPostLink($R)?>" target="_blank" class="muted-link"><?php echo getStrCut($R['subject'],50,'..')?></a>
|
||||
<?php if(strstr($R['content'],'.jpg')):?><i class="fa fa-picture-o"></i><?php endif?>
|
||||
<?php if($R['upload']):?><i class="glyphicon glyphicon-floppy-disk"></i><?php endif?>
|
||||
<?php if($R['hidden']):?><i class="fa fa-lock fa-lg"></i><?php endif?>
|
||||
<?php if($R['comment']):?><span class="comment">[<?php echo $R['comment']?><?php if($R['oneline']):?>+<?php echo $R['oneline']?><?php endif?>]</span><?php endif?>
|
||||
<?php if(getNew($R['d_regis'],24)):?><small class="text-danger">new</small><?php endif?>
|
||||
</td>
|
||||
<?php if($R['id']):?>
|
||||
<td>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_window" class="rb-modal-mbrinfo muted-link" onmousedown="mbrIdDrop('<?php echo $R['mbruid']?>','comment');">
|
||||
<?php echo $R[$_HS['nametype']]?>
|
||||
</a>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td><?php echo $R[$_HS['nametype']]?></td>
|
||||
<?php endif?>
|
||||
<td><?php echo $R['likes']?></td>
|
||||
<td><?php echo $R['dislikes']?></td>
|
||||
<td><?php echo $R['report']?></td>
|
||||
<td><time class="small text-muted"><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></time></td>
|
||||
</tr>
|
||||
<?php endwhile?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
|
||||
<div>
|
||||
<button type="button" onclick="chkFlag('comment_members[]');checkboxCheck();" class="btn btn-light btn-sm">선택/해제 </button>
|
||||
<button type="button" onclick="actCheck('comment_multi_delete');" class="btn btn-light btn-sm rb-action-btn" disabled>삭제</button>
|
||||
</div>
|
||||
|
||||
<ul class="pagination mb-0">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
|
||||
</ul>
|
||||
|
||||
</div><!-- ./card-footer -->
|
||||
|
||||
</form>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
|
||||
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
|
||||
<p>등록된 댓글이 없습니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
|
||||
<?php include $g['path_module'].'member/admin/_modal.php';?>
|
||||
|
||||
<!-- bootstrap-datepicker, http://eternicode.github.io/bootstrap-datepicker/ -->
|
||||
<?php getImport('bootstrap-datepicker','css/datepicker3',false,'css')?>
|
||||
<?php getImport('bootstrap-datepicker','js/bootstrap-datepicker',false,'js')?>
|
||||
<?php getImport('bootstrap-datepicker','js/locales/bootstrap-datepicker.kr',false,'js')?>
|
||||
<style type="text/css">
|
||||
.datepicker {z-index: 1151 !important;}
|
||||
</style>
|
||||
<script>
|
||||
|
||||
putCookieAlert('comment_post_result') // 실행결과 알림 메시지 출력
|
||||
|
||||
|
||||
$('.input-daterange').datepicker({
|
||||
format: "yyyy/mm/dd",
|
||||
todayBtn: "linked",
|
||||
language: "kr",
|
||||
calendarWeeks: true,
|
||||
todayHighlight: true,
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
//사이트 셀렉터 출력
|
||||
$('[data-role="siteSelector"]').removeClass('d-none')
|
||||
|
||||
// 선택박스 체크 이벤트 핸들러
|
||||
$(".checkAll-post-user").click(function(){
|
||||
$(".rb-post-user").prop("checked",$(".checkAll-post-user").prop("checked"));
|
||||
checkboxCheck();
|
||||
});
|
||||
// 선택박스 체크시 액션버튼 활성화 함수
|
||||
function checkboxCheck()
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('comment_members[]');
|
||||
var n = l.length;
|
||||
var i;
|
||||
var j=0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (l[i].checked == true) j++;
|
||||
}
|
||||
if (j) $('.rb-action-btn').prop("disabled",false);
|
||||
else $('.rb-action-btn').prop("disabled",true);
|
||||
}
|
||||
// 기간 검색 적용 함수
|
||||
function dropDate(date1,date2)
|
||||
{
|
||||
var f = document.procForm;
|
||||
f.d_start.value = date1;
|
||||
f.d_finish.value = date2;
|
||||
f.submit();
|
||||
}
|
||||
function actCheck(act)
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('comment_members[]');
|
||||
var n = l.length;
|
||||
var j = 0;
|
||||
var i;
|
||||
var s = '';
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if(l[i].checked == true)
|
||||
{
|
||||
j++;
|
||||
s += '['+l[i].value+']';
|
||||
}
|
||||
}
|
||||
if (!j)
|
||||
{
|
||||
alert('선택된 댓글이 없습니다. ');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (act == 'comment_multi_delete')
|
||||
{
|
||||
if(confirm('정말로 삭제하시겠습니까? '))
|
||||
{
|
||||
getIframeForAction(f);
|
||||
f.a.value = act;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 회원 이름,닉네임 클릭시 uid & mod( 탭 정보 : info, main, post 등) 지정하는 함수
|
||||
var _mbrModalUid;
|
||||
var _mbrModalMod;
|
||||
function mbrIdDrop(uid,mod)
|
||||
{
|
||||
_mbrModalUid = uid;
|
||||
_mbrModalMod = mod;
|
||||
}
|
||||
|
||||
// 회원정보 modal 호출하는 함수 : 위에서 지정한 회원 uid & mod 로 호출한다 .
|
||||
$('.rb-modal-mbrinfo').on('click',function() {
|
||||
modalSetting('modal_window','<?php echo getModalLink('&m=admin&module=member&front=modal.mbrinfo&uid=')?>'+_mbrModalUid+'&tab='+_mbrModalMod);
|
||||
});
|
||||
|
||||
</script>
|
||||
332
modules/comment/admin/makebbs.css
Normal file
@@ -0,0 +1,332 @@
|
||||
#rb-body .tab-content .form-group.tab-content {
|
||||
border: 0;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
#rb-body .tab-content .form-group {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.help-text {
|
||||
margin-top: 5px
|
||||
}
|
||||
|
||||
.dataTables_wrapper a{
|
||||
color: #666
|
||||
}
|
||||
|
||||
.form-horizontal .tab-content {
|
||||
border: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0
|
||||
}
|
||||
|
||||
#rb-body .row,
|
||||
#rb-body .xrow {
|
||||
margin-right: -5px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.rb-advance {
|
||||
border-top: 1px solid #EFEFEF;
|
||||
padding-top: 5px;
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px
|
||||
}
|
||||
|
||||
.rb-advance .btn span:before {
|
||||
content: "숨기기"
|
||||
}
|
||||
|
||||
.rb-advance .btn.collapsed span:before {
|
||||
content: "표시"
|
||||
}
|
||||
|
||||
.input-group-addon:first-child,
|
||||
.input-group-btn:last-child>.btn,
|
||||
.input-group-addon:last-child {
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
.help-block {
|
||||
margin-top: 10px;
|
||||
font-size: 13px
|
||||
}
|
||||
|
||||
.rb-guide {
|
||||
margin: 5px 0 0 0;
|
||||
padding: 15px;
|
||||
color: #777;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 13px
|
||||
}
|
||||
|
||||
.form-horizontal .has-feedback.rb-outside .form-control-feedback {
|
||||
left: -925px;
|
||||
}
|
||||
|
||||
#page-settings {
|
||||
padding-top: 15px;
|
||||
margin-top: 40px;
|
||||
border-top: 1px solid #EFEFEF
|
||||
}
|
||||
|
||||
#page-settings .panel-default {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#page-settings .panel-default>.panel-heading {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#page-settings .panel-default .panel-title>a {
|
||||
color: #428bca;
|
||||
}
|
||||
|
||||
|
||||
/*panel-form*/
|
||||
|
||||
.rb-panelform {
|
||||
margin-bottom: 0
|
||||
}
|
||||
|
||||
.rb-panelform .panel-body {
|
||||
padding: 0
|
||||
}
|
||||
|
||||
.rb-panelform .form-control {
|
||||
border-radius: 0
|
||||
}
|
||||
|
||||
|
||||
/*김성호추가*/
|
||||
.table {
|
||||
|
||||
}
|
||||
.table thead {
|
||||
border: 0;
|
||||
}
|
||||
.table thead td {
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
}
|
||||
.table tbody td a {
|
||||
color: #666;
|
||||
text-decoration: none;
|
||||
}
|
||||
.table tbody tr:hover {
|
||||
background: #efefef;
|
||||
cursor: pointer;
|
||||
}
|
||||
.table tbody td small {
|
||||
color: #999;
|
||||
font-size: 11px;
|
||||
}
|
||||
.rb-keyword-search input {
|
||||
border-top: #dfdfdf solid 1px;
|
||||
border-bottom: #dfdfdf solid 1px;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
.rb-pagename span {
|
||||
padding-left: 34px;
|
||||
}
|
||||
.rb-time {
|
||||
width: 100px;
|
||||
font-size:13px;
|
||||
text-align:center;
|
||||
color:#999;
|
||||
}
|
||||
.table .active1 td {
|
||||
background-color: #428BCA;
|
||||
}
|
||||
.table .active1 td a,
|
||||
.table .active1 td small,
|
||||
.table .active1 .rb-time {
|
||||
color: #fff;
|
||||
}
|
||||
.rb-search-box {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.rb-search-box .input-group {
|
||||
width: 190px;
|
||||
}
|
||||
.rb-panel-footer {
|
||||
text-align: center;
|
||||
}
|
||||
.rb-panel-footer .pagination {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.form-horizontal .has-feedback.rb-outside .form-control-feedback {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
right: -25px;
|
||||
left: auto
|
||||
}
|
||||
|
||||
#page-settings .panel-body {
|
||||
padding-left:0;
|
||||
padding-right:0;
|
||||
}
|
||||
}
|
||||
|
||||
.rb-top-btnbox {
|
||||
position: relative;
|
||||
top:-10px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
#rb-body .row,
|
||||
#rb-body .xrow {
|
||||
margin-right: -16px;
|
||||
margin-left: -16px;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Nestable
|
||||
*/
|
||||
|
||||
.dd {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.dd-list {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.dd-item,
|
||||
.dd-empty,
|
||||
.dd-placeholder {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.dd-handle {
|
||||
display: inline-block;
|
||||
width:90%;
|
||||
margin: 5px 0;
|
||||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
border: 1px solid #f1f1f1;
|
||||
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box; -moz-box-sizing: border-box;
|
||||
cursor: move;
|
||||
font-size: 13px
|
||||
}
|
||||
|
||||
.dd-handle:hover {
|
||||
color: #2ea8e5;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.dd-item > button {
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
margin: 5px 0;
|
||||
padding: 0;
|
||||
text-indent: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.dd-placeholder,
|
||||
.dd-empty {
|
||||
margin: 5px 0;
|
||||
padding: 0;
|
||||
min-height: 30px;
|
||||
background: #f2fbff;
|
||||
border: 1px dashed #b6bcbf;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box
|
||||
}
|
||||
|
||||
.dd-empty {
|
||||
border: 1px dashed #bbb;
|
||||
min-height: 100px;
|
||||
background-color: #e5e5e5;
|
||||
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||
background-size: 60px 60px;
|
||||
background-position: 0 0, 30px 30px;
|
||||
}
|
||||
|
||||
.dd-dragel {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
|
||||
|
||||
.dd-dragel .dd-handle {
|
||||
-webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
||||
box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.nopadding{padding:0 !important; }
|
||||
|
||||
/*고급설정 */
|
||||
#bbs-settings {
|
||||
border-top: 1px solid #efefef;
|
||||
margin-top: 40px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
#bbs-settings .panel-default {
|
||||
border: medium none;
|
||||
box-shadow: none;
|
||||
}
|
||||
#bbs-settings .panel-default > .panel-heading {
|
||||
background-color: transparent;
|
||||
border: medium none;
|
||||
}
|
||||
#bbs-settings .panel-default .panel-title > a {
|
||||
color: #428bca;
|
||||
}
|
||||
|
||||
.rb-form .checkbox-inline input, .rb-form .radio input, .rb-form .radio-inline input {
|
||||
left:0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rb-label {
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
margin-right: 15px;
|
||||
}
|
||||
434
modules/comment/admin/makebbs.php
Normal file
@@ -0,0 +1,434 @@
|
||||
<?php
|
||||
$sort = $sort ? $sort : 'gid';
|
||||
$orderby= $orderby ? $orderby : 'asc';
|
||||
$recnum = $recnum && $recnum < 301 ? $recnum : 20;
|
||||
$bbsque ='uid>0';
|
||||
// 키원드 검색 추가
|
||||
if ($keyw)
|
||||
{
|
||||
$bbsque .= " and (id like '%".$keyw."%' or name like '%".$keyw."%')";
|
||||
}
|
||||
$RCD = getDbArray($table[$module.'list'],$bbsque,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table[$module.'list'],$bbsque);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
if ($uid)
|
||||
{
|
||||
$R = getUidData($table[$module.'list'],$uid);
|
||||
if ($R['uid'])
|
||||
{
|
||||
include_once $g['path_module'].$module.'/var/var.'.$R['id'].'.php';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3">
|
||||
<div class="panel panel-default"> <!-- 메뉴 리스트 패털 시작 -->
|
||||
|
||||
<!-- 메뉴 패널 헤더 : 아이콘 & 제목 -->
|
||||
<div class="panel-heading rb-icon">
|
||||
<div class="icon">
|
||||
<i class="fa fa-file-text-o fa-2x"></i>
|
||||
</div>
|
||||
<h4 class="panel-title">
|
||||
채팅방 리스트
|
||||
<span class="pull-right">
|
||||
<button type="button" class="btn btn-default btn-xs<?php if(!$_SESSION['sh_site_bbs_search']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#panel-search" data-tooltip="tooltip" title="검색필터" onclick="sessionSetting('sh_site_bbs_search','1','','1');getSearchFocus();"><i class="glyphicon glyphicon-search"></i></button>
|
||||
</span>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="panel-search" class="collapse<?php if($_SESSION['sh_site_bbs_search']):?> in<?php endif?>">
|
||||
<form role="form" 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="panel-heading rb-search-box">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon"><small>출력수</small></div>
|
||||
<div class="input-group-btn">
|
||||
<select class="form-control" name="recnum" onchange="this.form.submit();">
|
||||
<option value="15"<?php if($recnum==15):?> selected<?php endif?>>15</option>
|
||||
<option value="30"<?php if($recnum==30):?> selected<?php endif?>>30</option>
|
||||
<option value="60"<?php if($recnum==60):?> selected<?php endif?>>60</option>
|
||||
<option value="100"<?php if($recnum==100):?> selected<?php endif?>>100</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rb-keyword-search input-group input-group-sm">
|
||||
<input type="text" name="keyw" class="form-control" value="<?php echo $keyw?>" placeholder="아이디 or 이름">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="submit">검색</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-body" style="border-top:1px solid #DEDEDE;">
|
||||
<?php if($NUM):?>
|
||||
<form name="bbsform" role="form" action="<?php echo $g['s']?>/" method="post" target="_orderframe_">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="a" value="bbsorder_update" />
|
||||
<div class="dd" id="nestable-menu">
|
||||
<ul class="dd-list list-unstyled">
|
||||
<?php $_i=1;while($BR = db_fetch_array($RCD)):?>
|
||||
<li class="dd-item" data-id="<?php echo $_i?>">
|
||||
<input type="checkbox" name="bbsmembers[]" value="<?php echo $BR['uid']?>" checked class="hidden"/>
|
||||
<span class="dd-handle <?php if($BR['uid']==$R['uid']):?>alert alert-info<?php endif?>" ><i class="fa fa-arrows fa-fw"></i>
|
||||
<?php echo $BR['name']?>(<?php echo $BR['id']?>)
|
||||
</span>
|
||||
<span title="<?php echo number_format($BR['num_r'])?>개" data-tootip="tooltip">
|
||||
<a href="<?php echo $g['adm_href']?>&recnum=<?php echo $recnum?>&p=<?php echo $p?>&uid=<?php echo $BR['uid']?>" data-tooltip="tooltip" title="수정하기">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<?php $_i++;endwhile?>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
<!-- nestable : https://github.com/dbushell/Nestable -->
|
||||
<?php getImport('nestable','jquery.nestable',false,'js') ?>
|
||||
<script>
|
||||
$('#nestable-menu').nestable();
|
||||
$('.dd').on('change', function() {
|
||||
var f = document.bbsform;
|
||||
getIframeForAction(f);
|
||||
f.submit();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php else:?>
|
||||
<div class="none">등록된 채팅방이 없습니다.</div>
|
||||
<?php endif?>
|
||||
|
||||
</div>
|
||||
<div class="panel-footer rb-panel-footer">
|
||||
<ul class="pagination">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
|
||||
<?php //echo getPageLink(5,$p,$TPG,'')?>
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- 좌측 패널 끝 -->
|
||||
</div><!-- 좌측 내용 끝 -->
|
||||
<!-- 우측 내용 시작 -->
|
||||
<div id="tab-content-view" class="col-md-8 col-lg-9">
|
||||
<form name="procForm" class="form-horizontal rb-form" role="form" action="<?php echo $g['s']?>/" method="post" enctype="multipart/form-data" onsubmit="return saveCheck(this);">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="a" value="makebbs" />
|
||||
<input type="hidden" name="bid" value="<?php echo $R['id']?>" />
|
||||
<input type="hidden" name="perm_g_list" value="<?php echo $R['perm_g_list']?>" />
|
||||
<input type="hidden" name="perm_g_view" value="<?php echo $R['perm_g_view']?>" />
|
||||
<input type="hidden" name="perm_g_write" value="<?php echo $R['perm_g_write']?>" />
|
||||
<input type="hidden" name="perm_g_down" value="<?php echo $R['perm_g_down']?>" />
|
||||
|
||||
<div class="page-header">
|
||||
<h4>
|
||||
<?php if($R['uid']):?>
|
||||
채팅방 등록정보
|
||||
<div class="pull-right rb-top-btnbox hidden-xs">
|
||||
<a href="<?php echo $g['adm_href']?>" class="btn btn-default"><i class="fa fa-plus"></i> 새채팅방 만들기</a>
|
||||
</div>
|
||||
<?php else:?>
|
||||
새채팅방 만들기
|
||||
<?php endif?>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">채팅방 이름</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input class="form-control" placeholder="" type="text" name="name" value="<?php echo $R['name']?>"<?php if(!$R['uid'] && !$g['device']):?> autofocus<?php endif?>>
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default rb-help-btn" type="button" data-toggle="collapse" data-target="#bbs_name-guide" data-tooltip="tooltip" title="도움말"><i class="fa fa-question-circle fa-lg"></i></button>
|
||||
</span>
|
||||
<?php if($R['uid']):?>
|
||||
<span class="input-group-btn">
|
||||
<a href="<?php echo RW('m='.$module.'&bid='.$R['id'])?>" target="_blank" class="btn btn-default" data-tooltip="tooltip" title="채팅방 보기">
|
||||
<i class="fa fa-link fa-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif?>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="bbs_name-guide">
|
||||
<small> 채팅방제목에 해당되며 한글,영문등 자유롭게 등록할 수 있습니다.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">채팅방 아이디</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input class="form-control" placeholder="" type="text" name="id" value="<?php echo $R['id']?>" <?php if($R['uid']):?>disabled<?php endif?>>
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default rb-help-btn" type="button" data-toggle="collapse" data-target="#bbs_id-guide" data-tooltip="tooltip" title="도움말"><i class="fa fa-question-circle fa-lg"></i></button>
|
||||
</span>
|
||||
<?php if($R['uid']):?>
|
||||
<span class="input-group-btn">
|
||||
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=deletebbs&uid=<?php echo $R['uid']?>" onclick="return hrefCheck(this,true,'삭제하시면 모든 게시물이 지워지며 복구할 수 없습니다.\n정말로 삭제하시겠습니까?');" class="btn btn-default" data-tooltip="tooltip" title="삭제하기">
|
||||
<i class="fa fa-trash-o fa-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif?>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="bbs_id-guide">
|
||||
<small> 영문 대소문자+숫자+_ 조합으로 만듭니다.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">방장 아이디</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input class="form-control" placeholder="방장 아이디를 입력해주세요." type="text" name="owner_id" value="<?php echo $R['owner_id']?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default rb-help-btn" type="button" data-toggle="collapse" data-target="#owner-guide" data-tooltip="tooltip" title="도움말"><i class="fa fa-question-circle fa-lg"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="owner-guide">
|
||||
<small>
|
||||
방장에게는 채팅방 설정/관리 권한이 주어집니다.<br />
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">채팅방 형식</label>
|
||||
<div class="col-sm-10">
|
||||
<label class="radio-inline" data-role="radio-ctype" data-type="1">
|
||||
<input type="radio" name="type" value="1"<?php if(!$R['type']||$R['type']==1):?> checked="checked"<?php endif?> /> 일반 채팅방
|
||||
</label>
|
||||
<label class="radio-inline" data-role="radio-ctype" data-type="2">
|
||||
<input type="radio" name="type" value="2"<?php if($R['type']==2):?> checked="checked"<?php endif?> /> 그룹 채팅방
|
||||
</label>
|
||||
<p class="help-block">
|
||||
<small>
|
||||
그룹 채팅방의 경우 권한설정과 상관 없이 지정된 멤버들에게만 열람/참여가 허용됩니다.<br />
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" data-role="members-wrapper" <?php if(!$R['type']||$R['type']==1):?>style="display:none;"<?php endif?>>
|
||||
<label class="col-sm-2 control-label">단톡멤버 아이디</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input class="form-control" placeholder="" type="text" name="members" value="<?php echo $R['members']?>">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default rb-help-btn" type="button" data-toggle="collapse" data-target="#team_id-guide" data-tooltip="tooltip" title="도움말"><i class="fa fa-question-circle fa-lg"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block collapse alert alert-warning" id="team_id-guide">
|
||||
<small>
|
||||
단톡멤버 아이디를 콤마(,)로 구분해서 팀원을 등록해 주세요.<br />
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">오픈 시간</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group input-group-sm" style="width:100%;">
|
||||
<input type="text" name="t_start" value="<?php echo $R['t_start']?>" class="form-control tpicker" placeholder="시작 시간">
|
||||
<span class="input-group-addon">~</span>
|
||||
<input type="text" name="t_end" value="<?php echo $R['t_end']?>" class="form-control tpicker" placeholder="종료 시간">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">레이아웃</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="layout" class="form-control">
|
||||
<option value=""> + 사이트 대표레이아웃</option>
|
||||
<option value="">--------------------------------</option>
|
||||
<?php $dirs = opendir($g['path_layout'])?>
|
||||
<?php while(false !== ($tpl = readdir($dirs))):?>
|
||||
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
|
||||
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
|
||||
<option value="">--------------------------------</option>
|
||||
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
|
||||
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
|
||||
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($d['bbs']['layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($g['path_layout'].$tpl)?>(<?php echo str_replace('.php','',$tpl1)?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs1)?>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">채팅방 테마 </label>
|
||||
<div class="col-sm-10">
|
||||
<select name="skin" class="form-control">
|
||||
<option value=""> + 채팅방 대표테마</option>
|
||||
<option value="">--------------------------------</option>
|
||||
<?php $tdir = $g['path_module'].$module.'/theme/_pc/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_pc/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin']=='_pc/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</select>
|
||||
</div> <!-- .col-sm-10 -->
|
||||
</div> <!-- .form-group -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label text-muted">(모바일 접속)</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="m_skin" class="form-control">
|
||||
<option value=""> + 채팅방 모바일 대표테마</option>
|
||||
<option value="">--------------------------------</option>
|
||||
<?php $tdir = $g['path_module'].$module.'/theme/_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['m_skin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</select>
|
||||
</div> <!-- .col-sm-10 -->
|
||||
</div> <!-- .form-group -->
|
||||
|
||||
<!-- 추가설정 시작 : panel-group 으로 각각의 panel 을 묶는다.-->
|
||||
<div id="bbs-settings" class="panel-group" style="padding-left: 15px;">
|
||||
|
||||
<div id="bbs-settings-right" class="panel panel-default"><!--권한설정-->
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a onclick="boxDeco('right');" href="#bbs-settings-right-body" data-parent="#bbs-settings" data-toggle="collapse" class="collapsed">
|
||||
<i class="fa fa-caret-right fa-fw"></i>권한설정
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-collapse collapse" id="bbs-settings-right-body">
|
||||
<div class="panel-body">
|
||||
<!-- .form-group 나열 -->
|
||||
<?php include $g['path_module'].$module.'/admin/_right_fgroup.php';?>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<small class="text-muted">
|
||||
<i class="fa fa-info-circle fa-lg fa-fw"></i> 이상 권한설정 내용입니다.
|
||||
</small>
|
||||
</div>
|
||||
</div> <!-- .panel-body & .panel-footer : 숨겼다 보였다 하는 내용 -->
|
||||
</div> <!-- .panel 전체 -->
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block btn-lg"><i class="fa fa-check fa-lg"></i> <?php echo $R['uid']?'채팅방속성 변경':'새채팅방 만들기'?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div> <!-- 우측내용 끝 -->
|
||||
</div> <!-- .row 전체 box -->
|
||||
<iframe name="_orderframe_" class="hide"></iframe>
|
||||
<?php getImport('bootstrap-timepicker','js/bootstrap-timepicker.min',false,'js')?>
|
||||
<?php getImport('bootstrap-timepicker','css/bootstrap-timepicker.min',false,'css')?>
|
||||
<script>
|
||||
$('.tpicker').timepicker({
|
||||
defaultTime : '',
|
||||
//showSeconds : true, // 초 노출
|
||||
showMeridian:true, // 24시 모드
|
||||
maxHours: 24,
|
||||
minuteStep : 15
|
||||
});
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
// 채팅방 타입 선택 이벤트
|
||||
$('[data-role="radio-ctype"]').on('click',function(){
|
||||
var members_wrapper = $('[data-role="members-wrapper"]');
|
||||
var type = $(this).data('type');
|
||||
if(type==1) $(members_wrapper).hide();
|
||||
else $(members_wrapper).show();
|
||||
});
|
||||
|
||||
// 추가설정 패널 디자인 조정
|
||||
function boxDeco(val)
|
||||
{
|
||||
var layer_arr=["add","right","hcode","fcode"]; // 레이어 배열
|
||||
var parent='bbs-settings-';
|
||||
var this_layer='bbs-settings-'+val;
|
||||
for(var i=0;i<layer_arr.length;i++)
|
||||
{
|
||||
if(layer_arr[i]!=val) $('#'+parent+layer_arr[i]).addClass("panel-default").removeClass("panel-primary");
|
||||
}
|
||||
$('#'+this_layer).addClass("panel-primary").removeClass("panel-default");
|
||||
}
|
||||
function saveCheck(f)
|
||||
{
|
||||
var l2 = f._perm_g_view;
|
||||
var n2 = l2.length;
|
||||
var l3 = f._perm_g_write;
|
||||
var n3 = l3.length;
|
||||
|
||||
var i;
|
||||
var s2 = '';
|
||||
var s3 = '';
|
||||
|
||||
for (i = 0; i < n2; i++)
|
||||
{
|
||||
if (l2[i].selected == true && l2[i].value != '')
|
||||
{
|
||||
s2 += '['+l2[i].value+']';
|
||||
}
|
||||
}
|
||||
for (i = 0; i < n3; i++)
|
||||
{
|
||||
if (l3[i].selected == true && l3[i].value != '')
|
||||
{
|
||||
s3 += '['+l3[i].value+']';
|
||||
}
|
||||
}
|
||||
|
||||
f.perm_g_view.value = s2;
|
||||
f.perm_g_write.value = s3;
|
||||
|
||||
if (f.name.value == '')
|
||||
{
|
||||
alert('채팅방이름을 입력해 주세요. ');
|
||||
f.name.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (f.bid.value == '')
|
||||
{
|
||||
if (f.id.value == '')
|
||||
{
|
||||
alert('채팅방아이디를 입력해 주세요. ');
|
||||
f.id.focus();
|
||||
return false;
|
||||
}
|
||||
if (!chkFnameValue(f.id.value))
|
||||
{
|
||||
alert('채팅방아이디는 영문 대소문자/숫자/_ 만 사용가능합니다. ');
|
||||
f.id.value = '';
|
||||
f.id.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (f.owner_id.value == '')
|
||||
{
|
||||
alert('방장아이디를 입력해 주세요. ');
|
||||
f.owner_id.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var type = $('input[name="type"]:checked').val();
|
||||
|
||||
if(type==2 && f.members.value==''){
|
||||
alert('단톡방 멤버를 입력해주세요. ');
|
||||
f.members.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
getIframeForAction(f);
|
||||
f.submit();
|
||||
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
150
modules/comment/admin/notidoc.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
function getMDname($id)
|
||||
{
|
||||
global $typeset;
|
||||
if ($typeset[$id]) return $typeset[$id];
|
||||
else return $id;
|
||||
}
|
||||
$typeset = array
|
||||
(
|
||||
'_regis_comment'=>'댓글 등록',
|
||||
'_regis_oneline'=>'한줄의견 등록'
|
||||
);
|
||||
$doc = $doc ? $doc : 'noti';
|
||||
$type = $type ? $type : '_regis_comment';
|
||||
?>
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div class="col-sm-4 col-md-3 col-xl-3 d-none d-sm-block sidebar" id="tab-content-list">
|
||||
|
||||
<div class="card border-0">
|
||||
<div class="card-header">
|
||||
양식목록
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<?php $tdir = $g['path_module'].$module.'/var/noti/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..')continue?>
|
||||
<?php $_type = str_replace('.php','',$skin)?>
|
||||
<a href="<?php echo $g['adm_href']?>&doc=noti&type=<?php echo $_type?>" class="list-group-item d-flex justify-content-between align-items-center list-group-item-action <?php if($_type==$type):?>active<?php endif?> doc-style pl-4">
|
||||
<?php echo getMDname($_type)?>
|
||||
<span class="badge badge-dark"><?php echo $_type?></span>
|
||||
</a>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</div>
|
||||
</div><!-- /.card -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-sm-8 col-md-9 ml-sm-auto col-xl-9" id="tab-content-view">
|
||||
|
||||
<form class="card border-0" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module?>">
|
||||
<input type="hidden" name="a" value="notidoc_regis">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc?>">
|
||||
<input type="hidden" name="type" value="<?php echo $type?>">
|
||||
|
||||
<div class="card-header page-body-header">
|
||||
<i class="fa fa-bell-o fa-lg fa-fw"></i>
|
||||
<span><?php echo getMDname($type)?> <span class="badge badge-primary badge-pill">양식수정</span></span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="small text-muted">
|
||||
<ul class="pl-3">
|
||||
<li>내용에는 다음과 같은 치환문자를 사용할 수 있습니다.</li>
|
||||
<li>댓글등록회원 이름 : <code>{NAME}</code> / 댓글등록회원 닉네임 <code>{NICK}</code> / 게시판명 <code>{BBS}</code> / 댓글내용 <code>{SUBJECT}</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php include_once $g['path_module'].$module.'/var/noti/'.$type.'.php'; ?>
|
||||
<div class="card w-75">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-bell-o mr-1" aria-hidden="true"></i> 알림내용 편집
|
||||
</div>
|
||||
<div class="card-body" id="noti-msg">
|
||||
|
||||
<div class="media">
|
||||
<img class="mr-3" src="<?php echo $g['s'].'/files/avatar/0.svg' ?>" alt="회원 아바타" style="width: 100px">
|
||||
<div class="media-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="sr-only">타이틀</label>
|
||||
<input type="text" class="form-control" name="noti_title" value="<?php echo $d['comment']['noti_title'] ?>" placeholder="알림 제목을 입력해 주세요.">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only">메세지 입력</label>
|
||||
<textarea name="noti_body" class="form-control" placeholder="알림내용을 입력해 주세요." rows="5"><?php echo $d['comment']['noti_body'] ?></textarea>
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>연결링크 버튼명</label>
|
||||
<input type="text" class="form-control" name="noti_button" value="<?php echo $d['comment']['noti_button'] ?>" placeholder="버튼명을 입력해 주세요.">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div><!-- /.card -->
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-outline-primary btn-block">수정</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /.card-footer -->
|
||||
|
||||
</form><!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function ToolCheck(compo) {
|
||||
frames.editFrame.showCompo();
|
||||
frames.editFrame.EditBox(compo);
|
||||
}
|
||||
|
||||
|
||||
function saveCheck(f) {
|
||||
|
||||
if (f.content.value == '')
|
||||
{
|
||||
$('.note-editable').focus();
|
||||
alert('내용을 입력해 주세요. ');
|
||||
return false;
|
||||
}
|
||||
if (f.newdoc.value != '')
|
||||
{
|
||||
if (!chkIdValue(f.newdoc.value))
|
||||
{
|
||||
alert('양식명은 영문소문자/숫자/_ 만 사용가능합니다. ');
|
||||
f.newdoc.value = '';
|
||||
f.newdoc.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
putCookieAlert('notidoc_result') // 실행결과 알림 메시지 출력
|
||||
|
||||
$('[data-toggle=tooltip]').tooltip();
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
384
modules/comment/admin/oneline.php
Normal file
@@ -0,0 +1,384 @@
|
||||
<?php
|
||||
//한줄의견링크
|
||||
function _getPostLink($arr)
|
||||
{
|
||||
global $table;
|
||||
$C = getUidData($table['s_comment'],$arr['parent']);
|
||||
$sync_arr=explode('|',$C['sync']);
|
||||
$B = getUidData($sync_arr[0],$sync_arr[2]);
|
||||
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#OLN-'.$arr['uid']));
|
||||
}
|
||||
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
|
||||
$sort = $sort ? $sort : 'uid';
|
||||
$orderby= $orderby ? $orderby : 'desc';
|
||||
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
|
||||
$_WHERE='uid>0';
|
||||
$account = $SD['uid'];
|
||||
if($account) $_WHERE .=' and site='.$account;
|
||||
if($d_start) $_WHERE .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
|
||||
if($d_finish) $_WHERE .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
|
||||
if($bid) $_WHERE .= ' and bbs='.$bid;
|
||||
if($category) $_WHERE .= " and category ='".$category."'";
|
||||
if($notice) $_WHERE .= ' and notice=1';
|
||||
if($hidden) $_WHERE .= ' and hidden=1';
|
||||
if($where && $keyw)
|
||||
{
|
||||
if (strstr('[name][nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyw."'";
|
||||
else $_WHERE .= getSearchSql($where,$keyw,$ikeyword,'or');
|
||||
}
|
||||
$RCD = getDbArray($table['s_oneline'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
|
||||
$NUM = getDbRows($table['s_oneline'],$_WHERE);
|
||||
$TPG = getTotalPage($NUM,$recnum);
|
||||
?>
|
||||
|
||||
<div class="row no-gutters">
|
||||
|
||||
<div class="col-sm-4 col-md-4 col-xl-3 d-none d-sm-block sidebar sidebar-right">
|
||||
|
||||
<form name="procForm" 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 id="accordion" role="tablist">
|
||||
<div class="card border-0">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_oneline_collapse']!='filter'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-filter" role="button" aria-expanded="true" aria-controls="collapseOne" onclick="sessionSetting('comment_oneline_collapse','filter','','');">
|
||||
필터
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="collapse-filter" class="collapse<?php if($_SESSION['comment_oneline_collapse']=='filter'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="mb-2">
|
||||
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="notice" name="notice" value="Y"<?php if($notice=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
|
||||
<label class="custom-control-label" for="notice">공지글</label>
|
||||
</div>
|
||||
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="hidden" name="hidden" value="Y"<?php if($hidden=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
|
||||
<label class="custom-control-label" for="hidden">비밀글</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-daterange input-group input-group-sm mb-2" id="datepicker">
|
||||
<input type="text" class="form-control" name="d_start" placeholder="시작일 선택" value="<?php echo $d_start?>">
|
||||
<input type="text" class="form-control" name="d_finish" placeholder="종료일 선택" value="<?php echo $d_finish?>">
|
||||
<span class="input-group-append">
|
||||
<button class="btn btn-light" type="submit">기간적용</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<span class="btn-group btn-group-toggle">
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');">어제</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat($date['today'],'Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">오늘</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">일주</button>
|
||||
</span>
|
||||
|
||||
<span class="btn-group btn-group-toggle">
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">한달</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat(substr($date['today'],0,6).'01','Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">당월</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');">전월</button>
|
||||
<button class="btn btn-light" type="button" onclick="dropDate('','');">전체</button>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_oneline_collapse']!='sort'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-sort" role="button" aria-expanded="false" aria-controls="collapseTwo" onclick="sessionSetting('comment_oneline_collapse','sort','','');">
|
||||
정렬
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-sort" class="collapse<?php if($_SESSION['comment_oneline_collapse']=='sort'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($sort=='d_regis'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="d_regis" name="sort"<?php if($sort=='d_regis'):?> checked<?php endif?>> 등록일
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='hit'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="hit" name="sort"<?php if($sort=='hit'):?> checked<?php endif?>> 조회
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='down'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="down" name="sort"<?php if($sort=='down'):?> checked<?php endif?>> 다운
|
||||
</label>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($sort=='likes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="likes" name="sort"<?php if($sort=='likes'):?> checked<?php endif?>> 추천
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='dislikes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="dislikes" name="sort"<?php if($sort=='dislikes'):?> checked<?php endif?>> 비추천
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($sort=='report'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="report" name="sort"<?php if($sort=='report'):?> checked<?php endif?>> 신고
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
|
||||
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i>역순
|
||||
</label>
|
||||
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
|
||||
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i>정순
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header p-0" role="tab">
|
||||
<a class="d-block muted-link<?php if($_SESSION['comment_oneline_collapse']!='search'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-search" role="button" aria-expanded="false" aria-controls="collapseThree" onclick="sessionSetting('comment_oneline_collapse','search','','');">
|
||||
검색
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-search" class="collapse<?php if($_SESSION['comment_oneline_collapse']=='search'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
|
||||
<select name="where" class="form-control custom-select mb-2">
|
||||
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
|
||||
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
|
||||
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
|
||||
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
|
||||
<option value="ip"<?php if($where=='ip'):?> selected="selected"<?php endif?>>아이피</option>
|
||||
</select>
|
||||
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control mb-2">
|
||||
<button class="btn btn-light btn-block" type="submit">검색</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-3">
|
||||
<div class="input-group input-group-sm mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text">출력수</label>
|
||||
</div>
|
||||
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
|
||||
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20개</option>
|
||||
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35개</option>
|
||||
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50개</option>
|
||||
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75개</option>
|
||||
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90개</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php if($NUM):?>
|
||||
<a href="<?php echo $g['adm_href']?>" class="btn btn-block btn-light<?php echo $keyw?' active':'' ?>">검색조건 초기화</a>
|
||||
<?php endif?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div><!-- /.sidebar -->
|
||||
<div class="col-sm-8 col-md-8 mr-sm-auto col-xl-9">
|
||||
|
||||
<?php if ($NUM): ?>
|
||||
|
||||
<form class="card rounded-0 border-0" name="listForm" action="<?php echo $g['s']?>/" method="post">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>">
|
||||
<input type="hidden" name="m" value="<?php echo $module?>">
|
||||
<input type="hidden" name="a" value="">
|
||||
|
||||
<div class="card-header border-0 page-body-header">
|
||||
<small><?php echo number_format($NUM)?> 개</small>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $p?>/<?php echo $TPG?> 페이지</span>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped text-center mb-0 f13">
|
||||
<thead class="small text-muted">
|
||||
<tr>
|
||||
<th><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-post-user"></label></th>
|
||||
<th>번호</th>
|
||||
<th>제목</th>
|
||||
<th>이름</th>
|
||||
<th>좋아요</th>
|
||||
<th>싫어요</th>
|
||||
<th>신고</th>
|
||||
<th>날짜</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php while($R=db_fetch_array($RCD)):?>
|
||||
<?php $R['mobile']=isMobileConnect($R['agent'])?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="oneline_members[]" value="<?php echo $R['uid']?>" class="rb-post-user" onclick="checkboxCheck();"/></td>
|
||||
<td>
|
||||
<?php echo $NUM-((($p-1)*$recnum)+$_rec++)?>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<?php if($R['notice']):?><i class="fa fa-volume-up"></i><?php endif?>
|
||||
<?php if($R['mobile']):?><i class="fa fa-mobile f-lg"></i><?php endif?>
|
||||
<?php if($R['category']):?><strong>[<?php echo $R['category']?>]</strong><?php endif?>
|
||||
<a href="<?php echo _getPostLink($R)?>" target="_blank" class="muted-link">
|
||||
<?php echo getStrCut($R['content'],50,'..')?>
|
||||
</a>
|
||||
<?php if(strstr($R['content'],'.jpg')):?><i class="fa fa-picture-o"></i><?php endif?>
|
||||
<?php if($R['upload']):?><i class="glyphicon glyphicon-floppy-disk"></i><?php endif?>
|
||||
<?php if($R['hidden']):?><i class="fa fa-lock fa-lg"></i><?php endif?>
|
||||
<?php if($R['comment']):?><span class="comment">[<?php echo $R['comment']?><?php if($R['oneline']):?>+<?php echo $R['oneline']?><?php endif?>]</span><?php endif?>
|
||||
<?php if($R['trackback']):?><span class="trackback">[<?php echo $R['trackback']?>]</span><?php endif?>
|
||||
<?php if(getNew($R['d_regis'],24)):?><small class="text-danger">new</small><?php endif?>
|
||||
</td>
|
||||
<?php if($R['id']):?>
|
||||
<td>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_window" class="rb-modal-mbrinfo muted-link" onmousedown="mbrIdDrop('<?php echo $R['mbruid']?>','oneline');">
|
||||
<?php echo $R[$_HS['nametype']]?>
|
||||
</a>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td><?php echo $R[$_HS['nametype']]?></td>
|
||||
<?php endif?>
|
||||
<td><?php echo $R['likes']?></td>
|
||||
<td><?php echo $R['dislikes']?></td>
|
||||
<td><?php echo $R['report']?></td>
|
||||
<td><time class="small text-muted"><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></time></td>
|
||||
</tr>
|
||||
<?php endwhile?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
|
||||
<div>
|
||||
<button type="button" onclick="chkFlag('oneline_members[]');checkboxCheck();" class="btn btn-light btn-sm">선택/해제 </button>
|
||||
<button type="button" onclick="actCheck('oneline_multi_delete');" class="btn btn-light btn-sm rb-action-btn" disabled>삭제</button>
|
||||
</div>
|
||||
|
||||
<ul class="pagination mb-0">
|
||||
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
|
||||
</ul>
|
||||
|
||||
</div><!-- ./card-footer -->
|
||||
|
||||
</form>
|
||||
|
||||
<?php else: ?>
|
||||
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
|
||||
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
|
||||
<p>등록된 의견이 없습니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
|
||||
<?php include $g['path_module'].'member/admin/_modal.php';?>
|
||||
|
||||
<!-- bootstrap-datepicker, http://eternicode.github.io/bootstrap-datepicker/ -->
|
||||
<?php getImport('bootstrap-datepicker','css/datepicker3',false,'css')?>
|
||||
<?php getImport('bootstrap-datepicker','js/bootstrap-datepicker',false,'js')?>
|
||||
<?php getImport('bootstrap-datepicker','js/locales/bootstrap-datepicker.kr',false,'js')?>
|
||||
<style type="text/css">
|
||||
.datepicker {z-index: 1151 !important;}
|
||||
</style>
|
||||
<script>
|
||||
putCookieAlert('comment_oneline_result') // 실행결과 알림 메시지 출력
|
||||
|
||||
$('.input-daterange').datepicker({
|
||||
format: "yyyy/mm/dd",
|
||||
todayBtn: "linked",
|
||||
language: "kr",
|
||||
calendarWeeks: true,
|
||||
todayHighlight: true,
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
//사이트 셀렉터 출력
|
||||
$('[data-role="siteSelector"]').removeClass('d-none')
|
||||
|
||||
// 선택박스 체크 이벤트 핸들러
|
||||
$(".checkAll-post-user").click(function(){
|
||||
$(".rb-post-user").prop("checked",$(".checkAll-post-user").prop("checked"));
|
||||
checkboxCheck();
|
||||
});
|
||||
// 선택박스 체크시 액션버튼 활성화 함수
|
||||
function checkboxCheck()
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('oneline_members[]');
|
||||
var n = l.length;
|
||||
var i;
|
||||
var j=0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (l[i].checked == true) j++;
|
||||
}
|
||||
if (j) $('.rb-action-btn').prop("disabled",false);
|
||||
else $('.rb-action-btn').prop("disabled",true);
|
||||
}
|
||||
// 기간 검색 적용 함수
|
||||
function dropDate(date1,date2)
|
||||
{
|
||||
var f = document.procForm;
|
||||
f.d_start.value = date1;
|
||||
f.d_finish.value = date2;
|
||||
f.submit();
|
||||
}
|
||||
function actCheck(act)
|
||||
{
|
||||
var f = document.listForm;
|
||||
var l = document.getElementsByName('oneline_members[]');
|
||||
var n = l.length;
|
||||
var j = 0;
|
||||
var i;
|
||||
var s = '';
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if(l[i].checked == true)
|
||||
{
|
||||
j++;
|
||||
s += '['+l[i].value+']';
|
||||
}
|
||||
}
|
||||
if (!j)
|
||||
{
|
||||
alert('선택된 의견이 없습니다. ');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (act == 'oneline_multi_delete')
|
||||
{
|
||||
if(confirm('정말로 삭제하시겠습니까? '))
|
||||
{
|
||||
getIframeForAction(f);
|
||||
f.a.value = act;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 회원 이름,닉네임 클릭시 uid & mod( 탭 정보 : info, main, post 등) 지정하는 함수
|
||||
var _mbrModalUid;
|
||||
var _mbrModalMod;
|
||||
function mbrIdDrop(uid,mod)
|
||||
{
|
||||
_mbrModalUid = uid;
|
||||
_mbrModalMod = mod;
|
||||
}
|
||||
|
||||
// 회원정보 modal 호출하는 함수 : 위에서 지정한 회원 uid & mod 로 호출한다 .
|
||||
$('.rb-modal-mbrinfo').on('click',function() {
|
||||
modalSetting('modal_window','<?php echo getModalLink('&m=admin&module=member&front=modal.mbrinfo&uid=')?>'+_mbrModalUid+'&tab='+_mbrModalMod);
|
||||
});
|
||||
|
||||
</script>
|
||||
117
modules/comment/admin/skin.css
Normal file
@@ -0,0 +1,117 @@
|
||||
.table tbody tr:hover {
|
||||
background: none repeat scroll 0 0 #efefef;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
{
|
||||
padding: 15px 5px;
|
||||
}
|
||||
.rb-files {
|
||||
background: none repeat scroll 0 0 #eee;
|
||||
border-radius: 3px;
|
||||
margin-top: 20px;
|
||||
padding: 3px;
|
||||
}
|
||||
.rb-codeview {
|
||||
border: 1px solid #c9c9c9;
|
||||
border-radius: 3px;
|
||||
box-shadow: 1px 1px 0 0 rgba(222, 222, 222, 0.1) inset, 1px 1px 0 0 rgba(255, 255, 255, 1);
|
||||
}
|
||||
.rb-codeview-header, .rb-codeview-footer {
|
||||
color: #999;
|
||||
font: 12px "Helvetica Neue",Helvetica,arial,freesans,clean,sans-serif;
|
||||
overflow: hidden;
|
||||
text-shadow: 1px 1px rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.rb-codeview-header .breadcrumb {
|
||||
background-color: transparent;
|
||||
line-height: 30px;
|
||||
margin-bottom: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.rb-codeview-header .btn {
|
||||
border-radius: 3px;
|
||||
line-height: 20px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.rb-codeview-header {
|
||||
background-color: #eaeaea;
|
||||
background-image: linear-gradient(#fafafa, #eaeaea);
|
||||
background-repeat: repeat-x;
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
padding: 5px 10px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
.rb-codeview-body {
|
||||
font-family: Consolas,"Liberation Mono",Courier,monospace;
|
||||
}
|
||||
.rb-codeview-body textarea {
|
||||
background: none repeat scroll 0 0 #000000;
|
||||
border: medium none;
|
||||
border-radius: 0;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
line-height: 150%;
|
||||
overflow: auto;
|
||||
padding: 15px;
|
||||
}
|
||||
.rb-codeview-footer {
|
||||
background-color: #e8e8e8;
|
||||
background-image: linear-gradient(#fafafa, #e8e8e8);
|
||||
background-repeat: repeat-x;
|
||||
border-top: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
}
|
||||
.rb-codeview-footer ul {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.rb-codeview-footer li:first-child, .rb-codeview-footer li:last-child {
|
||||
border-left: 0 none;
|
||||
box-shadow: 0 0 0 transparent inset;
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.rb-codeview-footer li {
|
||||
border-left: 1px solid #c1c1c1;
|
||||
box-shadow: 1px 0 0 #fff inset;
|
||||
color: #555555;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
padding-left: 9px;
|
||||
}
|
||||
.rb-submit {
|
||||
margin: 15px 0;
|
||||
}
|
||||
#rb-body.rb-device-connect .row .panel-default {
|
||||
margin-left: -14px;
|
||||
margin-right: -14px;
|
||||
}
|
||||
.rb-top-btnbox {
|
||||
position: relative;
|
||||
top: -10px;
|
||||
}
|
||||
.input-group {
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
.input-group .input-group-addon, .input-group .form-control {
|
||||
border: 0 none;
|
||||
}
|
||||
.input-group .input-group-addon {
|
||||
border-left: 1px solid #dfdfdf;
|
||||
border-right: 1px solid #dfdfdf;
|
||||
}
|
||||
.input-group .form-control {
|
||||
background: none repeat scroll 0 0 #fff;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.rb-nav-tabs {
|
||||
border: 10px solid #dfdfdf;
|
||||
}
|
||||
.rb-nav-tabs li {
|
||||
width: 33.333%;
|
||||
}
|
||||
.rb-nav-tabs li:last-child {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
191
modules/comment/admin/skin.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-lg-3"><!-- 좌측영역 시작 -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading rb-icon">
|
||||
<div class="icon"><i class="fa kf kf-layout fa-2x"></i> </div>
|
||||
<h4 class="panel-title">테마 리스트</h4>
|
||||
</div>
|
||||
<div class="panel-body" style="border-top:1px solid #DEDEDE;">
|
||||
<div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<?php $i=0?>
|
||||
<?php $xdir = $g['path_module'].$module.'/theme/'?>
|
||||
<?php $tdir = $xdir.'_pc/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<?php $i++?>
|
||||
<tr>
|
||||
<td onclick="goHref('<?php echo $g['adm_href']?>&theme=_pc/<?php echo $skin?>');">
|
||||
<i class="fa fa-folder-o fa-lg"></i>
|
||||
<a href="#"><span class="<?php if($theme=='_pc/'.$skin):?>active<?php endif?>"><strong>[P]</strong><?php echo getFolderName($tdir.$skin)?></span></a><span class="id">(<?php echo $skin?>)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
<?php $tdir = $xdir.'_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<?php $i++?>
|
||||
<tr>
|
||||
<td onclick="goHref('<?php echo $g['adm_href']?>&theme=_mobile/<?php echo $skin?>');">
|
||||
<i class="fa fa-folder-o fa-lg"></i>
|
||||
<a href="#"><span class="<?php if($theme=='_mobile/'.$skin):?>active<?php endif?>"><strong>[M]</strong><?php echo getFolderName($tdir.$skin)?></span></a><span class="id">(<?php echo $skin?>)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if(!$i):?>
|
||||
<div class="none">등록된 테마가 없습니다.</div>
|
||||
<?php endif?>
|
||||
</div> <!-- .panel-body -->
|
||||
</div> <!-- 좌측 패널 끝 -->
|
||||
</div> <!-- 좌측 영역 끝 -->
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<div class="page-header">
|
||||
<h4>
|
||||
<?php if($theme):?>
|
||||
테마 세부설정 변수
|
||||
<div class="pull-right rb-top-btnbox hidden-xs">
|
||||
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=theme_delete&theme=<?php echo $theme?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 이 테마를 삭제하시겠습니까? ');">테마삭제</a>
|
||||
</div>
|
||||
<?php endif?>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<form name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="a" value="theme_config" />
|
||||
<input type="hidden" name="theme" value="<?php echo $theme?>" />
|
||||
|
||||
<?php if($theme):?>
|
||||
<div class="notice">
|
||||
<strong><?php echo getFolderName($xdir.$theme)?></strong> 테마가 선택되었습니다.<br />
|
||||
이 테마를 사용하는 모든 게시판에 아래의 설정값이 적용됩니다.
|
||||
</div>
|
||||
<div class="rb-files">
|
||||
<div class="rb-codeview">
|
||||
<div class="rb-codeview-header">
|
||||
<ol class="breadcrumb pull-left">
|
||||
<li>파일경로 :</li>
|
||||
<li>root</li>
|
||||
<li>modules</li>
|
||||
<li><?php echo $module?></li>
|
||||
<li>theme</li>
|
||||
<li><?php echo $theme?></li>
|
||||
<li>_var.php</li>
|
||||
</ol>
|
||||
<button type="button" class="btn btn-default btn-xs pull-right" data-tooltip="tooltip" title="전체화면" onclick="editFullSize('tab-edit-area',this);"><i class="fa fa-arrows-alt fa-lg"></i></button>
|
||||
</div>
|
||||
<div class="rb-codeview-body">
|
||||
<textarea name="theme_var" id="__code__" class="form-control" rows="35"><?php echo implode('',file($g['path_module'].$module.'/theme/'.$theme.'/_var.php'))?></textarea>
|
||||
</div>
|
||||
<div class="input-group hidden-xs">
|
||||
<span class="input-group-addon"><small>Theme Name</small></span>
|
||||
<input type="text" name="name" value="<?php echo getFolderName($g['path_module'].$module.'/theme/'.$theme)?>" class="form-control">
|
||||
|
||||
<span class="input-group-addon"><small>Theme Folder</small></span>
|
||||
<input type="text" name="newLayout" value="<?php echo $theme?>" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="rb-codeview-footer">
|
||||
<ul class="list-inline">
|
||||
<li><code><?php echo count(file($g['path_module'].$module.'/theme/'.$theme.'/_var.php')).' lines'?></code></li>
|
||||
<li><code><?php echo getSizeFormat(@filesize($g['path_module'].$module.'/theme/'.$theme.'/_var.php'),2).' Byte'?></code></li>
|
||||
<li class="pull-right">파일을 편집한 후 저장 버튼을 클릭하면 실시간으로 사용자 페이지에 적용됩니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div> <!--.rb-codeview -->
|
||||
</div> <!--.rb-files -->
|
||||
<div class="rb-submit">
|
||||
<button type="submit" class="btn btn-primary<?php if($g['device']):?> btn-block<?php endif?>">저장하기</button>
|
||||
</div>
|
||||
|
||||
<?php else:?>
|
||||
|
||||
<div class="help-block">
|
||||
테마가 선택되지 않았습니다. 테마를 선택해 주세요.<br />
|
||||
테마설정은 해당 테마를 사용하는 모든 게시판에 적용됩니다.
|
||||
</div>
|
||||
<div class="help-block">
|
||||
<ul class="list list-unstyled">
|
||||
<li>테마는 게시판의 외형을 변경할 수 있는 요소입니다.</li>
|
||||
<li>테마설정은 게시판의 외형만 제어하며 게시판의 내부시스템에는 영향을 주지 않습니다.</li>
|
||||
<li>테마의 속성을 변경하면 해당테마를 사용하는 모든 게시판에 적용됩니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php endif?>
|
||||
|
||||
</form>
|
||||
</div> <!-- 우측영역 끝 -->
|
||||
</div> <!--.row -->
|
||||
|
||||
<?php if($d['admin']['codeeidt']):?>
|
||||
<!-- codemirror -->
|
||||
<style>
|
||||
.CodeMirror {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
font-family: Menlo,Monaco,Consolas,"Courier New",monospace !important;
|
||||
}
|
||||
</style>
|
||||
<?php getImport('codemirror','codemirror',false,'css')?>
|
||||
<?php getImport('codemirror','codemirror',false,'js')?>
|
||||
<?php getImport('codemirror','theme/'.$d['admin']['codeeidt'],false,'css')?>
|
||||
<?php getImport('codemirror','addon/display/fullscreen',false,'css')?>
|
||||
<?php getImport('codemirror','addon/display/fullscreen',false,'js')?>
|
||||
<?php getImport('codemirror','mode/htmlmixed/htmlmixed',false,'js')?>
|
||||
<?php getImport('codemirror','mode/xml/xml',false,'js')?>
|
||||
<?php getImport('codemirror','mode/javascript/javascript',false,'js')?>
|
||||
<?php getImport('codemirror','mode/clike/clike',false,'js')?>
|
||||
<?php getImport('codemirror','mode/php/php',false,'js')?>
|
||||
<?php getImport('codemirror','mode/css/css',false,'js')?>
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(getId('__code__'), {
|
||||
mode: "<?php echo $codeset[$codeext]?$codeset[$codeext]:'application/x-httpd-php'?>",
|
||||
indentUnit: 4,
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
indentWithTabs: true,
|
||||
theme: '<?php echo $d['admin']['codeeidt']?>',
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
editor.setSize('100%','550px');
|
||||
_isCodeEdit = true;
|
||||
function _codefullscreen()
|
||||
{
|
||||
editor.setOption('fullScreen', !editor.getOption('fullScreen'));
|
||||
}
|
||||
</script>
|
||||
<!-- @codemirror -->
|
||||
<?php endif?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function saveCheck(f)
|
||||
{
|
||||
return confirm('정말로 실행하시겠습니까? ');
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
235
modules/comment/admin/theme.php
Normal file
@@ -0,0 +1,235 @@
|
||||
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
|
||||
<style>
|
||||
#__code__ {
|
||||
font-weight: normal;
|
||||
font-family: Menlo,Monaco,Consolas,"Courier New",monospace !important;
|
||||
}
|
||||
</style>
|
||||
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
|
||||
|
||||
<?php getImport('codemirror','lib/codemirror',false,'css')?>
|
||||
<?php getImport('codemirror','lib/codemirror',false,'js')?>
|
||||
<?php getImport('codemirror','theme/'.$d['admin']['codeeidt'],false,'css')?>
|
||||
<?php getImport('codemirror','addon/display/fullscreen',false,'css')?>
|
||||
<?php getImport('codemirror','addon/display/fullscreen',false,'js')?>
|
||||
<?php getImport('codemirror','mode/htmlmixed/htmlmixed',false,'js')?>
|
||||
<?php getImport('codemirror','mode/xml/xml',false,'js')?>
|
||||
<?php getImport('codemirror','mode/javascript/javascript',false,'js')?>
|
||||
<?php getImport('codemirror','mode/css/css',false,'js')?>
|
||||
<?php getImport('codemirror','mode/htmlmixed/htmlmixed',false,'js')?>
|
||||
<?php getImport('codemirror','mode/clike/clike',false,'js')?>
|
||||
<?php getImport('codemirror','mode/php/php',false,'js')?>
|
||||
|
||||
<div class="row no-gutters">
|
||||
<div class="col-sm-4 col-md-4 col-lg-3 d-none d-sm-block sidebar"><!-- 좌측영역 시작 -->
|
||||
<div class="card border-0">
|
||||
<div class="card-header f13">
|
||||
테마 리스트
|
||||
</div>
|
||||
|
||||
<div class="list-group list-group-flush">
|
||||
<?php $i=0?>
|
||||
<?php $xdir = $g['path_module'].$module.'/themes/'?>
|
||||
<?php $tdir = $xdir.'_desktop/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<?php $i++?>
|
||||
<a href="<?php echo $g['adm_href']?>&theme=_desktop/<?php echo $skin?>" class="list-group-item list-group-item-action d-flex align-items-center<?php if($theme=='_desktop/'.$skin):?> border border-primary<?php endif?>">
|
||||
<span><?php echo getFolderName($tdir.$skin)?></span>
|
||||
<span class="badge badge-<?php echo $theme=='_desktop/'.$skin?'primary':'dark' ?> badge-pill ml-auto"><?php echo $skin?></span>
|
||||
</a>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
<?php $tdir = $xdir.'_mobile/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<?php $i++?>
|
||||
<a href="<?php echo $g['adm_href']?>&theme=_mobile/<?php echo $skin?>" class="list-group-item list-group-item-action d-flex align-items-center<?php if($theme=='_mobile/'.$skin):?> border border-primary<?php endif?>">
|
||||
<span><?php echo getFolderName($tdir.$skin)?></span>
|
||||
<span class="badge badge-<?php echo $theme=='_mobile/'.$skin?'primary':'dark' ?> badge-pill ml-auto"><?php echo $skin?></span>
|
||||
</a>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</div>
|
||||
|
||||
<?php if(!$i):?>
|
||||
<div class="none">등록된 테마가 없습니다.</div>
|
||||
<?php endif?>
|
||||
|
||||
|
||||
</div> <!-- 좌측 card 끝 -->
|
||||
</div> <!-- 좌측 영역 끝 -->
|
||||
<div class="col-sm-8 col-md-8 col-lg-9 ml-sm-auto ">
|
||||
|
||||
<?php if($theme):?>
|
||||
<form class="card rounded-0 border-0" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
|
||||
<input type="hidden" name="r" value="<?php echo $r?>" />
|
||||
<input type="hidden" name="m" value="<?php echo $module?>" />
|
||||
<input type="hidden" name="a" value="theme_config" />
|
||||
<input type="hidden" name="theme" value="<?php echo $theme?>" />
|
||||
|
||||
<div class="card-header p-0 page-body-header">
|
||||
<ol class="breadcrumb rounded-0 mb-0 bg-transparent text-muted">
|
||||
<?php $_theme =explode('/' , $theme); ?>
|
||||
<li class="breadcrumb-item">root</li>
|
||||
<li class="breadcrumb-item">modules</li>
|
||||
<li class="breadcrumb-item"><?php echo $module?></li>
|
||||
<li class="breadcrumb-item">themes</li>
|
||||
<li class="breadcrumb-item"><?php echo $_theme[0]?></li>
|
||||
<li class="breadcrumb-item"><?php echo $_theme[1]?></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link js-tooltip<?php if(!$_COOKIE['moduleBbsThemeTab']||$_COOKIE['moduleBbsThemeTab']=='readme'):?> active<?php endif?>" href="#readme" data-toggle="tab" onclick="setCookie('moduleBbsThemeTab','readme',1);" title="README.md" data-placement="bottom">
|
||||
안내문서
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item editor">
|
||||
<a class="nav-link js-tooltip<?php if($_COOKIE['moduleBbsThemeTab']=='editor'):?> active<?php endif?>" href="#var" data-toggle="tab" onclick="setCookie('moduleBbsThemeTab','editor','1');" title="_var.php" data-placement="bottom">
|
||||
설정 변수
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane <?php if(!$_COOKIE['moduleBbsThemeTab']||$_COOKIE['moduleBbsThemeTab']=='readme'):?> show active<?php endif?>" id="readme" role="tabpanel" aria-labelledby="readme-tab">
|
||||
|
||||
<?php if (is_file($g['path_module'].$module.'/themes/'.$theme.'/README.md')): ?>
|
||||
<div class="markdown-body px-4 py-0 readme">
|
||||
<?php readfile($g['path_module'].$module.'/themes/'.$theme.'/README.md')?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
||||
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
|
||||
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
|
||||
<p>테마 안내문서가 없습니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_file($g['path_module'].$module.'/themes/'.$theme.'/LICENSE')): ?>
|
||||
<div class="py-5 px-4">
|
||||
<h5>라이센스</h5>
|
||||
<textarea class="form-control" rows="10"><?php readfile($g['path_module'].$module.'/themes/'.$theme.'/LICENSE')?></textarea>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pr-2<?php if($_COOKIE['moduleBbsThemeTab']=='editor'):?> show active<?php endif?>" id="var" role="tabpanel" aria-labelledby="var-tab">
|
||||
|
||||
<div class="">
|
||||
<div class="rb-codeview">
|
||||
<div class="rb-codeview-body">
|
||||
<textarea name="theme_var" id="__code__" class="form-control" rows="30"><?php echo implode('',file($g['path_module'].$module.'/themes/'.$theme.'/_var.php'))?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="rb-codeview-footer p-2">
|
||||
<div class="form-row mb-2">
|
||||
<div class="col pt-2 text-muted">
|
||||
테마명 : <?php echo getFolderName($g['path_module'].$module.'/themes/'.$theme)?>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
</div>
|
||||
<div class="col text-right pt-2 text-muted">
|
||||
<small><?php echo count(file($g['path_module'].$module.'/themes/'.$theme.'/_var.php')).' lines'?></small></li>
|
||||
<small class="ml-3"><?php echo getSizeFormat(@filesize($g['path_module'].$module.'/themes/'.$theme.'/_var.php'),2)?></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--.rb-codeview -->
|
||||
</div> <!--.rb-files -->
|
||||
<div class="card-footer">
|
||||
|
||||
<button type="submit" class="btn btn-outline-primary">저장하기</button>
|
||||
<span class="ml-3 text-muted">이 테마를 사용하는 모든 댓글목록에 위의 설정값이 적용됩니다.</span>
|
||||
<?php if($theme):?>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-outline-danger" href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $module?>&a=theme_delete&theme=<?php echo $theme?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 이 테마를 삭제하시겠습니까? ');">테마삭제</a>
|
||||
</div>
|
||||
<?php endif?>
|
||||
|
||||
</div>
|
||||
</div><!-- /.tab-pane -->
|
||||
|
||||
</div><!-- /.tab-content -->
|
||||
|
||||
|
||||
|
||||
<?php else:?>
|
||||
|
||||
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
|
||||
<div class="">
|
||||
<i class="fa fa fa-picture-o fa-3x mb-3" aria-hidden="true"></i>
|
||||
<p>테마를 선택해 주세요.</p>
|
||||
<p class="small">테마설정은 해당 테마를 사용하는 모든 댓글목록에 적용됩니다.</p>
|
||||
|
||||
<ul class="list list-unstyled small">
|
||||
<li>테마는 댓글목록의 외형을 변경할 수 있는 요소입니다.</li>
|
||||
<li>테마설정은 댓글목록의 외형만 제어하며 댓글목록의 내부시스템에는 영향을 주지 않습니다.</li>
|
||||
<li>테마의 속성을 변경하면 해당테마를 사용하는 모든 댓글목록에 적용됩니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php endif?>
|
||||
|
||||
</form>
|
||||
</div> <!-- 우측영역 끝 -->
|
||||
</div> <!--.row -->
|
||||
|
||||
|
||||
<?php if($d['admin']['codeeidt'] && $theme):?>
|
||||
<!-- codemirror -->
|
||||
<style>
|
||||
.CodeMirror {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
font-family: Menlo,Monaco,Consolas,"Courier New",monospace !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
(function() {
|
||||
$(".markdown-body").markdown();
|
||||
|
||||
putCookieAlert('result_comment_theme') // 실행결과 알림 메시지 출력
|
||||
|
||||
var editor = CodeMirror.fromTextArea(getId('__code__'), {
|
||||
mode: "<?php echo $codeset[$codeext]?$codeset[$codeext]:'application/x-httpd-php'?>",
|
||||
indentUnit: 2,
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
indentWithTabs: true,
|
||||
theme: '<?php echo $d['admin']['codeeidt']?>'
|
||||
});
|
||||
editor.setSize('100%','500px');
|
||||
_isCodeEdit = true;
|
||||
})();
|
||||
|
||||
</script>
|
||||
<!-- @codemirror -->
|
||||
<?php endif?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function saveCheck(f)
|
||||
{
|
||||
return confirm('정말로 실행하시겠습니까? ');
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
29
modules/comment/admin/var/var.joint.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<div id="mjointbox">
|
||||
|
||||
<div class="title">
|
||||
이 모듈(댓글)을 연결하시겠습니까?
|
||||
</div>
|
||||
|
||||
<select id="comment_skin" class="form-control custom-select">
|
||||
<option value=""> + 댓글 대표테마</option>
|
||||
<option value="" disabled>--------------------------------</option>
|
||||
<?php $tdir = $g['path_module'].$smodule.'/themes/_desktop/'?>
|
||||
<?php $dirs = opendir($tdir)?>
|
||||
<?php while(false !== ($skin = readdir($dirs))):?>
|
||||
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
|
||||
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>">ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
|
||||
<?php endwhile?>
|
||||
<?php closedir($dirs)?>
|
||||
</select>
|
||||
|
||||
<input type="checkbox" id="hidepost" value="1" /> 최근댓글 출력제외
|
||||
|
||||
<input type="button" value="연결" class="btn btn-light" onclick="dropJoint('<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $smodule?>'+(getId('comment_skin').value!=''?'&skin='+getId('comment_skin').value:'')+(getId('hidepost').checked==true?'&hidepost=1':'')+'&sync=Y');" />
|
||||
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
#mjointbox {}
|
||||
#mjointbox select {width:150px;padding:2px;}
|
||||
#mjointbox .title {border-bottom:#dfdfdf dashed 1px;padding:0 0 10px 0;margin:0 0 20px 0;}
|
||||
</style>
|
||||
7
modules/comment/admin/var/var.menu.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$d['amenu']['config'] = '환경설정';
|
||||
$d['amenu']['main'] = '댓글';
|
||||
$d['amenu']['oneline'] = '한줄의견';
|
||||
$d['amenu']['notidoc'] = '알림양식';
|
||||
$d['amenu']['theme'] = '테마';
|
||||
?>
|
||||
192
modules/comment/includes/base.class.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
// Rb DB 객체화
|
||||
Class comment_DB{
|
||||
|
||||
public $changeQue;
|
||||
|
||||
public function query($sql){
|
||||
global $DB_CONNECT;
|
||||
$change_result=$this->changeQue=db_query($sql,$DB_CONNECT);
|
||||
return $change_result;
|
||||
}
|
||||
|
||||
public function fetch_assoc($result){
|
||||
$change_result=$this->changeQue=db_fetch_assoc($result);
|
||||
return $change_result;
|
||||
}
|
||||
|
||||
public function fetch_array($result){
|
||||
$change_result=$this->changeQue=db_fetch_array($result);
|
||||
return $change_result;
|
||||
}
|
||||
|
||||
public function num_rows($result){
|
||||
$change_result=$this->changeQue=db_num_rows($result);
|
||||
return $change_result;
|
||||
}
|
||||
|
||||
// 문자열 escape
|
||||
public function real_escape_string($string){
|
||||
global $DB_CONNECT;
|
||||
return mysqli_real_escape_string($DB_CONNECT,$string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 모듈 기본환경 설정
|
||||
class Comment_base {
|
||||
public $module;
|
||||
|
||||
public function __construct() {
|
||||
global $g,$table;
|
||||
|
||||
$this->module = 'comment';
|
||||
$this->commentTable = $table['s_comment'];
|
||||
$this->onelineTable = $table['s_oneline'];
|
||||
$this->opinionTable = $table['s_opinion'];
|
||||
$this->uploadTable = $table['s_upload'];
|
||||
$this->db=new comment_DB();
|
||||
}
|
||||
|
||||
// 테이블명 추출
|
||||
public function table($lastname){
|
||||
global $table;
|
||||
return $table[$this->module.$lastname];
|
||||
}
|
||||
|
||||
// mobile 여부 값 추출
|
||||
public function is_mobile(){
|
||||
global $g;
|
||||
|
||||
if($g['mobile']&&$_SESSION['pcmode']!='Y') return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
// device 정보 추출
|
||||
public function getUserAgent(){
|
||||
$device = '';
|
||||
$result = array();
|
||||
|
||||
if( stristr($_SERVER['HTTP_USER_AGENT'],'ipad') ) {
|
||||
$device = "ipad";
|
||||
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'iphone') || strstr($_SERVER['HTTP_USER_AGENT'],'iphone') ) {
|
||||
$device = "iphone";
|
||||
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'blackberry') ) {
|
||||
$device = "blackberry";
|
||||
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'android') ) {
|
||||
$device = "android";
|
||||
}
|
||||
|
||||
if( $device ) {
|
||||
return $device;
|
||||
} return false; {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAssoc($query){
|
||||
$rows=array();
|
||||
$result=$this->db->query($query);
|
||||
while ($row=$this->db->fetch_assoc($result)) $rows[]=$row;
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function getArray($query){
|
||||
$rows=array();
|
||||
$result=$this->db->query($query);
|
||||
while ($row=$this->db->fetch_array($result)) $rows[]=$row;
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function getRows($query){
|
||||
$result=$this->db->query($query);
|
||||
$rows=$this->db->num_rows($result);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
// uid 기준 row 데이타 추출
|
||||
public function getUidData($table,$uid){
|
||||
$query= sprintf("SELECT * FROM `%s` WHERE `uid` = %s",$table,$this->db->real_escape_string($uid));
|
||||
$rows = $this->getArray($query);
|
||||
|
||||
return $rows[0];
|
||||
}
|
||||
|
||||
// 숫자 변경 함수
|
||||
public function formatWithSuffix($input)
|
||||
{
|
||||
$suffixes = array('', 'K', 'M', 'G', 'T');
|
||||
$suffixIndex = 0;
|
||||
|
||||
while(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes))
|
||||
{
|
||||
$suffixIndex++;
|
||||
$input /= 1000;
|
||||
}
|
||||
|
||||
return (
|
||||
$input > 0
|
||||
// precision of 3 decimal places
|
||||
? floor($input * 1000) / 1000
|
||||
: ceil($input * 1000) / 1000
|
||||
)
|
||||
. $suffixes[$suffixIndex];
|
||||
}
|
||||
|
||||
// 사용자 입력내용 중 해시태그 분리 함수
|
||||
public function gethashtags($text)
|
||||
{
|
||||
//Match the hashtags
|
||||
preg_match_all('/(^|[^0-9a-zA-Z가-힣_])#([0-9a-zA-Z가-힣]+)/i', $text, $matchedHashtags);
|
||||
$hashtag = '';
|
||||
// For each hashtag, strip all characters but alpha numeric
|
||||
if(!empty($matchedHashtags[0])) {
|
||||
foreach($matchedHashtags[0] as $match) {
|
||||
$hashtag .= preg_replace("/[^0-9a-zA-Z가-힣]+/i", "", $match).',';
|
||||
}
|
||||
}
|
||||
//to remove last comma in a string
|
||||
return rtrim($hashtag, ',');
|
||||
}
|
||||
|
||||
// 해시태그 분리하여 링크 추가 함수
|
||||
public function addLink_hashtag($message)
|
||||
{
|
||||
global $g;
|
||||
|
||||
$parsedMessage = preg_replace(array('/(?i)\b((?:https?:\/\/|www\d{0,3}[.]|[0-9a-zA-Z가-힣.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))/', '/(^|[^0-9a-zA-Z가-힣_])@([0-9a-zA-Z가-힣_]+)/i', '/(^|[^0-9a-zA-Z가-힣_])#([0-9a-zA-Z가-힣_]+)/i'), array('<a href="$1" target="_blank">$1</a>', '$1<a href="">@$2</a>', '$1<a class="hash-alink" href="'.$g['s'].'/?m=sns&mod=search&tag=$2">#$2</a>'), $message);
|
||||
return $parsedMessage;
|
||||
}
|
||||
|
||||
|
||||
// 지난 시간 얻기 함수
|
||||
public function getJNTime($d_regis)
|
||||
{
|
||||
global $g;
|
||||
//include $g['path_core'].'function/sys.func.php';
|
||||
// 최근 이슈 경과 시간 추출
|
||||
$dnowdate=date("Y-m-j G:i:s");// 오늘 날짜
|
||||
$ddate=getDateFormat($d_regis,'Y-m-j G:i:s');//Last-ay
|
||||
$timediffer=strtotime($dnowdate) - strtotime("$ddate GMT"); // 기준일과 오늘의 시간(초) 차이
|
||||
$dval=$timediffer+32400;
|
||||
if((60>$dval && $dval>0)||!$dval){
|
||||
$JN_time=date('s 초 전',$timediffer);
|
||||
}elseif(3600>$dval&& $dval>60){
|
||||
$JN_time=date('i 분 전',$timediffer);
|
||||
}elseif(86400>$dval && $dval>3600){
|
||||
$JN_time=date('G 시간 전',$timediffer);
|
||||
}elseif(2592000>$dval && $dval>86400){
|
||||
$JN_time=date('j 일 전',$timediffer);
|
||||
}elseif(31104000>$dval && $dval>2592000){
|
||||
$JN_time=date('n 개월 전',$timediffer);
|
||||
}else{
|
||||
$JN_time='-';
|
||||
}
|
||||
return $JN_time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
28
modules/comment/includes/define.path.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$g['dir_include']=$g['dir_module'].'includes/';
|
||||
|
||||
if($g['mobile']&&$_SESSION['pcmode']!='Y'){
|
||||
$d['ad']['skin']=$d['ad']['skin_mobile'];
|
||||
$d['ad']['layout']=$d['ad']['layout_mobile'];
|
||||
}else{
|
||||
$d['ad']['skin']=$d['ad']['skin_main'];
|
||||
$d['ad']['layout']=$d['ad']['layout_main'];
|
||||
}
|
||||
// 모듈 theme 패스
|
||||
$g['dir_module_skin'] = $g['dir_module'].'themes/'.$d['ad']['skin'].'/';
|
||||
$g['url_module_skin'] = $g['url_module'].'/themes/'.$d['ad']['skin'];
|
||||
$g['img_module_skin'] = $g['url_module_skin'].'/images';
|
||||
|
||||
// 레이아아웃 패스
|
||||
$g['dir_layout'] = $g['path_layout'].$d['ad']['layout'].'/';
|
||||
$g['url_layout'] = $g['s'].'/layouts/'.$d['ad']['layout'];
|
||||
$g['img_layout'] = $g['url_layout'].'/_images';
|
||||
|
||||
// bsas.class.php skin class 에 필요
|
||||
$CONF['theme_path']=$g['dir_module'].'themes';
|
||||
$CONF['theme_name']=$d['ad']['skin'];
|
||||
|
||||
// class 인클루드
|
||||
require_once $g['dir_include'].'base.class.php';
|
||||
require_once $g['dir_include'].'module.class.php';
|
||||
?>
|
||||
434
modules/comment/includes/module.class.php
Normal file
@@ -0,0 +1,434 @@
|
||||
<?php
|
||||
|
||||
class Comment extends Comment_base{
|
||||
public $parent;
|
||||
public $parent_table;
|
||||
public $theme_name;
|
||||
public $recnum; // 출력 기본 값
|
||||
public $sort;
|
||||
public $orderby;
|
||||
public $oneline_recnum = 5;
|
||||
|
||||
// 테마 패스 추출함수
|
||||
public function getThemePath($type){
|
||||
global $g;
|
||||
|
||||
if($type=='relative') $result = $g['path_module'].$this->module.'/themes/'.$this->theme_name;
|
||||
else if($type=='absolute') $result = $g['url_root'].'/modules/'.$this->module.'/themes/'.$this->theme_name;
|
||||
|
||||
return $result;
|
||||
}
|
||||
// get html & replace-parse
|
||||
public function getHtml($fileName) {
|
||||
global $g,$TMPL;
|
||||
$theme_path = $this->getThemePath('relative');
|
||||
$file = sprintf($theme_path.'/html/%s.html', $fileName);
|
||||
$fh_skin = fopen($file, 'r');
|
||||
$skin = @fread($fh_skin, filesize($file));
|
||||
fclose($fh_skin);
|
||||
//return $skin;
|
||||
return $this->getParseHtml($skin);
|
||||
}
|
||||
|
||||
public function getParseHtml($skin) {
|
||||
global $TMPL;
|
||||
// $skin = preg_replace_callback('/{\$lng->(.+?)}/i', create_function('$matches', 'global $LNG; return $LNG[$matches[1]];'), $skin);
|
||||
$skin = preg_replace_callback('/{\$([a-zA-Z0-9_]+)}/', create_function('$matches', 'global $TMPL; return (isset($TMPL[$matches[1]])?$TMPL[$matches[1]]:"");'), $skin);
|
||||
|
||||
return $skin;
|
||||
}
|
||||
|
||||
// 이모티콘 리스트 추출 함수
|
||||
public function getEmoticonList($parent){
|
||||
global $g;
|
||||
$m = $this->module;
|
||||
$theme_path = $this->getThemePath('absolute');
|
||||
$emo_array=array("sunglass","smile","sleep","shock","love","laugh","joke","cry");
|
||||
$emo_folder = $theme_path.'/images/emoticon';
|
||||
$emo_list ='<ul>';
|
||||
foreach ($emo_array as $emo) {
|
||||
$emo_list .='<li data-role="insert-emoticon" data-emotion="'.$emo.'" data-parent="'.$parent.'"><img src="'.$emo_folder.'/emo_'.$emo.'.png" /></li>';
|
||||
}
|
||||
$emo_list .='</ul>';
|
||||
|
||||
return $emo_list;
|
||||
}
|
||||
|
||||
|
||||
// 전체 페이지 값 추출
|
||||
public function getTotalData($parent,$recnum,$type,$data,$notice){
|
||||
global $s,$table;
|
||||
if($type=='comment'){
|
||||
$_wh = $this->getCommentWhere($parent,$notice);
|
||||
$query = sprintf("SELECT uid FROM `%s` WHERE %s", $this->commentTable,$_wh);
|
||||
}
|
||||
else if($type=='oneline'){
|
||||
$_wh = $this->getOnelineWhere($parent);
|
||||
$query = sprintf("SELECT uid FROM `%s` WHERE %s", $this->onelineTable,$_wh);
|
||||
}
|
||||
|
||||
$result=array();
|
||||
$total_row = $this->getRows($query);
|
||||
$result['row'] = $total_row;// 전체 row 합계
|
||||
$result['page'] = ceil($total_row/$recnum); // 전체 페이지
|
||||
|
||||
return $result[$data];
|
||||
}
|
||||
|
||||
// chat 쿼리 추출
|
||||
public function getCommentWhere($parent,$notice){
|
||||
global $s;
|
||||
$_parent = str_replace('-','',$parent);
|
||||
$where = "site='".$s."' and notice=".$notice." and parent='".$_parent."'";
|
||||
return $where;
|
||||
}
|
||||
|
||||
// 챗팅 history 추출 함수
|
||||
public function getCommentLog($parent,$sort,$orderby,$recnum,$page,$notice){
|
||||
global $table,$s;
|
||||
$parent = $this->db->real_escape_string($parent);
|
||||
$page = $page?$page:1;
|
||||
$sort = $sort?$sort:$this->sort;
|
||||
$orderby = $orderby?$orderby:$this->orderby;
|
||||
$recnum = $recnum?$recnum:$this->recnum;
|
||||
$_wh = $this->getCommentWhere($parent,$notice);
|
||||
$limit=(($page-1)*$recnum).','.$recnum;
|
||||
$query = sprintf("SELECT * FROM `%s` WHERE %s ORDER BY `%s` %s LIMIT %s", $this->commentTable,$_wh,$sort,$orderby,$limit);
|
||||
$rows = $this->getAssoc($query);
|
||||
$commentLog ='';
|
||||
foreach($rows as $row) {
|
||||
$commentLog .= $this->getCommentRow($row,$page,$notice);
|
||||
}
|
||||
return $commentLog;
|
||||
|
||||
}
|
||||
|
||||
// 채팅 history row 추출 함수
|
||||
public function getCommentRow($row,$page,$notice){
|
||||
|
||||
global $TMPL,$my,$g,$d,$_HS;
|
||||
include_once $g['path_module'].$this->module.'/var/var.php';
|
||||
|
||||
$sync_arr = explode('|',$row['sync']); // parent_table|parent|parentmbr
|
||||
$TMPL['grant_uid'] = $sync_arr[2]; // 댓글 부모 PK
|
||||
$TMPL['comment_content'] = getContents($row['content'],'HTML');
|
||||
$TMPL['comment_user_name'] = $row[$_HS['nametype']]?$row[$_HS['nametype']]:'손님';
|
||||
$TMPL['comment_user_pic'] = $this->getUserAvatar($row['mbruid'],'src');
|
||||
$TMPL['comment_user_uid'] = $row['mbruid'];
|
||||
$TMPL['comment_user_nic'] = getProfileInfo($row['mbruid'],'nic');
|
||||
$TMPL['comment_user_url'] = getProfileLink($row['mbruid']);
|
||||
$TMPL['comment_like_total'] = ($row['likes']==0)?'':$row['likes'];
|
||||
$TMPL['comment_uid'] = $row['uid'];
|
||||
$TMPL['comment_regis_time'] = getDateFormat($row['d_modify']?$row['d_modify']:$row['d_regis'],'Y.m.d H:i');
|
||||
$TMPL['comment_regis_ago'] = getDateFormat($row['d_modify']?$row['d_modify']:$row['d_regis'],'c');
|
||||
$TMPL['comment_getNew'] = $this->getNew($row['d_modify']?$row['d_modify']:$row['d_regis'],$d['comment']['newtime']);
|
||||
$TMPL['comment_getNoitce'] = $row['notice']?'true':'false';
|
||||
$TMPL['comment_getIsNoitce'] = $row['notice']?'':'d-none';
|
||||
$TMPL['comment_getHidden'] = $row['hidden']?'true':'false';
|
||||
$TMPL['comment_getIsLiked'] = $this->getIsLiked('comment',$row['uid'],'like');
|
||||
$TMPL['comment_getIsDisliked'] = $this->getIsLiked('comment',$row['uid'],'dislike');
|
||||
$TMPL['comment_page'] = $page;
|
||||
$TMPL['oneline_rows'] = $this->getOnelineLog($row['uid'],1,$this->oneline_recnum);
|
||||
$TMPL['uid'] = $row['uid'];
|
||||
$TMPL['entry_type'] = 'comment';
|
||||
$TMPL['entry_parent'] = $sync_arr[1].$sync_arr[2];
|
||||
$TMPL['comment_parent'] =$this->parent;
|
||||
$TMPL['total_page'] = $this->getTotalData($sync_arr[1].$sync_arr[2],$this->recnum,'comment','page',$notice);
|
||||
|
||||
$TMPL['oneline_num'] = $row['oneline'];
|
||||
$TMPL['oneline_button'] = $row['oneline']?$this->getHtml('oneline_button'):'';
|
||||
|
||||
$my_menu = $this->getHtml('my_menu');
|
||||
$btn_showHideMenu = $this->getHtml('btn_showHideMenu');
|
||||
|
||||
// 타인 채팅 삭제 메뉴 노출 여부값
|
||||
if($my['uid'] == $row['mbruid']||$my['admin']){
|
||||
$TMPL['btn_showHideMenu'] = $btn_showHideMenu;
|
||||
$TMPL['my_menu'] = $my_menu;
|
||||
}
|
||||
else{
|
||||
$TMPL['btn_showHideMenu'] = '';
|
||||
$TMPL['my_menu'] = '';
|
||||
}
|
||||
|
||||
// 수정모드 버튼
|
||||
$TMPL['btn_editMod'] = $this->getHtml('btn_editMod');
|
||||
|
||||
$commentRow = $this->getHtml('comment_row');
|
||||
|
||||
if ($row['hidden']) {
|
||||
if ($my['uid'] != $row['mbruid'] && !$my['admin']) {
|
||||
$commentRow = $this->getHtml('comment_row_hidden');
|
||||
}
|
||||
}
|
||||
|
||||
return $commentRow;
|
||||
}
|
||||
|
||||
// chat 쿼리 추출
|
||||
public function getOnelineWhere($parent){
|
||||
global $s;
|
||||
$where = "site='".$s."' and parent='".$parent."'";
|
||||
return $where;
|
||||
}
|
||||
|
||||
// 챗팅 history 추출 함수
|
||||
public function getOnelineLog($parent,$page,$recnum){
|
||||
global $table,$s;
|
||||
$parent = $this->db->real_escape_string($parent);
|
||||
$page = $page?$page:1;
|
||||
$recnum = $recnum?$recnum:$this->oneline_recnum;
|
||||
$_wh = $this->getOnelineWhere($parent);
|
||||
$limit=(($page-1)*$recnum).','.$recnum;
|
||||
$query = sprintf("SELECT * FROM `%s` WHERE %s ORDER BY `uid` DESC LIMIT %s", $this->onelineTable,$_wh,$limit);
|
||||
$rows = $this->getAssoc($query);
|
||||
$onelineLog ='';
|
||||
foreach($rows as $row) {
|
||||
$onelineLog .= $this->getOnelineRow($row,$page);
|
||||
}
|
||||
return $onelineLog;
|
||||
|
||||
}
|
||||
// 채팅 history row 추출 함수
|
||||
public function getOnelineRow($row,$page){
|
||||
global $TMPL,$my,$g,$d,$_HS;
|
||||
include_once $g['path_module'].$this->module.'/var/var.php';
|
||||
|
||||
$TMPL['oneline_content'] = $this->getPrintContent($row);
|
||||
$TMPL['oneline_user_name'] = $row[$_HS['nametype']]?$row[$_HS['nametype']]:'손님';
|
||||
$TMPL['oneline_user_pic'] = $this->getUserAvatar($row['mbruid'],'src');
|
||||
$TMPL['oneline_like_total'] = $row['likes']?$row['likes']:0;
|
||||
$TMPL['oneline_uid'] = $row['uid'];
|
||||
$TMPL['oneline_regis_time'] = getDateFormat($row['d_modify']?$row['d_modify']:$row['d_regis'],'Y.m.d H:i');
|
||||
$TMPL['oneline_regis_ago'] = getDateFormat($row['d_modify']?$row['d_modify']:$row['d_regis'],'c');
|
||||
$TMPL['oneline_getNew'] = $this->getNew($row['d_modify']?$row['d_modify']:$row['d_regis'],$d['comment']['newtime']);
|
||||
$TMPL['oneline_getHidden'] = $row['hidden']?'true':'false';
|
||||
$TMPL['oneline_page'] = $page;
|
||||
$TMPL['oneline_rows'] = $this->getOnelineLog($row['uid'],1,$this->oneline_recnum);
|
||||
$TMPL['uid'] = $row['uid'];
|
||||
$TMPL['entry_type'] = 'oneline';
|
||||
$TMPL['entry_parent'] = $row['parent'];
|
||||
$TMPL['parent'] = $row['parent'];
|
||||
|
||||
$my_menu = $this->getHtml('my_menu');
|
||||
$btn_showHideMenu = $this->getHtml('btn_showHideMenu');
|
||||
|
||||
// 타인 채팅 삭제 메뉴 노출 여부값
|
||||
if($my['uid'] == $row['mbruid']||$my['admin']){
|
||||
$TMPL['btn_showHideMenu'] = $btn_showHideMenu;
|
||||
$TMPL['my_menu'] = $my_menu;
|
||||
}
|
||||
else{
|
||||
$TMPL['btn_showHideMenu'] = '';
|
||||
$TMPL['my_menu'] = '';
|
||||
}
|
||||
|
||||
// 수정모드 버튼
|
||||
$TMPL['btn_editMod'] = $this->getHtml('btn_editMod');
|
||||
$onelineRow = $this->getHtml('oneline_row');
|
||||
|
||||
if ($row['hidden']) {
|
||||
if ($my['uid'] != $row['mbruid'] && !$my['admin']) {
|
||||
$onelineRow = $this->getHtml('oneline_row_hidden');
|
||||
}
|
||||
}
|
||||
|
||||
return $onelineRow;
|
||||
}
|
||||
|
||||
// User 아바타 src 추출
|
||||
public function getUserAvatar($mbruid,$type){
|
||||
global $g,$table;
|
||||
|
||||
$M = getDbData($table['s_mbrdata'],'memberuid='.$mbruid,'photo');
|
||||
if($M['photo']) {
|
||||
|
||||
$_array=explode('.',$M['photo']);
|
||||
$name=$_array[0];
|
||||
$ext=$_array[1];
|
||||
$size='150x150';
|
||||
$user_avatar_src=$g['s'].'/avatar/'.$name.'_'.$size.'.'.$ext;
|
||||
}
|
||||
else $user_avatar_src = $g['s'].'/files/avatar/0.svg';
|
||||
|
||||
$result['src']=$user_avatar_src;
|
||||
|
||||
return $result[$type];
|
||||
}
|
||||
|
||||
// content 출력함수
|
||||
function getPrintContent($R){
|
||||
$content = str_replace("\"","'",$R['content']);
|
||||
return getContents($content,$R['html']);
|
||||
}
|
||||
|
||||
// 지난 시간 얻기 함수
|
||||
function getJNTime($d_regis)
|
||||
{
|
||||
$dnowdate=date("Y-m-j G:i:s");// 오늘 날짜
|
||||
$ddate=getDateFormat($d_regis,'Y-m-j G:i:s');//Last-ay
|
||||
$timediffer=strtotime($dnowdate) - strtotime("$ddate GMT"); // 기준일과 오늘의 시간(초) 차이
|
||||
$dval=$timediffer+32400;
|
||||
if((60>$dval && $dval>0)||!$dval){
|
||||
$JN_time=date('s초 전',$timediffer);
|
||||
}elseif(3600>$dval&& $dval>60){
|
||||
$JN_time=date('i분 전',$timediffer);
|
||||
}elseif(86400>$dval && $dval>3600){
|
||||
$JN_time=date('G시간 전',$timediffer);
|
||||
}elseif(2592000>$dval && $dval>86400){
|
||||
$JN_time=date('j일 전',$timediffer);
|
||||
}elseif(31104000>$dval && $dval>2592000){
|
||||
$JN_time=date('n개월 전',$timediffer);
|
||||
}else{
|
||||
$JN_time='-';
|
||||
}
|
||||
return $JN_time;
|
||||
}
|
||||
|
||||
//시간비교
|
||||
function getNew($time,$term)
|
||||
{
|
||||
if(!$time) return false;
|
||||
$dtime = date('YmdHis',mktime(substr($time,8,2)+$term,substr($time,10,2),substr($time,12,2),substr($time,4,2),substr($time,6,2),substr($time,0,4)));
|
||||
if ($dtime > $GLOBALS['date']['totime']) return 'rb-new';
|
||||
else return '';
|
||||
}
|
||||
|
||||
// 로그인한 사용자가 좋아요/싫어요를 했는지 여부 체크
|
||||
function getIsLiked($type,$entry,$opinion)
|
||||
{
|
||||
global $my,$table;
|
||||
$check_qry = "mbruid='".$my['uid']."' and module='".$type."' and entry='".$entry."' and opinion='".$opinion."'";
|
||||
$is_liked = getDbRows($table['s_opinion'],$check_qry);
|
||||
if ($is_liked) return 'active';
|
||||
else return '';
|
||||
}
|
||||
|
||||
|
||||
// 댓글삭제 함수
|
||||
public function deleteComment($uid){
|
||||
global $table,$d,$g,$date;
|
||||
include_once $g['path_module'].$this->module.'/var/var.php';
|
||||
$R = getUidData($this->commentTable,$uid);
|
||||
$sync_arr = explode('|',$R['sync']); // parent_table|parent|parentmbr
|
||||
$parent_table = $sync_arr[0]; // 댓글 부모 테이블
|
||||
$parent_module = $sync_arr[1];
|
||||
$parent_uid = $sync_arr[2]; // 댓글 부모 PK
|
||||
|
||||
$result='';
|
||||
|
||||
if($R['oneline']&&$d['comment']['commentdel']){
|
||||
$result = '한줄의견이 있는 댓글은 삭제할 수 없습니다.';
|
||||
}else{
|
||||
// 부모 테이블에 업데이트
|
||||
getDbUpdate($parent_table,'comment=comment-1','uid='.$parent_uid);
|
||||
|
||||
// 한줄의견 삭제
|
||||
$OCD = getDbSelect($this->onelineTable,'parent='.$uid,'uid');
|
||||
while($O=db_fetch_array($OCD)){
|
||||
getDbDelete($this->onelineTable,'uid='.$O['uid']); // 한줄의견 삭제
|
||||
getDbUpdate($parent_table,'oneline=oneline-1','uid='.$parent_uid); // 댓글의 부모 테이블 업데이트
|
||||
}
|
||||
|
||||
// 평가 삭제
|
||||
if ($R['likes'] || $R['dislikes']) getDbDelete($table['s_opinion'],'entry='.$uid);
|
||||
|
||||
// 자신(댓글) 삭제
|
||||
getDbDelete($this->commentTable,'uid='.$R['uid']);
|
||||
|
||||
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
// 연동모듈 댓글통계 반영
|
||||
getDbUpdate($table['s_mbrmonth'],'post_comment=post_comment-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and mbruid='.$R['parentmbr']); //부모글 등록자 월별 조회수 갱신
|
||||
getDbUpdate($table['s_mbrday'],'post_comment=post_comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and mbruid='.$R['parentmbr']); //부모글 등록자 일별조회수 갱신
|
||||
getDbUpdate($table[$parent_module.'month'],'comment=comment-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and data='.$parent_uid); //연동모듈 월별 조회수 갱신
|
||||
getDbUpdate($table[$parent_module.'day'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and data='.$parent_uid); //연동모듈 일별 조회수 갱신
|
||||
|
||||
$result='OK';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// 한줄의견 삭제 함수
|
||||
public function deleteOneline($parent_uid,$uid){
|
||||
global $table,$date;
|
||||
$C = getDbData($this->commentTable,'uid='.$parent_uid,'sync');
|
||||
$sync_arr = explode('|',$C['sync']);
|
||||
$grant_table = $sync_arr[0];
|
||||
$grant_uid = $sync_arr[2];
|
||||
|
||||
$R = getDbData($this->onelineTable,'uid='.$uid,'*');
|
||||
getDbDelete($this->onelineTable,'uid='.$R['uid']); // 한줄의견 삭제
|
||||
getDbUpdate($this->commentTable,'oneline=oneline-1','uid='.$parent_uid); // 댓글 테이블 업데이트
|
||||
getDbUpdate($grant_table,'oneline=oneline-1','uid='.$grant_uid); // 댓글의 부모 테이블 업데이트
|
||||
|
||||
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
|
||||
|
||||
// 평가 삭제
|
||||
if ($R['likes'] || $R['dislikes']) getDbDelete($table['s_opinion'],'entry='.$uid);
|
||||
|
||||
if ($R['point']&&$R['mbruid'])
|
||||
{
|
||||
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','한줄의견삭제(".getStrCut(str_replace('&',' ',strip_tags($R['content'])),15,'').")환원','".$date['totime']."'");
|
||||
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
|
||||
}
|
||||
|
||||
$result = 'OK';
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
// 포스트 파일 삭제 함수
|
||||
public function deletePostUpload($upload){
|
||||
|
||||
global $table;
|
||||
|
||||
$UPFILES = getArrayString($upload);
|
||||
|
||||
foreach($UPFILES['data'] as $_val)
|
||||
{
|
||||
$U = getUidData($this->uploadTable,$_val);
|
||||
if ($U['uid']) $this->deleteFile($U);
|
||||
}
|
||||
}
|
||||
|
||||
// 파일 삭제 함수
|
||||
public function deleteFile($row){
|
||||
global $table;
|
||||
|
||||
if($row['type']==2){
|
||||
unlink('.'.$row['folder'].'/'.$row['tmpname']);
|
||||
unlink('.'.$row['folder'].'/'.$row['thumbname']);
|
||||
}else if($row['type']==5){
|
||||
unlink('.'.$row['folder'].'/'.$row['name']);
|
||||
}
|
||||
// DB 삭제
|
||||
getDbDelete($this->uploadTable,'uid='.$row['uid']);
|
||||
}
|
||||
|
||||
// 신고 함수 : type - comment, oneline
|
||||
public function regisReport($R,$type){
|
||||
global $table,$date,$my;
|
||||
$is_reported_qry = "type='".$type."' and by_mbruid='".$my['uid']."' and entry='".$R['uid']."'";
|
||||
$is_reported = getDbRows($this->reportTable,$is_reported_qry,'uid');
|
||||
if($is_reported) return '해당 글은 이미 신고 처리되었습니다. ';
|
||||
else{
|
||||
$QKEY = "bbs,by_mbruid,type,entry,message,d_regis";
|
||||
$QVAL = "'".$R['bbs']."','".$my['uid']."','post','".$R['uid']."','$message','".$date['totime']."'";
|
||||
getDbInsert($this->reportTable,$QKEY,$QVAL);
|
||||
return '해당 글이 신고처리되었습니다. ';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
1217
modules/comment/lib/Rb.comment.js
Normal file
922
modules/comment/lib/Rb.comment.old.js
Normal file
@@ -0,0 +1,922 @@
|
||||
|
||||
(function (factory) {
|
||||
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 = function( root, jQuery ) {
|
||||
if ( jQuery === undefined ) {
|
||||
// require('jQuery') returns a factory that requires window to
|
||||
// build a jQuery instance, we normalize how we use modules
|
||||
// that require this pattern but the window provided is a noop
|
||||
// if it's defined (how jquery works)
|
||||
if ( typeof window !== 'undefined' ) {
|
||||
jQuery = require('jquery');
|
||||
}
|
||||
else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function($) {
|
||||
|
||||
var Comments = {
|
||||
|
||||
// Instance variables
|
||||
// ==================
|
||||
|
||||
$el: null,
|
||||
$el_id: null,
|
||||
module: null,
|
||||
parent : null,
|
||||
parent_table : null,
|
||||
theme_name: null,
|
||||
userLevel: 0,
|
||||
userGroup: 0,
|
||||
currentPage: 1,
|
||||
totalPage: null,
|
||||
totalRow: null,
|
||||
orderby: null,
|
||||
recnum: null,
|
||||
sort: null,
|
||||
loader: null,
|
||||
role_commentContainer: null,
|
||||
role_commentInput: null,
|
||||
perm_write: null, // 작성 권한
|
||||
is_admin: is_admin==1?true:false,
|
||||
uploadInputEle : null,
|
||||
emoticonPath : null,
|
||||
options: {},
|
||||
events: {
|
||||
'keyup [data-role="comment-input"]' : 'commentInputKeyUp',
|
||||
'click [data-role="showHide-menu"]' : 'showHideMenu', // row 메뉴 보이기/숨김 이벤트(desktop)
|
||||
'click [data-kcact]' : 'doUserAct', // 사용자 액션
|
||||
'tap [data-kcact]' : 'doUserAct', // 사용자 액션
|
||||
'scroll [data-role="comment-items-wrapper"]' : 'checkScrollTop', // 스크롤 이벤트 (댓글내역 더 가져오기)
|
||||
'change [data-role="upload-inputFile"]' : 'fileInputChanged', // 파일업로드 input change
|
||||
'click [data-role="open-emoticon"]' : 'showEmoticonBox', // 이모티콘 박스 보여주기
|
||||
'click [data-role="insert-emoticon"]' : 'insertEmoticon', // 이모티콘 입력
|
||||
'click [data-role="toggle-oneline-input"]' : 'showHideOnelineInput',// 한줄의견 입력창 노출/숨김 toggel
|
||||
'tab [data-role="toggle-oneline-input"]' : 'showHideOnelineInput',// 한줄의견 입력창 노출/숨김 toggel
|
||||
'click [data-role="trigger-edit"]' : 'createEditMod',// 수정 모드 시작
|
||||
'tab [data-role="trigger-edit"]' : 'createEditMod',// 수정 모드 시작
|
||||
'click [data-role="cancel-edit"]' : 'cancelEditMod',// 수정 취소
|
||||
'tab [data-role="cancel-edit"]' : 'cancelEditMod',// 수정 취소
|
||||
'click [data-role="trigger-getMoreComment"]' : 'getMoreComment',
|
||||
},
|
||||
|
||||
// Default options
|
||||
getDefaultOptions: function() {
|
||||
return {
|
||||
role_commentInput : '[data-role="comment-input"]',
|
||||
role_commentContainer: '[data-role="comment-container"]',
|
||||
role_commentWriteContainer : '[data-role="commentWrite-container"]',
|
||||
role_commentItem: '[data-role="comment-item"]',
|
||||
role_commentRowTotal: '[data-role="comment-itemTotal"]',
|
||||
role_commentLikeTotal: '[data-role="comment-likeTotal"]',
|
||||
role_onelineInput : '[data-role="oneline-input"]',
|
||||
role_onelineContainer: '[data-role="oneline-container"]',
|
||||
role_onelineItem: '[data-role="oneline-item"]',
|
||||
role_onelineRowTotal: '[data-role="oneline-rowTotal"]',
|
||||
role_onelineLikeTotal: '[data-role="oneline-likeTotal"]',
|
||||
role_showInputLength : '[data-role="show-inputLength"]',
|
||||
role_showTextLimit : '[data-role="show-textLimit"]',
|
||||
role_btnMoreContainer : '[data-role="btnMore-container"]',
|
||||
menuEle : '[data-role="comment-menuEle"]',
|
||||
uploadBtnWrapper : '[data-role="uploadBtn-wrapper"]',
|
||||
enableAttachments: true, // 업로드 가능 여부
|
||||
uploadInputDataRoleName : 'upload-inputFile',
|
||||
emoticonBox: '[data-role="emoticon-box"]',
|
||||
blockListWrapper: '[data-role="blockList-wrapper"]',
|
||||
showTotalRowEle : '[data-role="show-totalRow"]',
|
||||
noMoreCommentMsg: '더 이상 댓글이 존재하지 않습니다.',
|
||||
commentMainEle: '[data-role="comment-main"]',
|
||||
commentNoneEle: '[data-role="comment-none"]',
|
||||
orderby: 'asc',
|
||||
sort: 'uid',
|
||||
recnum: 5,
|
||||
useLoader: true,
|
||||
}
|
||||
},
|
||||
|
||||
// Initialization
|
||||
init: function(options, el) {
|
||||
var self = this;
|
||||
this.$el = $(el);
|
||||
this.$el_id = '#'+this.$el.attr('id');
|
||||
|
||||
// Detect mobile devices
|
||||
(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
|
||||
if($.browser.mobile) this.$el.addClass('mobile');
|
||||
|
||||
// Init options
|
||||
this.options = $.extend(true, {}, this.getDefaultOptions(), options);
|
||||
this.$el.addClass(this.options.containerClass); // 댓글박스 출력 container 에 class 추가
|
||||
this.module = this.options.moduleName; // module name 값 세팅
|
||||
this.parent = this.options.parent; // 위젯에서 세팅
|
||||
this.role_commentContainer = this.options.role_commentContainer;
|
||||
this.role_commentInput = this.options.role_commentInput;
|
||||
this.parent_table = this.options.parent_table; // 위젯에서 세팅
|
||||
this.theme_name = this.options.theme_name; // 위젯에서 세팅
|
||||
this.orderby = this.options.orderby;
|
||||
this.sort = this.options.sort;
|
||||
this.recnum = this.options.recnum;
|
||||
this.loader = this.getLoader();
|
||||
|
||||
this.initCommentBox(); // load 챗박스
|
||||
},
|
||||
|
||||
// comments box 로딩 및 접속자 권한/관련 데이타 세팅
|
||||
initCommentBox : function(){
|
||||
var self = this;
|
||||
var container = this.$el;
|
||||
$.post(
|
||||
rooturl+'/?r='+raccount+'&m='+this.module+'&a=get_Comment_Box',
|
||||
{
|
||||
parent : this.parent,
|
||||
parent_table : this.parent_table,
|
||||
theme_name : this.theme_name,
|
||||
sort: this.sort,
|
||||
orderby: this.orderby,
|
||||
recnum: this.recnum
|
||||
},
|
||||
function(response){
|
||||
var result = $.parseJSON(response);
|
||||
self.totalPage = result.totalPage; // 전체 페이지 값
|
||||
self.totalRow = result.totalRow; // 전체 row 갯수 값 (대화 내력받기 시 체크)
|
||||
self.userLevel = result.userLevel; // 접속자 level
|
||||
self.userGroup = result.userGroup; // 접속자 group
|
||||
self.perm_write = result.perm_write; // 글쓰기 권한
|
||||
self.emoticonPath = result.theme_path+'/images/emoticon/';
|
||||
$(container).append(result.comment_box);
|
||||
self.AfterInitCommentBox();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// CommentBox 로딩 후 초기화 함수들 호출
|
||||
AfterInitCommentBox : function(){
|
||||
this.undelegateEvents(); // comment box 엘리먼트들 이벤트 바인딩 off
|
||||
this.delegateEvents(); // comment box 엘리먼트들 이벤트 바인딩 on
|
||||
this.initUploadInput(); // 업로드 input 세팅
|
||||
this.initWritePerm(); // 글쓰기 권한 체크 적용
|
||||
this.initBtnMore(); // 더보기 버튼 세팅
|
||||
this.initDataNone(); // 자료없은 표시 세팅
|
||||
var e = $.Event('shown.rb.comment', { relatedTarget: this.$el_id });
|
||||
this.$el.trigger(e);
|
||||
},
|
||||
|
||||
|
||||
// 메제시 템플릿 초기화 함수 (type : me,other,notice)
|
||||
initMsgTpl : function(){
|
||||
var self = this;
|
||||
var chat_id = this.room;
|
||||
var themeName = this.themeName;
|
||||
var tmp_obj = {};
|
||||
$.get(
|
||||
rooturl+'/?r='+raccount+'&m='+this.module+'&a=get_Msg_Tpl',
|
||||
{chat_id: chat_id,themeName:themeName },
|
||||
function(response){
|
||||
var result = $.parseJSON(response);
|
||||
self.msgTpl = $.extend(self.msgTpl,result);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// 더보기 버튼 세팅
|
||||
initBtnMore : function(){
|
||||
var comment_item = $(this.role_commentContainer).find('[data-role="comment-item"]:last');
|
||||
var currentPage = $(comment_item).attr('data-page');
|
||||
var totalPage = $(comment_item).attr('data-totalPage');
|
||||
var btnMore_container = this.options.role_btnMoreContainer;
|
||||
if(totalPage>currentPage) $(btnMore_container).show();
|
||||
else $(btnMore_container).hide();
|
||||
},
|
||||
|
||||
//자료없음 표시
|
||||
initDataNone : function(){
|
||||
var comment_main_ele = this.options.commentMainEle;
|
||||
var comment_none_ele = this.options.commentNoneEle;
|
||||
var totalRow = this.totalRow;
|
||||
if (totalRow==0) {
|
||||
$(comment_main_ele).addClass('d-none');
|
||||
$(comment_none_ele).removeClass('d-none')
|
||||
} else {
|
||||
$(comment_main_ele).removeClass('d-none');
|
||||
$(comment_none_ele).addClass('d-none')
|
||||
}
|
||||
},
|
||||
|
||||
delegateEvents: function() {
|
||||
this.bindEvents(false);
|
||||
},
|
||||
|
||||
undelegateEvents: function() {
|
||||
this.bindEvents(true);
|
||||
},
|
||||
|
||||
bindEvents: function(unbind) {
|
||||
var bindFunction = unbind ? 'off' : 'on';
|
||||
for (var key in this.events) {
|
||||
var eventName = key.split(' ')[0];
|
||||
var selector = key.split(' ').slice(1).join(' ');
|
||||
var methodNames = this.events[key].split(' ');
|
||||
for(var index in methodNames) {
|
||||
if(methodNames.hasOwnProperty(index)) {
|
||||
var method = this[methodNames[index]];
|
||||
// Keep the context
|
||||
method = $.proxy(method, this);
|
||||
|
||||
if (selector == '') {
|
||||
this.$el[bindFunction](eventName, method);
|
||||
} else {
|
||||
// scroll 이벤트는 해당 엘리먼트에 직접 바인딩 해야한다.
|
||||
if(eventName=='scroll') $(selector)[bindFunction](eventName,method);
|
||||
else this.$el[bindFunction](eventName, selector, method);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 메뉴 노출/숨김 함수
|
||||
showHideMenu: function(e){
|
||||
var target = e.currentTarget;
|
||||
var type = $(target).data('type');
|
||||
var backdrop = $(target).parent().find('.backdrop')
|
||||
var sheet = $(target).parent().find('[data-role="menu-container-'+type+'"]')
|
||||
sheet.addClass('active');
|
||||
backdrop.removeClass('hidden');
|
||||
},
|
||||
|
||||
// 수정 취소
|
||||
cancelEditMod: function(e){
|
||||
e.preventDefault();
|
||||
var target = e.currentTarget;
|
||||
var type = $(target).data('type');
|
||||
var uid = $(target).data('uid');
|
||||
var e_data = {"type":type,"uid":uid};
|
||||
var origin_content = $('[data-role="'+type+'-origin-content-'+uid+'"]').html();
|
||||
$('[data-role="'+type+'-content-editable-'+uid+'"]').html(origin_content); // 기존 원래내용으로 복원
|
||||
|
||||
// 수정시 입력창 및 버튼 세팅 함수 실행
|
||||
this.setEditModBtn(e_data,'deactive');
|
||||
|
||||
},
|
||||
|
||||
// 수정 박스 생성 함수
|
||||
createEditMod: function(e){
|
||||
e.preventDefault();
|
||||
var target = e.currentTarget;
|
||||
var type = $(target).data('type');
|
||||
var uid = $(target).data('uid');
|
||||
var e_data = {"type":type,"uid":uid};
|
||||
|
||||
// 수정시 입력창 및 버튼 세팅 함수 실행
|
||||
this.setEditModBtn(e_data,'active');
|
||||
|
||||
},
|
||||
|
||||
// 수정시 입력창 및 버튼 세팅 함수
|
||||
setEditModBtn: function(data,mod){
|
||||
if(mod=='active'){
|
||||
// 입력창 active
|
||||
$('[data-role="'+data.type+'-content-editable-'+data.uid+'"]')
|
||||
.prop("contenteditable",true)
|
||||
.focus()
|
||||
.removeClass('markdown-body')
|
||||
.css({"border":"solid 1px #ccc","padding":"5px","margin-bottom":"3px","background":"#fff","min-height":"33px"});
|
||||
placeCaretAtEnd(document.querySelector('[data-role="'+data.type+'-content-editable-'+data.uid+'"]'));
|
||||
|
||||
// 수정/취소 버튼 노출
|
||||
$('[data-role="'+data.type+'-modify-btn-wrapper-'+data.uid+'"]').show();
|
||||
}else if(mod=='deactive'){
|
||||
// 입력창 deactive
|
||||
$('[data-role="'+data.type+'-content-editable-'+data.uid+'"]')
|
||||
.prop("contenteditable",false)
|
||||
.addClass('markdown-body')
|
||||
.css({"border":"none","padding":"0px","margin-bottom":"0px","background":"none","min-height":"0"});
|
||||
|
||||
// 수정/취소 버튼 숨김
|
||||
$('[data-role="'+data.type+'-modify-btn-wrapper-'+data.uid+'"]').hide();
|
||||
}
|
||||
},
|
||||
|
||||
// 한줄의견 입력창 wrapper 숨김/노출 함수
|
||||
showHideOnelineInput: function(e){
|
||||
if(!memberid){
|
||||
$('#modal-login').modal() // 비로그인 일 경우 로그인 모달 호출
|
||||
return false;
|
||||
}
|
||||
var target = e.currentTarget;
|
||||
var parent = $(target).data('parent');// 댓글 PK
|
||||
var oneline_input_wrapper = $('[data-role="oneline-input-wrapper-'+parent+'"]');
|
||||
$(oneline_input_wrapper).toggle();
|
||||
},
|
||||
|
||||
// 글자 수 체크
|
||||
fnChkByte : function(inputEle,maxByte) {
|
||||
var str = $(inputEle).val();
|
||||
var str_len = $(inputEle).val().length;
|
||||
|
||||
var rbyte = 0;
|
||||
var rlen = 0;
|
||||
var one_char = "";
|
||||
var str2 = "";
|
||||
|
||||
for (var i = 0; i < str_len; i++) {
|
||||
one_char = str.charAt(i);
|
||||
|
||||
if (escape(one_char).length > 4) {
|
||||
rbyte++;
|
||||
//rbyte += 2; //한글2Byte byte 수로 체크하는 경우
|
||||
} else {
|
||||
rbyte++; //영문 등 나머지 1Byte
|
||||
}
|
||||
|
||||
if (rbyte <= maxByte) {
|
||||
rlen = i + 1; //return할 문자열 갯수
|
||||
}
|
||||
}
|
||||
|
||||
if (rbyte > maxByte){
|
||||
this.showNotify(this.options.role_commentWriteContainer,this.options.commentLength+'자 를 초과했습니다.',null);
|
||||
str2 = str.substr(0, rlen); //문자열 자르기
|
||||
$(inputEle).val(str2);
|
||||
this.fnChkByte(inputEle, maxByte);
|
||||
} else {
|
||||
$(this.options.role_showInputLength).text(rbyte);
|
||||
}
|
||||
},
|
||||
|
||||
commentInputKeyUp: function(e){
|
||||
var target = e.currentTarget;
|
||||
var len = $(target).val().length;
|
||||
if(this.options.commentLength){
|
||||
// 글자수 체크함수 호출
|
||||
this.fnChkByte(target,this.options.commentLength);
|
||||
//$(this.options.role_showInputLength).text(len);
|
||||
}
|
||||
},
|
||||
|
||||
// 콤마 추가 함수
|
||||
addComma: function(string){
|
||||
var commaString=string.toLocaleString().split(".")[0];
|
||||
return commaString;
|
||||
},
|
||||
|
||||
// 콤마 삭제
|
||||
delComma: function(commaString){
|
||||
var string=commaString.replace(/,/gi,'');
|
||||
return string;
|
||||
},
|
||||
|
||||
// 전체 row 수량 업데이트
|
||||
updateTotal: function(num,type){
|
||||
var totalRow = this.totalRow; // 최초 합계
|
||||
var total_row_wrap = this.options.showTotalRowEle;
|
||||
var comment_main_ele = this.options.commentMainEle;
|
||||
var comment_none_ele = this.options.commentNoneEle;
|
||||
var total_row_text=$(total_row_wrap).text();
|
||||
total_row_text=this.delComma(total_row_text);
|
||||
var total_row;
|
||||
|
||||
if(type=='add'){
|
||||
total_row=parseInt(total_row_text)+parseInt(num);
|
||||
this.totalRow = totalRow+num;
|
||||
}
|
||||
else if(type=='del'){
|
||||
total_row=parseInt(total_row_text)-parseInt(num);
|
||||
this.totalRow = totalRow-num;
|
||||
}
|
||||
|
||||
if (total_row==0) {
|
||||
$(comment_main_ele).addClass('d-none');
|
||||
$(comment_none_ele).removeClass('d-none')
|
||||
} else {
|
||||
$(comment_main_ele).removeClass('d-none');
|
||||
$(comment_none_ele).addClass('d-none')
|
||||
}
|
||||
|
||||
// 최종 합계에 콤마 추가
|
||||
total_row_comma=this.addComma(total_row);
|
||||
|
||||
// 취소버튼 클릭시 초기화
|
||||
if(type=='init'){
|
||||
total_checked_num=0;
|
||||
$(total_row_wrap).text(0);
|
||||
}
|
||||
else $(total_row_wrap).text(total_row_comma);
|
||||
},
|
||||
|
||||
// 글쓰기 권한 적용
|
||||
initWritePerm : function(){
|
||||
var role_commentInput = this.options.role_commentInput;
|
||||
var role_onelineInput = this.options.role_onelineInput;
|
||||
var input_array = [role_commentInput,role_onelineInput];
|
||||
|
||||
if(!this.perm_write){
|
||||
|
||||
$.each(input_array,function(key,InputEle){
|
||||
$(InputEle).css("padding-left","10px");
|
||||
$(InputEle).attr("placeholder","로그인을 해주세요.")
|
||||
$(InputEle).attr("readonly",true);
|
||||
$(InputEle).attr("data-toggle","modal");
|
||||
$(InputEle).attr("data-target","#modal-login");
|
||||
$(InputEle).attr("role","button");
|
||||
});
|
||||
// 댓글 입력창
|
||||
$(this.options.emoticonBox).remove();
|
||||
}else{
|
||||
// 옵션에서 정한 placeholder
|
||||
$(role_commentInput).attr("placeholder",this.options.commentPlaceHolder);
|
||||
}
|
||||
// 입력수 제한값 세팅
|
||||
if(this.options.commentLength){
|
||||
$(this.options.role_showTextLimit).text(this.options.commentLength);
|
||||
}
|
||||
},
|
||||
|
||||
// 댓글 더 가져오기 이벤트
|
||||
checkScrollTop : function(e){
|
||||
var comment_box = e.currentTarget;
|
||||
var scrollTop = $(comment_box).scrollTop();
|
||||
var comment_row = $(comment_box).find('[data-role="comment-item"]:first');
|
||||
//var _currentPage = $(comment_row).data('page');
|
||||
var totalPage = this.totalPage;
|
||||
if((scrollTop<50) && (this.currentPage<totalPage)){
|
||||
this.getCommentList(this.currentPage);
|
||||
this.currentPage++;
|
||||
}
|
||||
},
|
||||
|
||||
// 댓글 더 보기
|
||||
getMoreComment: function(){
|
||||
var sort = sort?sort:this.sort;
|
||||
var orderby = orderby?orderby:this.orderby;
|
||||
var recnum = recnum?recnum:this.recnum;
|
||||
var currentPage = this.currentPage;//$(comment_item).data('page'); // 현재 페이지
|
||||
var totalPage = this.totalPage; // 전체 페이지
|
||||
var currentPage = this.currentPage; // 현재 페이지
|
||||
var nextPage = parseInt(currentPage)+1;
|
||||
if(totalPage>currentPage){
|
||||
this.getCommentList(sort,orderby,recnum,nextPage,'more');
|
||||
this.currentPage= nextPage;
|
||||
}else{
|
||||
this.showNotify(null,this.options.noMoreCommentMsg,null);
|
||||
}
|
||||
},
|
||||
|
||||
// 댓글 리스트 출력 함수 : getType (getMore : append , reload: html)
|
||||
getCommentList : function(sort,orderby,recnum,page,getType){
|
||||
var role_commentContainer = this.options.role_commentContainer;
|
||||
var role_moreBtnContainer = this.options.role_moreBtnContainer;
|
||||
var self = this;
|
||||
var sort = sort?sort:this.sort;
|
||||
var orderby = orderby?orderby:this.sort;
|
||||
var recnum = recnum?recnum:this.recnum;
|
||||
var page = page?page:this.page;
|
||||
if(this.options.useLoader){
|
||||
var loaderPosition = getType=='more'?'bottom':'top';
|
||||
this.showLoader(role_commentContainer,loaderPosition);
|
||||
// if(getType=='more') $(role_commentContainer).append(this.loader);
|
||||
// else $(role_commentContainer).prepend(this.loader);
|
||||
}
|
||||
$.get(rooturl+'/?r='+raccount+'&m='+this.module+'&a=do_userAct',{
|
||||
act: 'getCommentList',
|
||||
parent: this.parent,
|
||||
theme_name: this.theme_name,
|
||||
page : page,
|
||||
sort: sort,
|
||||
orderby: orderby,
|
||||
recnum: recnum,
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
var commentList = result.content;
|
||||
if(error){
|
||||
var error_comment = result.error_comment;
|
||||
self.showNotify(null,error_comment,null);
|
||||
}else{
|
||||
setTimeout(function(){
|
||||
$(role_commentContainer).find(self.loader).remove(); // loader 삭제
|
||||
},50);
|
||||
|
||||
if(getType=='more') $(role_commentContainer).append(commentList);
|
||||
else if(getType=='reload') $(role_commentContainer).html(commentList);
|
||||
|
||||
// 더보기 버튼 초기화
|
||||
self.initBtnMore();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 사용자 액션 실행
|
||||
doUserAct : function(e){
|
||||
e.preventDefault();
|
||||
var self = this;
|
||||
var target = e.currentTarget;
|
||||
var act = $(target).data('kcact'); // 액션 구분값
|
||||
var parent = $(target).data('parent'); // 부모 PK
|
||||
var grant = $(target).data('grant'); // 한줄의견 기준 댓글의 부모 PK
|
||||
var register = $(target).data('register');// 등록자 PK
|
||||
var type = $(target).data('type'); // comment, oneline...
|
||||
var uid = $(target).data('uid'); // comment, oneline PK
|
||||
var entry = $(target).data('entry');
|
||||
var totalRow = this.totalRow;
|
||||
var theme_name = this.theme_name;
|
||||
var parent_table = this.parent_table;
|
||||
var grant_table = this.parent_table; // 한줄의견 기준 댓글의 부모 table
|
||||
var sess_code = this.getWriteToken(); // 보안 토큰값
|
||||
var recnum = this.recnum;
|
||||
var html = $(target).data('html');
|
||||
var markdown = $(target).data('markdown');
|
||||
var effect = $(target).data('effect');
|
||||
|
||||
if(!memberid && (act!='reload'&&act!='more')){
|
||||
// alert('로그인을 해주세요.');
|
||||
$('#modal-login').modal()
|
||||
return false;
|
||||
}
|
||||
|
||||
if(act=='regis' || act=='edit'){
|
||||
var target_input;
|
||||
var result_container;
|
||||
var msg_container;
|
||||
var content;
|
||||
if(type=='comment'){ // 댓글
|
||||
target_input = $(this.role_commentInput);
|
||||
result_container = this.role_commentContainer;
|
||||
msg_container = $('[data-role="comment-input-wrapper"]');
|
||||
}
|
||||
else if(type=='oneline'){ // 한줄의견
|
||||
target_input = $('[data-role="oneline-input-'+parent+'"]');
|
||||
result_container = $('[data-role="oneline-container-'+parent+'"]');
|
||||
msg_container = $('[data-role="oneline-input-wrapper-'+parent+'"]');
|
||||
}
|
||||
// 입력내용
|
||||
if(act=='regis') content = target_input.val();
|
||||
else if(act=='edit') {
|
||||
var content_editable = $('[data-role="'+type+'-content-editable-'+uid+'"]')
|
||||
var tag = content_editable.prop('tagName');
|
||||
if (tag=='DIV' || tag=='ARTICLE' || tag=='SECTION') {
|
||||
content = content_editable.html();
|
||||
} else {
|
||||
content = content_editable.val();
|
||||
}
|
||||
html = 'HTML'
|
||||
}
|
||||
// console.log(tag)
|
||||
|
||||
if(content==''){
|
||||
self.showNotify(msg_container,'내용을 입력해주세요.',null);
|
||||
return false;
|
||||
}else{
|
||||
$(target_input).val(''); // 입력내용 초기화
|
||||
if(this.options.commentLength) $(this.options.role_showInputLength).text(0); // 입력 글자수 초기화
|
||||
}
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+this.module+'&a=regis_'+type,{
|
||||
content : content,
|
||||
parent : parent,
|
||||
grant : grant,
|
||||
parent_table : parent_table,
|
||||
grant_table: grant_table,
|
||||
theme_name : theme_name,
|
||||
sess_code : sess_code,
|
||||
uid : uid,
|
||||
recnum : recnum,
|
||||
html : html,
|
||||
markdown : markdown,
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
if(error){
|
||||
self.showNotify(msg_container,result.error_msg,null);
|
||||
}else{
|
||||
if(act=='regis'){
|
||||
var last_row = result.last_row;
|
||||
var last_uid = result.lastuid;
|
||||
$(result_container).prepend(last_row); // 등록된 댓글 출력
|
||||
$(result_container).find('[data-role="'+type+'-item"][data-uid='+last_uid+']').addClass(effect);
|
||||
if(type=='comment') self.updateTotal(1,'add');
|
||||
// 콜백 이벤트
|
||||
var e = $.Event('saved.rb.'+type, { relatedTarget: self.$el_id });
|
||||
self.$el.trigger(e);
|
||||
|
||||
}else if(act=='edit'){
|
||||
var edit_content = result.edit_content;
|
||||
var edit_uid = result.edit_uid;
|
||||
var edit_time = result.edit_time;
|
||||
var edit_data = {"type": type,"content": edit_content,"uid": edit_uid,"time": edit_time};
|
||||
var e = $.Event('edited.rb.'+type, { relatedTarget: self.$el_id });
|
||||
self.$el.trigger(e);
|
||||
self.updateEdit(edit_data); // 수정 적용 함수로 넘김
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return false;
|
||||
|
||||
}else if(act=='changeSort'){
|
||||
var sort = $(target).data('sort');
|
||||
var orderby = $(target).data('orderby');
|
||||
this.sort = sort;
|
||||
this.orderby = orderby;
|
||||
this.currentPage = 1; // 페이지 리셋
|
||||
this.getCommentList(sort,orderby,null,1,'reload');
|
||||
// return false;
|
||||
|
||||
}else if(act=='reload'){
|
||||
var sort = this.sort;
|
||||
var orderby = this.orderby;
|
||||
this.currentPage = 1; // 페이지 리셋
|
||||
this.getCommentList(sort,orderby,null,1,'reload');
|
||||
return false;
|
||||
|
||||
}else{
|
||||
|
||||
if(act=='delete'){
|
||||
var delete_confirm = confirm("정말로 삭제하시겠습니까?");
|
||||
if (delete_confirm == false) return false;
|
||||
}
|
||||
|
||||
var comment_container = $('[data-role="'+type+'-container"]');
|
||||
var comment_item_container = $('[data-role="comment-item"][data-uid="'+uid+'"]');
|
||||
var oneline_container = $('[data-role="'+type+'-container-'+parent+'"]');
|
||||
var msg_container;
|
||||
if(type=='comment') msg_container = comment_item_container;
|
||||
else if(type=='oneline') msg_container = oneline_container;
|
||||
|
||||
$.post(rooturl+'/?r='+raccount+'&m='+this.module+'&a=do_userAct',{
|
||||
act : act,
|
||||
parent : parent,
|
||||
register : register,
|
||||
type : type,
|
||||
uid : uid,
|
||||
entry: entry,
|
||||
},function(response) {
|
||||
var result = $.parseJSON(response);
|
||||
var error = result.error;
|
||||
if(error){
|
||||
var error_msg = result.error_msg;
|
||||
self.showNotify(msg_container,error_msg,null);
|
||||
}else{
|
||||
if(act=='like'){
|
||||
var total_like = result.total_like;
|
||||
var is_liked = result.is_liked;
|
||||
$('[data-role="'+type+'-likeTotal-'+entry+'"]').text(total_like);
|
||||
|
||||
if (is_liked) {
|
||||
$('[data-role="'+type+'-isLiked-'+entry+'"]').addClass('active '+effect);
|
||||
} else {
|
||||
$('[data-role="'+type+'-isLiked-'+entry+'"]').removeClass('active '+effect);
|
||||
}
|
||||
|
||||
}else if(act=='delete'){
|
||||
|
||||
if(type=='comment') self.updateTotal(1,'del');
|
||||
|
||||
// 해당 row 삭제
|
||||
if(type=='oneline') $(oneline_container).find('[data-uid="'+uid+'"]').slideUp();
|
||||
else if(type=='comment') $(comment_container).find('[data-uid="'+uid+'"]').slideUp();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 수정사항 업데이트 함수 d : edit_data
|
||||
updateEdit: function(d){
|
||||
|
||||
// 수정내용 적용
|
||||
var content_wrapper = $('[data-role="'+d.type+'-content-wrapper-'+d.uid+'"]');
|
||||
$(content_wrapper).html(d.content);
|
||||
|
||||
// 원본저장 div 에도 적용
|
||||
$('[data-role="'+d.type+'-origin-content-'+d.uid+'"]').html(d.content);
|
||||
|
||||
// 수정시간 업데이트
|
||||
$('[data-role="'+d.type+'-time-wrapper-'+d.uid+'"]').text(d.time);
|
||||
|
||||
// 입력창 및 버튼 세팅 함수 호출
|
||||
var e_data ={"type":d.type,"uid":d.uid}
|
||||
this.setEditModBtn(e_data,'deactive');
|
||||
},
|
||||
|
||||
|
||||
// Start of upload setting *****************************************************************************************************
|
||||
initUploadInput: function(){
|
||||
var sesscode = this.getWriteToken;
|
||||
var uploadButton = $('<span/>', {
|
||||
'class': 'comment-attach'
|
||||
});
|
||||
var uploadIcon = $('<i/>', {
|
||||
'class': 'fa fa-picture-o fa-lg'
|
||||
});
|
||||
var fileInput = $('<input/>', {
|
||||
type: 'file',
|
||||
name: 'upfiles[]',
|
||||
'data-role': this.options.uploadInputDataRoleName,
|
||||
'data-sesscode' : sesscode
|
||||
});
|
||||
// Multi file upload might not work with backend as the the file names
|
||||
// may be the same causing duplicates
|
||||
if(!$.browser.mobile) fileInput.attr('multiple', 'multiple');
|
||||
if(!this.options.enableAttachments) fileInput.attr('disabled', 'disabled');
|
||||
|
||||
uploadButton.append(uploadIcon).append(fileInput);
|
||||
$(this.options.uploadBtnWrapper).append(uploadButton);
|
||||
},
|
||||
|
||||
// 업로드 input change 이벤트
|
||||
fileInputChanged: function(e) {
|
||||
var files = e.currentTarget.files;
|
||||
var uploadInputFileEle = $('[data-role="'+this.options.uploadInputDataRoleName+'"]');
|
||||
var sesscode = $(uploadInputFileEle).data('sesscode');
|
||||
var uploadOptions = {
|
||||
uploadDir : this.options.uploadDir,
|
||||
sesscode : sesscode
|
||||
};
|
||||
if (sesscode === undefined){
|
||||
alert('파일 업로드를 위한 셋팅에 문제가 있습니다.');
|
||||
return false;
|
||||
}else if(files.length>0) this.uploadAttachments(files,uploadOptions);
|
||||
},
|
||||
|
||||
// 업로드 실행 함수
|
||||
uploadAttachments: function(files,uploadOptions){
|
||||
var self = this;
|
||||
var data = new FormData();
|
||||
|
||||
$.each(files, function(key, value) {data.append(key, value);});
|
||||
$.each(uploadOptions, function(key, value) {data.append(key, value);});
|
||||
|
||||
$.ajax({
|
||||
url: rooturl+'/?r='+raccount+'&m='+this.module+'&a=upload_Attachments',
|
||||
type: 'post',
|
||||
data: data,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
var result=$.parseJSON(response);
|
||||
var fileList = result.fileList;
|
||||
var comment_content = '';
|
||||
var upload = '';
|
||||
var files=fileList.split(',');
|
||||
$.each(files,function(key,list){
|
||||
var list_arr = list.split('^^');
|
||||
var src = list_arr[0];
|
||||
var uid = list_arr[1];
|
||||
var type = list_arr[2];
|
||||
upload +='['+uid+']';
|
||||
if(type==2){
|
||||
var photo_data = {"type":"photo","photo_src":src};
|
||||
comment_content += self.getCommentTpl(photo_data);
|
||||
}
|
||||
});
|
||||
self.uploadClientComment(comment_content,upload);
|
||||
},
|
||||
xhr: function() {
|
||||
var myXhr = $.ajaxSettings.xhr();
|
||||
if(myXhr.upload) {
|
||||
myXhr.upload.addEventListener('progress', function(e) {
|
||||
if(e.lengthComputable){
|
||||
var max = e.total;
|
||||
var current = e.loaded;
|
||||
var Percentage = (current * 100)/max;
|
||||
console.log(Percentage);
|
||||
// progressBar.css({width: Percentage + '%'});
|
||||
// percent.html(parseInt(Percentage));
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return myXhr;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// End of upload setting ********************************************************************************************************
|
||||
|
||||
// 업로드 전송 함수 :
|
||||
uploadClientComment : function(comment_content,upload_value){
|
||||
var token = this.getWriteToken();
|
||||
var data = {"comment":comment_content,"notice":0,"upload":upload_value,"token": token};
|
||||
this.saveComment(data);
|
||||
},
|
||||
|
||||
// emoticon 박스 보여주기
|
||||
showEmoticonBox: function(){
|
||||
$(this.options.emoticonBox).slideToggle('fast');
|
||||
},
|
||||
|
||||
// emoticon 입력
|
||||
insertEmoticon: function(e){
|
||||
var ele = e.currentTarget;
|
||||
var emoticon_comment = $(ele).data('emotion');
|
||||
var emoticon_src = this.emoticonPath+'/emo_'+emoticon_comment+'.png';
|
||||
var emoticon_data = {"type":"emoticon","emoticon_src":emoticon_src};
|
||||
var comment = this.getCommentTpl(emoticon_data);
|
||||
var token = this.getWriteToken();
|
||||
var comment_data = {"comment":comment,"notice":0,"token": token};
|
||||
this.saveComment(comment_data);
|
||||
$(this.options.emoticonBox).slideToggle('fast');
|
||||
},
|
||||
|
||||
// comment toekn 생성
|
||||
getWriteToken : function(){
|
||||
function chr4(){
|
||||
return Math.random().toString(16).slice(-4);
|
||||
}
|
||||
return chr4() + chr4() + '.' + chr4() + chr4() + chr4();
|
||||
},
|
||||
|
||||
// 입력창 포커스 이벤트
|
||||
focusInput : function(userInputEle){
|
||||
setTimeout(function(){
|
||||
$(userInputEle).focus();
|
||||
},10);
|
||||
},
|
||||
|
||||
// 입력내용 중 a 요소 자동으로 링크 만들기
|
||||
linkify: function(inputText) {
|
||||
var replacedText, replacePattern1, replacePattern2, replacePattern3;
|
||||
|
||||
// URLs starting with http://, https://, file:// or ftp://
|
||||
replacePattern1 = /(^|\s)((https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
|
||||
replacedText = inputText.replace(replacePattern1, '$1<a href="$2" target="_blank">$2</a>');
|
||||
|
||||
// URLs starting with "www." (without // before it, or it'd re-link the ones done above).
|
||||
replacePattern2 = /(^|\s)(www\.[\S]+(\b|$))/gim;
|
||||
replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');
|
||||
|
||||
// Change email addresses to mailto:: links.
|
||||
replacePattern3 = /(^|\s)(([a-zA-Z0-9\-\_\.]+)@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
|
||||
replacedText = replacedText.replace(replacePattern3, '$1<a href="mailto:$2">$2</a>');
|
||||
|
||||
// If there are hrefs in the original text, let's split
|
||||
// the text up and only work on the parts that don't have urls yet.
|
||||
var count = inputText.match(/<a href/g) || [];
|
||||
|
||||
if(count.length > 0){
|
||||
// Keep delimiter when splitting
|
||||
var splitInput = inputText.split(/(<\/a>)/g);
|
||||
for (var i = 0 ; i < splitInput.length ; i++){
|
||||
if(splitInput[i].match(/<a href/g) == null){
|
||||
splitInput[i] = splitInput[i].replace(replacePattern1, '<a href="$1" target="_blank">$1</a>').replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>').replace(replacePattern3, '<a href="mailto:$1">$1</a>');
|
||||
}
|
||||
}
|
||||
var combinedReplacedText = splitInput.join('');
|
||||
return combinedReplacedText;
|
||||
} else {
|
||||
return replacedText;
|
||||
}
|
||||
},
|
||||
// 알림 출력
|
||||
showNotify : function(target,message,type){
|
||||
var target = target?target:this.$el;
|
||||
var notify_msg ='<div class="comment-notify-msg">'+message+'</div>';
|
||||
var notify = $('<div/>', { id: 'comment-notify', html: notify_msg});
|
||||
$(target).css("position","relative");
|
||||
$(notify).addClass('active').appendTo(target);
|
||||
setTimeout(function(){
|
||||
$(notify).removeClass('active');
|
||||
$(notify).remove();
|
||||
}, 1500);
|
||||
|
||||
},
|
||||
|
||||
// loader 생성
|
||||
getLoader : function(){
|
||||
var spinner = '<i class="fa fa-spinner fa-spin" style="font-size:24px"></i>';
|
||||
var loader =$('<div/>',{id: 'comment-spinner-wrap',html: spinner});
|
||||
return loader;
|
||||
},
|
||||
|
||||
// loader 출력
|
||||
showLoader: function(container,position){
|
||||
if(position=='bottom') $(this.loader).attr("class","comment-bottom5p");
|
||||
else if(position=='top') $(this.loader).attr("class","comment-top5p");
|
||||
$(container).append(this.loader);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.Rb_comment = function(options) {
|
||||
return this.each(function() {
|
||||
var comments = Object.create(Comments);
|
||||
$.data(this, 'comments', comments);
|
||||
comments.init(options || {}, this);
|
||||
});
|
||||
};
|
||||
}));
|
||||
3
modules/comment/main.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
?>
|
||||
1
modules/comment/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
댓글
|
||||
21
modules/comment/themes/_desktop/bs4-classic/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.
|
||||
17
modules/comment/themes/_desktop/bs4-classic/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
# 부트스트랩 4 댓글 기본형 테마
|
||||
|
||||
안녕하세요. 감사합니다.
|
||||
|
||||
## 주요기능
|
||||
- Automated website building technology
|
||||
- Powerful content managing system
|
||||
- Multiple virtual site system
|
||||
- Unlimited extension
|
||||
- Multi Screen implementations
|
||||
|
||||
## 서버 요구사항
|
||||
- PHP version 5.2.x
|
||||
- MYSQL version 3.23.x or greater (recommend MYSQL >= 5.x)
|
||||
- GD Library
|
||||
- ICONV
|
||||
235
modules/comment/themes/_desktop/bs4-classic/css/style.css
Normal file
@@ -0,0 +1,235 @@
|
||||
@charset "utf-8";
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
[data-role="comment-item"],
|
||||
[data-role="comment-item"] .markdown-body {
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
[data-role="oneline-item"],
|
||||
[data-role="oneline-item"].markdown-body {
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
[data-role="oneline-item"] blockquote {
|
||||
margin-bottom: 0;
|
||||
padding: 0 1em;
|
||||
color: #6a737d;
|
||||
border-left: 0.25em solid #dfe2e5;
|
||||
}
|
||||
|
||||
.js-like.active {
|
||||
color: #007bff !important
|
||||
}
|
||||
|
||||
.js-like.active::after {
|
||||
content: ' 취소'
|
||||
}
|
||||
|
||||
.js-new.active::before {
|
||||
padding-left: 3px;
|
||||
content: 'new';
|
||||
color: red;
|
||||
font-size: 80%
|
||||
}
|
||||
|
||||
.rb-comments-write .card textarea {
|
||||
height: 34px;
|
||||
background-color: #fafbfc;
|
||||
-webkit-transition: height 1s;
|
||||
/* For Safari 3.1 to 6.0 */
|
||||
transition: height 1s;
|
||||
transition-delay: 1s;
|
||||
-webkit-transition-delay: 1s;
|
||||
}
|
||||
|
||||
.rb-comments-write .card.active textarea {
|
||||
min-height: 70px !important;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.rb-comments-write .card .card-footer {
|
||||
display: none
|
||||
}
|
||||
|
||||
.rb-comments-write .card.active .card-footer {
|
||||
display: block
|
||||
}
|
||||
|
||||
.media[data-role="comment-item"].border-bottom {
|
||||
border-bottom: 1px dotted #dee2e6 !important;
|
||||
}
|
||||
|
||||
.list-group-item[data-role="oneline-item"] {
|
||||
border-style: dotted;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.list-group:empty {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important
|
||||
}
|
||||
|
||||
.flex-column-reverse .list-group-item:last-child {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
/* notify */
|
||||
|
||||
#commentting-container,
|
||||
[data-role=comment-container],
|
||||
[data-role=moreBtn-container] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#comment-notify {
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 30px;
|
||||
top: auto
|
||||
}
|
||||
|
||||
#comment-notify .comment-notify-msg {
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
padding: 12px 6px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#comment-notify.active {
|
||||
visibility: visible;
|
||||
-webkit-animation: fadein 0.5s, fadeout 0.5s 1.1s;
|
||||
animation: fadein 0.5s, fadeout 0.5s 1.1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadein {
|
||||
from {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadein {
|
||||
from {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeout {
|
||||
from {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeout {
|
||||
from {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* notify */
|
||||
|
||||
/* attach trigger */
|
||||
|
||||
#commentting-container .comment-attach {
|
||||
position: relative;
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 8px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#commentting-container span.comment-attach input[type='file'] {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
right: -9px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
font-size: 0;
|
||||
width: 180%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* emoticon */
|
||||
|
||||
#commentting-container .emoticon-wrapper {
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
padding: 15px 5px;
|
||||
}
|
||||
|
||||
#commentting-container .emoticon-wrapper ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#commentting-container .emoticon-wrapper li {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
text-align: center;
|
||||
width: 12.5%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#commentting-container .emoticon-wrapper li img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
[data-role|=oneline-input-wrapper],
|
||||
[data-role|=comment-modify-btn-wrapper],
|
||||
[data-role|=oneline-modify-btn-wrapper] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* loader */
|
||||
|
||||
#comment-spinner-wrap {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.comment-top5p {
|
||||
top: 5%;
|
||||
}
|
||||
|
||||
.comment-bottom5p {
|
||||
bottom: 5%;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<div data-role="{$entry_type}-modify-btn-wrapper-{$uid}" class="my-2">
|
||||
<button class="btn btn-light btn-sm" data-toggle="cancel-edit" data-type="{$entry_type}" data-uid="{$uid}">수정취소</button>
|
||||
<button class="btn btn-primary btn-sm" data-kcact="edit" data-type="{$entry_type}" data-uid="{$uid}" data-parent="{$parent}">수정완료</button>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-link btn-sm dropdown-toggle" type="button" data-toggle="dropdown" data-role="showHide-menu" data-type="{$entry_type}">
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right" data-role="menu-container-{$entry_type}">
|
||||
<a href="#" class="dropdown-item" data-toggle="edit" data-type="{$entry_type}" data-uid="{$uid}">
|
||||
<i class="fa fa-edit"></i> 수정
|
||||
</a>
|
||||
<a href="#" class="dropdown-item" data-kcact="delete" data-type="{$entry_type}" data-uid="{$uid}" data-parent="{$entry_parent}">
|
||||
<i class="fa fa-trash-o"></i> 삭제
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,116 @@
|
||||
<!-- 공통 사항 data-* ="*" 과 {$*} 는 수정 금지 -->
|
||||
<header class="d-flex justify-content-start" data-role="header-container">
|
||||
{$comment_header} <!-- 댓글 header : comment_header.html -->
|
||||
</header>
|
||||
<div class="rb-comments-write" data-role="commentWrite-container"> <!-- 댓글 입렵부 : comment_write.html -->
|
||||
{$comment_write}
|
||||
</div>
|
||||
<main data-role="comment-main">
|
||||
<nav class="d-flex">
|
||||
<div class="btn-group btn-group-sm btn-group-toggle" data-toggle="buttons" role="group">
|
||||
<label class="btn btn-light active" data-kcact="changeSort" data-sort="uid" data-orderby="asc">
|
||||
<input type="radio" name="changeSort" id="sort_uid_asc" autocomplete="off" checked> 최신순
|
||||
</label>
|
||||
<label class="btn btn-light" data-kcact="changeSort" data-sort="uid" data-orderby="desc">
|
||||
<input type="radio" name="changeSort" id="sort_uid_desc" autocomplete="off"> 과거순
|
||||
</label>
|
||||
<label class="btn btn-light" data-kcact="changeSort" data-sort="likes" data-orderby="desc">
|
||||
<input type="radio" name="changeSort" id="sort_likes_desc" autocomplete="off"> 추천순
|
||||
</label>
|
||||
</div>
|
||||
<button type="button" class="btn btn-light btn-sm d-print-none ml-auto" role="button" data-kcact="reload" data-toggle="tooltip" title="새로고침">
|
||||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||||
</button>
|
||||
</nav>
|
||||
<hr>
|
||||
<ul class="list-unstyled" data-role="comment-container"> <!-- 댓글 출력부 : comment_row.html -->
|
||||
{$comment_rows}
|
||||
</ul>
|
||||
<div data-role="btnMore-container"> <!-- 더보기 버튼 -->
|
||||
<a class="btn btn-block btn-light" data-role="trigger-getMoreComment">더보기</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="d-none animated fadeIn" data-role="comment-none">
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 30vh;">
|
||||
<div class="text-muted text-center">
|
||||
<div class="display-2 mb-3">
|
||||
<i class="fa fa-comment-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
<button type="button" class="btn btn-link text-muted js-comment-focus">첫번째 댓글을 남겨주세요.</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modal_reaction" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
<i class="fa fa-thumbs-o-up fa-lg fa-fw" aria-hidden="true"></i> 공감한 사람 <span class="badge badge-light js-count">9</span>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body p-0">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div class="media w-100">
|
||||
<img class="mr-3 border rounded-circle" src="/_core/opensrc/timthumb/thumb.php?src=https://kimsq.com/_var/avatar/180.break93.png&w=38&h=38" alt="아바타" width="38">
|
||||
<div class="media-body">
|
||||
<strong>벽돌공장</strong>
|
||||
<p class="text-muted small mt-1 mb-0">
|
||||
엑스퍼트
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="badge badge-light badge-pill">36분 전</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div class="media w-100">
|
||||
<img class="mr-3 border rounded-circle" src="/_core/opensrc/timthumb/thumb.php?src=https://kimsq.com/_var/avatar/180.break93.png&w=38&h=38" alt="아바타" width="38">
|
||||
<div class="media-body">
|
||||
<strong>벽돌공장</strong>
|
||||
<p class="text-muted small mt-1 mb-0">
|
||||
엑스퍼트
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="badge badge-light badge-pill">36분 전</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light btn-block" data-dismiss="modal">확인</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
jQuery(function($) {
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
|
||||
$(".js-modal-window").click(function() {
|
||||
modalSetting('modal_window',$(this).attr("data-href"));
|
||||
});
|
||||
|
||||
$('.add-comment').click(function() {
|
||||
var uid = $(this).data('parent')
|
||||
var textarea = $('[data-role="oneline-input-'+uid+'"]')
|
||||
setTimeout(function(){ textarea.focus(); }, 200); // 한줄의견 추가시에 textarea focus 처리하기
|
||||
});
|
||||
|
||||
$('.js-comment-focus').click(function() {
|
||||
$('#meta-description-content').focus()
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,4 @@
|
||||
<h1 class="h5 text-muted">
|
||||
<i class="fa fa-commenting-o fa-fw" aria-hidden="true"></i> 댓글
|
||||
<span class="text-primary" data-role="show-totalRow">{$comment_total}</span>
|
||||
</h1>
|
||||
@@ -0,0 +1,71 @@
|
||||
<li class="media border-bottom mb-3" data-role="comment-item" data-uid="{$comment_uid}" data-page="{$comment_page}" data-totalPage="{$total_page}" data-type="comment" data-hidden="{$comment_getHidden}" data-notice="{$comment_getNoitce}">
|
||||
<div data-role="comment-origin-content-{$comment_uid}" class="d-none">{$comment_content}</div>
|
||||
<img class="mr-3 border rounded-circle" src="{$comment_user_pic}" alt="아바타" width="50">
|
||||
<div class="media-body">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<span>
|
||||
<span data-role="comment-hidden" class="badge"><i class="fa fa-lock fa-lg" aria-hidden="true"></i></span>
|
||||
<strong class="mr-2">{$comment_user_name}</strong>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
<time data-role="comment-time-wrapper-{$comment_uid}">{$comment_regis_time}</time>
|
||||
<small class="ml-1 {$comment_getNew}"></small><!-- 24시간이내 new 출력 -->
|
||||
</span>
|
||||
<span>
|
||||
{$btn_showHideMenu} <!-- 메뉴 출력/숨기 버튼 btn_showHideMenu.html : 권한이 있는 경우(로그인,작성자,관리자) 에만 노출됨 -->
|
||||
</span>
|
||||
</div><!-- /.d-flex -->
|
||||
<div class="markdown-body">
|
||||
<article class="mb-0" data-role="comment-content-editable-{$comment_uid}">{$comment_content}</article>
|
||||
</div>
|
||||
{$btn_editMod} <!-- 수정 모드시 취소/완료 버튼 btn_ediMod.html -->
|
||||
|
||||
<div class="mb-2">
|
||||
<button class="btn btn-link btn-sm add-comment px-0 muted-link" data-role="toggle-oneline-input" data-parent="{$comment_uid}">
|
||||
<i class="fa fa-comment-o fa-lg fa-fw" aria-hidden="true"></i>
|
||||
의견달기
|
||||
</button>
|
||||
<button class="btn btn-link btn-sm muted-link js-like pr-0 {$comment_getIsLiked}"
|
||||
data-kcact="like"
|
||||
data-type="comment"
|
||||
data-entry="{$comment_uid}"
|
||||
data-effect="animated bounceIn delay-1"
|
||||
data-role="comment-isLiked-{$comment_uid}">
|
||||
<i class="fa fa-thumbs-o-up fa-lg fa-fw" aria-hidden="true"></i>
|
||||
좋아요
|
||||
</button>
|
||||
<a href="#modal_reaction" class="badge badge-light"
|
||||
data-toggle="modal"
|
||||
data-type="comment"
|
||||
data-count="{$comment_like_total}"
|
||||
data-entry="{$comment_uid}"
|
||||
data-role="comment-likeTotal-{$comment_uid}" title="좋아요한 사람">
|
||||
{$comment_like_total}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<div class="my-2" data-role="oneline-input-wrapper-{$comment_uid}"> <!-- 한줄의견 등록폼 -->
|
||||
<form class="input-group">
|
||||
<input type="text" class="form-control" data-role="oneline-input-{$comment_uid}"><!-- 주의 : comment_uid 가 들어가야 함 -->
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-light" type="submit"
|
||||
title="의견추가"
|
||||
data-kcact="regis"
|
||||
data-type="oneline"
|
||||
data-parent="{$comment_uid}"
|
||||
data-effect="animated fadeInUp"
|
||||
data-grant="{$grant_uid}">
|
||||
<i class="fa fa-paper-plane fa-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form><!-- /.input-group -->
|
||||
</div>
|
||||
|
||||
<ul class="list-group my-2" data-role="oneline-container-{$comment_uid}">
|
||||
{$oneline_rows} <!-- 한줄의견 리스트 -->
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
@@ -0,0 +1,72 @@
|
||||
<li class="media border-bottom mb-3" data-role="comment-item" data-uid="{$comment_uid}" data-page="{$comment_page}" data-totalPage="{$total_page}" data-type="comment" data-hidden="{$comment_getHidden}" data-notice="{$comment_getNoitce}">
|
||||
<div data-role="comment-origin-content-{$comment_uid}" class="d-none">{$comment_content}</div>
|
||||
<img class="mr-3 border rounded-circle" src="{$comment_user_pic}" alt="아바타" width="50">
|
||||
<div class="media-body">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<span>
|
||||
<strong class="mr-2">{$comment_user_name}</strong>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
<time data-role="comment-time-wrapper-{$comment_uid}">{$comment_regis_time}</time>
|
||||
<small class="ml-1 {$comment_getNew}"></small><!-- 24시간이내 new 출력 -->
|
||||
</span>
|
||||
<span>
|
||||
{$btn_showHideMenu} <!-- 메뉴 출력/숨기 버튼 btn_showHideMenu.html : 권한이 있는 경우(로그인,작성자,관리자) 에만 노출됨 -->
|
||||
</span>
|
||||
</div><!-- /.d-flex -->
|
||||
<div class="markdown-body">
|
||||
<article class="mb-0" data-role="comment-content-editable-{$comment_uid}">
|
||||
<div class="text-center text-muted bg-light p-4 my-2"><i class="fa fa-lock fa-fw" aria-hidden="true"></i> 비밀글</div>
|
||||
</article>
|
||||
</div>
|
||||
{$btn_editMod} <!-- 수정 모드시 취소/완료 버튼 btn_ediMod.html -->
|
||||
|
||||
<div class="mb-2">
|
||||
<button class="btn btn-link btn-sm add-comment px-0 muted-link" data-role="toggle-oneline-input" data-parent="{$comment_uid}">
|
||||
<i class="fa fa-comment-o fa-lg fa-fw" aria-hidden="true"></i>
|
||||
의견달기
|
||||
</button>
|
||||
<button class="btn btn-link btn-sm muted-link js-like pr-0 {$comment_getIsLiked}"
|
||||
data-kcact="like"
|
||||
data-type="comment"
|
||||
data-entry="{$comment_uid}"
|
||||
data-effect="animated bounceIn delay-1"
|
||||
data-role="comment-isLiked-{$comment_uid}">
|
||||
<i class="fa fa-thumbs-o-up fa-lg fa-fw" aria-hidden="true"></i>
|
||||
좋아요
|
||||
</button>
|
||||
<a href="#modal_reaction" class="badge badge-light"
|
||||
data-toggle="modal"
|
||||
data-type="comment"
|
||||
data-count="{$comment_like_total}"
|
||||
data-entry="{$comment_uid}"
|
||||
data-role="comment-likeTotal-{$comment_uid}" title="좋아요한 사람">
|
||||
{$comment_like_total}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<div class="my-2" data-role="oneline-input-wrapper-{$comment_uid}"> <!-- 한줄의견 등록폼 -->
|
||||
<form class="input-group">
|
||||
<input type="text" class="form-control" data-role="oneline-input-{$comment_uid}"><!-- 주의 : comment_uid 가 들어가야 함 -->
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-light" type="submit"
|
||||
title="의견추가"
|
||||
data-kcact="regis"
|
||||
data-type="oneline"
|
||||
data-parent="{$comment_uid}"
|
||||
data-effect="animated fadeInUp"
|
||||
data-grant="{$grant_uid}">
|
||||
<i class="fa fa-paper-plane fa-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form><!-- /.input-group -->
|
||||
</div>
|
||||
|
||||
<ul class="list-group my-2" data-role="oneline-container-{$comment_uid}">
|
||||
{$oneline_rows} <!-- 한줄의견 리스트 -->
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
@@ -0,0 +1,48 @@
|
||||
<!-- 참조사항
|
||||
1. 등록폼에 등록자 아바타가 필요한 경우 : <img src="{$login_user_pic}">
|
||||
2. data-*="*" 필수
|
||||
-->
|
||||
<div class="card mb-4" data-role="comment-input-wrapper">
|
||||
|
||||
<textarea class="form-control border-0" name="content" rows="1" id="meta-description-content" data-role="comment-input"></textarea>
|
||||
|
||||
<div class="card-footer p-2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<small>글자수 <strong class="text-danger" data-role="show-inputLength">0</strong> / <span data-role="show-textLimit"><!-- 옵션에서 정한 값--></span></small>
|
||||
<button type="button" class="btn btn-light" data-role="open-emoticon" hidden>
|
||||
<i class="fa fa-smile-o fa-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn btn-outline-primary cmt-post ml-1 align-self-end"
|
||||
data-kcact="regis"
|
||||
data-type="comment"
|
||||
data-effect="animated fadeInUp"
|
||||
data-parent="{$comment_parent}">등록</button>
|
||||
</div><!-- /.d-flex -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
// 입력창 자동 리사이즈
|
||||
autosize($('#commentting-container textarea'));
|
||||
|
||||
var textarea_container = $('[data-role="comment-input-wrapper"]')
|
||||
var textarea = $('#meta-description-content');
|
||||
|
||||
textarea.focus(function(){
|
||||
textarea_container.addClass('active')
|
||||
});
|
||||
textarea.blur(function(){
|
||||
setTimeout(function(){
|
||||
textarea_container.removeClass('active')
|
||||
}, 200);
|
||||
});
|
||||
|
||||
// 댓글이 등록된 후에
|
||||
$('#commentting-container').on('saved.rb.comment',function(){
|
||||
textarea.removeAttr("style");
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1 @@
|
||||
<img src="{$emoticon_src}" style="width:50px"/>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<li class="list-group-item flex-column align-items-start p-0 border-left-0 rounded-0 list-group-item-light" data-role="oneline-item" data-uid="{$oneline_uid}" data-type="oneline" data-hidden="{$oneline_getHidden}">
|
||||
<div data-role="oneline-origin-content-{$oneline_uid}" class="d-none">{$oneline_content}</div>
|
||||
<blockquote class="py-2">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<span>
|
||||
<span data-role="oneline-hidden" class="badge"><i class="fa fa-lock fa-lg" aria-hidden="true"></i></span>
|
||||
<cite>{$oneline_user_name}</cite>
|
||||
<time class="small text-muted ml-2" data-role="oneline-time-wrapper-{$oneline_uid}">
|
||||
{$oneline_regis_time}
|
||||
</time>
|
||||
<small class="ml-1 {$oneline_getNew}"></small><!-- 24시간이내 new 출력 -->
|
||||
</span>
|
||||
<span>
|
||||
{$btn_showHideMenu} <!-- 메뉴 출력/숨기 버튼 btn_showHideMenu.html : 권한이 있는 경우(로그인,작성자,관리자) 에만 노출됨 -->
|
||||
</span>
|
||||
</div>
|
||||
<article class="mb-0" data-role="oneline-content-editable-{$oneline_uid}">{$oneline_content}</article>
|
||||
{$btn_editMod}
|
||||
<!-- <a data-kcact="like" data-type="oneline" data-entry="{$oneline_uid}">좋아요(<span data-role="oneline-likeTotal-{$oneline_uid}">{$oneline_like_total}</span>)</a> -->
|
||||
</blockquote>
|
||||
</li>
|
||||
@@ -0,0 +1,22 @@
|
||||
<li class="list-group-item flex-column align-items-start p-0 border-left-0 rounded-0 list-group-item-light" data-role="oneline-item" data-uid="{$oneline_uid}" data-type="oneline" data-hidden="{$oneline_getHidden}">
|
||||
<div data-role="oneline-origin-content-{$oneline_uid}" class="d-none">{$oneline_content}</div>
|
||||
<blockquote class="py-2">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<span>
|
||||
<cite>{$oneline_user_name}</cite>
|
||||
<time class="small text-muted ml-2" data-role="oneline-time-wrapper-{$oneline_uid}">
|
||||
{$oneline_regis_time}
|
||||
</time>
|
||||
<small class="ml-1 {$oneline_getNew}"></small><!-- 24시간이내 new 출력 -->
|
||||
</span>
|
||||
<span>
|
||||
{$btn_showHideMenu} <!-- 메뉴 출력/숨기 버튼 btn_showHideMenu.html : 권한이 있는 경우(로그인,작성자,관리자) 에만 노출됨 -->
|
||||
</span>
|
||||
</div>
|
||||
<article class="mb-0" data-role="oneline-content-editable-{$oneline_uid}">
|
||||
<div class="text-center text-muted border p-4 my-2"><i class="fa fa-lock fa-fw" aria-hidden="true"></i> 비밀글</div>
|
||||
</article>
|
||||
{$btn_editMod}
|
||||
<button class="btn btn-sm btn-link text-reset" data-kcact="like" data-type="oneline" data-entry="{$oneline_uid}">좋아요 <span class="badge badge-light" data-role="oneline-likeTotal-{$oneline_uid}">{$oneline_like_total}</span></button>
|
||||
</blockquote>
|
||||
</li>
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
1
modules/comment/themes/_desktop/bs4-classic/name.txt
Normal file
@@ -0,0 +1 @@
|
||||
부트스트랩4 기본형 댓글
|
||||
21
modules/comment/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.
|
||||
17
modules/comment/themes/_desktop/bs4-default/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
# 부트스트랩 4 댓글 기본형 테마
|
||||
|
||||
안녕하세요. 감사합니다.
|
||||
|
||||
## 주요기능
|
||||
- Automated website building technology
|
||||
- Powerful content managing system
|
||||
- Multiple virtual site system
|
||||
- Unlimited extension
|
||||
- Multi Screen implementations
|
||||
|
||||
## 서버 요구사항
|
||||
- PHP version 5.2.x
|
||||
- MYSQL version 3.23.x or greater (recommend MYSQL >= 5.x)
|
||||
- GD Library
|
||||
- ICONV
|
||||