mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 16:52:16 +09:00
Merge pull request #140 from SoneYours/pr/document-voted
추천/비추천/추천삭제 기능추가.
This commit is contained in:
commit
d5c921bb1b
19 changed files with 338 additions and 13 deletions
|
|
@ -34,7 +34,10 @@
|
|||
</ul>
|
||||
</div>
|
||||
<p class="action">
|
||||
<span class="vote" cond="$comment->get('voted_count')!=0">{$lang->cmd_vote}:{$comment->get('voted_count')?$comment->get('voted_count'):0}</span>
|
||||
<a cond="$comment->getVote() === false || $comment->getVote() < 0" href="#" onclick="doCallModuleAction('comment','procCommentVoteUp','{$comment->comment_srl}');return false;"|cond="$is_logged" class="voted"><i class="xi-thumbs-up"></i>{$lang->cmd_vote}{$comment->get('voted_count')}</a>
|
||||
<a cond="$comment->getVote() > 0" href="#" onclick="doCallModuleAction('comment','procCommentVoteUpCancel','{$comment->comment_srl}');return false;"|cond="$is_logged" class="voted"><i class="xi-thumbs-up"></i>{$lang->cmd_vote}{$comment->get('voted_count')}</a>
|
||||
<a cond="$comment->getVote() === false || $comment->getVote() > 0" href="#" onclick="doCallModuleAction('comment','procCommentVoteDown','{$comment->comment_srl}');return false;"|cond="$is_logged" class="voted"><i class="xi-thumbs-up"></i>{$lang->cmd_vote_down}{$comment->get('blamed_count')}</a>
|
||||
<a cond="$comment->getVote() < 0" href="#" onclick="doCallModuleAction('comment','procCommentVoteDownCancel','{$comment->comment_srl}');return false;"|cond="$is_logged" class="voted"><i class="xi-thumbs-up"></i>{$lang->cmd_vote_down}{$comment->get('blamed_count')}</a>
|
||||
<a cond="$oDocument->allowComment()" href="{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}" class="reply"><i class="xi-reply"></i> {$lang->cmd_reply}</a>
|
||||
<a cond="$comment->isGranted()||!$comment->get('member_srl')" href="{getUrl('act','dispBoardModifyComment','comment_srl',$comment->comment_srl)}" class="modify"><i class="xi-eraser"></i> {$lang->cmd_modify}</a>
|
||||
<a cond="$comment->isGranted()||!$comment->get('member_srl')" href="{getUrl('act','dispBoardDeleteComment','comment_srl',$comment->comment_srl)}" class="delete"><i class="xi-trash"></i> {$lang->cmd_delete}</a>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<script>
|
||||
var sTitle = '{str_ireplace(array('<script', '</script'), array("<scr'+'ipt", "</scr'+'ipt"), addslashes($oDocument->getTitleText()))}';
|
||||
var sTitle = '{$oDocument->getTitleText()}';
|
||||
jQuery(function($){
|
||||
$('.twitter').snspost({
|
||||
type : 'twitter',
|
||||
|
|
@ -79,7 +79,19 @@
|
|||
content : sTitle
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</div>
|
||||
<div class="vote">
|
||||
<ul>
|
||||
<li>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() < 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUp','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
<a cond="$oDocument->getVoted() > 0" href="#" onclick="doCallModuleAction('document','procDocumentVoteUpCancel','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-up"></i><br>{$lang->cmd_vote} {$oDocument->get('voted_count')}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a cond="$oDocument->getVoted() === false || $oDocument->getVoted() > 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDown','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
<a cond="$oDocument->getVoted() < 0" herf="#" onclick="doCallModuleAction('document','procDocumentVoteDownCancel','{$oDocument->document_srl}');return false;"|cond="$is_logged" class="voted"> <i class="xi-thumbs-down"></i><br>{$lang->cmd_vote_down} {$oDocument->get('blamed_count')}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div cond="$oDocument->hasUploadedFiles()" class="fileList">
|
||||
<button type="button" class="toggleFile" onclick="jQuery(this).next('ul.files').toggle();"><i class="xi-diskette"></i> {$lang->uploaded_file} [<strong>{$oDocument->get('uploaded_count')}</strong>]</button>
|
||||
|
|
|
|||
|
|
@ -570,6 +570,13 @@
|
|||
.read_footer .sns a:hover{border-color:#DECA79;background-color:#f9dc5f;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out}
|
||||
.read_footer .sns a:hover {color:#747474;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out}
|
||||
|
||||
.read_footer .vote{ margin-top:51px;text-align:center; }
|
||||
.read_footer .vote li{display:inline;vertical-align:top}
|
||||
.read_footer .vote a{display:inline-block;width:70px;height:70px;border:1px solid #e0e0e0;background-color:#f4f4f4; border-radius:2px;}
|
||||
.read_footer .vote i{font-size:22px;line-height:45px;color:#bcbcbc}
|
||||
.read_footer .vote a:hover{border-color:#DECA79;background-color:#f9dc5f;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out}
|
||||
.read_footer .vote a:hover {color:#747474;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out}
|
||||
|
||||
.read_footer .sign {
|
||||
clear: both;
|
||||
border: 1px solid #ddd;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<author email_address="developers@xpressengine.com" link="https://www.xpressengine.com/">
|
||||
<name xml:lang="ko">NAVER</name>
|
||||
</author>
|
||||
<license>LGPL v2</license>
|
||||
<license>GPL v2</license>
|
||||
<extra_vars>
|
||||
</extra_vars>
|
||||
</skin>
|
||||
|
|
|
|||
|
|
@ -59,6 +59,29 @@ class commentController extends comment
|
|||
return $output;
|
||||
}
|
||||
|
||||
function procCommentVoteUpCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('voted_count') <= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_comment_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output->setMessage('success_voted_canceled');
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action to handle recommendation votes on comments (Down)
|
||||
* @return Object
|
||||
|
|
@ -97,6 +120,74 @@ class commentController extends comment
|
|||
return $output;
|
||||
}
|
||||
|
||||
function procCommentVoteDownCancel()
|
||||
{
|
||||
if(!Context::get('logged_info')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$comment_srl = Context::get('target_srl');
|
||||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
|
||||
if($oComment->get('blamed_count') >= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_comment_blamed_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output->setMessage('success_voted_canceled');
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function updateVotedCountCancel($comment_srl, $oComment, $point)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$args = new stdClass();
|
||||
$d_args = new stdClass();
|
||||
$args->comment_srl = $d_args->comment_srl = $comment_srl;
|
||||
$d_args->member_srl = $logged_info->member_srl;
|
||||
if($point > 0)
|
||||
{
|
||||
$args->voted_count = $oComment->get('voted_count') - $point;
|
||||
$output = executeQuery('comment.updateVotedCount', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->blamed_count = $oComment->get('blamed_count') - $point;
|
||||
$output = executeQuery('comment.updateBlamedCount', $args);
|
||||
}
|
||||
$d_output = executeQuery('comment.deleteCommentVotedLog', $d_args);
|
||||
if(!$d_output->toBool()) return $d_output;
|
||||
|
||||
//session reset
|
||||
$_SESSION['voted_comment'][$comment_srl] = false;
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->member_srl = $oComment->get('member_srl');
|
||||
$obj->module_srl = $oComment->get('module_srl');
|
||||
$obj->comment_srl = $oComment->get('comment_srl');
|
||||
$obj->update_target = ($point < 0) ? 'blamed_count' : 'voted_count';
|
||||
$obj->point = $point;
|
||||
$obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
|
||||
$obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
|
||||
$obj->cancel = 1;
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.updateVotedCountCancel', 'after', $obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to be called when a comment posting is reported
|
||||
* @return void|Object
|
||||
|
|
@ -1163,11 +1254,14 @@ class commentController extends comment
|
|||
// update the number of votes
|
||||
if($point < 0)
|
||||
{
|
||||
// leave into session information
|
||||
$_SESSION['voted_comment'][$comment_srl] = $point;
|
||||
$args->blamed_count = $oComment->get('blamed_count') + $point;
|
||||
$output = executeQuery('comment.updateBlamedCount', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['voted_comment'][$comment_srl] = $point;
|
||||
$args->voted_count = $oComment->get('voted_count') + $point;
|
||||
$output = executeQuery('comment.updateVotedCount', $args);
|
||||
}
|
||||
|
|
@ -1193,9 +1287,6 @@ class commentController extends comment
|
|||
|
||||
$oDB->commit();
|
||||
|
||||
// leave into session information
|
||||
$_SESSION['voted_comment'][$comment_srl] = TRUE;
|
||||
|
||||
// Return the result
|
||||
$output = new Object(0, $success_message);
|
||||
if($point > 0)
|
||||
|
|
|
|||
|
|
@ -281,6 +281,29 @@ class commentItem extends Object
|
|||
return htmlspecialchars($this->get('nick_name'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
}
|
||||
|
||||
function getVote()
|
||||
{
|
||||
if(!$this->comment_srl) return false;
|
||||
if($_SESSION['voted_comment'][$this->comment_srl])
|
||||
{
|
||||
return $_SESSION['voted_comment'][$this->comment_srl];
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->comment_srl = $this->comment_srl;
|
||||
$output = executeQuery('comment.getCommentVotedLog', $args);
|
||||
|
||||
if($output->data->point)
|
||||
{
|
||||
return $output->data->point;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return content with htmlspecialchars
|
||||
* @return string
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
<action name="procCommentAdminAddCart" type="controller" />
|
||||
<action name="procCommentGetList" type="controller" />
|
||||
<action name="procCommentAdminMoveToTrash" type="controller" />
|
||||
<action name="procCommentVoteUpCancel" type="controller" />
|
||||
<action name="procCommentVoteDownCancel" type="controller" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="comment">
|
||||
|
|
|
|||
|
|
@ -81,6 +81,12 @@
|
|||
<value xml:lang="tr"><![CDATA[Yorumları, kullanıcının girdiği rakam kadar gösterin. Eğer yorum sayısı belirlenen sayıyı aşarsa, yorum Liste'ye taşınır.]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Hiển thị số bình luận được gửi, và nó sẽ tạo một danh sách nếu có nhiều bình luận.]]></value>
|
||||
</item>
|
||||
<item name="msg_comment_voted_cancel_not">
|
||||
<value xml:lang="ko"><![CDATA[추천수가 0이하일 경우 추천캔슬을 사용할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_comment_blamed_cancel_not">
|
||||
<value xml:lang="ko"><![CDATA[추천수가 0이하일 경우 비추천캔슬을 사용할 수 없습니다.]]></value>
|
||||
</item>
|
||||
<item name="msg_cart_is_null">
|
||||
<value xml:lang="ko"><![CDATA[삭제할 글을 선택해주세요.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Please select an article to delete.]]></value>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
</tables>
|
||||
<conditions>
|
||||
<condition operation="in" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
15
modules/comment/queries/getCommentVotedLog.xml
Normal file
15
modules/comment/queries/getCommentVotedLog.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getCommentVotedLog" action="select">
|
||||
<tables>
|
||||
<table name="comment_voted_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -29,7 +29,9 @@
|
|||
<action name="getDocumentMenu" type="model" />
|
||||
|
||||
<action name="procDocumentVoteUp" type="controller" />
|
||||
<action name="procDocumentVoteUpCancel" type="controller" />.
|
||||
<action name="procDocumentVoteDown" type="controller" />
|
||||
<action name="procDocumentVoteDownCancel" type="controller" />
|
||||
<action name="procDocumentDeclare" type="controller" />
|
||||
<action name="procDocumentAddCart" type="controller" />
|
||||
<action name="procDocumentManageCheckedDocument" type="controller" />
|
||||
|
|
@ -63,7 +65,6 @@
|
|||
<action name="procDocumentAdminDeleteAllThumbnail" type="controller" />
|
||||
<action name="procDocumentAdminCancelDeclare" type="controller" />
|
||||
<action name="procDocumentAdminMoveToTrash" type="controller" />
|
||||
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="document">
|
||||
|
|
|
|||
|
|
@ -44,6 +44,27 @@ class documentController extends document
|
|||
return $output;
|
||||
}
|
||||
|
||||
function procDocumentVoteUpCancel()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('voted_count') <= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output->setMessage('success_voted_canceled');
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* insert alias
|
||||
* @param int $module_srl
|
||||
|
|
@ -89,6 +110,82 @@ class documentController extends document
|
|||
return $output;
|
||||
}
|
||||
|
||||
function procDocumentVoteDownCancel()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
if($oDocument->get('blamed_count') >= 0)
|
||||
{
|
||||
return new Object(-1, 'msg_document_voted_cancel_not');
|
||||
}
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($document_srl, $oDocument, $point);
|
||||
|
||||
$output = new Object();
|
||||
$output->setMessage('success_blamed_canceled');
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Document Voted Cancel
|
||||
* @param int $document_srl
|
||||
* @param Document $oDocument
|
||||
* @param int $point
|
||||
* @return object
|
||||
*/
|
||||
function updateVotedCountCancel($document_srl, $oDocument, $point)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$args = new stdClass();
|
||||
$d_args = new stdClass();
|
||||
$args->document_srl = $d_args->document_srl = $document_srl;
|
||||
$d_args->member_srl = $logged_info->member_srl;
|
||||
if($point > 0)
|
||||
{
|
||||
$args->voted_count = $oDocument->get('voted_count') - $point;
|
||||
$output = executeQuery('document.updateVotedCount', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->blamed_count = $oDocument->get('blamed_count') - $point;
|
||||
$output = executeQuery('document.updateBlamedCount', $args);
|
||||
}
|
||||
$d_output = executeQuery('document.deleteDocumentVotedLog', $d_args);
|
||||
if(!$d_output->toBool()) return $d_output;
|
||||
|
||||
//session reset
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->member_srl = $oDocument->get('member_srl');
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
$obj->document_srl = $oDocument->get('document_srl');
|
||||
$obj->update_target = ($point < 0) ? 'blamed_count' : 'voted_count';
|
||||
$obj->point = $point;
|
||||
$obj->before_point = ($point < 0) ? $oDocument->get('blamed_count') : $oDocument->get('voted_count');
|
||||
$obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
|
||||
$obj->cancel = 1;
|
||||
|
||||
$trigger_output = ModuleHandler::triggerCall('document.updateVotedCountCancel', 'after', $obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action called when the post is reported by other member
|
||||
* @return void|Object
|
||||
|
|
@ -1175,7 +1272,7 @@ class documentController extends document
|
|||
}
|
||||
|
||||
// Use member_srl for logged-in members and IP address for non-members.
|
||||
$args = new stdClass;
|
||||
$args = new stdClass();
|
||||
if($member_srl)
|
||||
{
|
||||
$args->member_srl = $member_srl;
|
||||
|
|
@ -1201,11 +1298,15 @@ class documentController extends document
|
|||
if($point < 0)
|
||||
{
|
||||
$args->blamed_count = $oDocument->get('blamed_count') + $point;
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = $point;
|
||||
$output = executeQuery('document.updateBlamedCount', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->voted_count = $oDocument->get('voted_count') + $point;
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = $point;
|
||||
$output = executeQuery('document.updateVotedCount', $args);
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -1239,9 +1340,6 @@ class documentController extends document
|
|||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
|
||||
// Return result
|
||||
$output = new Object();
|
||||
if($point > 0)
|
||||
|
|
|
|||
|
|
@ -369,6 +369,29 @@ class documentItem extends Object
|
|||
return $title;
|
||||
}
|
||||
|
||||
function getVoted()
|
||||
{
|
||||
if(!$this->document_srl) return false;
|
||||
if($_SESSION['voted_document'][$this->document_srl])
|
||||
{
|
||||
return $_SESSION['voted_document'][$this->document_srl];
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->document_srl = $this->document_srl;
|
||||
$output = executeQuery('document.getDocumentVotedLog', $args);
|
||||
|
||||
if($output->data->point)
|
||||
{
|
||||
return $output->data->point;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTitle($cut_size = 0, $tail='...')
|
||||
{
|
||||
if(!$this->document_srl) return;
|
||||
|
|
|
|||
|
|
@ -349,6 +349,10 @@
|
|||
<value xml:lang="ko"><![CDATA[최고관리자의 게시글을 지울 권한이 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You don't have permission to delete the posts of Top Admin.]]></value>
|
||||
</item>
|
||||
<item name="msg_document_voted_cancel_not">
|
||||
<value xml:lang="ko"><![CDATA[추천수가 0이하일 경우 추천캔슬을 사용할 수 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[]]></value>
|
||||
</item>
|
||||
<item name="move_target_module">
|
||||
<value xml:lang="ko"><![CDATA[대상 페이지]]></value>
|
||||
<value xml:lang="en"><![CDATA[Target module ]]></value>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
</tables>
|
||||
<conditions>
|
||||
<condition operation="in" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
15
modules/document/queries/getDocumentVotedLog.xml
Normal file
15
modules/document/queries/getDocumentVotedLog.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getDocumentVotedLog" action="select">
|
||||
<tables>
|
||||
<table name="document_voted_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -93,6 +93,7 @@ class point extends ModuleObject
|
|||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
// Add a trigger for comment voting up and down 2014.08.30 sejin7940
|
||||
$oModuleController->insertTrigger('comment.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
$oModuleController->insertTrigger('document.updateVotedCountCancel', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
@ -132,6 +133,7 @@ class point extends ModuleObject
|
|||
|
||||
// Add a trigger for comment voting up and down 2014.08.30 sejin7940
|
||||
if(!$oModuleModel->getTrigger('comment.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCountCancel', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -174,6 +176,8 @@ class point extends ModuleObject
|
|||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCountCancel', 'point', 'controller', 'triggerUpdateVotedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateVotedCountCancel', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'))
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
|
|
|
|||
|
|
@ -492,7 +492,18 @@ class pointController extends point
|
|||
|
||||
if(!$point) return new Object();
|
||||
// Increase the point
|
||||
$cur_point += $point;
|
||||
if($obj->cancel > 0)
|
||||
{
|
||||
$cur_point -= $point;
|
||||
}
|
||||
else if($obj->cancel == null)
|
||||
{
|
||||
$cur_point += $point;
|
||||
}
|
||||
else
|
||||
{
|
||||
$cur_point += $point;
|
||||
}
|
||||
$this->setPoint($member_srl,$cur_point);
|
||||
|
||||
return new Object();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue