#19560480 추천 비추천 기능개선

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8112 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2011-02-21 01:38:28 +00:00
parent b230d45a71
commit 9b8e32d45b
10 changed files with 223 additions and 23 deletions

View file

@ -37,13 +37,23 @@
// 회원이어야만 가능한 기능
if($logged_info->member_srl) {
// 추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
$oCommentModel = &getModel('comment');
$oComment = $oCommentModel->getComment($comment_srl, false, false);
$module_srl = $oComment->get('module_srl');
$member_srl = $oComment->get('member_srl');
// 비추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
$oModuleModel = &getModel('module');
$comment_config = $oModuleModel->getModulePartConfig('document',$module_srl);
if($comment_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl){
// 추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
}
if($comment_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl){
// 비추천 버튼 추가
$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
$oCommentController->addCommentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
}
// 신고 기능 추가
$url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
@ -417,5 +427,29 @@
return $comment_config;
}
function getCommentVotedMemberList()
{
$comment_srl = Context::get('comment_srl');
if(!$comment_srl) return new Object(-1,'msg_invalid_request');
$point = Context::get('point');
if($point != -1) $point = 1;
$args->comment_srl = $comment_srl;
$args->point = $point;
$output = executeQueryArray('comment.getVotedMemberList',$args);
if(!$output->toBool()) return $output;
$oMemberModel = &getModel('member');
if($output->data){
foreach($output->data as $k => $d){
$profile_image = $oMemberModel->getProfileImage($d->member_srl);
$output->data[$k]->src = $profile_image->src;
}
}
$this->add('voted_member_list',$output->data);
}
}
?>